blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df62a549e7eea7d4dc021924b34f830363426f45 | 89dedd7f3c7acc81d12e2bcb2e716f9af9e5fa04 | /chromeos/dbus/session_manager_client.cc | c98a7c94ba0b54d2d5dcd005f64e0ff84b1b2e31 | [
"BSD-3-Clause"
] | permissive | bino7/chromium | 8d26f84a1b6e38a73d1b97fea6057c634eff68cb | 4666a6bb6fdcb1114afecf77bdaa239d9787b752 | refs/heads/master | 2022-12-22T14:31:53.913081 | 2016-09-06T10:05:11 | 2016-09-06T10:05:11 | 67,410,510 | 1 | 3 | BSD-3-Clause | 2022-12-17T03:08:52 | 2016-09-05T10:11:59 | null | UTF-8 | C++ | false | false | 38,665 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/dbus/session_manager_client.h"
#include <stddef.h>
#include <stdint.h>
#include <sys/socket.h>
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/macros.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task_runner_util.h"
#include "base/threading/worker_pool.h"
#include "chromeos/chromeos_paths.h"
#include "chromeos/cryptohome/cryptohome_parameters.h"
#include "chromeos/dbus/blocking_method_caller.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "crypto/sha2.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos {
namespace {
// Returns a location for |file| that is specific to the given |cryptohome_id|.
// These paths will be relative to DIR_USER_POLICY_KEYS, and can be used only
// to store stub files.
base::FilePath GetUserFilePath(const cryptohome::Identification& cryptohome_id,
const char* file) {
base::FilePath keys_path;
if (!PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &keys_path))
return base::FilePath();
const std::string sanitized =
CryptohomeClient::GetStubSanitizedUsername(cryptohome_id);
return keys_path.AppendASCII(sanitized).AppendASCII(file);
}
// Helper to asynchronously retrieve a file's content.
std::string GetFileContent(const base::FilePath& path) {
std::string result;
if (!path.empty())
base::ReadFileToString(path, &result);
return result;
}
// Helper to write a file in a background thread.
void StoreFile(const base::FilePath& path, const std::string& data) {
const int size = static_cast<int>(data.size());
if (path.empty() ||
!base::CreateDirectory(path.DirName()) ||
base::WriteFile(path, data.data(), size) != size) {
LOG(WARNING) << "Failed to write to " << path.value();
}
}
// Creates a pair of file descriptors that form a conduit for trustworthy
// transfer of credentials between Chrome and the session_manager
void CreateValidCredConduit(dbus::FileDescriptor* local_auth_fd,
dbus::FileDescriptor* remote_auth_fd) {
int sockets[2] = {-1, -1};
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) < 0) {
PLOG(ERROR) << "Failed to create a unix domain socketpair";
return;
}
local_auth_fd->PutValue(sockets[0]);
local_auth_fd->CheckValidity();
remote_auth_fd->PutValue(sockets[1]);
remote_auth_fd->CheckValidity();
}
} // namespace
// The SessionManagerClient implementation used in production.
class SessionManagerClientImpl : public SessionManagerClient {
public:
SessionManagerClientImpl()
: session_manager_proxy_(NULL),
screen_is_locked_(false),
weak_ptr_factory_(this) {}
~SessionManagerClientImpl() override {}
// SessionManagerClient overrides:
void SetStubDelegate(StubDelegate* delegate) override {
// Do nothing; this isn't a stub implementation.
}
void AddObserver(Observer* observer) override {
observers_.AddObserver(observer);
}
void RemoveObserver(Observer* observer) override {
observers_.RemoveObserver(observer);
}
bool HasObserver(const Observer* observer) const override {
return observers_.HasObserver(observer);
}
bool IsScreenLocked() const override { return screen_is_locked_; }
void EmitLoginPromptVisible() override {
SimpleMethodCallToSessionManager(
login_manager::kSessionManagerEmitLoginPromptVisible);
FOR_EACH_OBSERVER(Observer, observers_, EmitLoginPromptVisibleCalled());
}
void RestartJob(const std::vector<std::string>& argv) override {
dbus::ScopedFileDescriptor local_auth_fd(new dbus::FileDescriptor);
dbus::ScopedFileDescriptor remote_auth_fd(new dbus::FileDescriptor);
// session_manager's RestartJob call requires the caller to open a socket
// pair and pass one end over dbus while holding the local end open for the
// duration of the call. session_manager uses this to determine whether the
// PID the restart request originates from belongs to the browser itself.
//
// Here, we call CreateValidCredConduit() to create the socket pair,
// and then pass both ends along to CallRestartJobWithValidFd(), which
// takes care of them from there.
// NB: PostTaskAndReply ensures that the second callback (which owns the
// ScopedFileDescriptor objects) outlives the first, so passing the
// bare pointers to CreateValidCredConduit is safe...
// -- BUT --
// you have to grab pointers to the contents of {local,remote}_auth_fd
// _before_ they're acted on by base::Passed() below. Passing ownership
// of the ScopedFileDescriptor objects to the callback actually nulls
// out the storage inside the local instances. Since there are
// no guarantees about the order of evaluation of arguments in a
// function call, merely having them appear earlier among the args
// to PostTaskAndReply() is not enough. Relying on this crashed on
// some platforms.
base::Closure create_credentials_conduit_closure = base::Bind(
&CreateValidCredConduit, local_auth_fd.get(), remote_auth_fd.get());
base::WorkerPool::PostTaskAndReply(
FROM_HERE, create_credentials_conduit_closure,
base::Bind(&SessionManagerClientImpl::CallRestartJobWithValidFd,
weak_ptr_factory_.GetWeakPtr(), base::Passed(&local_auth_fd),
base::Passed(&remote_auth_fd), argv),
false);
}
void StartSession(const cryptohome::Identification& cryptohome_id) override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerStartSession);
dbus::MessageWriter writer(&method_call);
writer.AppendString(cryptohome_id.id());
writer.AppendString(""); // Unique ID is deprecated
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnStartSession,
weak_ptr_factory_.GetWeakPtr()));
}
void StopSession() override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerStopSession);
dbus::MessageWriter writer(&method_call);
writer.AppendString(""); // Unique ID is deprecated
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnStopSession,
weak_ptr_factory_.GetWeakPtr()));
}
void StartDeviceWipe() override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerStartDeviceWipe);
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnDeviceWipe,
weak_ptr_factory_.GetWeakPtr()));
}
void RequestLockScreen() override {
SimpleMethodCallToSessionManager(login_manager::kSessionManagerLockScreen);
}
void NotifyLockScreenShown() override {
SimpleMethodCallToSessionManager(
login_manager::kSessionManagerHandleLockScreenShown);
}
void NotifyLockScreenDismissed() override {
SimpleMethodCallToSessionManager(
login_manager::kSessionManagerHandleLockScreenDismissed);
}
void NotifySupervisedUserCreationStarted() override {
SimpleMethodCallToSessionManager(
login_manager::kSessionManagerHandleSupervisedUserCreationStarting);
}
void NotifySupervisedUserCreationFinished() override {
SimpleMethodCallToSessionManager(
login_manager::kSessionManagerHandleSupervisedUserCreationFinished);
}
void RetrieveActiveSessions(const ActiveSessionsCallback& callback) override {
dbus::MethodCall method_call(
login_manager::kSessionManagerInterface,
login_manager::kSessionManagerRetrieveActiveSessions);
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnRetrieveActiveSessions,
weak_ptr_factory_.GetWeakPtr(),
login_manager::kSessionManagerRetrieveActiveSessions,
callback));
}
void RetrieveDevicePolicy(const RetrievePolicyCallback& callback) override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerRetrievePolicy);
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnRetrievePolicy,
weak_ptr_factory_.GetWeakPtr(),
login_manager::kSessionManagerRetrievePolicy,
callback));
}
void RetrievePolicyForUser(const cryptohome::Identification& cryptohome_id,
const RetrievePolicyCallback& callback) override {
CallRetrievePolicyByUsername(
login_manager::kSessionManagerRetrievePolicyForUser, cryptohome_id.id(),
callback);
}
std::string BlockingRetrievePolicyForUser(
const cryptohome::Identification& cryptohome_id) override {
dbus::MethodCall method_call(
login_manager::kSessionManagerInterface,
login_manager::kSessionManagerRetrievePolicyForUser);
dbus::MessageWriter writer(&method_call);
writer.AppendString(cryptohome_id.id());
std::unique_ptr<dbus::Response> response =
blocking_method_caller_->CallMethodAndBlock(&method_call);
std::string policy;
ExtractString(login_manager::kSessionManagerRetrievePolicyForUser,
response.get(),
&policy);
return policy;
}
void RetrieveDeviceLocalAccountPolicy(
const std::string& account_name,
const RetrievePolicyCallback& callback) override {
CallRetrievePolicyByUsername(
login_manager::kSessionManagerRetrieveDeviceLocalAccountPolicy,
account_name,
callback);
}
void StoreDevicePolicy(const std::string& policy_blob,
const StorePolicyCallback& callback) override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerStorePolicy);
dbus::MessageWriter writer(&method_call);
// static_cast does not work due to signedness.
writer.AppendArrayOfBytes(
reinterpret_cast<const uint8_t*>(policy_blob.data()),
policy_blob.size());
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnStorePolicy,
weak_ptr_factory_.GetWeakPtr(),
login_manager::kSessionManagerStorePolicy,
callback));
}
void StorePolicyForUser(const cryptohome::Identification& cryptohome_id,
const std::string& policy_blob,
const StorePolicyCallback& callback) override {
CallStorePolicyByUsername(login_manager::kSessionManagerStorePolicyForUser,
cryptohome_id.id(), policy_blob, callback);
}
void StoreDeviceLocalAccountPolicy(
const std::string& account_name,
const std::string& policy_blob,
const StorePolicyCallback& callback) override {
CallStorePolicyByUsername(
login_manager::kSessionManagerStoreDeviceLocalAccountPolicy,
account_name,
policy_blob,
callback);
}
void SetFlagsForUser(const cryptohome::Identification& cryptohome_id,
const std::vector<std::string>& flags) override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerSetFlagsForUser);
dbus::MessageWriter writer(&method_call);
writer.AppendString(cryptohome_id.id());
writer.AppendArrayOfStrings(flags);
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
dbus::ObjectProxy::EmptyResponseCallback());
}
void GetServerBackedStateKeys(const StateKeysCallback& callback) override {
dbus::MethodCall method_call(
login_manager::kSessionManagerInterface,
login_manager::kSessionManagerGetServerBackedStateKeys);
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnGetServerBackedStateKeys,
weak_ptr_factory_.GetWeakPtr(),
callback));
}
void CheckArcAvailability(const ArcCallback& callback) override {
dbus::MethodCall method_call(
login_manager::kSessionManagerInterface,
login_manager::kSessionManagerCheckArcAvailability);
session_manager_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnCheckArcAvailability,
weak_ptr_factory_.GetWeakPtr(), callback));
}
void StartArcInstance(const cryptohome::Identification& cryptohome_id,
const ArcCallback& callback) override {
dbus::MethodCall method_call(
login_manager::kSessionManagerInterface,
login_manager::kSessionManagerStartArcInstance);
dbus::MessageWriter writer(&method_call);
writer.AppendString(cryptohome_id.id());
session_manager_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnArcMethod,
weak_ptr_factory_.GetWeakPtr(),
login_manager::kSessionManagerStartArcInstance, callback));
}
void StopArcInstance(const ArcCallback& callback) override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerStopArcInstance);
session_manager_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnArcMethod,
weak_ptr_factory_.GetWeakPtr(),
login_manager::kSessionManagerStopArcInstance, callback));
}
void GetArcStartTime(const GetArcStartTimeCallback& callback) override {
dbus::MethodCall method_call(
login_manager::kSessionManagerInterface,
login_manager::kSessionManagerGetArcStartTimeTicks);
session_manager_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnGetArcStartTime,
weak_ptr_factory_.GetWeakPtr(), callback));
}
void RemoveArcData(const cryptohome::Identification& cryptohome_id,
const ArcCallback& callback) override {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerRemoveArcData);
dbus::MessageWriter writer(&method_call);
writer.AppendString(cryptohome_id.id());
session_manager_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnArcMethod,
weak_ptr_factory_.GetWeakPtr(),
login_manager::kSessionManagerRemoveArcData, callback));
}
protected:
void Init(dbus::Bus* bus) override {
session_manager_proxy_ = bus->GetObjectProxy(
login_manager::kSessionManagerServiceName,
dbus::ObjectPath(login_manager::kSessionManagerServicePath));
blocking_method_caller_.reset(
new BlockingMethodCaller(bus, session_manager_proxy_));
// Signals emitted on the session manager's interface.
session_manager_proxy_->ConnectToSignal(
login_manager::kSessionManagerInterface,
login_manager::kOwnerKeySetSignal,
base::Bind(&SessionManagerClientImpl::OwnerKeySetReceived,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&SessionManagerClientImpl::SignalConnected,
weak_ptr_factory_.GetWeakPtr()));
session_manager_proxy_->ConnectToSignal(
login_manager::kSessionManagerInterface,
login_manager::kPropertyChangeCompleteSignal,
base::Bind(&SessionManagerClientImpl::PropertyChangeCompleteReceived,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&SessionManagerClientImpl::SignalConnected,
weak_ptr_factory_.GetWeakPtr()));
session_manager_proxy_->ConnectToSignal(
login_manager::kSessionManagerInterface,
login_manager::kScreenIsLockedSignal,
base::Bind(&SessionManagerClientImpl::ScreenIsLockedReceived,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&SessionManagerClientImpl::SignalConnected,
weak_ptr_factory_.GetWeakPtr()));
session_manager_proxy_->ConnectToSignal(
login_manager::kSessionManagerInterface,
login_manager::kScreenIsUnlockedSignal,
base::Bind(&SessionManagerClientImpl::ScreenIsUnlockedReceived,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&SessionManagerClientImpl::SignalConnected,
weak_ptr_factory_.GetWeakPtr()));
session_manager_proxy_->ConnectToSignal(
login_manager::kSessionManagerInterface,
login_manager::kArcInstanceStopped,
base::Bind(&SessionManagerClientImpl::ArcInstanceStoppedReceived,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&SessionManagerClientImpl::SignalConnected,
weak_ptr_factory_.GetWeakPtr()));
}
private:
// Makes a method call to the session manager with no arguments and no
// response.
void SimpleMethodCallToSessionManager(const std::string& method_name) {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
method_name);
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
dbus::ObjectProxy::EmptyResponseCallback());
}
// Helper for RetrieveDeviceLocalAccountPolicy and RetrievePolicyForUser.
void CallRetrievePolicyByUsername(const std::string& method_name,
const std::string& account_id,
const RetrievePolicyCallback& callback) {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
method_name);
dbus::MessageWriter writer(&method_call);
writer.AppendString(account_id);
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(
&SessionManagerClientImpl::OnRetrievePolicy,
weak_ptr_factory_.GetWeakPtr(),
method_name,
callback));
}
void CallStorePolicyByUsername(const std::string& method_name,
const std::string& account_id,
const std::string& policy_blob,
const StorePolicyCallback& callback) {
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
method_name);
dbus::MessageWriter writer(&method_call);
writer.AppendString(account_id);
// static_cast does not work due to signedness.
writer.AppendArrayOfBytes(
reinterpret_cast<const uint8_t*>(policy_blob.data()),
policy_blob.size());
session_manager_proxy_->CallMethod(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(
&SessionManagerClientImpl::OnStorePolicy,
weak_ptr_factory_.GetWeakPtr(),
method_name,
callback));
}
// Calls RestartJob to tell the session manager to restart the browser using
// the contents of |argv| as the command line, authorizing the call using
// credentials acquired via |remote_auth_fd|. Ownership of |local_auth_fd| is
// held for the duration of the dbus call.
void CallRestartJobWithValidFd(dbus::ScopedFileDescriptor local_auth_fd,
dbus::ScopedFileDescriptor remote_auth_fd,
const std::vector<std::string>& argv) {
VLOG(1) << "CallRestartJobWithValidFd";
dbus::MethodCall method_call(login_manager::kSessionManagerInterface,
login_manager::kSessionManagerRestartJob);
dbus::MessageWriter writer(&method_call);
writer.AppendFileDescriptor(*remote_auth_fd);
writer.AppendArrayOfStrings(argv);
// Ownership of local_auth_fd is passed to the callback that is to be
// called on completion of this method call. This keeps the browser end
// of the socket-pair alive for the duration of the RPC.
session_manager_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&SessionManagerClientImpl::OnRestartJob,
weak_ptr_factory_.GetWeakPtr(),
base::Passed(&local_auth_fd)));
}
// Called when kSessionManagerRestartJob method is complete.
// Now that the call is complete, local_auth_fd can be closed and discarded,
// which will happen automatically when it goes out of scope.
void OnRestartJob(dbus::ScopedFileDescriptor local_auth_fd,
dbus::Response* response) {
VLOG(1) << "OnRestartJob";
LOG_IF(ERROR, !response)
<< "Failed to call "
<< login_manager::kSessionManagerRestartJob;
}
// Called when kSessionManagerStartSession method is complete.
void OnStartSession(dbus::Response* response) {
LOG_IF(ERROR, !response)
<< "Failed to call "
<< login_manager::kSessionManagerStartSession;
}
// Called when kSessionManagerStopSession method is complete.
void OnStopSession(dbus::Response* response) {
LOG_IF(ERROR, !response)
<< "Failed to call "
<< login_manager::kSessionManagerStopSession;
}
// Called when kSessionManagerStopSession method is complete.
void OnDeviceWipe(dbus::Response* response) {
LOG_IF(ERROR, !response)
<< "Failed to call "
<< login_manager::kSessionManagerStartDeviceWipe;
}
// Called when kSessionManagerRetrieveActiveSessions method is complete.
void OnRetrieveActiveSessions(const std::string& method_name,
const ActiveSessionsCallback& callback,
dbus::Response* response) {
ActiveSessionsMap sessions;
bool success = false;
if (!response) {
LOG(ERROR) << "Failed to call " << method_name;
callback.Run(sessions, success);
return;
}
dbus::MessageReader reader(response);
dbus::MessageReader array_reader(NULL);
if (!reader.PopArray(&array_reader)) {
LOG(ERROR) << method_name << " response is incorrect: "
<< response->ToString();
} else {
while (array_reader.HasMoreData()) {
dbus::MessageReader dict_entry_reader(NULL);
std::string key;
std::string value;
if (!array_reader.PopDictEntry(&dict_entry_reader) ||
!dict_entry_reader.PopString(&key) ||
!dict_entry_reader.PopString(&value)) {
LOG(ERROR) << method_name << " response is incorrect: "
<< response->ToString();
} else {
sessions[cryptohome::Identification::FromString(key)] = value;
}
}
success = true;
}
callback.Run(sessions, success);
}
void ExtractString(const std::string& method_name,
dbus::Response* response,
std::string* extracted) {
if (!response) {
LOG(ERROR) << "Failed to call " << method_name;
return;
}
dbus::MessageReader reader(response);
const uint8_t* values = NULL;
size_t length = 0;
if (!reader.PopArrayOfBytes(&values, &length)) {
LOG(ERROR) << "Invalid response: " << response->ToString();
return;
}
// static_cast does not work due to signedness.
extracted->assign(reinterpret_cast<const char*>(values), length);
}
// Called when kSessionManagerRetrievePolicy or
// kSessionManagerRetrievePolicyForUser method is complete.
void OnRetrievePolicy(const std::string& method_name,
const RetrievePolicyCallback& callback,
dbus::Response* response) {
std::string serialized_proto;
ExtractString(method_name, response, &serialized_proto);
callback.Run(serialized_proto);
}
// Called when kSessionManagerStorePolicy or kSessionManagerStorePolicyForUser
// method is complete.
void OnStorePolicy(const std::string& method_name,
const StorePolicyCallback& callback,
dbus::Response* response) {
bool success = false;
if (!response) {
LOG(ERROR) << "Failed to call " << method_name;
} else {
dbus::MessageReader reader(response);
if (!reader.PopBool(&success))
LOG(ERROR) << "Invalid response: " << response->ToString();
}
callback.Run(success);
}
// Called when the owner key set signal is received.
void OwnerKeySetReceived(dbus::Signal* signal) {
dbus::MessageReader reader(signal);
std::string result_string;
if (!reader.PopString(&result_string)) {
LOG(ERROR) << "Invalid signal: " << signal->ToString();
return;
}
const bool success = base::StartsWith(result_string, "success",
base::CompareCase::INSENSITIVE_ASCII);
FOR_EACH_OBSERVER(Observer, observers_, OwnerKeySet(success));
}
// Called when the property change complete signal is received.
void PropertyChangeCompleteReceived(dbus::Signal* signal) {
dbus::MessageReader reader(signal);
std::string result_string;
if (!reader.PopString(&result_string)) {
LOG(ERROR) << "Invalid signal: " << signal->ToString();
return;
}
const bool success = base::StartsWith(result_string, "success",
base::CompareCase::INSENSITIVE_ASCII);
FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success));
}
void ScreenIsLockedReceived(dbus::Signal* signal) {
screen_is_locked_ = true;
FOR_EACH_OBSERVER(Observer, observers_, ScreenIsLocked());
}
void ScreenIsUnlockedReceived(dbus::Signal* signal) {
screen_is_locked_ = false;
FOR_EACH_OBSERVER(Observer, observers_, ScreenIsUnlocked());
}
void ArcInstanceStoppedReceived(dbus::Signal* signal) {
dbus::MessageReader reader(signal);
bool clean = false;
if (!reader.PopBool(&clean)) {
LOG(ERROR) << "Invalid signal: " << signal->ToString();
return;
}
FOR_EACH_OBSERVER(Observer, observers_, ArcInstanceStopped(clean));
}
// Called when the object is connected to the signal.
void SignalConnected(const std::string& interface_name,
const std::string& signal_name,
bool success) {
LOG_IF(ERROR, !success) << "Failed to connect to " << signal_name;
}
// Called when kSessionManagerGetServerBackedStateKeys method is complete.
void OnGetServerBackedStateKeys(const StateKeysCallback& callback,
dbus::Response* response) {
std::vector<std::string> state_keys;
if (!response) {
LOG(ERROR) << "Failed to call "
<< login_manager::kSessionManagerGetServerBackedStateKeys;
} else {
dbus::MessageReader reader(response);
dbus::MessageReader array_reader(NULL);
if (!reader.PopArray(&array_reader)) {
LOG(ERROR) << "Bad response: " << response->ToString();
} else {
while (array_reader.HasMoreData()) {
const uint8_t* data = NULL;
size_t size = 0;
if (!array_reader.PopArrayOfBytes(&data, &size)) {
LOG(ERROR) << "Bad response: " << response->ToString();
state_keys.clear();
break;
}
state_keys.push_back(
std::string(reinterpret_cast<const char*>(data), size));
}
}
}
if (!callback.is_null())
callback.Run(state_keys);
}
// Called when kSessionManagerCheckArcAvailability method is complete.
void OnCheckArcAvailability(const ArcCallback& callback,
dbus::Response* response) {
bool available = false;
if (!response) {
LOG(ERROR) << "Failed to call "
<< login_manager::kSessionManagerCheckArcAvailability;
} else {
dbus::MessageReader reader(response);
if (!reader.PopBool(&available))
LOG(ERROR) << "Invalid response: " << response->ToString();
}
if (!callback.is_null())
callback.Run(available);
}
void OnGetArcStartTime(const GetArcStartTimeCallback& callback,
dbus::Response* response) {
bool success = false;
base::TimeTicks arc_start_time;
if (!response) {
LOG(ERROR) << "Failed to call "
<< login_manager::kSessionManagerGetArcStartTimeTicks;
} else {
dbus::MessageReader reader(response);
int64_t ticks = 0;
if (reader.PopInt64(&ticks)) {
success = true;
arc_start_time = base::TimeTicks::FromInternalValue(ticks);
} else {
LOG(ERROR) << "Invalid response: " << response->ToString();
}
}
callback.Run(success, arc_start_time);
}
// Called when kSessionManagerStartArcInstance or
// kSessionManagerStopArcInstance methods complete.
void OnArcMethod(const std::string& method_name,
const ArcCallback& callback,
dbus::Response* response) {
bool success = false;
if (!response) {
LOG(ERROR) << "Failed to call " << method_name;
} else {
success = true;
}
if (!callback.is_null())
callback.Run(success);
}
dbus::ObjectProxy* session_manager_proxy_;
std::unique_ptr<BlockingMethodCaller> blocking_method_caller_;
base::ObserverList<Observer> observers_;
// Most recent screen-lock state received from session_manager.
bool screen_is_locked_;
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<SessionManagerClientImpl> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(SessionManagerClientImpl);
};
// The SessionManagerClient implementation used on Linux desktop,
// which does nothing.
class SessionManagerClientStubImpl : public SessionManagerClient {
public:
SessionManagerClientStubImpl() : delegate_(NULL), screen_is_locked_(false) {}
~SessionManagerClientStubImpl() override {}
// SessionManagerClient overrides
void Init(dbus::Bus* bus) override {}
void SetStubDelegate(StubDelegate* delegate) override {
delegate_ = delegate;
}
void AddObserver(Observer* observer) override {
observers_.AddObserver(observer);
}
void RemoveObserver(Observer* observer) override {
observers_.RemoveObserver(observer);
}
bool HasObserver(const Observer* observer) const override {
return observers_.HasObserver(observer);
}
bool IsScreenLocked() const override { return screen_is_locked_; }
void EmitLoginPromptVisible() override {}
void RestartJob(const std::vector<std::string>& argv) override {}
void StartSession(const cryptohome::Identification& cryptohome_id) override {}
void StopSession() override {}
void NotifySupervisedUserCreationStarted() override {}
void NotifySupervisedUserCreationFinished() override {}
void StartDeviceWipe() override {}
void RequestLockScreen() override {
if (delegate_)
delegate_->LockScreenForStub();
}
void NotifyLockScreenShown() override {
screen_is_locked_ = true;
FOR_EACH_OBSERVER(Observer, observers_, ScreenIsLocked());
}
void NotifyLockScreenDismissed() override {
screen_is_locked_ = false;
FOR_EACH_OBSERVER(Observer, observers_, ScreenIsUnlocked());
}
void RetrieveActiveSessions(const ActiveSessionsCallback& callback) override {
}
void RetrieveDevicePolicy(const RetrievePolicyCallback& callback) override {
base::FilePath owner_key_path;
if (!PathService::Get(chromeos::FILE_OWNER_KEY, &owner_key_path)) {
callback.Run("");
return;
}
base::FilePath device_policy_path =
owner_key_path.DirName().AppendASCII("stub_device_policy");
base::PostTaskAndReplyWithResult(
base::WorkerPool::GetTaskRunner(false).get(),
FROM_HERE,
base::Bind(&GetFileContent, device_policy_path),
callback);
}
void RetrievePolicyForUser(const cryptohome::Identification& cryptohome_id,
const RetrievePolicyCallback& callback) override {
base::PostTaskAndReplyWithResult(
base::WorkerPool::GetTaskRunner(false).get(), FROM_HERE,
base::Bind(&GetFileContent,
GetUserFilePath(cryptohome_id, "stub_policy")),
callback);
}
std::string BlockingRetrievePolicyForUser(
const cryptohome::Identification& cryptohome_id) override {
return GetFileContent(GetUserFilePath(cryptohome_id, "stub_policy"));
}
void RetrieveDeviceLocalAccountPolicy(
const std::string& account_id,
const RetrievePolicyCallback& callback) override {
RetrievePolicyForUser(cryptohome::Identification::FromString(account_id),
callback);
}
void StoreDevicePolicy(const std::string& policy_blob,
const StorePolicyCallback& callback) override {
enterprise_management::PolicyFetchResponse response;
base::FilePath owner_key_path;
if (!response.ParseFromString(policy_blob) ||
!PathService::Get(chromeos::FILE_OWNER_KEY, &owner_key_path)) {
callback.Run(false);
return;
}
if (response.has_new_public_key()) {
base::WorkerPool::PostTask(
FROM_HERE,
base::Bind(&StoreFile, owner_key_path, response.new_public_key()),
false);
}
// Chrome will attempt to retrieve the device policy right after storing
// during enrollment, so make sure it's written before signaling
// completion.
// Note also that the owner key will be written before the device policy,
// if it was present in the blob.
base::FilePath device_policy_path =
owner_key_path.DirName().AppendASCII("stub_device_policy");
base::WorkerPool::PostTaskAndReply(
FROM_HERE,
base::Bind(&StoreFile, device_policy_path, policy_blob),
base::Bind(callback, true),
false);
}
void StorePolicyForUser(const cryptohome::Identification& cryptohome_id,
const std::string& policy_blob,
const StorePolicyCallback& callback) override {
// The session manager writes the user policy key to a well-known
// location. Do the same with the stub impl, so that user policy works and
// can be tested on desktop builds.
enterprise_management::PolicyFetchResponse response;
if (!response.ParseFromString(policy_blob)) {
callback.Run(false);
return;
}
if (response.has_new_public_key()) {
base::FilePath key_path = GetUserFilePath(cryptohome_id, "policy.pub");
base::WorkerPool::PostTask(
FROM_HERE,
base::Bind(&StoreFile, key_path, response.new_public_key()),
false);
}
// This file isn't read directly by Chrome, but is used by this class to
// reload the user policy across restarts.
base::FilePath stub_policy_path =
GetUserFilePath(cryptohome_id, "stub_policy");
base::WorkerPool::PostTaskAndReply(
FROM_HERE,
base::Bind(&StoreFile, stub_policy_path, policy_blob),
base::Bind(callback, true),
false);
}
void StoreDeviceLocalAccountPolicy(
const std::string& account_id,
const std::string& policy_blob,
const StorePolicyCallback& callback) override {
StorePolicyForUser(cryptohome::Identification::FromString(account_id),
policy_blob, callback);
}
void SetFlagsForUser(const cryptohome::Identification& cryptohome_id,
const std::vector<std::string>& flags) override {}
void GetServerBackedStateKeys(const StateKeysCallback& callback) override {
std::vector<std::string> state_keys;
for (int i = 0; i < 5; ++i)
state_keys.push_back(crypto::SHA256HashString(base::IntToString(i)));
if (!callback.is_null())
callback.Run(state_keys);
}
void CheckArcAvailability(const ArcCallback& callback) override {
callback.Run(false);
}
void StartArcInstance(const cryptohome::Identification& cryptohome_id,
const ArcCallback& callback) override {
callback.Run(false);
}
void StopArcInstance(const ArcCallback& callback) override {
callback.Run(false);
}
void GetArcStartTime(const GetArcStartTimeCallback& callback) override {
callback.Run(false, base::TimeTicks::Now());
}
void RemoveArcData(const cryptohome::Identification& cryptohome_id,
const ArcCallback& callback) override {
if (!callback.is_null())
callback.Run(false);
}
private:
StubDelegate* delegate_; // Weak pointer; may be NULL.
base::ObserverList<Observer> observers_;
std::string device_policy_;
bool screen_is_locked_;
DISALLOW_COPY_AND_ASSIGN(SessionManagerClientStubImpl);
};
SessionManagerClient::SessionManagerClient() {
}
SessionManagerClient::~SessionManagerClient() {
}
SessionManagerClient* SessionManagerClient::Create(
DBusClientImplementationType type) {
if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
return new SessionManagerClientImpl();
DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
return new SessionManagerClientStubImpl();
}
} // namespace chromeos
| [
"bino.zh@gmail.com"
] | bino.zh@gmail.com |
4ace725f41bc92f3aca9426a4aa0109933de8998 | 8a0d2910f54ca7329ccb545b3fad407a14c21808 | /SettingsDialog.cxx | a574a03f0d3394441102b2c12a911fbf73f7c692 | [] | no_license | egrath/equagen | f9b662845a0ac32bd079485989d60745b58214f1 | 8de9f64586d74c4cd84c368825ce184bed3fe3be | refs/heads/master | 2020-04-01T13:00:02.581909 | 2012-12-19T13:16:30 | 2012-12-19T13:16:30 | 32,130,544 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 7,867 | cxx | #include "SettingsDialog.h"
void SettingsDialog::setupUserInterface()
{
m_UserInterface = new Ui_SettingsDialog();
m_UserInterface->setupUi( this );
// Set up font tab
setupFontTab();
// Refresh the list of installed templates
refreshTemplateList();
// Connect signals
QObject::connect( m_UserInterface->buttonBrowseLatex, SIGNAL(clicked()), this, SLOT(buttonBrowseLatexPressed()));
QObject::connect( m_UserInterface->buttonBrowseDvisvgm, SIGNAL(clicked()),this,SLOT(buttonBrowseDvisvgmPressed()));
QObject::connect( m_UserInterface->buttonSave,SIGNAL(clicked()),this,SLOT(buttonSavePressed()));
QObject::connect( m_UserInterface->buttonCancel,SIGNAL(clicked()),this,SLOT(buttonCancelPressed()));
QObject::connect( m_UserInterface->buttonTextColor, SIGNAL( clicked() ),this,SLOT(buttonTextColorPressed()));
QObject::connect( m_UserInterface->buttonBackgroundColor, SIGNAL(clicked()),this,SLOT(buttonBackgroundColorPressed()));
QObject::connect( m_UserInterface->buttonTemplateNew, SIGNAL(clicked()), this, SLOT(buttonTemplateNewPressed()));
QObject::connect( m_UserInterface->buttonTemplateEdit, SIGNAL(clicked()), this, SLOT(buttonTemplateEditPressed()));
QObject::connect( m_UserInterface->buttonTemplateDelete,SIGNAL(clicked()), this,SLOT(buttonTemplateRemovePressed()));
QObject::connect( m_UserInterface->templateList,SIGNAL(itemSelectionChanged()),this,SLOT(templateListSelectionChanged()));
}
void SettingsDialog::setupFontTab()
{
QFontDatabase fdb;
QStringList fontFamiliesList = fdb.families( QFontDatabase::Latin );
QString configuredFontFamily = m_Settings->editorFont().family();
int configuredFontSize = m_Settings->editorFont().pointSize();
// Add Font Families to Combo
QStringList::iterator fontFamiliesListIterator = fontFamiliesList.begin();
while( fontFamiliesListIterator != fontFamiliesList.end() )
{
QString currentFontFamily = *( fontFamiliesListIterator );
m_UserInterface->comboBoxFontFamily->addItem( currentFontFamily );
// Is this font the configured one?
if( currentFontFamily.compare( configuredFontFamily ) == 0 )
m_UserInterface->comboBoxFontFamily->setCurrentIndex( m_UserInterface->comboBoxFontFamily->count()-1 );
fontFamiliesListIterator ++;
}
// Add standard Font sizes to Combo
QList<int> fontSizes = QFontDatabase::standardSizes();
QList<int>::iterator fontSizesIterator = fontSizes.begin();
while( fontSizesIterator != fontSizes.end() )
{
int currentFontSize = *(fontSizesIterator);
m_UserInterface->comboBoxFontSize->addItem( QString( "%1" ).arg( currentFontSize ));
// Current font size equal the configured one?
if( currentFontSize == configuredFontSize )
m_UserInterface->comboBoxFontSize->setCurrentIndex( m_UserInterface->comboBoxFontSize->count() -1 );
fontSizesIterator++;
}
}
void SettingsDialog::refreshTemplateList()
{
QListWidget *templateList = m_UserInterface->templateList;
templateList->clear();
QList<Template *> *templates = m_Settings->getLatexTemplates();
QList<Template *>::iterator iter = templates->begin();
while( iter != templates->end() )
{
debug() << "SettingsDialog: Adding Template to list:" << (*iter)->text();
templateList->addItem( (*iter));
iter++;
}
delete templates;
}
void SettingsDialog::buttonTemplateNewPressed()
{
debug() << "Showing Template Editor with empty template";
TemplateEditor *templateEditor = new TemplateEditor();
int rc = templateEditor->exec();
if( rc == QDialog::Accepted )
{
Template *t = new Template(
templateEditor->templateName(),
templateEditor->templateCode());
m_Settings->addLatexTemplate( *t );
refreshTemplateList();
}
delete templateEditor;
}
void SettingsDialog::buttonTemplateEditPressed()
{
debug() << "Editing template";
QListWidget *templateList = m_UserInterface->templateList;
Template *t = ( Template * ) templateList->selectedItems().at(0);
TemplateEditor *templateEditor = new TemplateEditor( 0, true );
templateEditor->setTemplateName( t->name() );
templateEditor->setTemplateCode( t->code() );
int rc = templateEditor->exec();
if( rc == QDialog::Accepted )
{
t->setName( templateEditor->templateName() );
t->setCode( templateEditor->templateCode() );
// This will also perform the update
m_Settings->addLatexTemplate( *t );
refreshTemplateList();
}
delete templateEditor;
}
void SettingsDialog::buttonTemplateRemovePressed()
{
Template *t = ( Template *) m_UserInterface->templateList->selectedItems().at( 0 );
debug() << "Removing template: " << t->name();
m_Settings->delLatexTemplate( *t );
refreshTemplateList();
}
void SettingsDialog::buttonBrowseLatexPressed()
{
debug() << "Browse for Latex Binary";
QString newBinary = showFileOpenDialog( m_UserInterface->textEditLatex->text() );
if( newBinary.length() > 0 )
m_UserInterface->textEditLatex->setText( newBinary );
}
void SettingsDialog::buttonBrowseDvisvgmPressed()
{
debug() << "Browse for DviSvgm Binary";
QString newBinary = showFileOpenDialog( m_UserInterface->textEditDvisvgm->text() );
if( newBinary.length() > 0 )
m_UserInterface->textEditDvisvgm->setText( newBinary );
}
void SettingsDialog::buttonTextColorPressed()
{
debug() << "SettingsDialog: buttonTextColorPressed";
}
void SettingsDialog::buttonBackgroundColorPressed()
{
debug() << "SettingsDialog: buttonBackgroundColorPressed";
}
void SettingsDialog::buttonSavePressed()
{
debug() << "Save";
m_Settings->setLatexBinary( m_UserInterface->textEditLatex->text() );
m_Settings->setDvisvgmBinary( m_UserInterface->textEditDvisvgm->text() );
m_Settings->setEditorFont( m_UserInterface->comboBoxFontFamily->itemText( m_UserInterface->comboBoxFontFamily->currentIndex() ),
m_UserInterface->comboBoxFontSize->itemText( m_UserInterface->comboBoxFontSize->currentIndex() ).toInt() );
debug() << " latex: " << m_Settings->latexBinary();
debug() << " dvisvgm: " << m_Settings->dvisvgmBinary();
debug() << " font: " << m_Settings->editorFont();
// Set dirty, so that the corresponding signal is emitted and all subscribers
// change their settings according to the new values
m_Settings->setDirty();
close();
}
void SettingsDialog::buttonCancelPressed()
{
debug() << "Cancel";
close();
}
void SettingsDialog::templateListSelectionChanged()
{
if( m_UserInterface->templateList->selectedItems().count() > 0 )
{
m_UserInterface->buttonTemplateDelete->setEnabled(true);
m_UserInterface->buttonTemplateEdit->setEnabled(true);
}
else
{
m_UserInterface->buttonTemplateDelete->setEnabled(false);
m_UserInterface->buttonTemplateEdit->setEnabled(false);
}
}
QString SettingsDialog::showFileOpenDialog( const QString &directory )
{
QFileDialog fileDialog;
fileDialog.setDirectory( directory );
fileDialog.setFileMode( QFileDialog::ExistingFile );
fileDialog.setAcceptMode( QFileDialog::AcceptOpen );
if( fileDialog.exec() )
return fileDialog.selectedFiles().at( 0 );
return "";
}
SettingsDialog::SettingsDialog( QWidget *parent ) : QDialog( parent )
{
// Get settings Object
m_Settings = SettingsProvider::instance();
setupUserInterface();
// Fill with values from settings
m_UserInterface->textEditLatex->setText( m_Settings->latexBinary() );
m_UserInterface->textEditDvisvgm->setText( m_Settings->dvisvgmBinary() );
}
SettingsDialog::~SettingsDialog()
{
}
| [
"egon.rath@de8f3505-683c-149d-5a3e-bae6d93cff59"
] | egon.rath@de8f3505-683c-149d-5a3e-bae6d93cff59 |
aef133ae00fbbbd08d78ca1b96edacfd2f3ebaea | f67338f7c90cbc8593166628350a066a85472f5e | /LoadoutData.cpp | 000fba19b571ca0d20af4c7af65ffda878c9d937 | [] | no_license | AlanWills/UnderSiege_DirectX | 33affe6cf5dc8307ed9e1aed3bde7d8eed670467 | 808135b73a21a859ff81335e115715324723714c | refs/heads/master | 2021-01-13T00:46:26.918058 | 2015-12-14T21:40:05 | 2015-12-14T21:40:05 | 46,755,632 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,597 | cpp | #include "pch.h"
#include "LoadoutData.h"
//-----------------------------------------------------------------------------------------------------------------------------------
LoadoutData::LoadoutData(const char* dataAsset) :
BaseData(dataAsset)
{
}
//-----------------------------------------------------------------------------------------------------------------------------------
LoadoutData::~LoadoutData()
{
}
//-----------------------------------------------------------------------------------------------------------------------------------
const std::wstring LoadoutData::GetDisplayName() const
{
return GenericUtils::CharToWChar(GetDocument()->RootElement()->FirstChildElement("DisplayName")->GetText());
}
//-----------------------------------------------------------------------------------------------------------------------------------
const char* LoadoutData::GetUITextureAsset() const
{
return GetDocument()->RootElement()->FirstChildElement("UITextureAsset")->GetText();
}
//-----------------------------------------------------------------------------------------------------------------------------------
const char* LoadoutData::GetGameTextureAsset() const
{
return GetDocument()->RootElement()->FirstChildElement("GameTextureAsset")->GetText();
}
//-----------------------------------------------------------------------------------------------------------------------------------
const int LoadoutData::GetSpeed() const
{
int speed = 0;
GetDocument()->RootElement()->FirstChildElement("Speed")->QueryIntText(&speed);
return speed;
}
//-----------------------------------------------------------------------------------------------------------------------------------
const int LoadoutData::GetArmour() const
{
int armour = 0;
GetDocument()->RootElement()->FirstChildElement("Armour")->QueryIntText(&armour);
return armour;
}
//-----------------------------------------------------------------------------------------------------------------------------------
const char* LoadoutData::GetGunDataAsset() const
{
return GetDocument()->RootElement()->FirstChildElement("GunDataAsset")->GetText();
}
//-----------------------------------------------------------------------------------------------------------------------------------
const Vector2 LoadoutData::GetBarrelOffset() const
{
Vector2 barrelOffset(Vector2::Zero);
GetDocument()->RootElement()->FirstChildElement("BarrelOffsetX")->QueryFloatText(&barrelOffset.x);
GetDocument()->RootElement()->FirstChildElement("BarrelOffsetY")->QueryFloatText(&barrelOffset.y);
return barrelOffset;
} | [
"alawills@googlemail.com"
] | alawills@googlemail.com |
4fc8d69298c9007834e71c6699152cf0184a0dd2 | 4382d8e976816ba2be05621b3566df9d5be9c0a6 | /OpenHome/Net/Bindings/C/ControlPoint/Proxies/CpUpnpOrgConnectionManager2C.cpp | 4e1912e2518ccbd582e11be1f1323c26f6ccf74c | [
"MIT"
] | permissive | openhome/ohNetGenerated | f9e9fc591d52c1a2ed69c676046af4e931c22f7c | 05270d36e77f97a2ffd0f9eb44249a908c333d71 | refs/heads/master | 2020-12-13T18:39:35.802161 | 2018-07-12T13:09:23 | 2018-07-12T13:09:23 | 22,726,722 | 1 | 6 | null | 2016-10-17T12:43:53 | 2014-08-07T15:38:18 | C++ | UTF-8 | C++ | false | false | 36,229 | cpp | #include "CpUpnpOrgConnectionManager2.h"
#include <OpenHome/Net/Core/CpDevice.h>
#include <OpenHome/Net/C/CpProxyCPrivate.h>
#include <OpenHome/Net/Core/FunctorAsync.h>
#include <OpenHome/Types.h>
#include <OpenHome/Buffer.h>
#include <OpenHome/Exception.h>
#include <OpenHome/Functor.h>
#include <OpenHome/Net/Core/CpProxy.h>
#include <OpenHome/Net/Private/CpiService.h>
#include <OpenHome/Private/Thread.h>
#include <OpenHome/Net/Private/AsyncPrivate.h>
#include <OpenHome/Net/Core/CpDevice.h>
#include <OpenHome/Net/Private/CpiDevice.h>
using namespace OpenHome;
using namespace OpenHome::Net;
class CpProxyUpnpOrgConnectionManager2C : public CpProxyC
{
public:
CpProxyUpnpOrgConnectionManager2C(CpDeviceC aDevice);
~CpProxyUpnpOrgConnectionManager2C();
//CpProxyUpnpOrgConnectionManager2* Proxy() { return static_cast<CpProxyUpnpOrgConnectionManager2*>(iProxy); }
void SyncGetProtocolInfo(Brh& aSource, Brh& aSink);
void BeginGetProtocolInfo(FunctorAsync& aFunctor);
void EndGetProtocolInfo(IAsync& aAsync, Brh& aSource, Brh& aSink);
void SyncPrepareForConnection(const Brx& aRemoteProtocolInfo, const Brx& aPeerConnectionManager, TInt aPeerConnectionID, const Brx& aDirection, TInt& aConnectionID, TInt& aAVTransportID, TInt& aRcsID);
void BeginPrepareForConnection(const Brx& aRemoteProtocolInfo, const Brx& aPeerConnectionManager, TInt aPeerConnectionID, const Brx& aDirection, FunctorAsync& aFunctor);
void EndPrepareForConnection(IAsync& aAsync, TInt& aConnectionID, TInt& aAVTransportID, TInt& aRcsID);
void SyncConnectionComplete(TInt aConnectionID);
void BeginConnectionComplete(TInt aConnectionID, FunctorAsync& aFunctor);
void EndConnectionComplete(IAsync& aAsync);
void SyncGetCurrentConnectionIDs(Brh& aConnectionIDs);
void BeginGetCurrentConnectionIDs(FunctorAsync& aFunctor);
void EndGetCurrentConnectionIDs(IAsync& aAsync, Brh& aConnectionIDs);
void SyncGetCurrentConnectionInfo(TInt aConnectionID, TInt& aRcsID, TInt& aAVTransportID, Brh& aProtocolInfo, Brh& aPeerConnectionManager, TInt& aPeerConnectionID, Brh& aDirection, Brh& aStatus);
void BeginGetCurrentConnectionInfo(TInt aConnectionID, FunctorAsync& aFunctor);
void EndGetCurrentConnectionInfo(IAsync& aAsync, TInt& aRcsID, TInt& aAVTransportID, Brh& aProtocolInfo, Brh& aPeerConnectionManager, TInt& aPeerConnectionID, Brh& aDirection, Brh& aStatus);
void SetPropertySourceProtocolInfoChanged(Functor& aFunctor);
void SetPropertySinkProtocolInfoChanged(Functor& aFunctor);
void SetPropertyCurrentConnectionIDsChanged(Functor& aFunctor);
void PropertySourceProtocolInfo(Brhz& aSourceProtocolInfo) const;
void PropertySinkProtocolInfo(Brhz& aSinkProtocolInfo) const;
void PropertyCurrentConnectionIDs(Brhz& aCurrentConnectionIDs) const;
private:
void SourceProtocolInfoPropertyChanged();
void SinkProtocolInfoPropertyChanged();
void CurrentConnectionIDsPropertyChanged();
private:
Mutex iLock;
Action* iActionGetProtocolInfo;
Action* iActionPrepareForConnection;
Action* iActionConnectionComplete;
Action* iActionGetCurrentConnectionIDs;
Action* iActionGetCurrentConnectionInfo;
PropertyString* iSourceProtocolInfo;
PropertyString* iSinkProtocolInfo;
PropertyString* iCurrentConnectionIDs;
Functor iSourceProtocolInfoChanged;
Functor iSinkProtocolInfoChanged;
Functor iCurrentConnectionIDsChanged;
};
class SyncGetProtocolInfoUpnpOrgConnectionManager2C : public SyncProxyAction
{
public:
SyncGetProtocolInfoUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, Brh& aSource, Brh& aSink);
virtual void CompleteRequest(IAsync& aAsync);
virtual ~SyncGetProtocolInfoUpnpOrgConnectionManager2C() {};
private:
CpProxyUpnpOrgConnectionManager2C& iService;
Brh& iSource;
Brh& iSink;
};
SyncGetProtocolInfoUpnpOrgConnectionManager2C::SyncGetProtocolInfoUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, Brh& aSource, Brh& aSink)
: iService(aProxy)
, iSource(aSource)
, iSink(aSink)
{
}
void SyncGetProtocolInfoUpnpOrgConnectionManager2C::CompleteRequest(IAsync& aAsync)
{
iService.EndGetProtocolInfo(aAsync, iSource, iSink);
}
class SyncPrepareForConnectionUpnpOrgConnectionManager2C : public SyncProxyAction
{
public:
SyncPrepareForConnectionUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, TInt& aConnectionID, TInt& aAVTransportID, TInt& aRcsID);
virtual void CompleteRequest(IAsync& aAsync);
virtual ~SyncPrepareForConnectionUpnpOrgConnectionManager2C() {};
private:
CpProxyUpnpOrgConnectionManager2C& iService;
TInt& iConnectionID;
TInt& iAVTransportID;
TInt& iRcsID;
};
SyncPrepareForConnectionUpnpOrgConnectionManager2C::SyncPrepareForConnectionUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, TInt& aConnectionID, TInt& aAVTransportID, TInt& aRcsID)
: iService(aProxy)
, iConnectionID(aConnectionID)
, iAVTransportID(aAVTransportID)
, iRcsID(aRcsID)
{
}
void SyncPrepareForConnectionUpnpOrgConnectionManager2C::CompleteRequest(IAsync& aAsync)
{
iService.EndPrepareForConnection(aAsync, iConnectionID, iAVTransportID, iRcsID);
}
class SyncConnectionCompleteUpnpOrgConnectionManager2C : public SyncProxyAction
{
public:
SyncConnectionCompleteUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy);
virtual void CompleteRequest(IAsync& aAsync);
virtual ~SyncConnectionCompleteUpnpOrgConnectionManager2C() {};
private:
CpProxyUpnpOrgConnectionManager2C& iService;
};
SyncConnectionCompleteUpnpOrgConnectionManager2C::SyncConnectionCompleteUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy)
: iService(aProxy)
{
}
void SyncConnectionCompleteUpnpOrgConnectionManager2C::CompleteRequest(IAsync& aAsync)
{
iService.EndConnectionComplete(aAsync);
}
class SyncGetCurrentConnectionIDsUpnpOrgConnectionManager2C : public SyncProxyAction
{
public:
SyncGetCurrentConnectionIDsUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, Brh& aConnectionIDs);
virtual void CompleteRequest(IAsync& aAsync);
virtual ~SyncGetCurrentConnectionIDsUpnpOrgConnectionManager2C() {};
private:
CpProxyUpnpOrgConnectionManager2C& iService;
Brh& iConnectionIDs;
};
SyncGetCurrentConnectionIDsUpnpOrgConnectionManager2C::SyncGetCurrentConnectionIDsUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, Brh& aConnectionIDs)
: iService(aProxy)
, iConnectionIDs(aConnectionIDs)
{
}
void SyncGetCurrentConnectionIDsUpnpOrgConnectionManager2C::CompleteRequest(IAsync& aAsync)
{
iService.EndGetCurrentConnectionIDs(aAsync, iConnectionIDs);
}
class SyncGetCurrentConnectionInfoUpnpOrgConnectionManager2C : public SyncProxyAction
{
public:
SyncGetCurrentConnectionInfoUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, TInt& aRcsID, TInt& aAVTransportID, Brh& aProtocolInfo, Brh& aPeerConnectionManager, TInt& aPeerConnectionID, Brh& aDirection, Brh& aStatus);
virtual void CompleteRequest(IAsync& aAsync);
virtual ~SyncGetCurrentConnectionInfoUpnpOrgConnectionManager2C() {};
private:
CpProxyUpnpOrgConnectionManager2C& iService;
TInt& iRcsID;
TInt& iAVTransportID;
Brh& iProtocolInfo;
Brh& iPeerConnectionManager;
TInt& iPeerConnectionID;
Brh& iDirection;
Brh& iStatus;
};
SyncGetCurrentConnectionInfoUpnpOrgConnectionManager2C::SyncGetCurrentConnectionInfoUpnpOrgConnectionManager2C(CpProxyUpnpOrgConnectionManager2C& aProxy, TInt& aRcsID, TInt& aAVTransportID, Brh& aProtocolInfo, Brh& aPeerConnectionManager, TInt& aPeerConnectionID, Brh& aDirection, Brh& aStatus)
: iService(aProxy)
, iRcsID(aRcsID)
, iAVTransportID(aAVTransportID)
, iProtocolInfo(aProtocolInfo)
, iPeerConnectionManager(aPeerConnectionManager)
, iPeerConnectionID(aPeerConnectionID)
, iDirection(aDirection)
, iStatus(aStatus)
{
}
void SyncGetCurrentConnectionInfoUpnpOrgConnectionManager2C::CompleteRequest(IAsync& aAsync)
{
iService.EndGetCurrentConnectionInfo(aAsync, iRcsID, iAVTransportID, iProtocolInfo, iPeerConnectionManager, iPeerConnectionID, iDirection, iStatus);
}
CpProxyUpnpOrgConnectionManager2C::CpProxyUpnpOrgConnectionManager2C(CpDeviceC aDevice)
: CpProxyC("schemas-upnp-org", "ConnectionManager", 2, *reinterpret_cast<CpiDevice*>(aDevice))
, iLock("MPCS")
{
OpenHome::Net::Parameter* param;
TChar** allowedValues;
TUint index;
iActionGetProtocolInfo = new Action("GetProtocolInfo");
param = new OpenHome::Net::ParameterString("Source");
iActionGetProtocolInfo->AddOutputParameter(param);
param = new OpenHome::Net::ParameterString("Sink");
iActionGetProtocolInfo->AddOutputParameter(param);
iActionPrepareForConnection = new Action("PrepareForConnection");
param = new OpenHome::Net::ParameterString("RemoteProtocolInfo");
iActionPrepareForConnection->AddInputParameter(param);
param = new OpenHome::Net::ParameterString("PeerConnectionManager");
iActionPrepareForConnection->AddInputParameter(param);
param = new OpenHome::Net::ParameterInt("PeerConnectionID");
iActionPrepareForConnection->AddInputParameter(param);
index = 0;
allowedValues = new TChar*[2];
allowedValues[index++] = (TChar*)"Input";
allowedValues[index++] = (TChar*)"Output";
param = new OpenHome::Net::ParameterString("Direction", allowedValues, 2);
iActionPrepareForConnection->AddInputParameter(param);
delete[] allowedValues;
param = new OpenHome::Net::ParameterInt("ConnectionID");
iActionPrepareForConnection->AddOutputParameter(param);
param = new OpenHome::Net::ParameterInt("AVTransportID");
iActionPrepareForConnection->AddOutputParameter(param);
param = new OpenHome::Net::ParameterInt("RcsID");
iActionPrepareForConnection->AddOutputParameter(param);
iActionConnectionComplete = new Action("ConnectionComplete");
param = new OpenHome::Net::ParameterInt("ConnectionID");
iActionConnectionComplete->AddInputParameter(param);
iActionGetCurrentConnectionIDs = new Action("GetCurrentConnectionIDs");
param = new OpenHome::Net::ParameterString("ConnectionIDs");
iActionGetCurrentConnectionIDs->AddOutputParameter(param);
iActionGetCurrentConnectionInfo = new Action("GetCurrentConnectionInfo");
param = new OpenHome::Net::ParameterInt("ConnectionID");
iActionGetCurrentConnectionInfo->AddInputParameter(param);
param = new OpenHome::Net::ParameterInt("RcsID");
iActionGetCurrentConnectionInfo->AddOutputParameter(param);
param = new OpenHome::Net::ParameterInt("AVTransportID");
iActionGetCurrentConnectionInfo->AddOutputParameter(param);
param = new OpenHome::Net::ParameterString("ProtocolInfo");
iActionGetCurrentConnectionInfo->AddOutputParameter(param);
param = new OpenHome::Net::ParameterString("PeerConnectionManager");
iActionGetCurrentConnectionInfo->AddOutputParameter(param);
param = new OpenHome::Net::ParameterInt("PeerConnectionID");
iActionGetCurrentConnectionInfo->AddOutputParameter(param);
index = 0;
allowedValues = new TChar*[2];
allowedValues[index++] = (TChar*)"Input";
allowedValues[index++] = (TChar*)"Output";
param = new OpenHome::Net::ParameterString("Direction", allowedValues, 2);
iActionGetCurrentConnectionInfo->AddOutputParameter(param);
delete[] allowedValues;
index = 0;
allowedValues = new TChar*[5];
allowedValues[index++] = (TChar*)"OK";
allowedValues[index++] = (TChar*)"ContentFormatMismatch";
allowedValues[index++] = (TChar*)"InsufficientBandwidth";
allowedValues[index++] = (TChar*)"UnreliableChannel";
allowedValues[index++] = (TChar*)"Unknown";
param = new OpenHome::Net::ParameterString("Status", allowedValues, 5);
iActionGetCurrentConnectionInfo->AddOutputParameter(param);
delete[] allowedValues;
Functor functor;
functor = MakeFunctor(*this, &CpProxyUpnpOrgConnectionManager2C::SourceProtocolInfoPropertyChanged);
iSourceProtocolInfo = new PropertyString("SourceProtocolInfo", functor);
AddProperty(iSourceProtocolInfo);
functor = MakeFunctor(*this, &CpProxyUpnpOrgConnectionManager2C::SinkProtocolInfoPropertyChanged);
iSinkProtocolInfo = new PropertyString("SinkProtocolInfo", functor);
AddProperty(iSinkProtocolInfo);
functor = MakeFunctor(*this, &CpProxyUpnpOrgConnectionManager2C::CurrentConnectionIDsPropertyChanged);
iCurrentConnectionIDs = new PropertyString("CurrentConnectionIDs", functor);
AddProperty(iCurrentConnectionIDs);
}
CpProxyUpnpOrgConnectionManager2C::~CpProxyUpnpOrgConnectionManager2C()
{
DestroyService();
delete iActionGetProtocolInfo;
delete iActionPrepareForConnection;
delete iActionConnectionComplete;
delete iActionGetCurrentConnectionIDs;
delete iActionGetCurrentConnectionInfo;
}
void CpProxyUpnpOrgConnectionManager2C::SyncGetProtocolInfo(Brh& aSource, Brh& aSink)
{
SyncGetProtocolInfoUpnpOrgConnectionManager2C sync(*this, aSource, aSink);
BeginGetProtocolInfo(sync.Functor());
sync.Wait();
}
void CpProxyUpnpOrgConnectionManager2C::BeginGetProtocolInfo(FunctorAsync& aFunctor)
{
Invocation* invocation = Service()->Invocation(*iActionGetProtocolInfo, aFunctor);
TUint outIndex = 0;
const Action::VectorParameters& outParams = iActionGetProtocolInfo->OutputParameters();
invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
Invocable().InvokeAction(*invocation);
}
void CpProxyUpnpOrgConnectionManager2C::EndGetProtocolInfo(IAsync& aAsync, Brh& aSource, Brh& aSink)
{
ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
Invocation& invocation = (Invocation&)aAsync;
ASSERT(invocation.Action().Name() == Brn("GetProtocolInfo"));
Error::ELevel level;
TUint code;
const TChar* ignore;
if (invocation.Error(level, code, ignore)) {
THROW_PROXYERROR(level, code);
}
TUint index = 0;
((ArgumentString*)invocation.OutputArguments()[index++])->TransferTo(aSource);
((ArgumentString*)invocation.OutputArguments()[index++])->TransferTo(aSink);
}
void CpProxyUpnpOrgConnectionManager2C::SyncPrepareForConnection(const Brx& aRemoteProtocolInfo, const Brx& aPeerConnectionManager, TInt aPeerConnectionID, const Brx& aDirection, TInt& aConnectionID, TInt& aAVTransportID, TInt& aRcsID)
{
SyncPrepareForConnectionUpnpOrgConnectionManager2C sync(*this, aConnectionID, aAVTransportID, aRcsID);
BeginPrepareForConnection(aRemoteProtocolInfo, aPeerConnectionManager, aPeerConnectionID, aDirection, sync.Functor());
sync.Wait();
}
void CpProxyUpnpOrgConnectionManager2C::BeginPrepareForConnection(const Brx& aRemoteProtocolInfo, const Brx& aPeerConnectionManager, TInt aPeerConnectionID, const Brx& aDirection, FunctorAsync& aFunctor)
{
Invocation* invocation = Service()->Invocation(*iActionPrepareForConnection, aFunctor);
TUint inIndex = 0;
const Action::VectorParameters& inParams = iActionPrepareForConnection->InputParameters();
invocation->AddInput(new ArgumentString(*inParams[inIndex++], aRemoteProtocolInfo));
invocation->AddInput(new ArgumentString(*inParams[inIndex++], aPeerConnectionManager));
invocation->AddInput(new ArgumentInt(*inParams[inIndex++], aPeerConnectionID));
invocation->AddInput(new ArgumentString(*inParams[inIndex++], aDirection));
TUint outIndex = 0;
const Action::VectorParameters& outParams = iActionPrepareForConnection->OutputParameters();
invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
Invocable().InvokeAction(*invocation);
}
void CpProxyUpnpOrgConnectionManager2C::EndPrepareForConnection(IAsync& aAsync, TInt& aConnectionID, TInt& aAVTransportID, TInt& aRcsID)
{
ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
Invocation& invocation = (Invocation&)aAsync;
ASSERT(invocation.Action().Name() == Brn("PrepareForConnection"));
Error::ELevel level;
TUint code;
const TChar* ignore;
if (invocation.Error(level, code, ignore)) {
THROW_PROXYERROR(level, code);
}
TUint index = 0;
aConnectionID = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
aAVTransportID = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
aRcsID = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
}
void CpProxyUpnpOrgConnectionManager2C::SyncConnectionComplete(TInt aConnectionID)
{
SyncConnectionCompleteUpnpOrgConnectionManager2C sync(*this);
BeginConnectionComplete(aConnectionID, sync.Functor());
sync.Wait();
}
void CpProxyUpnpOrgConnectionManager2C::BeginConnectionComplete(TInt aConnectionID, FunctorAsync& aFunctor)
{
Invocation* invocation = Service()->Invocation(*iActionConnectionComplete, aFunctor);
TUint inIndex = 0;
const Action::VectorParameters& inParams = iActionConnectionComplete->InputParameters();
invocation->AddInput(new ArgumentInt(*inParams[inIndex++], aConnectionID));
Invocable().InvokeAction(*invocation);
}
void CpProxyUpnpOrgConnectionManager2C::EndConnectionComplete(IAsync& aAsync)
{
ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
Invocation& invocation = (Invocation&)aAsync;
ASSERT(invocation.Action().Name() == Brn("ConnectionComplete"));
Error::ELevel level;
TUint code;
const TChar* ignore;
if (invocation.Error(level, code, ignore)) {
THROW_PROXYERROR(level, code);
}
}
void CpProxyUpnpOrgConnectionManager2C::SyncGetCurrentConnectionIDs(Brh& aConnectionIDs)
{
SyncGetCurrentConnectionIDsUpnpOrgConnectionManager2C sync(*this, aConnectionIDs);
BeginGetCurrentConnectionIDs(sync.Functor());
sync.Wait();
}
void CpProxyUpnpOrgConnectionManager2C::BeginGetCurrentConnectionIDs(FunctorAsync& aFunctor)
{
Invocation* invocation = Service()->Invocation(*iActionGetCurrentConnectionIDs, aFunctor);
TUint outIndex = 0;
const Action::VectorParameters& outParams = iActionGetCurrentConnectionIDs->OutputParameters();
invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
Invocable().InvokeAction(*invocation);
}
void CpProxyUpnpOrgConnectionManager2C::EndGetCurrentConnectionIDs(IAsync& aAsync, Brh& aConnectionIDs)
{
ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
Invocation& invocation = (Invocation&)aAsync;
ASSERT(invocation.Action().Name() == Brn("GetCurrentConnectionIDs"));
Error::ELevel level;
TUint code;
const TChar* ignore;
if (invocation.Error(level, code, ignore)) {
THROW_PROXYERROR(level, code);
}
TUint index = 0;
((ArgumentString*)invocation.OutputArguments()[index++])->TransferTo(aConnectionIDs);
}
void CpProxyUpnpOrgConnectionManager2C::SyncGetCurrentConnectionInfo(TInt aConnectionID, TInt& aRcsID, TInt& aAVTransportID, Brh& aProtocolInfo, Brh& aPeerConnectionManager, TInt& aPeerConnectionID, Brh& aDirection, Brh& aStatus)
{
SyncGetCurrentConnectionInfoUpnpOrgConnectionManager2C sync(*this, aRcsID, aAVTransportID, aProtocolInfo, aPeerConnectionManager, aPeerConnectionID, aDirection, aStatus);
BeginGetCurrentConnectionInfo(aConnectionID, sync.Functor());
sync.Wait();
}
void CpProxyUpnpOrgConnectionManager2C::BeginGetCurrentConnectionInfo(TInt aConnectionID, FunctorAsync& aFunctor)
{
Invocation* invocation = Service()->Invocation(*iActionGetCurrentConnectionInfo, aFunctor);
TUint inIndex = 0;
const Action::VectorParameters& inParams = iActionGetCurrentConnectionInfo->InputParameters();
invocation->AddInput(new ArgumentInt(*inParams[inIndex++], aConnectionID));
TUint outIndex = 0;
const Action::VectorParameters& outParams = iActionGetCurrentConnectionInfo->OutputParameters();
invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
Invocable().InvokeAction(*invocation);
}
void CpProxyUpnpOrgConnectionManager2C::EndGetCurrentConnectionInfo(IAsync& aAsync, TInt& aRcsID, TInt& aAVTransportID, Brh& aProtocolInfo, Brh& aPeerConnectionManager, TInt& aPeerConnectionID, Brh& aDirection, Brh& aStatus)
{
ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
Invocation& invocation = (Invocation&)aAsync;
ASSERT(invocation.Action().Name() == Brn("GetCurrentConnectionInfo"));
Error::ELevel level;
TUint code;
const TChar* ignore;
if (invocation.Error(level, code, ignore)) {
THROW_PROXYERROR(level, code);
}
TUint index = 0;
aRcsID = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
aAVTransportID = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
((ArgumentString*)invocation.OutputArguments()[index++])->TransferTo(aProtocolInfo);
((ArgumentString*)invocation.OutputArguments()[index++])->TransferTo(aPeerConnectionManager);
aPeerConnectionID = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
((ArgumentString*)invocation.OutputArguments()[index++])->TransferTo(aDirection);
((ArgumentString*)invocation.OutputArguments()[index++])->TransferTo(aStatus);
}
void CpProxyUpnpOrgConnectionManager2C::SetPropertySourceProtocolInfoChanged(Functor& aFunctor)
{
iLock.Wait();
iSourceProtocolInfoChanged = aFunctor;
iLock.Signal();
}
void CpProxyUpnpOrgConnectionManager2C::SetPropertySinkProtocolInfoChanged(Functor& aFunctor)
{
iLock.Wait();
iSinkProtocolInfoChanged = aFunctor;
iLock.Signal();
}
void CpProxyUpnpOrgConnectionManager2C::SetPropertyCurrentConnectionIDsChanged(Functor& aFunctor)
{
iLock.Wait();
iCurrentConnectionIDsChanged = aFunctor;
iLock.Signal();
}
void CpProxyUpnpOrgConnectionManager2C::PropertySourceProtocolInfo(Brhz& aSourceProtocolInfo) const
{
AutoMutex a(GetPropertyReadLock());
CheckSubscribed();
aSourceProtocolInfo.Set(iSourceProtocolInfo->Value());
}
void CpProxyUpnpOrgConnectionManager2C::PropertySinkProtocolInfo(Brhz& aSinkProtocolInfo) const
{
AutoMutex a(GetPropertyReadLock());
CheckSubscribed();
aSinkProtocolInfo.Set(iSinkProtocolInfo->Value());
}
void CpProxyUpnpOrgConnectionManager2C::PropertyCurrentConnectionIDs(Brhz& aCurrentConnectionIDs) const
{
AutoMutex a(GetPropertyReadLock());
CheckSubscribed();
aCurrentConnectionIDs.Set(iCurrentConnectionIDs->Value());
}
void CpProxyUpnpOrgConnectionManager2C::SourceProtocolInfoPropertyChanged()
{
ReportEvent(iSourceProtocolInfoChanged);
}
void CpProxyUpnpOrgConnectionManager2C::SinkProtocolInfoPropertyChanged()
{
ReportEvent(iSinkProtocolInfoChanged);
}
void CpProxyUpnpOrgConnectionManager2C::CurrentConnectionIDsPropertyChanged()
{
ReportEvent(iCurrentConnectionIDsChanged);
}
THandle STDCALL CpProxyUpnpOrgConnectionManager2Create(CpDeviceC aDevice)
{
return new CpProxyUpnpOrgConnectionManager2C(aDevice);
}
void STDCALL CpProxyUpnpOrgConnectionManager2Destroy(THandle aHandle)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
delete proxyC;
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2SyncGetProtocolInfo(THandle aHandle, char** aSource, char** aSink)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brh buf_aSource;
Brh buf_aSink;
int32_t err = 0;
try {
proxyC->SyncGetProtocolInfo(buf_aSource, buf_aSink);
*aSource = buf_aSource.Extract();
*aSink = buf_aSink.Extract();
}
catch (ProxyError& ) {
err = -1;
*aSource = NULL;
*aSink = NULL;
}
return err;
}
void STDCALL CpProxyUpnpOrgConnectionManager2BeginGetProtocolInfo(THandle aHandle, OhNetCallbackAsync aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
FunctorAsync functor = MakeFunctorAsync(aPtr, (OhNetFunctorAsync)aCallback);
proxyC->BeginGetProtocolInfo(functor);
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2EndGetProtocolInfo(THandle aHandle, OhNetHandleAsync aAsync, char** aSource, char** aSink)
{
int32_t err = 0;
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
IAsync* async = reinterpret_cast<IAsync*>(aAsync);
ASSERT(async != NULL);
Brh buf_aSource;
*aSource = NULL;
Brh buf_aSink;
*aSink = NULL;
try {
proxyC->EndGetProtocolInfo(*async, buf_aSource, buf_aSink);
*aSource = buf_aSource.Extract();
*aSink = buf_aSink.Extract();
}
catch(...) {
err = -1;
}
return err;
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2SyncPrepareForConnection(THandle aHandle, const char* aRemoteProtocolInfo, const char* aPeerConnectionManager, int32_t aPeerConnectionID, const char* aDirection, int32_t* aConnectionID, int32_t* aAVTransportID, int32_t* aRcsID)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brh buf_aRemoteProtocolInfo(aRemoteProtocolInfo);
Brh buf_aPeerConnectionManager(aPeerConnectionManager);
Brh buf_aDirection(aDirection);
int32_t err = 0;
try {
proxyC->SyncPrepareForConnection(buf_aRemoteProtocolInfo, buf_aPeerConnectionManager, aPeerConnectionID, buf_aDirection, *aConnectionID, *aAVTransportID, *aRcsID);
}
catch (ProxyError& ) {
err = -1;
*aConnectionID = 0;
*aAVTransportID = 0;
*aRcsID = 0;
}
return err;
}
void STDCALL CpProxyUpnpOrgConnectionManager2BeginPrepareForConnection(THandle aHandle, const char* aRemoteProtocolInfo, const char* aPeerConnectionManager, int32_t aPeerConnectionID, const char* aDirection, OhNetCallbackAsync aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brh buf_aRemoteProtocolInfo(aRemoteProtocolInfo);
Brh buf_aPeerConnectionManager(aPeerConnectionManager);
Brh buf_aDirection(aDirection);
FunctorAsync functor = MakeFunctorAsync(aPtr, (OhNetFunctorAsync)aCallback);
proxyC->BeginPrepareForConnection(buf_aRemoteProtocolInfo, buf_aPeerConnectionManager, aPeerConnectionID, buf_aDirection, functor);
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2EndPrepareForConnection(THandle aHandle, OhNetHandleAsync aAsync, int32_t* aConnectionID, int32_t* aAVTransportID, int32_t* aRcsID)
{
int32_t err = 0;
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
IAsync* async = reinterpret_cast<IAsync*>(aAsync);
ASSERT(async != NULL);
try {
proxyC->EndPrepareForConnection(*async, *aConnectionID, *aAVTransportID, *aRcsID);
}
catch(...) {
err = -1;
}
return err;
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2SyncConnectionComplete(THandle aHandle, int32_t aConnectionID)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
int32_t err = 0;
try {
proxyC->SyncConnectionComplete(aConnectionID);
}
catch (ProxyError& ) {
err = -1;
}
return err;
}
void STDCALL CpProxyUpnpOrgConnectionManager2BeginConnectionComplete(THandle aHandle, int32_t aConnectionID, OhNetCallbackAsync aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
FunctorAsync functor = MakeFunctorAsync(aPtr, (OhNetFunctorAsync)aCallback);
proxyC->BeginConnectionComplete(aConnectionID, functor);
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2EndConnectionComplete(THandle aHandle, OhNetHandleAsync aAsync)
{
int32_t err = 0;
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
IAsync* async = reinterpret_cast<IAsync*>(aAsync);
ASSERT(async != NULL);
try {
proxyC->EndConnectionComplete(*async);
}
catch(...) {
err = -1;
}
return err;
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2SyncGetCurrentConnectionIDs(THandle aHandle, char** aConnectionIDs)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brh buf_aConnectionIDs;
int32_t err = 0;
try {
proxyC->SyncGetCurrentConnectionIDs(buf_aConnectionIDs);
*aConnectionIDs = buf_aConnectionIDs.Extract();
}
catch (ProxyError& ) {
err = -1;
*aConnectionIDs = NULL;
}
return err;
}
void STDCALL CpProxyUpnpOrgConnectionManager2BeginGetCurrentConnectionIDs(THandle aHandle, OhNetCallbackAsync aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
FunctorAsync functor = MakeFunctorAsync(aPtr, (OhNetFunctorAsync)aCallback);
proxyC->BeginGetCurrentConnectionIDs(functor);
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2EndGetCurrentConnectionIDs(THandle aHandle, OhNetHandleAsync aAsync, char** aConnectionIDs)
{
int32_t err = 0;
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
IAsync* async = reinterpret_cast<IAsync*>(aAsync);
ASSERT(async != NULL);
Brh buf_aConnectionIDs;
*aConnectionIDs = NULL;
try {
proxyC->EndGetCurrentConnectionIDs(*async, buf_aConnectionIDs);
*aConnectionIDs = buf_aConnectionIDs.Extract();
}
catch(...) {
err = -1;
}
return err;
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2SyncGetCurrentConnectionInfo(THandle aHandle, int32_t aConnectionID, int32_t* aRcsID, int32_t* aAVTransportID, char** aProtocolInfo, char** aPeerConnectionManager, int32_t* aPeerConnectionID, char** aDirection, char** aStatus)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brh buf_aProtocolInfo;
Brh buf_aPeerConnectionManager;
Brh buf_aDirection;
Brh buf_aStatus;
int32_t err = 0;
try {
proxyC->SyncGetCurrentConnectionInfo(aConnectionID, *aRcsID, *aAVTransportID, buf_aProtocolInfo, buf_aPeerConnectionManager, *aPeerConnectionID, buf_aDirection, buf_aStatus);
*aProtocolInfo = buf_aProtocolInfo.Extract();
*aPeerConnectionManager = buf_aPeerConnectionManager.Extract();
*aDirection = buf_aDirection.Extract();
*aStatus = buf_aStatus.Extract();
}
catch (ProxyError& ) {
err = -1;
*aRcsID = 0;
*aAVTransportID = 0;
*aProtocolInfo = NULL;
*aPeerConnectionManager = NULL;
*aPeerConnectionID = 0;
*aDirection = NULL;
*aStatus = NULL;
}
return err;
}
void STDCALL CpProxyUpnpOrgConnectionManager2BeginGetCurrentConnectionInfo(THandle aHandle, int32_t aConnectionID, OhNetCallbackAsync aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
FunctorAsync functor = MakeFunctorAsync(aPtr, (OhNetFunctorAsync)aCallback);
proxyC->BeginGetCurrentConnectionInfo(aConnectionID, functor);
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2EndGetCurrentConnectionInfo(THandle aHandle, OhNetHandleAsync aAsync, int32_t* aRcsID, int32_t* aAVTransportID, char** aProtocolInfo, char** aPeerConnectionManager, int32_t* aPeerConnectionID, char** aDirection, char** aStatus)
{
int32_t err = 0;
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
IAsync* async = reinterpret_cast<IAsync*>(aAsync);
ASSERT(async != NULL);
Brh buf_aProtocolInfo;
*aProtocolInfo = NULL;
Brh buf_aPeerConnectionManager;
*aPeerConnectionManager = NULL;
Brh buf_aDirection;
*aDirection = NULL;
Brh buf_aStatus;
*aStatus = NULL;
try {
proxyC->EndGetCurrentConnectionInfo(*async, *aRcsID, *aAVTransportID, buf_aProtocolInfo, buf_aPeerConnectionManager, *aPeerConnectionID, buf_aDirection, buf_aStatus);
*aProtocolInfo = buf_aProtocolInfo.Extract();
*aPeerConnectionManager = buf_aPeerConnectionManager.Extract();
*aDirection = buf_aDirection.Extract();
*aStatus = buf_aStatus.Extract();
}
catch(...) {
err = -1;
}
return err;
}
void STDCALL CpProxyUpnpOrgConnectionManager2SetPropertySourceProtocolInfoChanged(THandle aHandle, OhNetCallback aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Functor functor = MakeFunctor(aPtr, aCallback);
proxyC->SetPropertySourceProtocolInfoChanged(functor);
}
void STDCALL CpProxyUpnpOrgConnectionManager2SetPropertySinkProtocolInfoChanged(THandle aHandle, OhNetCallback aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Functor functor = MakeFunctor(aPtr, aCallback);
proxyC->SetPropertySinkProtocolInfoChanged(functor);
}
void STDCALL CpProxyUpnpOrgConnectionManager2SetPropertyCurrentConnectionIDsChanged(THandle aHandle, OhNetCallback aCallback, void* aPtr)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Functor functor = MakeFunctor(aPtr, aCallback);
proxyC->SetPropertyCurrentConnectionIDsChanged(functor);
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2PropertySourceProtocolInfo(THandle aHandle, char** aSourceProtocolInfo)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brhz buf_aSourceProtocolInfo;
try {
proxyC->PropertySourceProtocolInfo(buf_aSourceProtocolInfo);
}
catch (ProxyNotSubscribed&) {
return -1;
}
*aSourceProtocolInfo = buf_aSourceProtocolInfo.Transfer();
return 0;
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2PropertySinkProtocolInfo(THandle aHandle, char** aSinkProtocolInfo)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brhz buf_aSinkProtocolInfo;
try {
proxyC->PropertySinkProtocolInfo(buf_aSinkProtocolInfo);
}
catch (ProxyNotSubscribed&) {
return -1;
}
*aSinkProtocolInfo = buf_aSinkProtocolInfo.Transfer();
return 0;
}
int32_t STDCALL CpProxyUpnpOrgConnectionManager2PropertyCurrentConnectionIDs(THandle aHandle, char** aCurrentConnectionIDs)
{
CpProxyUpnpOrgConnectionManager2C* proxyC = reinterpret_cast<CpProxyUpnpOrgConnectionManager2C*>(aHandle);
ASSERT(proxyC != NULL);
Brhz buf_aCurrentConnectionIDs;
try {
proxyC->PropertyCurrentConnectionIDs(buf_aCurrentConnectionIDs);
}
catch (ProxyNotSubscribed&) {
return -1;
}
*aCurrentConnectionIDs = buf_aCurrentConnectionIDs.Transfer();
return 0;
}
| [
"simon.chisholm@linn.co.uk"
] | simon.chisholm@linn.co.uk |
5222079ce02be99078a3333e27f58667499ef186 | 49728e3a138f1025efb8cd21395ef2a5b34fee70 | /wcmp/solver/PathBasedILPSolver.cpp | f68ee6ff8c2194456db3eb332e3dcc886766401d | [] | no_license | googleinterns/minimal-wcmp-precision-loss | 40af48580de40dc9c3a0703ad94cbba2e254c8fa | 359119ffc32f5a0c0c81b78260c5b509f5221e34 | refs/heads/master | 2022-12-01T00:11:01.090187 | 2020-08-14T22:03:13 | 2020-08-14T22:03:13 | 265,093,114 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 36,744 | cpp | //
// Created by wwt on 6/20/20.
//
#include <chrono>
#include <glog/logging.h>
#include "PathBasedILPSolver.h"
namespace wcmp {
namespace solver {
PathBasedILPSolver::PathBasedILPSolver(wcmp::topo::AbstractTopology topology, std::unordered_map<int, double> &trace): AbstractSolver(topology, trace) {
}
// create variable for MLU
SCIP_RETCODE PathBasedILPSolver::PathILPCreateVariableGoal(SCIP *scip, SCIP_VAR *&u) {
SCIP_CALL(SCIPcreateVarBasic(scip,
&u, // variable
"MLU", // name
0.0, // lower bound
infinity, // upper bound
1.0, // objective
SCIP_VARTYPE_CONTINUOUS)); // variable type
SCIP_CALL(SCIPaddVar(scip, u)); //Adding the variable
return SCIP_OKAY;
}
// create variable for weights for each source destination pair on each link
SCIP_RETCODE PathBasedILPSolver::PathILPCreateVariableF(SCIP *scip,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &f) {
f = std::vector<std::vector<std::vector<SCIP_VAR *>>>(sources_.size(),
std::vector<std::vector<SCIP_VAR *>>(destinations_.size()));
for (int src_idx = 0; src_idx < sources_.size(); ++src_idx) {
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
for (int l=0; l<links_.size(); ++l) {
f[src_idx][dst_idx].emplace_back((SCIP_VAR *) nullptr);
std::stringstream ss;
ss << "f_" << src_idx << "_" << dst_idx << "_" << l;
SCIP_CALL(SCIPcreateVarBasic(scip,
&f[src_idx][dst_idx][l], // variable
ss.str().c_str(), // name
0.0, // lower bound
1.0, // upper bound
0.0, // objective
SCIP_VARTYPE_CONTINUOUS)); // variable type
SCIP_CALL(SCIPaddVar(scip, f[src_idx][dst_idx][l])); //Adding the variable
}
}
}
return SCIP_OKAY;
}
// create variable for x
// used to determine whether the choice of the integer group weight is valid
SCIP_RETCODE PathBasedILPSolver::PathILPCreateVariableX(SCIP *scip,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &x) {
x = std::vector<std::vector<std::vector<SCIP_VAR *>>>(destinations_.size(),
std::vector<std::vector<SCIP_VAR *>>(maxGroupSize+1));
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
// get the Dt
double dt = 0;
for (int src_idx=0; src_idx < sources_.size(); ++src_idx) {
if (src_idx != dst_idx) dt = dt + traffic_matrix_[src_idx * destinations_.size() + dst_idx];
}
for (int n=0; n<maxGroupSize+1; ++n) {
for (int l=0; l<links_.size(); ++l) {
if (links_[l].link_type == LinkType::dcn) {
x[dst_idx][n].emplace_back((SCIP_VAR *) nullptr);
std::stringstream ss;
ss << "x_" << dst_idx << "_" << n << "_" << l;
SCIP_CALL(SCIPcreateVarBasic(scip,
&x[dst_idx][n][l], // variable
ss.str().c_str(), // name
-dt, // lower bound
dt, // upper bound
0.0, // objective
SCIP_VARTYPE_CONTINUOUS)); // variable type
SCIP_CALL(SCIPaddVar(scip, x[dst_idx][n][l])); //Adding the variable
}
}
}
}
return SCIP_OKAY;
}
// create variable for y
// used to force the number of choice of the group weight can only be 1
SCIP_RETCODE PathBasedILPSolver::PathILPCreateVariableY(SCIP *scip,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &y) {
y = std::vector<std::vector<std::vector<SCIP_VAR *>>>(destinations_.size(),
std::vector<std::vector<SCIP_VAR *>>(maxGroupSize+1));
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
for (int n=0; n<maxGroupSize+1; ++n) {
for (int l = 0; l < links_.size(); ++l) {
if ((links_[l].link_type == LinkType::src) ||
(links_[l].link_type == LinkType::dst)) continue;
y[dst_idx][n].emplace_back((SCIP_VAR *) nullptr);
std::stringstream ss;
ss << "y_" << dst_idx << "_" << n << "_" << l;
SCIP_CALL(SCIPcreateVarBasic(scip,
&y[dst_idx][n][l], // variable
ss.str().c_str(), // name
0, // lower bound
1, // upper bound
0.0, // objective
SCIP_VARTYPE_INTEGER)); // variable type
SCIP_CALL(SCIPaddVar(scip, y[dst_idx][n][l])); //Adding the variable
}
}
}
return SCIP_OKAY;
}
// create variable for b
// used to determine whether the flow will go through this node
SCIP_RETCODE PathBasedILPSolver::PathILPCreateVariableB(SCIP *scip,
std::vector<std::vector<SCIP_VAR *>> &b) {
b = std::vector<std::vector<SCIP_VAR *>>(destinations_.size());
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
// get the Dt
double dt = 0;
for (int src_idx=0; src_idx < sources_.size(); ++src_idx) {
if (src_idx != dst_idx) dt = dt + traffic_matrix_[src_idx * destinations_.size() + dst_idx];
}
for (int sw=0; sw<switches_.size(); ++sw) {
b[dst_idx].emplace_back((SCIP_VAR *) nullptr);
std::stringstream ss;
ss << "b_" << dst_idx << "_" << sw;
SCIP_CALL(SCIPcreateVarBasic(scip,
&b[dst_idx][sw], // variable
ss.str().c_str(), // name
0, // lower bound
1, // upper bound
0.0, // objective
SCIP_VARTYPE_INTEGER)); // variable type
SCIP_CALL(SCIPaddVar(scip, b[dst_idx][sw])); //Adding the variable
}
}
return SCIP_OKAY;
}
// add constraints for flow conservation
// the input flow and the output flow should be the same
SCIP_RETCODE PathBasedILPSolver::PathILPCreateConstraints1(
SCIP *scip,
std::vector<SCIP_CONS *> &cons_1,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &f) {
int cnt = 0;
// iterate all st pairs
for (int src_idx = 0; src_idx < sources_.size(); ++src_idx) {
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
// iterate all switches
for (int sw=0; sw<switches_.size(); ++sw) {
if ((switches_[sw].switch_type == SwitchType::src) ||
(switches_[sw].switch_type == SwitchType::dst)) continue;
cons_1.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
// for source s3 switch
if (switches_[sw].superblock_id == src_idx) {
for (int i=0; i<per_switch_links_[sw].size(); ++i) {
int l = per_switch_links_[sw][i];
if ((links_[l].link_type==LinkType::dcn) && (links_[l].src_sw_gid == sw)) {
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(1);
}
else if ((links_[l].link_type==LinkType::src) && (links_[l].dst_sw_gid == sw)) {
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(-1);
}
}
}
// for destination s3 switch
else if (switches_[sw].superblock_id == dst_idx) {
for (int i=0; i<per_switch_links_[sw].size(); ++i) {
int l = per_switch_links_[sw][i];
if ((links_[l].link_type==LinkType::dcn) && (links_[l].dst_sw_gid == sw)) {
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(1);
}
else if ((links_[l].link_type==LinkType::dst) && (links_[l].src_sw_gid == sw)) {
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(-1);
}
}
}
// for mid s3 switches
else {
for (int i=0; i<per_switch_links_[sw].size(); ++i) {
int l = per_switch_links_[sw][i];
if ((links_[l].link_type==LinkType::dcn) && (switches_[links_[l].src_sw_gid].superblock_id == src_idx)) {
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(1);
}
else if ((links_[l].link_type==LinkType::dcn) && (switches_[links_[l].dst_sw_gid].superblock_id == dst_idx)) {
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(-1);
}
else {
// std::cout << switches_[links_[l].dst_sw_gid].superblock_id << std::endl;
}
}
}
// add constraints
SCIP_VAR *scip_vars[vars.size()];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size()];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
std::stringstream ss;
ss << "cons_1_" << src_idx << "_" << dst_idx << "_" << sw;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_1[cnt], // constraint
ss.str().c_str(), // name
vars.size(), // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
0, // LHS of the constraint
0)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_1[cnt]));
++cnt;
}
}
}
return SCIP_OKAY;
}
// add constraints for flow conservation at source and destination
// the input flow and the output flow should be 100%
SCIP_RETCODE PathBasedILPSolver::PathILPCreateConstraints2(
SCIP *scip,
std::vector<SCIP_CONS *> &cons_2,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &f) {
int cnt = 0;
for (int src_idx = 0; src_idx < sources_.size(); ++src_idx) {
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
if (sources_[src_idx] == destinations_[dst_idx]) continue;
// add constraints for source switches
for (int vs=0; vs < sources_.size(); ++vs) {
cons_2.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
int vsw = sources_[vs];
for (int i=0; i<per_switch_links_[vsw].size(); ++i) {
int l = per_switch_links_[vsw][i];
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(1);
}
// add constraints
SCIP_VAR *scip_vars[vars.size()];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size()];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
std::stringstream ss;
ss << "cons_2_" << src_idx << "_" << dst_idx << "_" << vs;
int lrhs;
if (vs == src_idx) lrhs = 1;
else lrhs = 0;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_2[cnt], // constraint
ss.str().c_str(), // name
vars.size(), // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
lrhs, // LHS of the constraint
lrhs)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_2[cnt]));
++cnt;
}
// add constraints for destination switches
for (int vs=0; vs < destinations_.size(); ++vs) {
cons_2.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
int vsw = destinations_[vs];
for (int i=0; i<per_switch_links_[vsw].size(); ++i) {
int l = per_switch_links_[vsw][i];
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(1);
}
// add constraints
SCIP_VAR *scip_vars[vars.size()];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size()];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
std::stringstream ss;
ss << "cons_2_" << src_idx << "_" << dst_idx << "_" << vs;
int lrhs;
if (vs == dst_idx) lrhs = 1;
else lrhs = 0;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_2[cnt], // constraint
ss.str().c_str(), // name
vars.size(), // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
lrhs, // LHS of the constraint
lrhs)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_2[cnt]));
++cnt;
}
}
}
return SCIP_OKAY;
}
// add constraints for
// integer requirement for the split
SCIP_RETCODE PathBasedILPSolver::PathILPCreateConstraints3(
SCIP *scip,
std::vector<SCIP_CONS *> &cons_3,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &f,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &x) {
int cnt = 0;
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
for (int l = 0; l < links_.size(); ++l) {
if ((links_[l].link_type == LinkType::src) ||
(links_[l].link_type == LinkType::dst)) continue;
for (int n = 0; n <= maxGroupSize; ++n) {
cons_3.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
for (int src_idx=0; src_idx < sources_.size(); ++src_idx) {
if (src_idx == dst_idx) continue;
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(-traffic_matrix_[src_idx * destinations_.size() + dst_idx]);
}
for (int pi=0; pi<per_switch_links_[links_[l].src_sw_gid].size(); ++pi) {
int pl = per_switch_links_[links_[l].src_sw_gid][pi];
if (links_[pl].dst_sw_gid != links_[l].src_sw_gid) continue;
for (int src_idx=0; src_idx < sources_.size(); ++src_idx) {
if (src_idx == dst_idx) continue;
vars.push_back(f[src_idx][dst_idx][pl]);
values.push_back(traffic_matrix_[src_idx * destinations_.size() + dst_idx] * n / double(maxGroupSize));
}
}
vars.push_back(x[dst_idx][n][l]);
values.push_back(1);
// add constraints
SCIP_VAR *scip_vars[vars.size()];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size()];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
std::stringstream ss;
ss << "cons_3_" << dst_idx << "_" << n << "_" << l;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_3[cnt], // constraint
ss.str().c_str(), // name
vars.size(), // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
0, // LHS of the constraint
0)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_3[cnt]));
++cnt;
}
}
}
return SCIP_OKAY;
}
// add constraints for forcing the split to be fractional
SCIP_RETCODE PathBasedILPSolver::PathILPCreateConstraints4(
SCIP *scip,
std::vector<SCIP_CONS *> &cons_4,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &x,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &y) {
int cnt = 0;
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
for (int l = 0; l < links_.size(); ++l) {
if ((links_[l].link_type == LinkType::src) ||
(links_[l].link_type == LinkType::dst)) continue;
for (int n = 0; n <= maxGroupSize; ++n) {
cons_4.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
vars.push_back(x[dst_idx][n][l]);
values.push_back(1);
vars.push_back(y[dst_idx][n][l]);
double dt = 0;
for (int src_idx=0; src_idx < sources_.size(); ++src_idx) {
dt+=traffic_matrix_[src_idx * destinations_.size() + dst_idx];
}
values.push_back(-dt);
// add constraints
SCIP_VAR *scip_vars[vars.size()];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size()];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
std::stringstream ss;
ss << "cons_4_" << dst_idx << "_" << n << "_" << l;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_4[cnt], // constraint
ss.str().c_str(), // name
vars.size(), // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
-dt, // LHS of the constraint
infinity)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_4[cnt]));
++cnt;
cons_4.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars2;
std::vector<SCIP_Real> values2;
vars2.push_back(x[dst_idx][n][l]);
values2.push_back(1);
vars2.push_back(y[dst_idx][n][l]);
values2.push_back(dt);
// add constraints
SCIP_VAR *scip_vars2[vars.size()];
for (int v = 0; v < vars2.size(); ++v) scip_vars2[v] = vars2[v];
SCIP_Real scip_values2[values2.size()];
for (int v = 0; v < values2.size(); ++v) scip_values2[v] = values2[v];
std::stringstream ss2;
ss2 << "cons_4_" << dst_idx << "_" << n << "_" << l;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_4[cnt], // constraint
ss2.str().c_str(), // name
vars2.size(), // how many variables
scip_vars2, // array of pointers to various variables
scip_values2, // array of values of the coefficients of corresponding variables
-infinity, // LHS of the constraint
dt)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_4[cnt]));
++cnt;
}
}
}
return SCIP_OKAY;
}
// add constraints for forcing the number of group weight choice to be 1
SCIP_RETCODE PathBasedILPSolver::PathILPCreateConstraints5(
SCIP *scip,
std::vector<SCIP_CONS *> &cons_5,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &y,
std::vector<std::vector<SCIP_VAR *>> &b) {
int cnt = 0;
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
for (int sw=0; sw<switches_.size(); ++sw) {
if ((switches_[sw].switch_type == SwitchType::src) ||
(switches_[sw].switch_type == SwitchType::dst)) continue;
for (int l : per_switch_links_[sw]) {
if ((links_[l].link_type == LinkType::src) ||
(links_[l].link_type == LinkType::dst)) continue;
if (links_[l].dst_sw_gid == sw) continue;
if (links_[l].link_type != LinkType::dcn) continue;
cons_5.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
for (int n=0; n<=maxGroupSize; ++n) {
vars.push_back(y[dst_idx][n][l]);
values.push_back(1);
}
std::cout << "mid" << std::endl;
vars.push_back(b[dst_idx][sw]);
values.push_back(-1);
// add constraints
SCIP_VAR *scip_vars[vars.size()];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size()];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
std::stringstream ss;
ss << "cons_5_" << dst_idx << "_" << l;
std::cout << "set" << std::endl;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_5[cnt], // constraint
ss.str().c_str(), // name
vars.size(), // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
0, // LHS of the constraint
0)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_5[cnt]));
++cnt;
std::cout << "end" << std::endl;
}
}
}
return SCIP_OKAY;
}
// add constraints for determining the traffic to go through node i or not
SCIP_RETCODE PathBasedILPSolver::PathILPCreateConstraints6(
SCIP *scip,
std::vector<SCIP_CONS *> &cons_6,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &f,
std::vector<std::vector<SCIP_VAR *>> &b) {
int cnt = 0;
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
for (int sw=0; sw<switches_.size(); ++sw) {
if ((switches_[sw].switch_type == SwitchType::src) ||
(switches_[sw].switch_type == SwitchType::dst)) continue;
cons_6.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
std::cout << sw << " " << dst_idx << std::endl;
for (int l : per_switch_links_[sw]) {
if (links_[l].dst_sw_gid == sw) {
std::cout << l << " ";
for (int src_idx = 0; src_idx < sources_.size(); ++src_idx) {
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(-traffic_matrix_[src_idx * destinations_.size() + dst_idx]);
}
}
}
vars.push_back(b[dst_idx][sw]);
values.push_back(0.0);
for (int src_idx = 0; src_idx < sources_.size(); ++src_idx) {
values[values.size()-1] += traffic_matrix_[src_idx * destinations_.size() + dst_idx];
}
// add constraints
for (int k =0; k<vars.size(); ++k) std::cout << values[k] << std::endl;
SCIP_VAR *scip_vars[vars.size()];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size()];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
std::stringstream ss;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_6[cnt], // constraint
ss.str().c_str(), // name
vars.size(), // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
0, // LHS of the constraint
infinity)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_6[cnt]));
++cnt;
}
}
return SCIP_OKAY;
}
// set the constraint: link utilization < u
SCIP_RETCODE PathBasedILPSolver::PathILPCreateConstraints9(
SCIP *scip,
std::vector<SCIP_CONS *> &cons_9,
SCIP_VAR *&u,
std::vector<std::vector<std::vector<SCIP_VAR *>>> &f) {
int cnt = 0;
// iterate all the links
for (int l=0; l<links_.size(); ++l) {
if ((links_[l].link_type == LinkType::src) ||
(links_[l].link_type == LinkType::dst)) continue;
cons_9.emplace_back((SCIP_CONS *) nullptr); // add constraint
std::vector<SCIP_VAR *> vars;
std::vector<SCIP_Real> values;
// iterate all the source and destination
for (int src_idx=0; src_idx < sources_.size(); ++src_idx) {
for (int dst_idx=0; dst_idx < destinations_.size(); ++dst_idx) {
std::cout << src_idx << " " << dst_idx << " " << l << std::endl;
vars.push_back(f[src_idx][dst_idx][l]);
values.push_back(-traffic_matrix_[src_idx * destinations_.size() + dst_idx]);
}
}
SCIP_VAR *scip_vars[vars.size() + 1];
for (int v = 0; v < vars.size(); ++v) scip_vars[v] = vars[v];
SCIP_Real scip_values[values.size() + 1];
for (int v = 0; v < values.size(); ++v) scip_values[v] = values[v];
// add u
scip_vars[vars.size()] = u;
scip_values[vars.size()] = links_[l].capacity;
std::stringstream ss;
ss << "cons_9_" << links_[l].gid;
SCIP_CALL(SCIPcreateConsBasicLinear(scip,
&cons_9[cnt], // constraint
ss.str().c_str(), // name
vars.size()+1, // how many variables
scip_vars, // array of pointers to various variables
scip_values, // array of values of the coefficients of corresponding variables
0, // LHS of the constraint
infinity)); // RHS of the constraint
SCIP_CALL(SCIPaddCons(scip, cons_9[cnt]));
++cnt;
}
return SCIP_OKAY;
}
// find the best routing policy
SCIP_RETCODE PathBasedILPSolver::FindBestRouting() {
SCIP *scip = nullptr;
SCIP_CALL(SCIPcreate(&scip)); // create the SCIP environment
SCIP_CALL(SCIPincludeDefaultPlugins(scip)); // include default plugins
SCIP_CALL(SCIPcreateProbBasic(scip, "MLU_ILP_DCN")); // create the SCIP problem
SCIP_CALL(SCIPsetObjsense(scip,
SCIP_OBJSENSE_MINIMIZE)); // set object sense to be minimize
std::cout << "SCIP setup successfully" << std::endl;
SCIP_RETCODE ret;
SCIP_VAR *u; // MLU
ret = PathILPCreateVariableGoal(scip, u);
if (ret != SCIP_OKAY) LOG(ERROR) << "The variable u is wrong.";
else std::cout << "Variable u created." << std::endl;
std::vector<std::vector<std::vector<SCIP_VAR *>>> f; // initialize the variables
ret = PathILPCreateVariableF(scip, f);
if (ret != SCIP_OKAY) LOG(ERROR) << "The variable f is wrong.";
else std::cout << "Variable f created." << std::endl;
std::vector<std::vector<std::vector<SCIP_VAR *>>> x; // initialize the variables
ret = PathILPCreateVariableX(scip, x);
if (ret != SCIP_OKAY) LOG(ERROR) << "The variable x is wrong.";
else std::cout << "Variable x created." << std::endl;
std::vector<std::vector<std::vector<SCIP_VAR *>>> y; // initialize the variables
ret = PathILPCreateVariableY(scip, y);
if (ret != SCIP_OKAY) LOG(ERROR) << "The variable y is wrong.";
else std::cout << "Variable y created." << std::endl;
std::vector<std::vector<SCIP_VAR *>> b; // initialize the variables
ret = PathILPCreateVariableB(scip, b);
if (ret != SCIP_OKAY) LOG(ERROR) << "The variable b is wrong.";
else std::cout << "Variable b created." << std::endl;
std::vector<SCIP_CONS *> cons_1;
ret = PathILPCreateConstraints1(scip, cons_1, f);
if (ret != SCIP_OKAY) LOG(ERROR) << "The equal constraints is wrong.";
else std::cout << "Constraints 1 created." << std::endl;
std::vector<SCIP_CONS *> cons_2;
ret = PathILPCreateConstraints2(scip, cons_2, f);
if (ret != SCIP_OKAY) LOG(ERROR) << "The link constraints is wrong.";
else std::cout << "Constraints 2 created" << std::endl;
std::vector<SCIP_CONS *> cons_3;
ret = PathILPCreateConstraints3(scip, cons_3, f, x);
if (ret != SCIP_OKAY) LOG(ERROR) << "The link constraints is wrong.";
else std::cout << "Constraints 3 created" << std::endl;
std::vector<SCIP_CONS *> cons_4;
ret = PathILPCreateConstraints4(scip, cons_4, x, y);
if (ret != SCIP_OKAY) LOG(ERROR) << "The link constraints is wrong.";
else std::cout << "Constraints 4 created" << std::endl;
std::vector<SCIP_CONS *> cons_5;
ret = PathILPCreateConstraints5(scip, cons_5, y, b);
if (ret != SCIP_OKAY) LOG(ERROR) << "The link constraints is wrong.";
else std::cout << "Constraints 5 created" << std::endl;
std::vector<SCIP_CONS *> cons_6;
ret = PathILPCreateConstraints6(scip, cons_6, f, b);
if (ret != SCIP_OKAY) LOG(ERROR) << "The link constraints is wrong.";
else std::cout << "Constraints 6 created" << std::endl;
std::vector<SCIP_CONS *> cons_9;
ret = PathILPCreateConstraints9(scip, cons_9, u, f);
if (ret != SCIP_OKAY) LOG(ERROR) << "The link constraints is wrong.";
else std::cout << "Constraints 9 created" << std::endl;
SCIP_CALL((SCIPwriteOrigProblem(scip, "MLU_before.lp", nullptr, FALSE)));
// Release the constraints
for (SCIP_CONS *con : cons_1) {
SCIP_CALL(SCIPreleaseCons(scip, &con));
}
for (SCIP_CONS *con : cons_2) {
SCIP_CALL(SCIPreleaseCons(scip, &con));
}
for (SCIP_CONS *con : cons_3) {
SCIP_CALL(SCIPreleaseCons(scip, &con));
}
for (SCIP_CONS *con : cons_4) {
SCIP_CALL(SCIPreleaseCons(scip, &con));
}
for (SCIP_CONS *con : cons_5) {
SCIP_CALL(SCIPreleaseCons(scip, &con));
}
for (SCIP_CONS *con : cons_9) {
SCIP_CALL(SCIPreleaseCons(scip, &con));
}
std::cout << "Constraints released" << std::endl;
auto begin = std::chrono::high_resolution_clock::now();
// Solve the problem
SCIP_CALL(SCIPsolve(scip));
auto end = std::chrono::high_resolution_clock::now();
std::cout << "Solved in "
<< std::chrono::duration_cast<std::chrono::nanoseconds>(
end - begin).count() << "ns" << std::endl;
// record the model
SCIP_CALL((SCIPwriteOrigProblem(scip, "MLU.lp", nullptr, FALSE)));
// Get the solutions
SCIP_SOL *sol = nullptr;
sol = SCIPgetBestSol(scip);
res_f_ = std::vector<std::vector<std::vector<double>>>(sources_.size(),
std::vector<std::vector<double>>(destinations_.size()));
res_u_ = SCIPgetSolVal(scip, sol, u);
std::cout << "problem result: " << res_u_ << std::endl;
for (int src_idx = 0; src_idx < sources_.size(); ++src_idx) {
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
if (src_idx == dst_idx) continue;
std::cout << src_idx << "->" << dst_idx << ": ";
for (int l = 0; l < links_.size(); ++l) {
res_f_[src_idx][dst_idx].push_back(
SCIPgetSolVal(scip, sol, x[src_idx][dst_idx][l]));
std::cout << res_f_[src_idx][dst_idx][l] << ", ";
}
std::cout << std::endl;
}
}
for (int src_idx = 0; src_idx < sources_.size(); ++src_idx) {
for (int dst_idx = 0; dst_idx < destinations_.size(); ++dst_idx) {
for (SCIP_VAR *v : x[src_idx][dst_idx])
SCIP_CALL(SCIPreleaseVar(scip, &v));
}
}
SCIP_CALL(SCIPreleaseVar(scip, &u));
SCIP_CALL(SCIPfree(&scip));
return SCIP_OKAY;
}
//void FullTopology::PathILPResultAnalysis() {
// // traffic amount of each link
// std::vector<double> links_load = std::vector<double>(links_.size());
// std::cout << "The path with 0 traffic is not printed. " << std::endl;
// for (int src_sb = 0; src_sb < numSbPerDcn; ++src_sb)
// for (int dst_sb = 0; dst_sb < numSbPerDcn; ++dst_sb)
// if (src_sb != dst_sb) {
// for (int p : per_sb_pair_paths_[src_sb][dst_sb]) {
// // print the traffic amount for each link
// double traffic_amount =
// traffic_matrix_[src_sb * numSbPerDcn + dst_sb] *
// scip_result_[src_sb][dst_sb][paths_[p].per_pair_id];
// if (traffic_amount > 0) {
// std::cout << traffic_amount << " Gbps of demand from u"
// << src_sb << " -> u" << dst_sb
// << " is placed on DCN link "
// << links_[paths_[p].link_gid_list.front()].gid
// << std::endl;
// }
// // add the traffic to the links' load
// if (paths_[p].link_gid_list.size() == 1) {
// int first_hop = links_[paths_[p].link_gid_list.front()].gid;
// links_load[first_hop] += traffic_amount;
// }
// else if (paths_[p].link_gid_list.size() == 2) {
// int first_hop = links_[paths_[p].link_gid_list.front()].gid;
// int second_hop = links_[paths_[p].link_gid_list.back()].gid;
// links_load[first_hop] += traffic_amount;
// links_load[second_hop] += traffic_amount;
// }
// }
// }
// // print the link utilization
// for (int l=0; l < links_.size(); ++l) {
// std::cout << "Link " << l << ": "
// << links_load[l]/links_[l].capacity
// << std::endl;
// }
// // print the WCMP group weight at source s3 -> destination SB level
// std::unordered_map<int, std::vector<std::pair<int, double>>> assignment;
// std::unordered_map<int, std::vector<std::pair<int, double>>>::iterator it;
// for (int src_sb = 0; src_sb < numSbPerDcn; ++src_sb)
// for (int dst_sb = 0; dst_sb < numSbPerDcn; ++dst_sb)
// if (src_sb != dst_sb) {
// for (int p : per_sb_pair_paths_[src_sb][dst_sb]) {
// int src_sw = paths_[p].src_sw_gid;
// int key = src_sw*numSbPerDcn + dst_sb;
// int link_gid = paths_[p].link_gid_list.front();
// double traffic_amount =
// traffic_matrix_[src_sb * numSbPerDcn + dst_sb] *
// scip_result_[src_sb][dst_sb][paths_[p].per_pair_id];
// // add the traffic amount to the group
// it = assignment.find(key);
// if (it == assignment.end()) { // new key
// std::vector<std::pair<int, double>> new_vec;
// new_vec.emplace_back(std::make_pair(link_gid, traffic_amount));
// assignment[key] = new_vec;
// }
// else { // existing key
// assignment[key].emplace_back(std::make_pair(link_gid, traffic_amount));
// }
// }
// }
//
// // print the WCMP group that serves the original traffic from its own
// for (it=assignment.begin(); it!=assignment.end(); ++it) {
// // set group vector
// std::unordered_map<int, double> weights;
// int src_sw = it->first / numSbPerDcn;
// int dst_sb = it->first % numSbPerDcn;
//
// double sum_weight = 0;
// std::unordered_map<int, double>::iterator iter;
// for (std::pair<int, double> p : it->second) {
// int link = p.first;
// iter = weights.find(link);
// if (iter == weights.end()) {
// weights[link] = p.second;
// sum_weight += p.second;
// }
// else {
// weights[link] += p.second;
// sum_weight += p.second;
// }
// }
// if (sum_weight <= 0) continue;
// std::cout << "Group Assignment for Switch " << src_sw << " -> "
// << "SuperBlock " << dst_sb << " " << std::endl;
// for (iter=weights.begin(); iter!=weights.end(); ++iter) {
// std::cout << "link " << iter->first << ": " << iter->second/sum_weight*127 << std::endl;
// }
// }
//}
} // namespace solver
} // namespace wcmp | [
"wtwang@rice.edu"
] | wtwang@rice.edu |
23fb0f652f4784d8f207ecf128aaeff41bb161b4 | a901f40e80834d715377e30e97249e7105d26487 | /src/listing_9.7.h | d7d2f8bab3f2738cdbe224aa23134f57988dd5a6 | [] | no_license | pvthuyet/CppInAction | 0205c1bf473bd925255c96990f5c53b02377b6f8 | 5df707bafa1169a7eaac61ad9c51fc59d0ff7a26 | refs/heads/master | 2020-06-24T21:30:39.142400 | 2019-09-20T04:28:17 | 2019-09-20T04:28:17 | 199,095,612 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,205 | h | /*
* listing_9.7.h
*
* Created on: Aug 12, 2019
* Author: thuye
*/
#ifndef LISTING_9_7_H_
#define LISTING_9_7_H_
#include "include.h"
#include "functionwrapper.h"
namespace LISTING_9_7 {
class work_stealing_queue {
private:
using data_type = tet::function_wrapper;
std::deque<data_type> the_queue;
mutable std::mutex the_mutex;
public:
work_stealing_queue() {}
work_stealing_queue(const work_stealing_queue&) = delete;
work_stealing_queue& operator=(work_stealing_queue const&) = delete;
void push(data_type data) {
std::lock_guard<std::mutex> lk(the_mutex);
the_queue.push_front(std::move(data));
}
bool empty() {
std::lock_guard<std::mutex> lk(the_mutex);
return the_queue.empty();
}
bool try_pop(data_type& res) {
std::lock_guard<std::mutex> lk(the_mutex);
if (the_queue.empty()) {
return false;
}
res = std::move(the_queue.front());
the_queue.pop_front();
return true;
}
bool try_steal(data_type& res) {
std::lock_guard<std::mutex> lk(the_mutex);
if (the_queue.empty()) {
return false;
}
res = std::move(the_queue.back());
the_queue.pop_back();
return true;
}
};
}
#endif /* LISTING_9_7_H_ */
| [
"tvp@wherzat.com"
] | tvp@wherzat.com |
f6bf22dbfaaedd3eac15774fea31640388b313d3 | aa39bd8f40a492c56ff7b4dd6514c81e2440f30f | /QuadrantSelection.cc | 716f4f339a0fa2d43a77d2c1fb64e27d020feebf | [] | no_license | duntonjoe/MyKattisSolutions | dd53d1c85c82db3a82e5c2be328426e0ef02cfa5 | 9c01c9fc7f3ed436ee64fc034d68fb7080d664f5 | refs/heads/master | 2020-03-16T16:59:27.610854 | 2018-09-17T15:06:15 | 2018-09-17T15:06:15 | 132,813,178 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 774 | cc | /*
Filename : QuadrantSelection.cc
Author : Joseph Dunton
Problem : Quadrant Selection
Description : Return the quadrant a given order pair would be within.
*/
/************************************************************/
// System includes
#include <iostream>
#include <string>
/************************************************************/
// Using Declartions
using std::cout;
using std::cin;
using std::endl;
/************************************************************/
int
main (int argc, char* argv[])
{
int x;
int y;
int q;
cin >> x;
cin >> y;
if (x > 0 && y > 0)
q = 1;
else if (x < 0 && y > 0)
q = 2;
else if (x < 0 && y < 0)
q = 3;
else if (x > 0 && y < 0)
q = 4;
cout << q << endl;
}
| [
"duntonjoe@gmail.com"
] | duntonjoe@gmail.com |
b55fc9b5582f818476150051b3e36ff727b39730 | 7ccdcc27e50526d568dfe2918aabfb172ef41b62 | /LRU_Cache.cpp | 6ce3f3bb7307a7b50e61568320fa58982e204295 | [] | no_license | albin3/leetcode | 71c30df4a7a778b2ce10619a244b7bc2a5122f33 | c458f80ec4a493f3b104883f6fa54321386f58a9 | refs/heads/master | 2021-01-22T15:22:32.827552 | 2015-08-12T10:08:59 | 2015-08-12T10:08:59 | 26,163,258 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,158 | cpp | #include <iostream>
#include <map>
#include <vector>
using namespace std;
class LRUCache{
public:
map<int, int> m;
map<int, int> mk_t;
map<int, int> mt_k;
int l;
int t;
LRUCache(int capacity):l(capacity),t(0) {
}
int get(int key) {
if (mk_t.find(key)!=mk_t.end()) {
mt_k.erase(mk_t[key]);
mk_t[key] = ++t;
mt_k[t] = key;
return m[key];
} else {
return -1;
}
}
void set(int key, int value) {
m[key] = value;
if (mk_t.find(key)!=mk_t.end()) {
mt_k.erase(mk_t[key]);
mk_t[key] = ++t;
mt_k[t] = key;
return ;
} else if(mk_t.size()==l) {
pair<int,int> p = (pair<int, int>)(*mt_k.begin());
mt_k.erase(p.first);
mk_t.erase(p.second);
mk_t[key] = ++t;
mt_k[t] = key;
return ;
} else {
mk_t[key] = ++t;
mt_k[t] = key;
return ;
}
}
};
int main() {
LRUCache * l = new LRUCache(2);
l->set(2,2);
l->set(2,2);
l->set(3,3);
l->set(4,4);
cout<<l->get(3)<<endl;
cout<<l->get(2)<<endl;
cout<<l->get(4)<<endl;
}
| [
"binwei.zeng3@gmail.com"
] | binwei.zeng3@gmail.com |
33e549593e35b4253954a666faddd6c4d8af3c47 | e35ffbca64ad6f64c070a4a730c90690e45d944d | /QtSQLITE0/QtSQL0/classes/cindexdataset.h | 58e88a3049e98cc297dd9dbb4891475663c8ec67 | [] | no_license | sas26031962/QtProjects | ca651f47f903a94e00b99f88889a021e295333fc | c3b2f97a4373a91bff6395c849d980c7c3d0fd6f | refs/heads/master | 2020-08-29T10:05:41.985390 | 2019-10-28T09:11:49 | 2019-10-28T09:11:49 | 218,001,538 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 867 | h | #ifndef CINDEXDATASET_H
#define CINDEXDATASET_H
#include <QString>
class cIndexDataSet
{
public:
//=========================================================================
// Конструктор
//=========================================================================
cIndexDataSet();
//=========================================================================
// Атрибуты
//=========================================================================
int Index;
int Object;
int Subject;
int Relation;
QString Date;
QString Memo;
//=========================================================================
// Методы
//=========================================================================
};//End of class cIndexDataSet
#endif // CINDEXDATASET_H
| [
"sasx26031962@gmail.com"
] | sasx26031962@gmail.com |
e53df9b5a33380de8c3e4a9ae1210cf5c433c701 | 78ccc1571c92b82875c3b68ecee39f757894f328 | /src/checkpoints.cpp | 9dc486ed09ac0e989767b83bfa090204d17f1437 | [
"MIT"
] | permissive | quorumdev/ktest | d1dfb0b39f1c11e6b57fe5fd2c774e1ec9527bbe | 02196d098237ebe53b5ae39c99093f77b3bf655e | refs/heads/master | 2020-03-12T04:38:03.542880 | 2018-04-21T08:24:56 | 2018-04-21T08:24:56 | 130,448,880 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,097 | cpp | // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2017 The Dash Core developers
// Copyright (c) 2017-2018 The Nyx Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "checkpoints.h"
#include "chain.h"
#include "chainparams.h"
#include "validation.h"
#include "uint256.h"
#include <stdint.h>
#include <boost/foreach.hpp>
namespace Checkpoints {
/**
* How many times slower we expect checking transactions after the last
* checkpoint to be (from checking signatures, which is skipped up to the
* last checkpoint). This number is a compromise, as it can't be accurate
* for every system. When reindexing from a fast disk with a slow CPU, it
* can be up to 20, while when downloading from a slow network with a
* fast multicore CPU, it won't be much higher than 1.
*/
static const double SIGCHECK_VERIFICATION_FACTOR = 5.0;
//! Guess how far we are in the verification process at the given block index
double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex *pindex, bool fSigchecks) {
if (pindex==NULL)
return 0.0;
int64_t nNow = time(NULL);
double fSigcheckVerificationFactor = fSigchecks ? SIGCHECK_VERIFICATION_FACTOR : 1.0;
double fWorkBefore = 0.0; // Amount of work done before pindex
double fWorkAfter = 0.0; // Amount of work left after pindex (estimated)
// Work is defined as: 1.0 per transaction before the last checkpoint, and
// fSigcheckVerificationFactor per transaction after.
if (pindex->nChainTx <= data.nTransactionsLastCheckpoint) {
double nCheapBefore = pindex->nChainTx;
double nCheapAfter = data.nTransactionsLastCheckpoint - pindex->nChainTx;
double nExpensiveAfter = (nNow - data.nTimeLastCheckpoint)/86400.0*data.fTransactionsPerDay;
fWorkBefore = nCheapBefore;
fWorkAfter = nCheapAfter + nExpensiveAfter*fSigcheckVerificationFactor;
} else {
double nCheapBefore = data.nTransactionsLastCheckpoint;
double nExpensiveBefore = pindex->nChainTx - data.nTransactionsLastCheckpoint;
double nExpensiveAfter = (nNow - pindex->GetBlockTime())/86400.0*data.fTransactionsPerDay;
fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor;
fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor;
}
return fWorkBefore / (fWorkBefore + fWorkAfter);
}
CBlockIndex* GetLastCheckpoint(const CCheckpointData& data)
{
const MapCheckpoints& checkpoints = data.mapCheckpoints;
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints)
{
const uint256& hash = i.second;
BlockMap::const_iterator t = mapBlockIndex.find(hash);
if (t != mapBlockIndex.end())
return t->second;
}
return NULL;
}
} // namespace Checkpoints
| [
"root@vultr.guest"
] | root@vultr.guest |
27e74bea5c604cf6d3e714ae6f528b56964e0b72 | 5499e8b91353ef910d2514c8a57a80565ba6f05b | /third_party/rust_crates/vendor/harfbuzz-sys/harfbuzz/src/hb-buffer-serialize.cc | 6e265e84c6c492d781e0e7e1fe1a87a03b0d9b4b | [
"BSD-3-Clause",
"LicenseRef-scancode-other-permissive",
"MIT-Modern-Variant",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"MIT"
] | permissive | winksaville/fuchsia | 410f451b8dfc671f6372cb3de6ff0165a2ef30ec | a0ec86f1d51ae8d2538ff3404dad46eb302f9b4f | refs/heads/master | 2022-11-01T11:57:38.343655 | 2019-11-01T17:06:19 | 2019-11-01T17:06:19 | 223,695,500 | 3 | 2 | BSD-3-Clause | 2022-10-13T13:47:02 | 2019-11-24T05:08:59 | C++ | UTF-8 | C++ | false | false | 13,817 | cc | /*
* Copyright © 2012,2013 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Google Author(s): Behdad Esfahbod
*/
#include "hb-buffer.hh"
static const char *serialize_formats[] = {
"text",
"json",
nullptr
};
/**
* hb_buffer_serialize_list_formats:
*
* Returns a list of supported buffer serialization formats.
*
* Return value: (transfer none):
* A string array of buffer serialization formats. Should not be freed.
*
* Since: 0.9.7
**/
const char **
hb_buffer_serialize_list_formats ()
{
return serialize_formats;
}
/**
* hb_buffer_serialize_format_from_string:
* @str: (array length=len) (element-type uint8_t): a string to parse
* @len: length of @str, or -1 if string is %NULL terminated
*
* Parses a string into an #hb_buffer_serialize_format_t. Does not check if
* @str is a valid buffer serialization format, use
* hb_buffer_serialize_list_formats() to get the list of supported formats.
*
* Return value:
* The parsed #hb_buffer_serialize_format_t.
*
* Since: 0.9.7
**/
hb_buffer_serialize_format_t
hb_buffer_serialize_format_from_string (const char *str, int len)
{
/* Upper-case it. */
return (hb_buffer_serialize_format_t) (hb_tag_from_string (str, len) & ~0x20202020u);
}
/**
* hb_buffer_serialize_format_to_string:
* @format: an #hb_buffer_serialize_format_t to convert.
*
* Converts @format to the string corresponding it, or %NULL if it is not a valid
* #hb_buffer_serialize_format_t.
*
* Return value: (transfer none):
* A %NULL terminated string corresponding to @format. Should not be freed.
*
* Since: 0.9.7
**/
const char *
hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format)
{
switch (format)
{
case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0];
case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1];
default:
case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return nullptr;
}
}
static unsigned int
_hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
unsigned int start,
unsigned int end,
char *buf,
unsigned int buf_size,
unsigned int *buf_consumed,
hb_font_t *font,
hb_buffer_serialize_flags_t flags)
{
hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr);
hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
nullptr : hb_buffer_get_glyph_positions (buffer, nullptr);
*buf_consumed = 0;
hb_position_t x = 0, y = 0;
for (unsigned int i = start; i < end; i++)
{
char b[1024];
char *p = b;
/* In the following code, we know b is large enough that no overflow can happen. */
#define APPEND(s) HB_STMT_START { strcpy (p, s); p += strlen (s); } HB_STMT_END
if (i)
*p++ = ',';
*p++ = '{';
APPEND ("\"g\":");
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES))
{
char g[128];
hb_font_glyph_to_string (font, info[i].codepoint, g, sizeof (g));
*p++ = '"';
for (char *q = g; *q; q++) {
if (*q == '"')
*p++ = '\\';
*p++ = *q;
}
*p++ = '"';
}
else
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint));
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) {
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"cl\":%u", info[i].cluster));
}
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS))
{
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"dx\":%d,\"dy\":%d",
x+pos[i].x_offset, y+pos[i].y_offset));
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES))
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"ax\":%d,\"ay\":%d",
pos[i].x_advance, pos[i].y_advance));
}
if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS)
{
if (info[i].mask & HB_GLYPH_FLAG_DEFINED)
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"fl\":%u", info[i].mask & HB_GLYPH_FLAG_DEFINED));
}
if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
{
hb_glyph_extents_t extents;
hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"xb\":%d,\"yb\":%d",
extents.x_bearing, extents.y_bearing));
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"w\":%d,\"h\":%d",
extents.width, extents.height));
}
*p++ = '}';
unsigned int l = p - b;
if (buf_size > l)
{
memcpy (buf, b, l);
buf += l;
buf_size -= l;
*buf_consumed += l;
*buf = '\0';
} else
return i - start;
if (pos && (flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES))
{
x += pos[i].x_advance;
y += pos[i].y_advance;
}
}
return end - start;
}
static unsigned int
_hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
unsigned int start,
unsigned int end,
char *buf,
unsigned int buf_size,
unsigned int *buf_consumed,
hb_font_t *font,
hb_buffer_serialize_flags_t flags)
{
hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr);
hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
nullptr : hb_buffer_get_glyph_positions (buffer, nullptr);
*buf_consumed = 0;
hb_position_t x = 0, y = 0;
for (unsigned int i = start; i < end; i++)
{
char b[1024];
char *p = b;
/* In the following code, we know b is large enough that no overflow can happen. */
if (i)
*p++ = '|';
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES))
{
hb_font_glyph_to_string (font, info[i].codepoint, p, 128);
p += strlen (p);
}
else
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint));
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) {
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].cluster));
}
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS))
{
if (x+pos[i].x_offset || y+pos[i].y_offset)
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", x+pos[i].x_offset, y+pos[i].y_offset));
if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES))
{
*p++ = '+';
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advance));
if (pos[i].y_advance)
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance));
}
}
if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS)
{
if (info[i].mask & HB_GLYPH_FLAG_DEFINED)
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "#%X", info[i].mask &HB_GLYPH_FLAG_DEFINED));
}
if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
{
hb_glyph_extents_t extents;
hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "<%d,%d,%d,%d>", extents.x_bearing, extents.y_bearing, extents.width, extents.height));
}
unsigned int l = p - b;
if (buf_size > l)
{
memcpy (buf, b, l);
buf += l;
buf_size -= l;
*buf_consumed += l;
*buf = '\0';
} else
return i - start;
if (pos && (flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES))
{
x += pos[i].x_advance;
y += pos[i].y_advance;
}
}
return end - start;
}
/**
* hb_buffer_serialize_glyphs:
* @buffer: an #hb_buffer_t buffer.
* @start: the first item in @buffer to serialize.
* @end: the last item in @buffer to serialize.
* @buf: (out) (array length=buf_size) (element-type uint8_t): output string to
* write serialized buffer into.
* @buf_size: the size of @buf.
* @buf_consumed: (out) (allow-none): if not %NULL, will be set to the number of byes written into @buf.
* @font: (allow-none): the #hb_font_t used to shape this buffer, needed to
* read glyph names and extents. If %NULL, and empty font will be used.
* @format: the #hb_buffer_serialize_format_t to use for formatting the output.
* @flags: the #hb_buffer_serialize_flags_t that control what glyph properties
* to serialize.
*
* Serializes @buffer into a textual representation of its glyph content,
* useful for showing the contents of the buffer, for example during debugging.
* There are currently two supported serialization formats:
*
* ## text
* A human-readable, plain text format.
* The serialized glyphs will look something like:
*
* ```
* [uni0651=0@518,0+0|uni0628=0+1897]
* ```
* - The serialized glyphs are delimited with `[` and `]`.
* - Glyphs are separated with `|`
* - Each glyph starts with glyph name, or glyph index if
* #HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set. Then,
* - If #HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set, `=` then #hb_glyph_info_t.cluster.
* - If #HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set, the #hb_glyph_position_t in the format:
* - If both #hb_glyph_position_t.x_offset and #hb_glyph_position_t.y_offset are not 0, `@x_offset,y_offset`. Then,
* - `+x_advance`, then `,y_advance` if #hb_glyph_position_t.y_advance is not 0. Then,
* - If #HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set, the
* #hb_glyph_extents_t in the format
* `<x_bearing,y_bearing,width,height>`
*
* ## json
* TODO.
*
* Return value:
* The number of serialized items.
*
* Since: 0.9.7
**/
unsigned int
hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
unsigned int start,
unsigned int end,
char *buf,
unsigned int buf_size,
unsigned int *buf_consumed,
hb_font_t *font,
hb_buffer_serialize_format_t format,
hb_buffer_serialize_flags_t flags)
{
assert (start <= end && end <= buffer->len);
unsigned int sconsumed;
if (!buf_consumed)
buf_consumed = &sconsumed;
*buf_consumed = 0;
if (buf_size)
*buf = '\0';
assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) ||
buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);
if (!buffer->have_positions)
flags |= HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS;
if (unlikely (start == end))
return 0;
if (!font)
font = hb_font_get_empty ();
switch (format)
{
case HB_BUFFER_SERIALIZE_FORMAT_TEXT:
return _hb_buffer_serialize_glyphs_text (buffer, start, end,
buf, buf_size, buf_consumed,
font, flags);
case HB_BUFFER_SERIALIZE_FORMAT_JSON:
return _hb_buffer_serialize_glyphs_json (buffer, start, end,
buf, buf_size, buf_consumed,
font, flags);
default:
case HB_BUFFER_SERIALIZE_FORMAT_INVALID:
return 0;
}
}
static hb_bool_t
parse_uint (const char *pp, const char *end, uint32_t *pv)
{
char buf[32];
unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - pp));
strncpy (buf, pp, len);
buf[len] = '\0';
char *p = buf;
char *pend = p;
uint32_t v;
errno = 0;
v = strtol (p, &pend, 10);
if (errno || p == pend || pend - p != end - pp)
return false;
*pv = v;
return true;
}
static hb_bool_t
parse_int (const char *pp, const char *end, int32_t *pv)
{
char buf[32];
unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - pp));
strncpy (buf, pp, len);
buf[len] = '\0';
char *p = buf;
char *pend = p;
int32_t v;
errno = 0;
v = strtol (p, &pend, 10);
if (errno || p == pend || pend - p != end - pp)
return false;
*pv = v;
return true;
}
#include "hb-buffer-deserialize-json.hh"
#include "hb-buffer-deserialize-text.hh"
/**
* hb_buffer_deserialize_glyphs:
* @buffer: an #hb_buffer_t buffer.
* @buf: (array length=buf_len):
* @buf_len:
* @end_ptr: (out):
* @font:
* @format:
*
*
*
* Return value:
*
* Since: 0.9.7
**/
hb_bool_t
hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
const char *buf,
int buf_len, /* -1 means nul-terminated */
const char **end_ptr, /* May be NULL */
hb_font_t *font, /* May be NULL */
hb_buffer_serialize_format_t format)
{
const char *end;
if (!end_ptr)
end_ptr = &end;
*end_ptr = buf;
assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) ||
buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);
if (buf_len == -1)
buf_len = strlen (buf);
if (!buf_len)
{
*end_ptr = buf;
return false;
}
hb_buffer_set_content_type (buffer, HB_BUFFER_CONTENT_TYPE_GLYPHS);
if (!font)
font = hb_font_get_empty ();
switch (format)
{
case HB_BUFFER_SERIALIZE_FORMAT_TEXT:
return _hb_buffer_deserialize_glyphs_text (buffer,
buf, buf_len, end_ptr,
font);
case HB_BUFFER_SERIALIZE_FORMAT_JSON:
return _hb_buffer_deserialize_glyphs_json (buffer,
buf, buf_len, end_ptr,
font);
default:
case HB_BUFFER_SERIALIZE_FORMAT_INVALID:
return false;
}
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
d2072809f46d35bf00e0eda9146c6e12e67cacda | 33ecdeeaf983c969f2f006570e914b6be4f0ae04 | /Plugins/HFDataDriven/Source/HFDataDriven/Public/HFCommon/HFDefine.h | a442f9fa3f530062198490e2adcc5e50827314ea | [] | no_license | PoorMonk/Mmo01Project | f3e375d7b1ea7dd86ce74119c7dd6e7b5e9bd1ca | 3f9f8001b088e6309ca2fdfbda6faaeb9efc810c | refs/heads/main | 2023-01-18T21:48:21.715812 | 2020-11-26T14:01:06 | 2020-11-26T14:01:06 | 315,823,512 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 81,209 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "HFTypes.h"
#include "HFDefine.generated.h"
/**
*
*/
UCLASS()
class HFDATADRIVEN_API UHFDefine : public UObject
{
GENERATED_BODY()
};
#define HFMODFUNC(FuncName); \
struct FuncName##Param : public HFParam \
{\
FuncName##Param() { ParamPtr = nullptr; }\
};\
void FuncName(int32 ModuIndex, FName FunctionName)\
{\
HFModuleAgreement Agreement;\
Agreement.ModuleIndex = ModuIndex;\
Agreement.FunctionName = FunctionName;\
FuncName##Param* Param = new FuncName##Param();\
ExecuteFunction(Agreement, Param);\
delete Param;\
}\
FuncName##Param* FuncName##Rt(int32 ModuIndex, FName FunctionName)\
{\
HFModuleAgreement Agreement;\
Agreement.ModuleIndex = ModuIndex;\
Agreement.FunctionName = FunctionName;\
FuncName##Param* Param = new FuncName##Param();\
ExecuteFunction(Agreement, Param);\
return Param;\
}
#define HFMODFUNC_ONE(FuncName, ParamType1, ParamName1); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_TWO(FuncName, ParamType1, ParamName1, ParamType2, ParamName2); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_THREE(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_FOUR(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_FIVE(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_SIX(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_SEVEN(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_EIGHT(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7, ParamType8, ParamName8); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
ParamType8 ParamName8; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
ParamType8 ParamName8() { return Parameter.ParamName8; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_NINE(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7, ParamType8, ParamName8, ParamType9, ParamName9); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
ParamType8 ParamName8; \
ParamType9 ParamName9; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
ParamType8 ParamName8() { return Parameter.ParamName8; } \
ParamType9 ParamName9() { return Parameter.ParamName9; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFMODFUNC_TEN(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7, ParamType8, ParamName8, ParamType9, ParamName9, ParamType10, ParamName10); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
ParamType8 ParamName8; \
ParamType9 ParamName9; \
ParamType10 ParamName10; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
ParamType8 ParamName8() { return Parameter.ParamName8; } \
ParamType9 ParamName9() { return Parameter.ParamName9; } \
ParamType10 ParamName10() { return Parameter.ParamName10; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFModuleAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC(FuncName); \
struct FuncName##Param : HFParam \
{ \
FuncName##Param() { ParamPtr = NULL; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_ONE(FuncName, ParamType1, ParamName1); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_TWO(FuncName, ParamType1, ParamName1, ParamType2, ParamName2); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_THREE(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_FOUR(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_FIVE(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_SIX(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_SEVEN(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_EIGHT(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7, ParamType8, ParamName8); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
ParamType8 ParamName8; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
ParamType8 ParamName8() { return Parameter.ParamName8; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_NINE(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7, ParamType8, ParamName8, ParamType9, ParamName9); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
ParamType8 ParamName8; \
ParamType9 ParamName9; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
ParamType8 ParamName8() { return Parameter.ParamName8; } \
ParamType9 ParamName9() { return Parameter.ParamName9; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
#define HFOBJFUNC_TEN(FuncName, ParamType1, ParamName1, ParamType2, ParamName2, ParamType3, ParamName3, ParamType4, ParamName4, ParamType5, ParamName5, ParamType6, ParamName6, ParamType7, ParamName7, ParamType8, ParamName8, ParamType9, ParamName9, ParamType10, ParamName10); \
struct FuncName##Param : HFParam \
{ \
struct \
{ \
ParamType1 ParamName1; \
ParamType2 ParamName2; \
ParamType3 ParamName3; \
ParamType4 ParamName4; \
ParamType5 ParamName5; \
ParamType6 ParamName6; \
ParamType7 ParamName7; \
ParamType8 ParamName8; \
ParamType9 ParamName9; \
ParamType10 ParamName10; \
} Parameter; \
ParamType1 ParamName1() { return Parameter.ParamName1; } \
ParamType2 ParamName2() { return Parameter.ParamName2; } \
ParamType3 ParamName3() { return Parameter.ParamName3; } \
ParamType4 ParamName4() { return Parameter.ParamName4; } \
ParamType5 ParamName5() { return Parameter.ParamName5; } \
ParamType6 ParamName6() { return Parameter.ParamName6; } \
ParamType7 ParamName7() { return Parameter.ParamName7; } \
ParamType8 ParamName8() { return Parameter.ParamName8; } \
ParamType9 ParamName9() { return Parameter.ParamName9; } \
ParamType10 ParamName10() { return Parameter.ParamName10; } \
FuncName##Param() { ParamPtr = &Parameter; } \
};\
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
FuncName##Param* FuncName##RT(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
return Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, TArray<FName> ObjectGroup, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup = ObjectGroup; \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, EAgreementType AgreementType, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = AgreementType; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
delete Param; \
} \
void FuncName(int32 ModuIndex, FName ObjName, FName FunctionName, ParamType1 ParamName1, ParamType2 ParamName2, ParamType3 ParamName3, ParamType4 ParamName4, ParamType5 ParamName5, ParamType6 ParamName6, ParamType7 ParamName7, ParamType8 ParamName8, ParamType9 ParamName9, ParamType10 ParamName10) \
{ \
HFObjectAgreement Agreement; \
Agreement.ModuleIndex = ModuIndex; \
Agreement.AgreementType = EAgreementType::SelfObject; \
Agreement.ObjectGroup.Add(ObjName); \
Agreement.FunctionName = FunctionName; \
FuncName##Param* Param = new FuncName##Param(); \
Param->Parameter.ParamName1 = ParamName1; \
Param->Parameter.ParamName2 = ParamName2; \
Param->Parameter.ParamName3 = ParamName3; \
Param->Parameter.ParamName4 = ParamName4; \
Param->Parameter.ParamName5 = ParamName5; \
Param->Parameter.ParamName6 = ParamName6; \
Param->Parameter.ParamName7 = ParamName7; \
Param->Parameter.ParamName8 = ParamName8; \
Param->Parameter.ParamName9 = ParamName9; \
Param->Parameter.ParamName10 = ParamName10; \
ExecuteFunction(Agreement, Param); \
delete Param; \
}
| [
"461874693@qq.com"
] | 461874693@qq.com |
3a807695c096ad0e056c25672093ef803f9fc65b | 135f16f65206fda37479599a8fbb48e05534c17b | /Brbanje/src/Brbanje/Scene/SceneCameraController.cpp | 5164746b6941981f13e93d276239e30b6068333c | [] | no_license | Rustifan/Brbanje | a2951569b6ca9e67cf6916dd54c5dc4ec76d5f7f | f97713872cee4302e58a131d0c9e7f9532206e98 | refs/heads/main | 2023-05-26T10:42:36.743265 | 2021-06-10T17:58:55 | 2021-06-10T17:58:55 | 309,349,375 | 0 | 0 | null | 2020-11-03T12:17:52 | 2020-11-02T11:27:22 | C++ | UTF-8 | C++ | false | false | 2,498 | cpp | #include "brpch.h"
#include "SceneCameraController.h"
#include "Brbanje/Core/Input.h"
#include "Brbanje/Events/MouseEvents.h"
#include "Scene.h"
#include "imgui.h"
namespace Brbanje
{
SceneCameraController::SceneCameraController(Scene* scene):
m_Scene(scene), m_Camera(SceneCamera()), m_Transform(TransformComponent())
{
m_MoveSpeed = m_Camera.GetSize() * 0.001f;
}
void SceneCameraController::OnUpdate(Timestep ts)
{
if (ImGui::IsMouseClicked(1) && m_Scene->IsMouseHovered())
{
ImGuiIO& io = ImGui::GetIO();
m_IsMoving = true;
m_StartCameraPos = m_Transform.position;
m_MouseStartPos = glm::vec2(io.MousePos.x, io.MousePos.y);
}
if (ImGui::IsMouseReleased(1))
{
m_IsMoving = false;
}
Move(ts);
}
void SceneCameraController::OnRender()
{
}
void SceneCameraController::OnImGuiRender()
{
ImGui::Begin("Editor Camera Settings");
ImGui::Dummy(ImVec2(0, 5.0f));
SceneHierarchyPanel::DrawVec3Control("Position", m_Transform.position);
glm::vec3 rotation = glm::degrees(m_Transform.rotation);
SceneHierarchyPanel::DrawVec3Control("Rotation", rotation, 0.0f);
m_Transform.rotation = glm::radians(rotation);
ImGui::Dummy(ImVec2(0, 10.0f));
float size = m_Camera.GetSize();
if (ImGui::DragFloat("size", &size, 0.1f))
{
m_Camera.SetSize(size);
}
float nearClip = m_Camera.GetOrthographicNearClip();
if (ImGui::DragFloat("near clip", &nearClip, 0.1f))
{
m_Camera.SetOrthoGraphicNearClip(nearClip);
}
float farClip = m_Camera.GetOrthographicFarClip();
if (ImGui::DragFloat("far clip", &farClip, 0.1f))
{
m_Camera.SetOrthoGraphicFarClip(farClip);
}
ImGui::End();
}
void SceneCameraController::OnEvent(Event& event)
{
EventDispacher ed(event);
ed.Dispatch<MouseScrolledEvent>(std::bind(&SceneCameraController::OnMouseScrolledEvent, this, std::placeholders::_1));
}
bool SceneCameraController::OnMouseScrolledEvent(MouseScrolledEvent& ev)
{
if (m_Scene->IsMouseHovered())
{
m_Camera.SetSize(m_Camera.GetSize() - ev.GetYOffset());
m_MoveSpeed = m_Camera.GetSize() * 0.001f;
}
return false;
}
void SceneCameraController::Move(Timestep ts)
{
if (m_IsMoving)
{
ImGuiIO& io = ImGui::GetIO();
glm::vec2 mousePosDiff;
mousePosDiff.y = io.MousePos.y - m_MouseStartPos.y;
mousePosDiff.x = m_MouseStartPos.x - io.MousePos.x;
m_Transform.position = m_StartCameraPos + glm::vec3(mousePosDiff.x, mousePosDiff.y, 0.0f) * m_MoveSpeed;
}
}
} | [
"ivancace3@gmail.com"
] | ivancace3@gmail.com |
ed805b4c0d7394d4e7db9bdda207e2bc4cb243bb | 6338150e6083272fcb5ce0f9b2b228be0dc80cdd | /aieBootstrap-master/ProjectilePhysics/PhysicsScene.h | f4cbb9771553984f378225894709ad21720c05f8 | [
"MIT"
] | permissive | Goodii/PhysicsForGames | 55f162c1fe5a7c252b7aa10ac7aa19df3e3ee0e4 | 202ce3d82c6ad15774f6b0874bdaa4190278ec74 | refs/heads/master | 2018-09-05T13:34:15.435709 | 2018-06-04T12:59:06 | 2018-06-04T12:59:06 | 120,531,377 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,247 | h | #pragma once
#include <vector>
#include <glm/glm.hpp>
class PhysicsObject;
class PhysicsScene
{
public:
struct CollisionData
{
bool wasCollision;
glm::vec2 normal;
float overlap;
};
PhysicsScene();
~PhysicsScene();
void addActor(PhysicsObject* actor);
void removeActor(PhysicsObject* actor);
void update(float deltaTime);
void updateGizmos();
void debugScene();
void setGravity(glm::vec2 gravity) { m_gravity = gravity; }
glm::vec2 getGravity() { return m_gravity; }
void setTimeStep(float timeStep) { m_timeStep = timeStep; }
float getTimeStep() { return m_timeStep; }
std::vector<PhysicsObject*> getActors() { return m_actors; }
void checkForCollision();
static bool plane2sphere(PhysicsObject*, PhysicsObject*);
static bool plane2aabb(PhysicsObject*, PhysicsObject*);
static bool sphere2plane(PhysicsObject*, PhysicsObject*);
static bool sphere2sphere(PhysicsObject*, PhysicsObject*);
static bool sphere2aabb(PhysicsObject*, PhysicsObject*);
static bool aabb2plane(PhysicsObject*, PhysicsObject*);
static bool aabb2sphere(PhysicsObject*, PhysicsObject*);
static bool aabb2aabb(PhysicsObject*, PhysicsObject*);
protected:
glm::vec2 m_gravity;
float m_timeStep;
std::vector<PhysicsObject*> m_actors;
};
| [
"iPatt98@gmail.com"
] | iPatt98@gmail.com |
24c644c0126e333eb264a1cedd30156b089d2cc7 | 0991057364d89ceb58cb04825387fc78319a50aa | /Puzzler/Temp/il2cppOutput/il2cppOutput/AssemblyU2DCSharp_Scene22470765894.h | 7a0dd2bc98cf9650e85a15f59314cac08e2edb4e | [] | no_license | austinmwi/puzzlerProject | 21a983d178ef55af7c14f1f717b2654b5bd1a8f7 | 80efcd886ec06aa2117b4c56d34432e9574b2f79 | refs/heads/master | 2020-04-06T06:25:56.309674 | 2016-11-15T22:31:22 | 2016-11-15T22:31:22 | 73,860,390 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,731 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// UnityEngine.Material
struct Material_t3870600107;
#include "UnityEngine_UnityEngine_MonoBehaviour667441552.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Scene2
struct Scene2_t2470765894 : public MonoBehaviour_t667441552
{
public:
// UnityEngine.Material Scene2::ocean_material
Material_t3870600107 * ___ocean_material_2;
// UnityEngine.Material Scene2::cloud_material
Material_t3870600107 * ___cloud_material_3;
public:
inline static int32_t get_offset_of_ocean_material_2() { return static_cast<int32_t>(offsetof(Scene2_t2470765894, ___ocean_material_2)); }
inline Material_t3870600107 * get_ocean_material_2() const { return ___ocean_material_2; }
inline Material_t3870600107 ** get_address_of_ocean_material_2() { return &___ocean_material_2; }
inline void set_ocean_material_2(Material_t3870600107 * value)
{
___ocean_material_2 = value;
Il2CppCodeGenWriteBarrier(&___ocean_material_2, value);
}
inline static int32_t get_offset_of_cloud_material_3() { return static_cast<int32_t>(offsetof(Scene2_t2470765894, ___cloud_material_3)); }
inline Material_t3870600107 * get_cloud_material_3() const { return ___cloud_material_3; }
inline Material_t3870600107 ** get_address_of_cloud_material_3() { return &___cloud_material_3; }
inline void set_cloud_material_3(Material_t3870600107 * value)
{
___cloud_material_3 = value;
Il2CppCodeGenWriteBarrier(&___cloud_material_3, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"austin@wearableintelligence.com"
] | austin@wearableintelligence.com |
3b10f4231a0b8949444caae0feb20a0012087935 | b6027f686e77978c3cc238c4b4af3fb7c4872b57 | /Scorer.h | 1bba7ed79d9d2882e07cf8868b1b2fc265a5299c | [] | no_license | udalov/russianaicup2015 | 13cb7f61c329a4a6be49161b2aa0f521ed4498da | 7ca5e5ba69a84984824f26be172950c886632cac | refs/heads/master | 2020-09-13T10:54:46.078142 | 2016-08-24T19:29:03 | 2016-08-24T19:29:03 | 66,493,454 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 460 | h | #pragma once
#include "Path.h"
#include "State.h"
#include "Tracks.h"
#include "VisClient.h"
#include <vector>
using std::vector;
class Track;
struct Scorer {
const State& startState;
vector<Tile> path;
vector<Segment> pathSegment;
explicit Scorer(const State& startState, const vector<Tile>& path, VisClient *vis);
double scoreTrack(const Track& track) const;
double scoreState(const State& state, bool debug = false) const;
};
| [
"udalov.alexander@gmail.com"
] | udalov.alexander@gmail.com |
d1ba61e173b777b66de76078d1a19a4ff42e7684 | 8457ed858b9194ff7a3e23adbbea89521bfe5c89 | /HalfTimeBuild/GTMK Game Jam 2020_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/UnityEngine.AnimationModule.cpp | 6953c7ea514cf54bf5e842bddeb8a540689a7663 | [] | no_license | Yernemm/GMTK-Game-Jam-2020 | 9dd017796727324c487104449c1eb1a815032461 | 18cb86c0dae2832ae7dd7bc2911ae6b52a274beb | refs/heads/master | 2022-11-18T08:15:23.692086 | 2020-07-12T15:33:30 | 2020-07-12T15:33:30 | 278,729,303 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 246,999 | cpp | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
template <typename R, typename T1>
struct VirtFuncInvoker1
{
typedef R (*Func)(void*, T1, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
return ((Func)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
struct VirtActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
struct GenericVirtActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
struct InterfaceActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
struct GenericInterfaceActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4;
// System.Attribute
struct Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74;
// System.Char[]
struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2;
// System.Collections.IDictionary
struct IDictionary_t1BD5C1546718A374EA8122FBD6C6EE45331E8CE7;
// System.Delegate
struct Delegate_t;
// System.DelegateData
struct DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE;
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
// System.Diagnostics.StackTrace[]
struct StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196;
// System.IAsyncResult
struct IAsyncResult_t8E194308510B375B42432981AE5E7488C458D598;
// System.IntPtr[]
struct IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD;
// System.InvalidCastException
struct InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA;
// System.InvalidOperationException
struct InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1;
// System.Reflection.MethodInfo
struct MethodInfo_t;
// System.Runtime.Serialization.SafeSerializationManager
struct SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770;
// System.String
struct String_t;
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017;
// UnityEngine.AnimationEvent
struct AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F;
// UnityEngine.AnimationState
struct AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386;
// UnityEngine.Animations.NotKeyableAttribute
struct NotKeyableAttribute_tC0F8DAA85C33BBE045EFE59BB65D9A060D4282BE;
// UnityEngine.Animator
struct Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A;
// UnityEngine.AnimatorOverrideController
struct AnimatorOverrideController_t130F04B57E753FD4288EF3235699ABE7C88FF312;
// UnityEngine.AnimatorOverrideController/OnOverrideControllerDirtyCallback
struct OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E;
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0;
// UnityEngine.ScriptableObject
struct ScriptableObject_tAB015486CEAB714DA0D5C1BA389B84FB90427734;
// UnityEngine.StateMachineBehaviour
struct StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C;
IL2CPP_EXTERN_C RuntimeClass* AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C String_t* _stringLiteral04E4E32AA834F9BA9336C5388E9470F196EB0891;
IL2CPP_EXTERN_C String_t* _stringLiteral35482DF98E7DEED2FC6BDE9BDD1E273E27CF1F2C;
IL2CPP_EXTERN_C String_t* _stringLiteral4518459D262696CF9B5DAB1E0A1BC3AC2F9BD9DF;
IL2CPP_EXTERN_C String_t* _stringLiteral59BDBA16999CF4EF3F7712740907B2C5E860459C;
IL2CPP_EXTERN_C String_t* _stringLiteral6502516F734DD885173E353D47AAEB82BC7070A9;
IL2CPP_EXTERN_C String_t* _stringLiteral7E3996230D9AF0349B43FF7B536FC25AF0C19C71;
IL2CPP_EXTERN_C String_t* _stringLiteralB47C26932C83DD7E0C54FC87EDDE2F3B50E5104C;
IL2CPP_EXTERN_C String_t* _stringLiteralB9DF0CBB713EC6E9DFD70C9BFB0B820148433428;
IL2CPP_EXTERN_C String_t* _stringLiteralDA39A3EE5E6B4B0D3255BFEF95601890AFD80709;
IL2CPP_EXTERN_C String_t* _stringLiteralFCF5307272E4A4426DDA9E4E6930E2B834B95B2C;
IL2CPP_EXTERN_C const RuntimeMethod* AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_mC3942EB4B00EAC10035AA7EBE23CA679C8790D20_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_m172B8D6DA48AD49F0740833F7D18CD468B072E5E_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_mCC63F3E0D55A21A9E56D80D26150AD2B78C6EC50_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_mF434E44E279E1DBD0887921B38A5C57812B1371A_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_m35A103AAF8E80E7C007214546C71B4E90901C2A2_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_m1E16540EE6283270E3DE85D46C3BE1F8B85E73C2_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_m1767ADED196AAA8B4D6FBB9313003E33A967E799_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* PlayableHandle_IsPlayableOfType_TisAnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_mC6A8CB67F39B0B39BF77ED6177B3C2DF1BC91533_RuntimeMethod_var;
IL2CPP_EXTERN_C const uint32_t AnimationClipPlayable_Equals_m06BA3E1C3AE0CC205C8531CCF6596C99C8D927EE_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationEvent__ctor_m6C228EB716B6B53DE2665091C056428EFB90897F_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationLayerMixerPlayable_Equals_m0A6A86FEDCE98E63B84BD01D0D362D03EA733E59_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationLayerMixerPlayable__cctor_m3712A5D44F275E70624C0D734C9CED9BD12D0AC9_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationMixerPlayable_Equals_m7CB1B61B74A6BE00A35AD072490F07D4C7A17B0F_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationMixerPlayable__cctor_m820F56C1D4257D4F5446BD66402D4428E0DF8E3E_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationMotionXToDeltaPlayable_Equals_m53B4AAB54D7F3633C3954056F8C334BB8B7D590E_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationMotionXToDeltaPlayable__cctor_mCB948CE31E0AAEC53CB1D6746D091604413C5EEE_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationOffsetPlayable_Equals_m30B207FC6287EABF6FC1FDA47784322A3ABB98DF_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationOffsetPlayable__cctor_m174AD41778526FA15E41C6A11303A4F190A4CEA6_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationPosePlayable_Equals_m4417430115DCF9B39D3E4B64424120CE7E555961_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationPosePlayable__cctor_mDE42A26BC2624427AA8086C4AB69FB531949153F_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationRemoveScalePlayable_Equals_m58B139243E3B27CE86CA4CC470895BF719CD9BAD_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationRemoveScalePlayable__cctor_m7BA13559FDA2BF8E061839B333085C402DED6829_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationScriptPlayable_Equals_m4995D1AD353F43FE3FA854A8384601F58156E69E_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationScriptPlayable__cctor_m3FA9E1E2E1EADACBC718598BEFECB25F867E454E_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimatorControllerPlayable_Equals_m04685CCA5A5FC388A0387D3453A677C0CB47D173_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimatorControllerPlayable__cctor_m6FCC197F3BF33EAFC37D5217617FCDC64E8B304E_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AnimatorControllerPlayable__ctor_m739B1BFC592B6C160410141057F1B2BA1B971897_MetadataUsageId;
struct Delegate_t_marshaled_com;
struct Delegate_t_marshaled_pinvoke;
struct Exception_t_marshaled_com;
struct Exception_t_marshaled_pinvoke;
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0;;
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com;
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com;;
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke;
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke;;
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
IL2CPP_EXTERN_C_BEGIN
IL2CPP_EXTERN_C_END
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// <Module>
struct U3CModuleU3E_t6EFABDA0B2A020FB3DD6CA286799D867733667F1
{
public:
public:
};
// System.Object
struct Il2CppArrayBounds;
// System.Array
// System.Attribute
struct Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74 : public RuntimeObject
{
public:
public:
};
// System.String
struct String_t : public RuntimeObject
{
public:
// System.Int32 System.String::m_stringLength
int32_t ___m_stringLength_0;
// System.Char System.String::m_firstChar
Il2CppChar ___m_firstChar_1;
public:
inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); }
inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; }
inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; }
inline void set_m_stringLength_0(int32_t value)
{
___m_stringLength_0 = value;
}
inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); }
inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; }
inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; }
inline void set_m_firstChar_1(Il2CppChar value)
{
___m_firstChar_1 = value;
}
};
struct String_t_StaticFields
{
public:
// System.String System.String::Empty
String_t* ___Empty_5;
public:
inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); }
inline String_t* get_Empty_5() const { return ___Empty_5; }
inline String_t** get_address_of_Empty_5() { return &___Empty_5; }
inline void set_Empty_5(String_t* value)
{
___Empty_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value);
}
};
// System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject
{
public:
public:
};
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com
{
};
// System.Boolean
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C
{
public:
// System.Boolean System.Boolean::m_value
bool ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); }
inline bool get_m_value_0() const { return ___m_value_0; }
inline bool* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(bool value)
{
___m_value_0 = value;
}
};
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields
{
public:
// System.String System.Boolean::TrueString
String_t* ___TrueString_5;
// System.String System.Boolean::FalseString
String_t* ___FalseString_6;
public:
inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); }
inline String_t* get_TrueString_5() const { return ___TrueString_5; }
inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; }
inline void set_TrueString_5(String_t* value)
{
___TrueString_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value);
}
inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); }
inline String_t* get_FalseString_6() const { return ___FalseString_6; }
inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; }
inline void set_FalseString_6(String_t* value)
{
___FalseString_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value);
}
};
// System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521 : public ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF
{
public:
public:
};
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields
{
public:
// System.Char[] System.Enum::enumSeperatorCharArray
CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___enumSeperatorCharArray_0;
public:
inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields, ___enumSeperatorCharArray_0)); }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; }
inline void set_enumSeperatorCharArray_0(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value)
{
___enumSeperatorCharArray_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_com
{
};
// System.Int32
struct Int32_t585191389E07734F19F3156FF88FB3EF4800D102
{
public:
// System.Int32 System.Int32::m_value
int32_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t585191389E07734F19F3156FF88FB3EF4800D102, ___m_value_0)); }
inline int32_t get_m_value_0() const { return ___m_value_0; }
inline int32_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(int32_t value)
{
___m_value_0 = value;
}
};
// System.IntPtr
struct IntPtr_t
{
public:
// System.Void* System.IntPtr::m_value
void* ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); }
inline void* get_m_value_0() const { return ___m_value_0; }
inline void** get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(void* value)
{
___m_value_0 = value;
}
};
struct IntPtr_t_StaticFields
{
public:
// System.IntPtr System.IntPtr::Zero
intptr_t ___Zero_1;
public:
inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); }
inline intptr_t get_Zero_1() const { return ___Zero_1; }
inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; }
inline void set_Zero_1(intptr_t value)
{
___Zero_1 = value;
}
};
// System.Single
struct Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1
{
public:
// System.Single System.Single::m_value
float ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1, ___m_value_0)); }
inline float get_m_value_0() const { return ___m_value_0; }
inline float* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(float value)
{
___m_value_0 = value;
}
};
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017
{
public:
union
{
struct
{
};
uint8_t Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017__padding[1];
};
public:
};
// UnityEngine.Animations.NotKeyableAttribute
struct NotKeyableAttribute_tC0F8DAA85C33BBE045EFE59BB65D9A060D4282BE : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
// UnityEngine.AnimatorClipInfo
struct AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180
{
public:
// System.Int32 UnityEngine.AnimatorClipInfo::m_ClipInstanceID
int32_t ___m_ClipInstanceID_0;
// System.Single UnityEngine.AnimatorClipInfo::m_Weight
float ___m_Weight_1;
public:
inline static int32_t get_offset_of_m_ClipInstanceID_0() { return static_cast<int32_t>(offsetof(AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180, ___m_ClipInstanceID_0)); }
inline int32_t get_m_ClipInstanceID_0() const { return ___m_ClipInstanceID_0; }
inline int32_t* get_address_of_m_ClipInstanceID_0() { return &___m_ClipInstanceID_0; }
inline void set_m_ClipInstanceID_0(int32_t value)
{
___m_ClipInstanceID_0 = value;
}
inline static int32_t get_offset_of_m_Weight_1() { return static_cast<int32_t>(offsetof(AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180, ___m_Weight_1)); }
inline float get_m_Weight_1() const { return ___m_Weight_1; }
inline float* get_address_of_m_Weight_1() { return &___m_Weight_1; }
inline void set_m_Weight_1(float value)
{
___m_Weight_1 = value;
}
};
// UnityEngine.AnimatorStateInfo
struct AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2
{
public:
// System.Int32 UnityEngine.AnimatorStateInfo::m_Name
int32_t ___m_Name_0;
// System.Int32 UnityEngine.AnimatorStateInfo::m_Path
int32_t ___m_Path_1;
// System.Int32 UnityEngine.AnimatorStateInfo::m_FullPath
int32_t ___m_FullPath_2;
// System.Single UnityEngine.AnimatorStateInfo::m_NormalizedTime
float ___m_NormalizedTime_3;
// System.Single UnityEngine.AnimatorStateInfo::m_Length
float ___m_Length_4;
// System.Single UnityEngine.AnimatorStateInfo::m_Speed
float ___m_Speed_5;
// System.Single UnityEngine.AnimatorStateInfo::m_SpeedMultiplier
float ___m_SpeedMultiplier_6;
// System.Int32 UnityEngine.AnimatorStateInfo::m_Tag
int32_t ___m_Tag_7;
// System.Int32 UnityEngine.AnimatorStateInfo::m_Loop
int32_t ___m_Loop_8;
public:
inline static int32_t get_offset_of_m_Name_0() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_Name_0)); }
inline int32_t get_m_Name_0() const { return ___m_Name_0; }
inline int32_t* get_address_of_m_Name_0() { return &___m_Name_0; }
inline void set_m_Name_0(int32_t value)
{
___m_Name_0 = value;
}
inline static int32_t get_offset_of_m_Path_1() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_Path_1)); }
inline int32_t get_m_Path_1() const { return ___m_Path_1; }
inline int32_t* get_address_of_m_Path_1() { return &___m_Path_1; }
inline void set_m_Path_1(int32_t value)
{
___m_Path_1 = value;
}
inline static int32_t get_offset_of_m_FullPath_2() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_FullPath_2)); }
inline int32_t get_m_FullPath_2() const { return ___m_FullPath_2; }
inline int32_t* get_address_of_m_FullPath_2() { return &___m_FullPath_2; }
inline void set_m_FullPath_2(int32_t value)
{
___m_FullPath_2 = value;
}
inline static int32_t get_offset_of_m_NormalizedTime_3() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_NormalizedTime_3)); }
inline float get_m_NormalizedTime_3() const { return ___m_NormalizedTime_3; }
inline float* get_address_of_m_NormalizedTime_3() { return &___m_NormalizedTime_3; }
inline void set_m_NormalizedTime_3(float value)
{
___m_NormalizedTime_3 = value;
}
inline static int32_t get_offset_of_m_Length_4() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_Length_4)); }
inline float get_m_Length_4() const { return ___m_Length_4; }
inline float* get_address_of_m_Length_4() { return &___m_Length_4; }
inline void set_m_Length_4(float value)
{
___m_Length_4 = value;
}
inline static int32_t get_offset_of_m_Speed_5() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_Speed_5)); }
inline float get_m_Speed_5() const { return ___m_Speed_5; }
inline float* get_address_of_m_Speed_5() { return &___m_Speed_5; }
inline void set_m_Speed_5(float value)
{
___m_Speed_5 = value;
}
inline static int32_t get_offset_of_m_SpeedMultiplier_6() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_SpeedMultiplier_6)); }
inline float get_m_SpeedMultiplier_6() const { return ___m_SpeedMultiplier_6; }
inline float* get_address_of_m_SpeedMultiplier_6() { return &___m_SpeedMultiplier_6; }
inline void set_m_SpeedMultiplier_6(float value)
{
___m_SpeedMultiplier_6 = value;
}
inline static int32_t get_offset_of_m_Tag_7() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_Tag_7)); }
inline int32_t get_m_Tag_7() const { return ___m_Tag_7; }
inline int32_t* get_address_of_m_Tag_7() { return &___m_Tag_7; }
inline void set_m_Tag_7(int32_t value)
{
___m_Tag_7 = value;
}
inline static int32_t get_offset_of_m_Loop_8() { return static_cast<int32_t>(offsetof(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2, ___m_Loop_8)); }
inline int32_t get_m_Loop_8() const { return ___m_Loop_8; }
inline int32_t* get_address_of_m_Loop_8() { return &___m_Loop_8; }
inline void set_m_Loop_8(int32_t value)
{
___m_Loop_8 = value;
}
};
// UnityEngine.AnimatorTransitionInfo
struct AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B
{
public:
// System.Int32 UnityEngine.AnimatorTransitionInfo::m_FullPath
int32_t ___m_FullPath_0;
// System.Int32 UnityEngine.AnimatorTransitionInfo::m_UserName
int32_t ___m_UserName_1;
// System.Int32 UnityEngine.AnimatorTransitionInfo::m_Name
int32_t ___m_Name_2;
// System.Boolean UnityEngine.AnimatorTransitionInfo::m_HasFixedDuration
bool ___m_HasFixedDuration_3;
// System.Single UnityEngine.AnimatorTransitionInfo::m_Duration
float ___m_Duration_4;
// System.Single UnityEngine.AnimatorTransitionInfo::m_NormalizedTime
float ___m_NormalizedTime_5;
// System.Boolean UnityEngine.AnimatorTransitionInfo::m_AnyState
bool ___m_AnyState_6;
// System.Int32 UnityEngine.AnimatorTransitionInfo::m_TransitionType
int32_t ___m_TransitionType_7;
public:
inline static int32_t get_offset_of_m_FullPath_0() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_FullPath_0)); }
inline int32_t get_m_FullPath_0() const { return ___m_FullPath_0; }
inline int32_t* get_address_of_m_FullPath_0() { return &___m_FullPath_0; }
inline void set_m_FullPath_0(int32_t value)
{
___m_FullPath_0 = value;
}
inline static int32_t get_offset_of_m_UserName_1() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_UserName_1)); }
inline int32_t get_m_UserName_1() const { return ___m_UserName_1; }
inline int32_t* get_address_of_m_UserName_1() { return &___m_UserName_1; }
inline void set_m_UserName_1(int32_t value)
{
___m_UserName_1 = value;
}
inline static int32_t get_offset_of_m_Name_2() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_Name_2)); }
inline int32_t get_m_Name_2() const { return ___m_Name_2; }
inline int32_t* get_address_of_m_Name_2() { return &___m_Name_2; }
inline void set_m_Name_2(int32_t value)
{
___m_Name_2 = value;
}
inline static int32_t get_offset_of_m_HasFixedDuration_3() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_HasFixedDuration_3)); }
inline bool get_m_HasFixedDuration_3() const { return ___m_HasFixedDuration_3; }
inline bool* get_address_of_m_HasFixedDuration_3() { return &___m_HasFixedDuration_3; }
inline void set_m_HasFixedDuration_3(bool value)
{
___m_HasFixedDuration_3 = value;
}
inline static int32_t get_offset_of_m_Duration_4() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_Duration_4)); }
inline float get_m_Duration_4() const { return ___m_Duration_4; }
inline float* get_address_of_m_Duration_4() { return &___m_Duration_4; }
inline void set_m_Duration_4(float value)
{
___m_Duration_4 = value;
}
inline static int32_t get_offset_of_m_NormalizedTime_5() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_NormalizedTime_5)); }
inline float get_m_NormalizedTime_5() const { return ___m_NormalizedTime_5; }
inline float* get_address_of_m_NormalizedTime_5() { return &___m_NormalizedTime_5; }
inline void set_m_NormalizedTime_5(float value)
{
___m_NormalizedTime_5 = value;
}
inline static int32_t get_offset_of_m_AnyState_6() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_AnyState_6)); }
inline bool get_m_AnyState_6() const { return ___m_AnyState_6; }
inline bool* get_address_of_m_AnyState_6() { return &___m_AnyState_6; }
inline void set_m_AnyState_6(bool value)
{
___m_AnyState_6 = value;
}
inline static int32_t get_offset_of_m_TransitionType_7() { return static_cast<int32_t>(offsetof(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B, ___m_TransitionType_7)); }
inline int32_t get_m_TransitionType_7() const { return ___m_TransitionType_7; }
inline int32_t* get_address_of_m_TransitionType_7() { return &___m_TransitionType_7; }
inline void set_m_TransitionType_7(int32_t value)
{
___m_TransitionType_7 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.AnimatorTransitionInfo
struct AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_pinvoke
{
int32_t ___m_FullPath_0;
int32_t ___m_UserName_1;
int32_t ___m_Name_2;
int32_t ___m_HasFixedDuration_3;
float ___m_Duration_4;
float ___m_NormalizedTime_5;
int32_t ___m_AnyState_6;
int32_t ___m_TransitionType_7;
};
// Native definition for COM marshalling of UnityEngine.AnimatorTransitionInfo
struct AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_com
{
int32_t ___m_FullPath_0;
int32_t ___m_UserName_1;
int32_t ___m_Name_2;
int32_t ___m_HasFixedDuration_3;
float ___m_Duration_4;
float ___m_NormalizedTime_5;
int32_t ___m_AnyState_6;
int32_t ___m_TransitionType_7;
};
// UnityEngine.Quaternion
struct Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357
{
public:
// System.Single UnityEngine.Quaternion::x
float ___x_0;
// System.Single UnityEngine.Quaternion::y
float ___y_1;
// System.Single UnityEngine.Quaternion::z
float ___z_2;
// System.Single UnityEngine.Quaternion::w
float ___w_3;
public:
inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357, ___x_0)); }
inline float get_x_0() const { return ___x_0; }
inline float* get_address_of_x_0() { return &___x_0; }
inline void set_x_0(float value)
{
___x_0 = value;
}
inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357, ___y_1)); }
inline float get_y_1() const { return ___y_1; }
inline float* get_address_of_y_1() { return &___y_1; }
inline void set_y_1(float value)
{
___y_1 = value;
}
inline static int32_t get_offset_of_z_2() { return static_cast<int32_t>(offsetof(Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357, ___z_2)); }
inline float get_z_2() const { return ___z_2; }
inline float* get_address_of_z_2() { return &___z_2; }
inline void set_z_2(float value)
{
___z_2 = value;
}
inline static int32_t get_offset_of_w_3() { return static_cast<int32_t>(offsetof(Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357, ___w_3)); }
inline float get_w_3() const { return ___w_3; }
inline float* get_address_of_w_3() { return &___w_3; }
inline void set_w_3(float value)
{
___w_3 = value;
}
};
struct Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357_StaticFields
{
public:
// UnityEngine.Quaternion UnityEngine.Quaternion::identityQuaternion
Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 ___identityQuaternion_4;
public:
inline static int32_t get_offset_of_identityQuaternion_4() { return static_cast<int32_t>(offsetof(Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357_StaticFields, ___identityQuaternion_4)); }
inline Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 get_identityQuaternion_4() const { return ___identityQuaternion_4; }
inline Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 * get_address_of_identityQuaternion_4() { return &___identityQuaternion_4; }
inline void set_identityQuaternion_4(Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 value)
{
___identityQuaternion_4 = value;
}
};
// UnityEngine.SharedBetweenAnimatorsAttribute
struct SharedBetweenAnimatorsAttribute_tD52C4EACCF9B8F7A21A34D11D3971A823B131F03 : public Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74
{
public:
public:
};
// UnityEngine.Vector3
struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720
{
public:
// System.Single UnityEngine.Vector3::x
float ___x_2;
// System.Single UnityEngine.Vector3::y
float ___y_3;
// System.Single UnityEngine.Vector3::z
float ___z_4;
public:
inline static int32_t get_offset_of_x_2() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___x_2)); }
inline float get_x_2() const { return ___x_2; }
inline float* get_address_of_x_2() { return &___x_2; }
inline void set_x_2(float value)
{
___x_2 = value;
}
inline static int32_t get_offset_of_y_3() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___y_3)); }
inline float get_y_3() const { return ___y_3; }
inline float* get_address_of_y_3() { return &___y_3; }
inline void set_y_3(float value)
{
___y_3 = value;
}
inline static int32_t get_offset_of_z_4() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___z_4)); }
inline float get_z_4() const { return ___z_4; }
inline float* get_address_of_z_4() { return &___z_4; }
inline void set_z_4(float value)
{
___z_4 = value;
}
};
struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields
{
public:
// UnityEngine.Vector3 UnityEngine.Vector3::zeroVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___zeroVector_5;
// UnityEngine.Vector3 UnityEngine.Vector3::oneVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___oneVector_6;
// UnityEngine.Vector3 UnityEngine.Vector3::upVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___upVector_7;
// UnityEngine.Vector3 UnityEngine.Vector3::downVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___downVector_8;
// UnityEngine.Vector3 UnityEngine.Vector3::leftVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___leftVector_9;
// UnityEngine.Vector3 UnityEngine.Vector3::rightVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___rightVector_10;
// UnityEngine.Vector3 UnityEngine.Vector3::forwardVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___forwardVector_11;
// UnityEngine.Vector3 UnityEngine.Vector3::backVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___backVector_12;
// UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___positiveInfinityVector_13;
// UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___negativeInfinityVector_14;
public:
inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___zeroVector_5)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_zeroVector_5() const { return ___zeroVector_5; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_zeroVector_5() { return &___zeroVector_5; }
inline void set_zeroVector_5(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___zeroVector_5 = value;
}
inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___oneVector_6)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_oneVector_6() const { return ___oneVector_6; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_oneVector_6() { return &___oneVector_6; }
inline void set_oneVector_6(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___oneVector_6 = value;
}
inline static int32_t get_offset_of_upVector_7() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___upVector_7)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_upVector_7() const { return ___upVector_7; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_upVector_7() { return &___upVector_7; }
inline void set_upVector_7(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___upVector_7 = value;
}
inline static int32_t get_offset_of_downVector_8() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___downVector_8)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_downVector_8() const { return ___downVector_8; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_downVector_8() { return &___downVector_8; }
inline void set_downVector_8(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___downVector_8 = value;
}
inline static int32_t get_offset_of_leftVector_9() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___leftVector_9)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_leftVector_9() const { return ___leftVector_9; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_leftVector_9() { return &___leftVector_9; }
inline void set_leftVector_9(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___leftVector_9 = value;
}
inline static int32_t get_offset_of_rightVector_10() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___rightVector_10)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_rightVector_10() const { return ___rightVector_10; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_rightVector_10() { return &___rightVector_10; }
inline void set_rightVector_10(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___rightVector_10 = value;
}
inline static int32_t get_offset_of_forwardVector_11() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___forwardVector_11)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_forwardVector_11() const { return ___forwardVector_11; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_forwardVector_11() { return &___forwardVector_11; }
inline void set_forwardVector_11(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___forwardVector_11 = value;
}
inline static int32_t get_offset_of_backVector_12() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___backVector_12)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_backVector_12() const { return ___backVector_12; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_backVector_12() { return &___backVector_12; }
inline void set_backVector_12(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___backVector_12 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___positiveInfinityVector_13)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_positiveInfinityVector_13() const { return ___positiveInfinityVector_13; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_positiveInfinityVector_13() { return &___positiveInfinityVector_13; }
inline void set_positiveInfinityVector_13(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___positiveInfinityVector_13 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_14() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___negativeInfinityVector_14)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_negativeInfinityVector_14() const { return ___negativeInfinityVector_14; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_negativeInfinityVector_14() { return &___negativeInfinityVector_14; }
inline void set_negativeInfinityVector_14(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___negativeInfinityVector_14 = value;
}
};
// System.Delegate
struct Delegate_t : public RuntimeObject
{
public:
// System.IntPtr System.Delegate::method_ptr
Il2CppMethodPointer ___method_ptr_0;
// System.IntPtr System.Delegate::invoke_impl
intptr_t ___invoke_impl_1;
// System.Object System.Delegate::m_target
RuntimeObject * ___m_target_2;
// System.IntPtr System.Delegate::method
intptr_t ___method_3;
// System.IntPtr System.Delegate::delegate_trampoline
intptr_t ___delegate_trampoline_4;
// System.IntPtr System.Delegate::extra_arg
intptr_t ___extra_arg_5;
// System.IntPtr System.Delegate::method_code
intptr_t ___method_code_6;
// System.Reflection.MethodInfo System.Delegate::method_info
MethodInfo_t * ___method_info_7;
// System.Reflection.MethodInfo System.Delegate::original_method_info
MethodInfo_t * ___original_method_info_8;
// System.DelegateData System.Delegate::data
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
// System.Boolean System.Delegate::method_is_virtual
bool ___method_is_virtual_10;
public:
inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_ptr_0)); }
inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; }
inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; }
inline void set_method_ptr_0(Il2CppMethodPointer value)
{
___method_ptr_0 = value;
}
inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t, ___invoke_impl_1)); }
inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; }
inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; }
inline void set_invoke_impl_1(intptr_t value)
{
___invoke_impl_1 = value;
}
inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t, ___m_target_2)); }
inline RuntimeObject * get_m_target_2() const { return ___m_target_2; }
inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; }
inline void set_m_target_2(RuntimeObject * value)
{
___m_target_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_target_2), (void*)value);
}
inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_3)); }
inline intptr_t get_method_3() const { return ___method_3; }
inline intptr_t* get_address_of_method_3() { return &___method_3; }
inline void set_method_3(intptr_t value)
{
___method_3 = value;
}
inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t, ___delegate_trampoline_4)); }
inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; }
inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; }
inline void set_delegate_trampoline_4(intptr_t value)
{
___delegate_trampoline_4 = value;
}
inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t, ___extra_arg_5)); }
inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; }
inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; }
inline void set_extra_arg_5(intptr_t value)
{
___extra_arg_5 = value;
}
inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_code_6)); }
inline intptr_t get_method_code_6() const { return ___method_code_6; }
inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; }
inline void set_method_code_6(intptr_t value)
{
___method_code_6 = value;
}
inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_info_7)); }
inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; }
inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; }
inline void set_method_info_7(MethodInfo_t * value)
{
___method_info_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&___method_info_7), (void*)value);
}
inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t, ___original_method_info_8)); }
inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; }
inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; }
inline void set_original_method_info_8(MethodInfo_t * value)
{
___original_method_info_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&___original_method_info_8), (void*)value);
}
inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t, ___data_9)); }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * get_data_9() const { return ___data_9; }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE ** get_address_of_data_9() { return &___data_9; }
inline void set_data_9(DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * value)
{
___data_9 = value;
Il2CppCodeGenWriteBarrier((void**)(&___data_9), (void*)value);
}
inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_is_virtual_10)); }
inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; }
inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; }
inline void set_method_is_virtual_10(bool value)
{
___method_is_virtual_10 = value;
}
};
// Native definition for P/Invoke marshalling of System.Delegate
struct Delegate_t_marshaled_pinvoke
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// Native definition for COM marshalling of System.Delegate
struct Delegate_t_marshaled_com
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// System.Exception
struct Exception_t : public RuntimeObject
{
public:
// System.String System.Exception::_className
String_t* ____className_1;
// System.String System.Exception::_message
String_t* ____message_2;
// System.Collections.IDictionary System.Exception::_data
RuntimeObject* ____data_3;
// System.Exception System.Exception::_innerException
Exception_t * ____innerException_4;
// System.String System.Exception::_helpURL
String_t* ____helpURL_5;
// System.Object System.Exception::_stackTrace
RuntimeObject * ____stackTrace_6;
// System.String System.Exception::_stackTraceString
String_t* ____stackTraceString_7;
// System.String System.Exception::_remoteStackTraceString
String_t* ____remoteStackTraceString_8;
// System.Int32 System.Exception::_remoteStackIndex
int32_t ____remoteStackIndex_9;
// System.Object System.Exception::_dynamicMethods
RuntimeObject * ____dynamicMethods_10;
// System.Int32 System.Exception::_HResult
int32_t ____HResult_11;
// System.String System.Exception::_source
String_t* ____source_12;
// System.Runtime.Serialization.SafeSerializationManager System.Exception::_safeSerializationManager
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
// System.Diagnostics.StackTrace[] System.Exception::captured_traces
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
// System.IntPtr[] System.Exception::native_trace_ips
IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* ___native_trace_ips_15;
public:
inline static int32_t get_offset_of__className_1() { return static_cast<int32_t>(offsetof(Exception_t, ____className_1)); }
inline String_t* get__className_1() const { return ____className_1; }
inline String_t** get_address_of__className_1() { return &____className_1; }
inline void set__className_1(String_t* value)
{
____className_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&____className_1), (void*)value);
}
inline static int32_t get_offset_of__message_2() { return static_cast<int32_t>(offsetof(Exception_t, ____message_2)); }
inline String_t* get__message_2() const { return ____message_2; }
inline String_t** get_address_of__message_2() { return &____message_2; }
inline void set__message_2(String_t* value)
{
____message_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&____message_2), (void*)value);
}
inline static int32_t get_offset_of__data_3() { return static_cast<int32_t>(offsetof(Exception_t, ____data_3)); }
inline RuntimeObject* get__data_3() const { return ____data_3; }
inline RuntimeObject** get_address_of__data_3() { return &____data_3; }
inline void set__data_3(RuntimeObject* value)
{
____data_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&____data_3), (void*)value);
}
inline static int32_t get_offset_of__innerException_4() { return static_cast<int32_t>(offsetof(Exception_t, ____innerException_4)); }
inline Exception_t * get__innerException_4() const { return ____innerException_4; }
inline Exception_t ** get_address_of__innerException_4() { return &____innerException_4; }
inline void set__innerException_4(Exception_t * value)
{
____innerException_4 = value;
Il2CppCodeGenWriteBarrier((void**)(&____innerException_4), (void*)value);
}
inline static int32_t get_offset_of__helpURL_5() { return static_cast<int32_t>(offsetof(Exception_t, ____helpURL_5)); }
inline String_t* get__helpURL_5() const { return ____helpURL_5; }
inline String_t** get_address_of__helpURL_5() { return &____helpURL_5; }
inline void set__helpURL_5(String_t* value)
{
____helpURL_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&____helpURL_5), (void*)value);
}
inline static int32_t get_offset_of__stackTrace_6() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTrace_6)); }
inline RuntimeObject * get__stackTrace_6() const { return ____stackTrace_6; }
inline RuntimeObject ** get_address_of__stackTrace_6() { return &____stackTrace_6; }
inline void set__stackTrace_6(RuntimeObject * value)
{
____stackTrace_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&____stackTrace_6), (void*)value);
}
inline static int32_t get_offset_of__stackTraceString_7() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTraceString_7)); }
inline String_t* get__stackTraceString_7() const { return ____stackTraceString_7; }
inline String_t** get_address_of__stackTraceString_7() { return &____stackTraceString_7; }
inline void set__stackTraceString_7(String_t* value)
{
____stackTraceString_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&____stackTraceString_7), (void*)value);
}
inline static int32_t get_offset_of__remoteStackTraceString_8() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_8)); }
inline String_t* get__remoteStackTraceString_8() const { return ____remoteStackTraceString_8; }
inline String_t** get_address_of__remoteStackTraceString_8() { return &____remoteStackTraceString_8; }
inline void set__remoteStackTraceString_8(String_t* value)
{
____remoteStackTraceString_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&____remoteStackTraceString_8), (void*)value);
}
inline static int32_t get_offset_of__remoteStackIndex_9() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackIndex_9)); }
inline int32_t get__remoteStackIndex_9() const { return ____remoteStackIndex_9; }
inline int32_t* get_address_of__remoteStackIndex_9() { return &____remoteStackIndex_9; }
inline void set__remoteStackIndex_9(int32_t value)
{
____remoteStackIndex_9 = value;
}
inline static int32_t get_offset_of__dynamicMethods_10() { return static_cast<int32_t>(offsetof(Exception_t, ____dynamicMethods_10)); }
inline RuntimeObject * get__dynamicMethods_10() const { return ____dynamicMethods_10; }
inline RuntimeObject ** get_address_of__dynamicMethods_10() { return &____dynamicMethods_10; }
inline void set__dynamicMethods_10(RuntimeObject * value)
{
____dynamicMethods_10 = value;
Il2CppCodeGenWriteBarrier((void**)(&____dynamicMethods_10), (void*)value);
}
inline static int32_t get_offset_of__HResult_11() { return static_cast<int32_t>(offsetof(Exception_t, ____HResult_11)); }
inline int32_t get__HResult_11() const { return ____HResult_11; }
inline int32_t* get_address_of__HResult_11() { return &____HResult_11; }
inline void set__HResult_11(int32_t value)
{
____HResult_11 = value;
}
inline static int32_t get_offset_of__source_12() { return static_cast<int32_t>(offsetof(Exception_t, ____source_12)); }
inline String_t* get__source_12() const { return ____source_12; }
inline String_t** get_address_of__source_12() { return &____source_12; }
inline void set__source_12(String_t* value)
{
____source_12 = value;
Il2CppCodeGenWriteBarrier((void**)(&____source_12), (void*)value);
}
inline static int32_t get_offset_of__safeSerializationManager_13() { return static_cast<int32_t>(offsetof(Exception_t, ____safeSerializationManager_13)); }
inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * get__safeSerializationManager_13() const { return ____safeSerializationManager_13; }
inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 ** get_address_of__safeSerializationManager_13() { return &____safeSerializationManager_13; }
inline void set__safeSerializationManager_13(SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * value)
{
____safeSerializationManager_13 = value;
Il2CppCodeGenWriteBarrier((void**)(&____safeSerializationManager_13), (void*)value);
}
inline static int32_t get_offset_of_captured_traces_14() { return static_cast<int32_t>(offsetof(Exception_t, ___captured_traces_14)); }
inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* get_captured_traces_14() const { return ___captured_traces_14; }
inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196** get_address_of_captured_traces_14() { return &___captured_traces_14; }
inline void set_captured_traces_14(StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* value)
{
___captured_traces_14 = value;
Il2CppCodeGenWriteBarrier((void**)(&___captured_traces_14), (void*)value);
}
inline static int32_t get_offset_of_native_trace_ips_15() { return static_cast<int32_t>(offsetof(Exception_t, ___native_trace_ips_15)); }
inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* get_native_trace_ips_15() const { return ___native_trace_ips_15; }
inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD** get_address_of_native_trace_ips_15() { return &___native_trace_ips_15; }
inline void set_native_trace_ips_15(IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* value)
{
___native_trace_ips_15 = value;
Il2CppCodeGenWriteBarrier((void**)(&___native_trace_ips_15), (void*)value);
}
};
struct Exception_t_StaticFields
{
public:
// System.Object System.Exception::s_EDILock
RuntimeObject * ___s_EDILock_0;
public:
inline static int32_t get_offset_of_s_EDILock_0() { return static_cast<int32_t>(offsetof(Exception_t_StaticFields, ___s_EDILock_0)); }
inline RuntimeObject * get_s_EDILock_0() const { return ___s_EDILock_0; }
inline RuntimeObject ** get_address_of_s_EDILock_0() { return &___s_EDILock_0; }
inline void set_s_EDILock_0(RuntimeObject * value)
{
___s_EDILock_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___s_EDILock_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Exception
struct Exception_t_marshaled_pinvoke
{
char* ____className_1;
char* ____message_2;
RuntimeObject* ____data_3;
Exception_t_marshaled_pinvoke* ____innerException_4;
char* ____helpURL_5;
Il2CppIUnknown* ____stackTrace_6;
char* ____stackTraceString_7;
char* ____remoteStackTraceString_8;
int32_t ____remoteStackIndex_9;
Il2CppIUnknown* ____dynamicMethods_10;
int32_t ____HResult_11;
char* ____source_12;
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
Il2CppSafeArray/*NONE*/* ___native_trace_ips_15;
};
// Native definition for COM marshalling of System.Exception
struct Exception_t_marshaled_com
{
Il2CppChar* ____className_1;
Il2CppChar* ____message_2;
RuntimeObject* ____data_3;
Exception_t_marshaled_com* ____innerException_4;
Il2CppChar* ____helpURL_5;
Il2CppIUnknown* ____stackTrace_6;
Il2CppChar* ____stackTraceString_7;
Il2CppChar* ____remoteStackTraceString_8;
int32_t ____remoteStackIndex_9;
Il2CppIUnknown* ____dynamicMethods_10;
int32_t ____HResult_11;
Il2CppChar* ____source_12;
SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13;
StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14;
Il2CppSafeArray/*NONE*/* ___native_trace_ips_15;
};
// UnityEngine.AnimationEventSource
struct AnimationEventSource_t0CA86CB3D775209B46F475A99887C93530F20702
{
public:
// System.Int32 UnityEngine.AnimationEventSource::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(AnimationEventSource_t0CA86CB3D775209B46F475A99887C93530F20702, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.Animations.AnimationHumanStream
struct AnimationHumanStream_t4E6A2B8E37C9F4DCC77F8B2A802AD604EDEC4FB2
{
public:
// System.IntPtr UnityEngine.Animations.AnimationHumanStream::stream
intptr_t ___stream_0;
public:
inline static int32_t get_offset_of_stream_0() { return static_cast<int32_t>(offsetof(AnimationHumanStream_t4E6A2B8E37C9F4DCC77F8B2A802AD604EDEC4FB2, ___stream_0)); }
inline intptr_t get_stream_0() const { return ___stream_0; }
inline intptr_t* get_address_of_stream_0() { return &___stream_0; }
inline void set_stream_0(intptr_t value)
{
___stream_0 = value;
}
};
// UnityEngine.Animations.AnimationStream
struct AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E
{
public:
// System.UInt32 UnityEngine.Animations.AnimationStream::m_AnimatorBindingsVersion
uint32_t ___m_AnimatorBindingsVersion_0;
// System.IntPtr UnityEngine.Animations.AnimationStream::constant
intptr_t ___constant_1;
// System.IntPtr UnityEngine.Animations.AnimationStream::input
intptr_t ___input_2;
// System.IntPtr UnityEngine.Animations.AnimationStream::output
intptr_t ___output_3;
// System.IntPtr UnityEngine.Animations.AnimationStream::workspace
intptr_t ___workspace_4;
// System.IntPtr UnityEngine.Animations.AnimationStream::inputStreamAccessor
intptr_t ___inputStreamAccessor_5;
// System.IntPtr UnityEngine.Animations.AnimationStream::animationHandleBinder
intptr_t ___animationHandleBinder_6;
public:
inline static int32_t get_offset_of_m_AnimatorBindingsVersion_0() { return static_cast<int32_t>(offsetof(AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E, ___m_AnimatorBindingsVersion_0)); }
inline uint32_t get_m_AnimatorBindingsVersion_0() const { return ___m_AnimatorBindingsVersion_0; }
inline uint32_t* get_address_of_m_AnimatorBindingsVersion_0() { return &___m_AnimatorBindingsVersion_0; }
inline void set_m_AnimatorBindingsVersion_0(uint32_t value)
{
___m_AnimatorBindingsVersion_0 = value;
}
inline static int32_t get_offset_of_constant_1() { return static_cast<int32_t>(offsetof(AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E, ___constant_1)); }
inline intptr_t get_constant_1() const { return ___constant_1; }
inline intptr_t* get_address_of_constant_1() { return &___constant_1; }
inline void set_constant_1(intptr_t value)
{
___constant_1 = value;
}
inline static int32_t get_offset_of_input_2() { return static_cast<int32_t>(offsetof(AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E, ___input_2)); }
inline intptr_t get_input_2() const { return ___input_2; }
inline intptr_t* get_address_of_input_2() { return &___input_2; }
inline void set_input_2(intptr_t value)
{
___input_2 = value;
}
inline static int32_t get_offset_of_output_3() { return static_cast<int32_t>(offsetof(AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E, ___output_3)); }
inline intptr_t get_output_3() const { return ___output_3; }
inline intptr_t* get_address_of_output_3() { return &___output_3; }
inline void set_output_3(intptr_t value)
{
___output_3 = value;
}
inline static int32_t get_offset_of_workspace_4() { return static_cast<int32_t>(offsetof(AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E, ___workspace_4)); }
inline intptr_t get_workspace_4() const { return ___workspace_4; }
inline intptr_t* get_address_of_workspace_4() { return &___workspace_4; }
inline void set_workspace_4(intptr_t value)
{
___workspace_4 = value;
}
inline static int32_t get_offset_of_inputStreamAccessor_5() { return static_cast<int32_t>(offsetof(AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E, ___inputStreamAccessor_5)); }
inline intptr_t get_inputStreamAccessor_5() const { return ___inputStreamAccessor_5; }
inline intptr_t* get_address_of_inputStreamAccessor_5() { return &___inputStreamAccessor_5; }
inline void set_inputStreamAccessor_5(intptr_t value)
{
___inputStreamAccessor_5 = value;
}
inline static int32_t get_offset_of_animationHandleBinder_6() { return static_cast<int32_t>(offsetof(AnimationStream_t2104CE46F2C21C34F635E991A1BEE4B8924D188E, ___animationHandleBinder_6)); }
inline intptr_t get_animationHandleBinder_6() const { return ___animationHandleBinder_6; }
inline intptr_t* get_address_of_animationHandleBinder_6() { return &___animationHandleBinder_6; }
inline void set_animationHandleBinder_6(intptr_t value)
{
___animationHandleBinder_6 = value;
}
};
// UnityEngine.HumanLimit
struct HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3
{
public:
// UnityEngine.Vector3 UnityEngine.HumanLimit::m_Min
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___m_Min_0;
// UnityEngine.Vector3 UnityEngine.HumanLimit::m_Max
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___m_Max_1;
// UnityEngine.Vector3 UnityEngine.HumanLimit::m_Center
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___m_Center_2;
// System.Single UnityEngine.HumanLimit::m_AxisLength
float ___m_AxisLength_3;
// System.Int32 UnityEngine.HumanLimit::m_UseDefaultValues
int32_t ___m_UseDefaultValues_4;
public:
inline static int32_t get_offset_of_m_Min_0() { return static_cast<int32_t>(offsetof(HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3, ___m_Min_0)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_m_Min_0() const { return ___m_Min_0; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_m_Min_0() { return &___m_Min_0; }
inline void set_m_Min_0(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___m_Min_0 = value;
}
inline static int32_t get_offset_of_m_Max_1() { return static_cast<int32_t>(offsetof(HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3, ___m_Max_1)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_m_Max_1() const { return ___m_Max_1; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_m_Max_1() { return &___m_Max_1; }
inline void set_m_Max_1(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___m_Max_1 = value;
}
inline static int32_t get_offset_of_m_Center_2() { return static_cast<int32_t>(offsetof(HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3, ___m_Center_2)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_m_Center_2() const { return ___m_Center_2; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_m_Center_2() { return &___m_Center_2; }
inline void set_m_Center_2(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___m_Center_2 = value;
}
inline static int32_t get_offset_of_m_AxisLength_3() { return static_cast<int32_t>(offsetof(HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3, ___m_AxisLength_3)); }
inline float get_m_AxisLength_3() const { return ___m_AxisLength_3; }
inline float* get_address_of_m_AxisLength_3() { return &___m_AxisLength_3; }
inline void set_m_AxisLength_3(float value)
{
___m_AxisLength_3 = value;
}
inline static int32_t get_offset_of_m_UseDefaultValues_4() { return static_cast<int32_t>(offsetof(HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3, ___m_UseDefaultValues_4)); }
inline int32_t get_m_UseDefaultValues_4() const { return ___m_UseDefaultValues_4; }
inline int32_t* get_address_of_m_UseDefaultValues_4() { return &___m_UseDefaultValues_4; }
inline void set_m_UseDefaultValues_4(int32_t value)
{
___m_UseDefaultValues_4 = value;
}
};
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.Object::m_CachedPtr
intptr_t ___m_CachedPtr_0;
public:
inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0, ___m_CachedPtr_0)); }
inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; }
inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; }
inline void set_m_CachedPtr_0(intptr_t value)
{
___m_CachedPtr_0 = value;
}
};
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields
{
public:
// System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject
int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1;
public:
inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); }
inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value)
{
___OffsetOfInstanceIDInCPlusPlusObject_1 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke
{
intptr_t ___m_CachedPtr_0;
};
// Native definition for COM marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com
{
intptr_t ___m_CachedPtr_0;
};
// UnityEngine.Playables.PlayableHandle
struct PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182
{
public:
// System.IntPtr UnityEngine.Playables.PlayableHandle::m_Handle
intptr_t ___m_Handle_0;
// System.UInt32 UnityEngine.Playables.PlayableHandle::m_Version
uint32_t ___m_Version_1;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182, ___m_Handle_0)); }
inline intptr_t get_m_Handle_0() const { return ___m_Handle_0; }
inline intptr_t* get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(intptr_t value)
{
___m_Handle_0 = value;
}
inline static int32_t get_offset_of_m_Version_1() { return static_cast<int32_t>(offsetof(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182, ___m_Version_1)); }
inline uint32_t get_m_Version_1() const { return ___m_Version_1; }
inline uint32_t* get_address_of_m_Version_1() { return &___m_Version_1; }
inline void set_m_Version_1(uint32_t value)
{
___m_Version_1 = value;
}
};
struct PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_StaticFields
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Playables.PlayableHandle::m_Null
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Null_2;
public:
inline static int32_t get_offset_of_m_Null_2() { return static_cast<int32_t>(offsetof(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_StaticFields, ___m_Null_2)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Null_2() const { return ___m_Null_2; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Null_2() { return &___m_Null_2; }
inline void set_m_Null_2(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Null_2 = value;
}
};
// UnityEngine.Playables.PlayableOutputHandle
struct PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922
{
public:
// System.IntPtr UnityEngine.Playables.PlayableOutputHandle::m_Handle
intptr_t ___m_Handle_0;
// System.UInt32 UnityEngine.Playables.PlayableOutputHandle::m_Version
uint32_t ___m_Version_1;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922, ___m_Handle_0)); }
inline intptr_t get_m_Handle_0() const { return ___m_Handle_0; }
inline intptr_t* get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(intptr_t value)
{
___m_Handle_0 = value;
}
inline static int32_t get_offset_of_m_Version_1() { return static_cast<int32_t>(offsetof(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922, ___m_Version_1)); }
inline uint32_t get_m_Version_1() const { return ___m_Version_1; }
inline uint32_t* get_address_of_m_Version_1() { return &___m_Version_1; }
inline void set_m_Version_1(uint32_t value)
{
___m_Version_1 = value;
}
};
struct PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922_StaticFields
{
public:
// UnityEngine.Playables.PlayableOutputHandle UnityEngine.Playables.PlayableOutputHandle::m_Null
PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 ___m_Null_2;
public:
inline static int32_t get_offset_of_m_Null_2() { return static_cast<int32_t>(offsetof(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922_StaticFields, ___m_Null_2)); }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 get_m_Null_2() const { return ___m_Null_2; }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 * get_address_of_m_Null_2() { return &___m_Null_2; }
inline void set_m_Null_2(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 value)
{
___m_Null_2 = value;
}
};
// UnityEngine.SkeletonBone
struct SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5
{
public:
// System.String UnityEngine.SkeletonBone::name
String_t* ___name_0;
// System.String UnityEngine.SkeletonBone::parentName
String_t* ___parentName_1;
// UnityEngine.Vector3 UnityEngine.SkeletonBone::position
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___position_2;
// UnityEngine.Quaternion UnityEngine.SkeletonBone::rotation
Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 ___rotation_3;
// UnityEngine.Vector3 UnityEngine.SkeletonBone::scale
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___scale_4;
public:
inline static int32_t get_offset_of_name_0() { return static_cast<int32_t>(offsetof(SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5, ___name_0)); }
inline String_t* get_name_0() const { return ___name_0; }
inline String_t** get_address_of_name_0() { return &___name_0; }
inline void set_name_0(String_t* value)
{
___name_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___name_0), (void*)value);
}
inline static int32_t get_offset_of_parentName_1() { return static_cast<int32_t>(offsetof(SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5, ___parentName_1)); }
inline String_t* get_parentName_1() const { return ___parentName_1; }
inline String_t** get_address_of_parentName_1() { return &___parentName_1; }
inline void set_parentName_1(String_t* value)
{
___parentName_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___parentName_1), (void*)value);
}
inline static int32_t get_offset_of_position_2() { return static_cast<int32_t>(offsetof(SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5, ___position_2)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_position_2() const { return ___position_2; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_position_2() { return &___position_2; }
inline void set_position_2(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___position_2 = value;
}
inline static int32_t get_offset_of_rotation_3() { return static_cast<int32_t>(offsetof(SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5, ___rotation_3)); }
inline Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 get_rotation_3() const { return ___rotation_3; }
inline Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 * get_address_of_rotation_3() { return &___rotation_3; }
inline void set_rotation_3(Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 value)
{
___rotation_3 = value;
}
inline static int32_t get_offset_of_scale_4() { return static_cast<int32_t>(offsetof(SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5, ___scale_4)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_scale_4() const { return ___scale_4; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_scale_4() { return &___scale_4; }
inline void set_scale_4(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___scale_4 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.SkeletonBone
struct SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_pinvoke
{
char* ___name_0;
char* ___parentName_1;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___position_2;
Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 ___rotation_3;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___scale_4;
};
// Native definition for COM marshalling of UnityEngine.SkeletonBone
struct SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_com
{
Il2CppChar* ___name_0;
Il2CppChar* ___parentName_1;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___position_2;
Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 ___rotation_3;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___scale_4;
};
// UnityEngine.TrackedReference
struct TrackedReference_tE93229EF7055CBB35B2A98DD2493947428D06107 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.TrackedReference::m_Ptr
intptr_t ___m_Ptr_0;
public:
inline static int32_t get_offset_of_m_Ptr_0() { return static_cast<int32_t>(offsetof(TrackedReference_tE93229EF7055CBB35B2A98DD2493947428D06107, ___m_Ptr_0)); }
inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; }
inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; }
inline void set_m_Ptr_0(intptr_t value)
{
___m_Ptr_0 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.TrackedReference
struct TrackedReference_tE93229EF7055CBB35B2A98DD2493947428D06107_marshaled_pinvoke
{
intptr_t ___m_Ptr_0;
};
// Native definition for COM marshalling of UnityEngine.TrackedReference
struct TrackedReference_tE93229EF7055CBB35B2A98DD2493947428D06107_marshaled_com
{
intptr_t ___m_Ptr_0;
};
// System.MulticastDelegate
struct MulticastDelegate_t : public Delegate_t
{
public:
// System.Delegate[] System.MulticastDelegate::delegates
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11;
public:
inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* get_delegates_11() const { return ___delegates_11; }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86** get_address_of_delegates_11() { return &___delegates_11; }
inline void set_delegates_11(DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* value)
{
___delegates_11 = value;
Il2CppCodeGenWriteBarrier((void**)(&___delegates_11), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t_marshaled_pinvoke
{
Delegate_t_marshaled_pinvoke** ___delegates_11;
};
// Native definition for COM marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_com : public Delegate_t_marshaled_com
{
Delegate_t_marshaled_com** ___delegates_11;
};
// System.SystemException
struct SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782 : public Exception_t
{
public:
public:
};
// UnityEngine.AnimationEvent
struct AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F : public RuntimeObject
{
public:
// System.Single UnityEngine.AnimationEvent::m_Time
float ___m_Time_0;
// System.String UnityEngine.AnimationEvent::m_FunctionName
String_t* ___m_FunctionName_1;
// System.String UnityEngine.AnimationEvent::m_StringParameter
String_t* ___m_StringParameter_2;
// UnityEngine.Object UnityEngine.AnimationEvent::m_ObjectReferenceParameter
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___m_ObjectReferenceParameter_3;
// System.Single UnityEngine.AnimationEvent::m_FloatParameter
float ___m_FloatParameter_4;
// System.Int32 UnityEngine.AnimationEvent::m_IntParameter
int32_t ___m_IntParameter_5;
// System.Int32 UnityEngine.AnimationEvent::m_MessageOptions
int32_t ___m_MessageOptions_6;
// UnityEngine.AnimationEventSource UnityEngine.AnimationEvent::m_Source
int32_t ___m_Source_7;
// UnityEngine.AnimationState UnityEngine.AnimationEvent::m_StateSender
AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 * ___m_StateSender_8;
// UnityEngine.AnimatorStateInfo UnityEngine.AnimationEvent::m_AnimatorStateInfo
AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___m_AnimatorStateInfo_9;
// UnityEngine.AnimatorClipInfo UnityEngine.AnimationEvent::m_AnimatorClipInfo
AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180 ___m_AnimatorClipInfo_10;
public:
inline static int32_t get_offset_of_m_Time_0() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_Time_0)); }
inline float get_m_Time_0() const { return ___m_Time_0; }
inline float* get_address_of_m_Time_0() { return &___m_Time_0; }
inline void set_m_Time_0(float value)
{
___m_Time_0 = value;
}
inline static int32_t get_offset_of_m_FunctionName_1() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_FunctionName_1)); }
inline String_t* get_m_FunctionName_1() const { return ___m_FunctionName_1; }
inline String_t** get_address_of_m_FunctionName_1() { return &___m_FunctionName_1; }
inline void set_m_FunctionName_1(String_t* value)
{
___m_FunctionName_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_FunctionName_1), (void*)value);
}
inline static int32_t get_offset_of_m_StringParameter_2() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_StringParameter_2)); }
inline String_t* get_m_StringParameter_2() const { return ___m_StringParameter_2; }
inline String_t** get_address_of_m_StringParameter_2() { return &___m_StringParameter_2; }
inline void set_m_StringParameter_2(String_t* value)
{
___m_StringParameter_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_StringParameter_2), (void*)value);
}
inline static int32_t get_offset_of_m_ObjectReferenceParameter_3() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_ObjectReferenceParameter_3)); }
inline Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * get_m_ObjectReferenceParameter_3() const { return ___m_ObjectReferenceParameter_3; }
inline Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 ** get_address_of_m_ObjectReferenceParameter_3() { return &___m_ObjectReferenceParameter_3; }
inline void set_m_ObjectReferenceParameter_3(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * value)
{
___m_ObjectReferenceParameter_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_ObjectReferenceParameter_3), (void*)value);
}
inline static int32_t get_offset_of_m_FloatParameter_4() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_FloatParameter_4)); }
inline float get_m_FloatParameter_4() const { return ___m_FloatParameter_4; }
inline float* get_address_of_m_FloatParameter_4() { return &___m_FloatParameter_4; }
inline void set_m_FloatParameter_4(float value)
{
___m_FloatParameter_4 = value;
}
inline static int32_t get_offset_of_m_IntParameter_5() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_IntParameter_5)); }
inline int32_t get_m_IntParameter_5() const { return ___m_IntParameter_5; }
inline int32_t* get_address_of_m_IntParameter_5() { return &___m_IntParameter_5; }
inline void set_m_IntParameter_5(int32_t value)
{
___m_IntParameter_5 = value;
}
inline static int32_t get_offset_of_m_MessageOptions_6() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_MessageOptions_6)); }
inline int32_t get_m_MessageOptions_6() const { return ___m_MessageOptions_6; }
inline int32_t* get_address_of_m_MessageOptions_6() { return &___m_MessageOptions_6; }
inline void set_m_MessageOptions_6(int32_t value)
{
___m_MessageOptions_6 = value;
}
inline static int32_t get_offset_of_m_Source_7() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_Source_7)); }
inline int32_t get_m_Source_7() const { return ___m_Source_7; }
inline int32_t* get_address_of_m_Source_7() { return &___m_Source_7; }
inline void set_m_Source_7(int32_t value)
{
___m_Source_7 = value;
}
inline static int32_t get_offset_of_m_StateSender_8() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_StateSender_8)); }
inline AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 * get_m_StateSender_8() const { return ___m_StateSender_8; }
inline AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 ** get_address_of_m_StateSender_8() { return &___m_StateSender_8; }
inline void set_m_StateSender_8(AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 * value)
{
___m_StateSender_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_StateSender_8), (void*)value);
}
inline static int32_t get_offset_of_m_AnimatorStateInfo_9() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_AnimatorStateInfo_9)); }
inline AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 get_m_AnimatorStateInfo_9() const { return ___m_AnimatorStateInfo_9; }
inline AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 * get_address_of_m_AnimatorStateInfo_9() { return &___m_AnimatorStateInfo_9; }
inline void set_m_AnimatorStateInfo_9(AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 value)
{
___m_AnimatorStateInfo_9 = value;
}
inline static int32_t get_offset_of_m_AnimatorClipInfo_10() { return static_cast<int32_t>(offsetof(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F, ___m_AnimatorClipInfo_10)); }
inline AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180 get_m_AnimatorClipInfo_10() const { return ___m_AnimatorClipInfo_10; }
inline AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180 * get_address_of_m_AnimatorClipInfo_10() { return &___m_AnimatorClipInfo_10; }
inline void set_m_AnimatorClipInfo_10(AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180 value)
{
___m_AnimatorClipInfo_10 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.AnimationEvent
struct AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_pinvoke
{
float ___m_Time_0;
char* ___m_FunctionName_1;
char* ___m_StringParameter_2;
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke ___m_ObjectReferenceParameter_3;
float ___m_FloatParameter_4;
int32_t ___m_IntParameter_5;
int32_t ___m_MessageOptions_6;
int32_t ___m_Source_7;
AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 * ___m_StateSender_8;
AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___m_AnimatorStateInfo_9;
AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180 ___m_AnimatorClipInfo_10;
};
// Native definition for COM marshalling of UnityEngine.AnimationEvent
struct AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_com
{
float ___m_Time_0;
Il2CppChar* ___m_FunctionName_1;
Il2CppChar* ___m_StringParameter_2;
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com* ___m_ObjectReferenceParameter_3;
float ___m_FloatParameter_4;
int32_t ___m_IntParameter_5;
int32_t ___m_MessageOptions_6;
int32_t ___m_Source_7;
AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 * ___m_StateSender_8;
AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___m_AnimatorStateInfo_9;
AnimatorClipInfo_t78457ABBA83D388EDFF26F436F5E61A29CF4E180 ___m_AnimatorClipInfo_10;
};
// UnityEngine.AnimationState
struct AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 : public TrackedReference_tE93229EF7055CBB35B2A98DD2493947428D06107
{
public:
public:
};
// UnityEngine.Animations.AnimationClipPlayable
struct AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationClipPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
// UnityEngine.Animations.AnimationLayerMixerPlayable
struct AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationLayerMixerPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_StaticFields
{
public:
// UnityEngine.Animations.AnimationLayerMixerPlayable UnityEngine.Animations.AnimationLayerMixerPlayable::m_NullPlayable
AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_StaticFields, ___m_NullPlayable_1)); }
inline AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Animations.AnimationMixerPlayable
struct AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationMixerPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_StaticFields
{
public:
// UnityEngine.Animations.AnimationMixerPlayable UnityEngine.Animations.AnimationMixerPlayable::m_NullPlayable
AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_StaticFields, ___m_NullPlayable_1)); }
inline AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Animations.AnimationMotionXToDeltaPlayable
struct AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationMotionXToDeltaPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_StaticFields
{
public:
// UnityEngine.Animations.AnimationMotionXToDeltaPlayable UnityEngine.Animations.AnimationMotionXToDeltaPlayable::m_NullPlayable
AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_StaticFields, ___m_NullPlayable_1)); }
inline AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Animations.AnimationOffsetPlayable
struct AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationOffsetPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_StaticFields
{
public:
// UnityEngine.Animations.AnimationOffsetPlayable UnityEngine.Animations.AnimationOffsetPlayable::m_NullPlayable
AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_StaticFields, ___m_NullPlayable_1)); }
inline AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Animations.AnimationPlayableOutput
struct AnimationPlayableOutput_tA10178429D6528BDB4516F6788CE680E349553E6
{
public:
// UnityEngine.Playables.PlayableOutputHandle UnityEngine.Animations.AnimationPlayableOutput::m_Handle
PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationPlayableOutput_tA10178429D6528BDB4516F6788CE680E349553E6, ___m_Handle_0)); }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 value)
{
___m_Handle_0 = value;
}
};
// UnityEngine.Animations.AnimationPosePlayable
struct AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationPosePlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_StaticFields
{
public:
// UnityEngine.Animations.AnimationPosePlayable UnityEngine.Animations.AnimationPosePlayable::m_NullPlayable
AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_StaticFields, ___m_NullPlayable_1)); }
inline AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Animations.AnimationRemoveScalePlayable
struct AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationRemoveScalePlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_StaticFields
{
public:
// UnityEngine.Animations.AnimationRemoveScalePlayable UnityEngine.Animations.AnimationRemoveScalePlayable::m_NullPlayable
AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_StaticFields, ___m_NullPlayable_1)); }
inline AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Animations.AnimationScriptPlayable
struct AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationScriptPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_StaticFields
{
public:
// UnityEngine.Animations.AnimationScriptPlayable UnityEngine.Animations.AnimationScriptPlayable::m_NullPlayable
AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_StaticFields, ___m_NullPlayable_1)); }
inline AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Animations.AnimatorControllerPlayable
struct AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimatorControllerPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
struct AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_StaticFields
{
public:
// UnityEngine.Animations.AnimatorControllerPlayable UnityEngine.Animations.AnimatorControllerPlayable::m_NullPlayable
AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___m_NullPlayable_1;
public:
inline static int32_t get_offset_of_m_NullPlayable_1() { return static_cast<int32_t>(offsetof(AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_StaticFields, ___m_NullPlayable_1)); }
inline AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B get_m_NullPlayable_1() const { return ___m_NullPlayable_1; }
inline AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * get_address_of_m_NullPlayable_1() { return &___m_NullPlayable_1; }
inline void set_m_NullPlayable_1(AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B value)
{
___m_NullPlayable_1 = value;
}
};
// UnityEngine.Component
struct Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
// UnityEngine.HumanBone
struct HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995
{
public:
// System.String UnityEngine.HumanBone::m_BoneName
String_t* ___m_BoneName_0;
// System.String UnityEngine.HumanBone::m_HumanName
String_t* ___m_HumanName_1;
// UnityEngine.HumanLimit UnityEngine.HumanBone::limit
HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 ___limit_2;
public:
inline static int32_t get_offset_of_m_BoneName_0() { return static_cast<int32_t>(offsetof(HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995, ___m_BoneName_0)); }
inline String_t* get_m_BoneName_0() const { return ___m_BoneName_0; }
inline String_t** get_address_of_m_BoneName_0() { return &___m_BoneName_0; }
inline void set_m_BoneName_0(String_t* value)
{
___m_BoneName_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_BoneName_0), (void*)value);
}
inline static int32_t get_offset_of_m_HumanName_1() { return static_cast<int32_t>(offsetof(HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995, ___m_HumanName_1)); }
inline String_t* get_m_HumanName_1() const { return ___m_HumanName_1; }
inline String_t** get_address_of_m_HumanName_1() { return &___m_HumanName_1; }
inline void set_m_HumanName_1(String_t* value)
{
___m_HumanName_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_HumanName_1), (void*)value);
}
inline static int32_t get_offset_of_limit_2() { return static_cast<int32_t>(offsetof(HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995, ___limit_2)); }
inline HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 get_limit_2() const { return ___limit_2; }
inline HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 * get_address_of_limit_2() { return &___limit_2; }
inline void set_limit_2(HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 value)
{
___limit_2 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.HumanBone
struct HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_pinvoke
{
char* ___m_BoneName_0;
char* ___m_HumanName_1;
HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 ___limit_2;
};
// Native definition for COM marshalling of UnityEngine.HumanBone
struct HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_com
{
Il2CppChar* ___m_BoneName_0;
Il2CppChar* ___m_HumanName_1;
HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 ___limit_2;
};
// UnityEngine.Motion
struct Motion_t497BF9244B6A769D1AE925C3876B187C56C8CF8F : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
// UnityEngine.RuntimeAnimatorController
struct RuntimeAnimatorController_tDA6672C8194522C2F60F8F2F241657E57C3520BD : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
// UnityEngine.ScriptableObject
struct ScriptableObject_tAB015486CEAB714DA0D5C1BA389B84FB90427734 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
// Native definition for P/Invoke marshalling of UnityEngine.ScriptableObject
struct ScriptableObject_tAB015486CEAB714DA0D5C1BA389B84FB90427734_marshaled_pinvoke : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke
{
};
// Native definition for COM marshalling of UnityEngine.ScriptableObject
struct ScriptableObject_tAB015486CEAB714DA0D5C1BA389B84FB90427734_marshaled_com : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com
{
};
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 : public MulticastDelegate_t
{
public:
public:
};
// System.InvalidCastException
struct InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA : public SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782
{
public:
public:
};
// System.InvalidOperationException
struct InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1 : public SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782
{
public:
public:
};
// UnityEngine.AnimationClip
struct AnimationClip_t336CFC94F6275526DC0B9BEEF833D4D89D6DEDDE : public Motion_t497BF9244B6A769D1AE925C3876B187C56C8CF8F
{
public:
public:
};
// UnityEngine.AnimatorOverrideController
struct AnimatorOverrideController_t130F04B57E753FD4288EF3235699ABE7C88FF312 : public RuntimeAnimatorController_tDA6672C8194522C2F60F8F2F241657E57C3520BD
{
public:
// UnityEngine.AnimatorOverrideController_OnOverrideControllerDirtyCallback UnityEngine.AnimatorOverrideController::OnOverrideControllerDirty
OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * ___OnOverrideControllerDirty_4;
public:
inline static int32_t get_offset_of_OnOverrideControllerDirty_4() { return static_cast<int32_t>(offsetof(AnimatorOverrideController_t130F04B57E753FD4288EF3235699ABE7C88FF312, ___OnOverrideControllerDirty_4)); }
inline OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * get_OnOverrideControllerDirty_4() const { return ___OnOverrideControllerDirty_4; }
inline OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E ** get_address_of_OnOverrideControllerDirty_4() { return &___OnOverrideControllerDirty_4; }
inline void set_OnOverrideControllerDirty_4(OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * value)
{
___OnOverrideControllerDirty_4 = value;
Il2CppCodeGenWriteBarrier((void**)(&___OnOverrideControllerDirty_4), (void*)value);
}
};
// UnityEngine.AnimatorOverrideController_OnOverrideControllerDirtyCallback
struct OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.Behaviour
struct Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8 : public Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621
{
public:
public:
};
// UnityEngine.StateMachineBehaviour
struct StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C : public ScriptableObject_tAB015486CEAB714DA0D5C1BA389B84FB90427734
{
public:
public:
};
// UnityEngine.Animator
struct Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A : public Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86 : public RuntimeArray
{
public:
ALIGN_FIELD (8) Delegate_t * m_Items[1];
public:
inline Delegate_t * GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline Delegate_t ** GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, Delegate_t * value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
inline Delegate_t * GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline Delegate_t ** GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, Delegate_t * value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
};
IL2CPP_EXTERN_C void Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshal_pinvoke(const Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0& unmarshaled, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke& marshaled);
IL2CPP_EXTERN_C void Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshal_pinvoke_back(const Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke& marshaled, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0& unmarshaled);
IL2CPP_EXTERN_C void Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshal_pinvoke_cleanup(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke& marshaled);
IL2CPP_EXTERN_C void Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshal_com(const Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0& unmarshaled, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com& marshaled);
IL2CPP_EXTERN_C void Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshal_com_back(const Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com& marshaled, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0& unmarshaled);
IL2CPP_EXTERN_C void Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshal_com_cleanup(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com& marshaled);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationLayerMixerPlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_mC3942EB4B00EAC10035AA7EBE23CA679C8790D20_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationMixerPlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_m172B8D6DA48AD49F0740833F7D18CD468B072E5E_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationMotionXToDeltaPlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_mCC63F3E0D55A21A9E56D80D26150AD2B78C6EC50_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationOffsetPlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_mF434E44E279E1DBD0887921B38A5C57812B1371A_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationPosePlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_m35A103AAF8E80E7C007214546C71B4E90901C2A2_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationRemoveScalePlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_m1E16540EE6283270E3DE85D46C3BE1F8B85E73C2_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationScriptPlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_m1767ADED196AAA8B4D6FBB9313003E33A967E799_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimatorControllerPlayable>()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsPlayableOfType_TisAnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_mC6A8CB67F39B0B39BF77ED6177B3C2DF1BC91533_gshared (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Void System.Object::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0 (RuntimeObject * __this, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationClipPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationClipPlayable_GetHandle_mB1B706B9ADB194766DC938C332469AC698AD0D9E (AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::op_Equality(UnityEngine.Playables.PlayableHandle,UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___x0, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___y1, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationClipPlayable::Equals(UnityEngine.Animations.AnimationClipPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationClipPlayable_Equals_m06BA3E1C3AE0CC205C8531CCF6596C99C8D927EE (AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 * __this, AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 ___other0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsValid()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059 (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationLayerMixerPlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_mC3942EB4B00EAC10035AA7EBE23CA679C8790D20 (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_mC3942EB4B00EAC10035AA7EBE23CA679C8790D20_gshared)(__this, method);
}
// System.Void System.InvalidCastException::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812 (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * __this, String_t* ___message0, const RuntimeMethod* method);
// System.Void UnityEngine.Animations.AnimationLayerMixerPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C (AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationLayerMixerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationLayerMixerPlayable_GetHandle_mD4159505D29B17D507599ED6FA3BEC1370691DB8 (AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationLayerMixerPlayable::Equals(UnityEngine.Animations.AnimationLayerMixerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationLayerMixerPlayable_Equals_m0A6A86FEDCE98E63B84BD01D0D362D03EA733E59 (AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * __this, AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 ___other0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Playables.PlayableHandle::get_Null()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1 (const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationMixerPlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_m172B8D6DA48AD49F0740833F7D18CD468B072E5E (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_m172B8D6DA48AD49F0740833F7D18CD468B072E5E_gshared)(__this, method);
}
// System.Void UnityEngine.Animations.AnimationMixerPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43 (AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationMixerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationMixerPlayable_GetHandle_mC5939239D7C47C6E0FF4EC72021EE793863BC567 (AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationMixerPlayable::Equals(UnityEngine.Animations.AnimationMixerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationMixerPlayable_Equals_m7CB1B61B74A6BE00A35AD072490F07D4C7A17B0F (AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * __this, AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A ___other0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationMotionXToDeltaPlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_mCC63F3E0D55A21A9E56D80D26150AD2B78C6EC50 (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_mCC63F3E0D55A21A9E56D80D26150AD2B78C6EC50_gshared)(__this, method);
}
// System.Void UnityEngine.Animations.AnimationMotionXToDeltaPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6 (AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationMotionXToDeltaPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationMotionXToDeltaPlayable_GetHandle_mE36F0671962333EAF5B434A062930D9E76A79076 (AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationMotionXToDeltaPlayable::Equals(UnityEngine.Animations.AnimationMotionXToDeltaPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationMotionXToDeltaPlayable_Equals_m53B4AAB54D7F3633C3954056F8C334BB8B7D590E (AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * __this, AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC ___other0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationOffsetPlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_mF434E44E279E1DBD0887921B38A5C57812B1371A (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_mF434E44E279E1DBD0887921B38A5C57812B1371A_gshared)(__this, method);
}
// System.Void UnityEngine.Animations.AnimationOffsetPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607 (AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationOffsetPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationOffsetPlayable_GetHandle_m5213878A6D7F29801F74CD3A8B866D444793665E (AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationOffsetPlayable::Equals(UnityEngine.Animations.AnimationOffsetPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationOffsetPlayable_Equals_m30B207FC6287EABF6FC1FDA47784322A3ABB98DF (AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * __this, AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E ___other0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationPosePlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_m35A103AAF8E80E7C007214546C71B4E90901C2A2 (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_m35A103AAF8E80E7C007214546C71B4E90901C2A2_gshared)(__this, method);
}
// System.Void UnityEngine.Animations.AnimationPosePlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D (AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationPosePlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationPosePlayable_GetHandle_m9D856E83755A447ABCD6C0D8FE011AFF659A016E (AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationPosePlayable::Equals(UnityEngine.Animations.AnimationPosePlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationPosePlayable_Equals_m4417430115DCF9B39D3E4B64424120CE7E555961 (AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * __this, AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 ___other0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationRemoveScalePlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_m1E16540EE6283270E3DE85D46C3BE1F8B85E73C2 (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_m1E16540EE6283270E3DE85D46C3BE1F8B85E73C2_gshared)(__this, method);
}
// System.Void UnityEngine.Animations.AnimationRemoveScalePlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1 (AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationRemoveScalePlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationRemoveScalePlayable_GetHandle_mA5063F10E01C8546F88E9ABE07B71373BF290EED (AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationRemoveScalePlayable::Equals(UnityEngine.Animations.AnimationRemoveScalePlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationRemoveScalePlayable_Equals_m58B139243E3B27CE86CA4CC470895BF719CD9BAD (AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * __this, AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B ___other0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimationScriptPlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_m1767ADED196AAA8B4D6FBB9313003E33A967E799 (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_m1767ADED196AAA8B4D6FBB9313003E33A967E799_gshared)(__this, method);
}
// System.Void UnityEngine.Animations.AnimationScriptPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412 (AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationScriptPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationScriptPlayable_GetHandle_m661730E4C17F10A8D3C46492A9AD1D61EF0F4315 (AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Animations.AnimationScriptPlayable::Equals(UnityEngine.Animations.AnimationScriptPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationScriptPlayable_Equals_m4995D1AD353F43FE3FA854A8384601F58156E69E (AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * __this, AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E ___other0, const RuntimeMethod* method);
// System.Void UnityEngine.Animations.AnimatorControllerPlayable::SetHandle(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// System.Void UnityEngine.Animations.AnimatorControllerPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimatorControllerPlayable__ctor_m739B1BFC592B6C160410141057F1B2BA1B971897 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimatorControllerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimatorControllerPlayable_GetHandle_mB83731910E1534BECA36F64BA22AA68A71D08CA8 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, const RuntimeMethod* method);
// System.Void System.InvalidOperationException::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void InvalidOperationException__ctor_m72027D5F1D513C25C05137E203EEED8FD8297706 (InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1 * __this, String_t* ___message0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::IsPlayableOfType<UnityEngine.Animations.AnimatorControllerPlayable>()
inline bool PlayableHandle_IsPlayableOfType_TisAnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_mC6A8CB67F39B0B39BF77ED6177B3C2DF1BC91533 (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * __this, const RuntimeMethod* method)
{
return (( bool (*) (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *, const RuntimeMethod*))PlayableHandle_IsPlayableOfType_TisAnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_mC6A8CB67F39B0B39BF77ED6177B3C2DF1BC91533_gshared)(__this, method);
}
// System.Boolean UnityEngine.Animations.AnimatorControllerPlayable::Equals(UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimatorControllerPlayable_Equals_m04685CCA5A5FC388A0387D3453A677C0CB47D173 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___other0, const RuntimeMethod* method);
// System.Void System.Attribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Attribute__ctor_m45CAD4B01265CC84CC5A84F62EE2DBE85DE89EC0 (Attribute_tF048C13FB3C8CFCC53F82290E4A3F621089F9A74 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Animator::SetTriggerString(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_SetTriggerString_m77CE57996467D0C973FA2D0CB4DF87BD062C8A1E (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___name0, const RuntimeMethod* method);
// System.Void UnityEngine.Animator::ResetTriggerString(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_ResetTriggerString_m31B233F948D7551D220FEDA56B002E6724B89851 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___name0, const RuntimeMethod* method);
// System.Void UnityEngine.Animator::Play(System.String,System.Int32,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_Play_m1942D7FB37F84959D2C6A859E11F70791E95FA50 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___stateName0, int32_t ___layer1, float ___normalizedTime2, const RuntimeMethod* method);
// System.Int32 UnityEngine.Animator::StringToHash(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Animator_StringToHash_m80E4CCCB84AAD032A5D84EF5832B7F35C1E5AE3F (String_t* ___name0, const RuntimeMethod* method);
// System.Void UnityEngine.Animator::Play(System.Int32,System.Int32,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_Play_m20B525F785DA59888E645125DB2DDC071E924F3E (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, int32_t ___stateNameHash0, int32_t ___layer1, float ___normalizedTime2, const RuntimeMethod* method);
// System.Void UnityEngine.AnimatorOverrideController/OnOverrideControllerDirtyCallback::Invoke()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void OnOverrideControllerDirtyCallback_Invoke_m002CFC2CE3C42A058380BE98F015E654D5F9F177 (OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * __this, const RuntimeMethod* method);
// System.Void UnityEngine.ScriptableObject::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ScriptableObject__ctor_m6E2B3821A4A361556FC12E9B1C71E1D5DC002C5B (ScriptableObject_tAB015486CEAB714DA0D5C1BA389B84FB90427734 * __this, const RuntimeMethod* method);
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: UnityEngine.AnimationEvent
IL2CPP_EXTERN_C void AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshal_pinvoke(const AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F& unmarshaled, AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_pinvoke& marshaled)
{
Exception_t* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception, NULL);
}
IL2CPP_EXTERN_C void AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshal_pinvoke_back(const AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_pinvoke& marshaled, AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F& unmarshaled)
{
Exception_t* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.AnimationEvent
IL2CPP_EXTERN_C void AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshal_pinvoke_cleanup(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_pinvoke& marshaled)
{
}
// Conversion methods for marshalling of: UnityEngine.AnimationEvent
IL2CPP_EXTERN_C void AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshal_com(const AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F& unmarshaled, AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_com& marshaled)
{
Exception_t* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception, NULL);
}
IL2CPP_EXTERN_C void AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshal_com_back(const AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_com& marshaled, AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F& unmarshaled)
{
Exception_t* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.AnimationEvent
IL2CPP_EXTERN_C void AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshal_com_cleanup(AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F_marshaled_com& marshaled)
{
}
// System.Void UnityEngine.AnimationEvent::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationEvent__ctor_m6C228EB716B6B53DE2665091C056428EFB90897F (AnimationEvent_tEDD4E45FEA5CA4657CBBF1E0CFF657191D90673F * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationEvent__ctor_m6C228EB716B6B53DE2665091C056428EFB90897F_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0(__this, /*hidden argument*/NULL);
__this->set_m_Time_0((0.0f));
__this->set_m_FunctionName_1(_stringLiteralDA39A3EE5E6B4B0D3255BFEF95601890AFD80709);
__this->set_m_StringParameter_2(_stringLiteralDA39A3EE5E6B4B0D3255BFEF95601890AFD80709);
__this->set_m_ObjectReferenceParameter_3((Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL);
__this->set_m_FloatParameter_4((0.0f));
__this->set_m_IntParameter_5(0);
__this->set_m_MessageOptions_6(0);
__this->set_m_Source_7(0);
__this->set_m_StateSender_8((AnimationState_t48FF4D41FEF3492F8286100BE3758CE3A4656386 *)NULL);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationClipPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationClipPlayable_GetHandle_mB1B706B9ADB194766DC938C332469AC698AD0D9E (AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationClipPlayable_GetHandle_mB1B706B9ADB194766DC938C332469AC698AD0D9E_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 * _thisAdjusted = reinterpret_cast<AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 *>(__this + _offset);
return AnimationClipPlayable_GetHandle_mB1B706B9ADB194766DC938C332469AC698AD0D9E(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationClipPlayable::Equals(UnityEngine.Animations.AnimationClipPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationClipPlayable_Equals_m06BA3E1C3AE0CC205C8531CCF6596C99C8D927EE (AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 * __this, AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationClipPlayable_Equals_m06BA3E1C3AE0CC205C8531CCF6596C99C8D927EE_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationClipPlayable_GetHandle_mB1B706B9ADB194766DC938C332469AC698AD0D9E((AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AnimationClipPlayable_GetHandle_mB1B706B9ADB194766DC938C332469AC698AD0D9E((AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0016;
}
IL_0016:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AnimationClipPlayable_Equals_m06BA3E1C3AE0CC205C8531CCF6596C99C8D927EE_AdjustorThunk (RuntimeObject * __this, AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 * _thisAdjusted = reinterpret_cast<AnimationClipPlayable_t6EF38F9EED94096D4793638AFC8D11D285B43183 *>(__this + _offset);
return AnimationClipPlayable_Equals_m06BA3E1C3AE0CC205C8531CCF6596C99C8D927EE(_thisAdjusted, ___other0, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimationLayerMixerPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C (AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
bool L_0 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = V_0;
if (!L_1)
{
goto IL_0027;
}
}
{
bool L_2 = PlayableHandle_IsPlayableOfType_TisAnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_mC3942EB4B00EAC10035AA7EBE23CA679C8790D20((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_mC3942EB4B00EAC10035AA7EBE23CA679C8790D20_RuntimeMethod_var);
V_1 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0);
bool L_3 = V_1;
if (!L_3)
{
goto IL_0026;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_4 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_4, _stringLiteral6502516F734DD885173E353D47AAEB82BC7070A9, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C_RuntimeMethod_var);
}
IL_0026:
{
}
IL_0027:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_5 = ___handle0;
__this->set_m_Handle_0(L_5);
return;
}
}
IL2CPP_EXTERN_C void AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * _thisAdjusted = reinterpret_cast<AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 *>(__this + _offset);
AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationLayerMixerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationLayerMixerPlayable_GetHandle_mD4159505D29B17D507599ED6FA3BEC1370691DB8 (AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationLayerMixerPlayable_GetHandle_mD4159505D29B17D507599ED6FA3BEC1370691DB8_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * _thisAdjusted = reinterpret_cast<AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 *>(__this + _offset);
return AnimationLayerMixerPlayable_GetHandle_mD4159505D29B17D507599ED6FA3BEC1370691DB8(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationLayerMixerPlayable::Equals(UnityEngine.Animations.AnimationLayerMixerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationLayerMixerPlayable_Equals_m0A6A86FEDCE98E63B84BD01D0D362D03EA733E59 (AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * __this, AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationLayerMixerPlayable_Equals_m0A6A86FEDCE98E63B84BD01D0D362D03EA733E59_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationLayerMixerPlayable_GetHandle_mD4159505D29B17D507599ED6FA3BEC1370691DB8((AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AnimationLayerMixerPlayable_GetHandle_mD4159505D29B17D507599ED6FA3BEC1370691DB8((AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0016;
}
IL_0016:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AnimationLayerMixerPlayable_Equals_m0A6A86FEDCE98E63B84BD01D0D362D03EA733E59_AdjustorThunk (RuntimeObject * __this, AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 * _thisAdjusted = reinterpret_cast<AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 *>(__this + _offset);
return AnimationLayerMixerPlayable_Equals_m0A6A86FEDCE98E63B84BD01D0D362D03EA733E59(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimationLayerMixerPlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationLayerMixerPlayable__cctor_m3712A5D44F275E70624C0D734C9CED9BD12D0AC9 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationLayerMixerPlayable__cctor_m3712A5D44F275E70624C0D734C9CED9BD12D0AC9_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371 L_1;
memset((&L_1), 0, sizeof(L_1));
AnimationLayerMixerPlayable__ctor_mA2156DFDEA435F14446528098837ED3FF6B7147C((&L_1), L_0, /*hidden argument*/NULL);
((AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_StaticFields*)il2cpp_codegen_static_fields_for(AnimationLayerMixerPlayable_t699CCDE32ABD6FC79BFC09064E473D785D9F9371_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimationMixerPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43 (AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
bool L_0 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = V_0;
if (!L_1)
{
goto IL_0027;
}
}
{
bool L_2 = PlayableHandle_IsPlayableOfType_TisAnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_m172B8D6DA48AD49F0740833F7D18CD468B072E5E((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_m172B8D6DA48AD49F0740833F7D18CD468B072E5E_RuntimeMethod_var);
V_1 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0);
bool L_3 = V_1;
if (!L_3)
{
goto IL_0026;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_4 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_4, _stringLiteral35482DF98E7DEED2FC6BDE9BDD1E273E27CF1F2C, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43_RuntimeMethod_var);
}
IL_0026:
{
}
IL_0027:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_5 = ___handle0;
__this->set_m_Handle_0(L_5);
return;
}
}
IL2CPP_EXTERN_C void AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * _thisAdjusted = reinterpret_cast<AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A *>(__this + _offset);
AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationMixerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationMixerPlayable_GetHandle_mC5939239D7C47C6E0FF4EC72021EE793863BC567 (AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationMixerPlayable_GetHandle_mC5939239D7C47C6E0FF4EC72021EE793863BC567_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * _thisAdjusted = reinterpret_cast<AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A *>(__this + _offset);
return AnimationMixerPlayable_GetHandle_mC5939239D7C47C6E0FF4EC72021EE793863BC567(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationMixerPlayable::Equals(UnityEngine.Animations.AnimationMixerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationMixerPlayable_Equals_m7CB1B61B74A6BE00A35AD072490F07D4C7A17B0F (AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * __this, AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationMixerPlayable_Equals_m7CB1B61B74A6BE00A35AD072490F07D4C7A17B0F_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationMixerPlayable_GetHandle_mC5939239D7C47C6E0FF4EC72021EE793863BC567((AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AnimationMixerPlayable_GetHandle_mC5939239D7C47C6E0FF4EC72021EE793863BC567((AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0016;
}
IL_0016:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AnimationMixerPlayable_Equals_m7CB1B61B74A6BE00A35AD072490F07D4C7A17B0F_AdjustorThunk (RuntimeObject * __this, AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A * _thisAdjusted = reinterpret_cast<AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A *>(__this + _offset);
return AnimationMixerPlayable_Equals_m7CB1B61B74A6BE00A35AD072490F07D4C7A17B0F(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimationMixerPlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationMixerPlayable__cctor_m820F56C1D4257D4F5446BD66402D4428E0DF8E3E (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationMixerPlayable__cctor_m820F56C1D4257D4F5446BD66402D4428E0DF8E3E_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A L_1;
memset((&L_1), 0, sizeof(L_1));
AnimationMixerPlayable__ctor_mD446E3257F803A3D4C04D394A75AA5376533CF43((&L_1), L_0, /*hidden argument*/NULL);
((AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_StaticFields*)il2cpp_codegen_static_fields_for(AnimationMixerPlayable_tA71C834654979CF92B034B537EE5A3DA9713030A_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimationMotionXToDeltaPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6 (AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
bool L_0 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = V_0;
if (!L_1)
{
goto IL_0027;
}
}
{
bool L_2 = PlayableHandle_IsPlayableOfType_TisAnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_mCC63F3E0D55A21A9E56D80D26150AD2B78C6EC50((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_mCC63F3E0D55A21A9E56D80D26150AD2B78C6EC50_RuntimeMethod_var);
V_1 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0);
bool L_3 = V_1;
if (!L_3)
{
goto IL_0026;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_4 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_4, _stringLiteral59BDBA16999CF4EF3F7712740907B2C5E860459C, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6_RuntimeMethod_var);
}
IL_0026:
{
}
IL_0027:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_5 = ___handle0;
__this->set_m_Handle_0(L_5);
return;
}
}
IL2CPP_EXTERN_C void AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * _thisAdjusted = reinterpret_cast<AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC *>(__this + _offset);
AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationMotionXToDeltaPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationMotionXToDeltaPlayable_GetHandle_mE36F0671962333EAF5B434A062930D9E76A79076 (AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationMotionXToDeltaPlayable_GetHandle_mE36F0671962333EAF5B434A062930D9E76A79076_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * _thisAdjusted = reinterpret_cast<AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC *>(__this + _offset);
return AnimationMotionXToDeltaPlayable_GetHandle_mE36F0671962333EAF5B434A062930D9E76A79076(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationMotionXToDeltaPlayable::Equals(UnityEngine.Animations.AnimationMotionXToDeltaPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationMotionXToDeltaPlayable_Equals_m53B4AAB54D7F3633C3954056F8C334BB8B7D590E (AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * __this, AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationMotionXToDeltaPlayable_Equals_m53B4AAB54D7F3633C3954056F8C334BB8B7D590E_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationMotionXToDeltaPlayable_GetHandle_mE36F0671962333EAF5B434A062930D9E76A79076((AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AnimationMotionXToDeltaPlayable_GetHandle_mE36F0671962333EAF5B434A062930D9E76A79076((AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0016;
}
IL_0016:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AnimationMotionXToDeltaPlayable_Equals_m53B4AAB54D7F3633C3954056F8C334BB8B7D590E_AdjustorThunk (RuntimeObject * __this, AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC * _thisAdjusted = reinterpret_cast<AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC *>(__this + _offset);
return AnimationMotionXToDeltaPlayable_Equals_m53B4AAB54D7F3633C3954056F8C334BB8B7D590E(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimationMotionXToDeltaPlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationMotionXToDeltaPlayable__cctor_mCB948CE31E0AAEC53CB1D6746D091604413C5EEE (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationMotionXToDeltaPlayable__cctor_mCB948CE31E0AAEC53CB1D6746D091604413C5EEE_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC L_1;
memset((&L_1), 0, sizeof(L_1));
AnimationMotionXToDeltaPlayable__ctor_mC51D5F76DD0CE29B305932303A4A5AA42ACCD9E6((&L_1), L_0, /*hidden argument*/NULL);
((AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_StaticFields*)il2cpp_codegen_static_fields_for(AnimationMotionXToDeltaPlayable_tA5F0BE3BA966E1A6661311F185C1544F90302CDC_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimationOffsetPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607 (AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
bool L_0 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = V_0;
if (!L_1)
{
goto IL_0027;
}
}
{
bool L_2 = PlayableHandle_IsPlayableOfType_TisAnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_mF434E44E279E1DBD0887921B38A5C57812B1371A((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_mF434E44E279E1DBD0887921B38A5C57812B1371A_RuntimeMethod_var);
V_1 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0);
bool L_3 = V_1;
if (!L_3)
{
goto IL_0026;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_4 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_4, _stringLiteral04E4E32AA834F9BA9336C5388E9470F196EB0891, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607_RuntimeMethod_var);
}
IL_0026:
{
}
IL_0027:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_5 = ___handle0;
__this->set_m_Handle_0(L_5);
return;
}
}
IL2CPP_EXTERN_C void AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * _thisAdjusted = reinterpret_cast<AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E *>(__this + _offset);
AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationOffsetPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationOffsetPlayable_GetHandle_m5213878A6D7F29801F74CD3A8B866D444793665E (AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationOffsetPlayable_GetHandle_m5213878A6D7F29801F74CD3A8B866D444793665E_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * _thisAdjusted = reinterpret_cast<AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E *>(__this + _offset);
return AnimationOffsetPlayable_GetHandle_m5213878A6D7F29801F74CD3A8B866D444793665E(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationOffsetPlayable::Equals(UnityEngine.Animations.AnimationOffsetPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationOffsetPlayable_Equals_m30B207FC6287EABF6FC1FDA47784322A3ABB98DF (AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * __this, AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationOffsetPlayable_Equals_m30B207FC6287EABF6FC1FDA47784322A3ABB98DF_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationOffsetPlayable_GetHandle_m5213878A6D7F29801F74CD3A8B866D444793665E((AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E *)(&___other0), /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = L_0;
RuntimeObject * L_2 = Box(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var, &L_1);
RuntimeObject * L_3 = Box(AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_il2cpp_TypeInfo_var, __this);
NullCheck(L_3);
bool L_4 = VirtFuncInvoker1< bool, RuntimeObject * >::Invoke(0 /* System.Boolean System.Object::Equals(System.Object) */, L_3, L_2);
*__this = *(AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E *)UnBox(L_3);
V_0 = L_4;
goto IL_001c;
}
IL_001c:
{
bool L_5 = V_0;
return L_5;
}
}
IL2CPP_EXTERN_C bool AnimationOffsetPlayable_Equals_m30B207FC6287EABF6FC1FDA47784322A3ABB98DF_AdjustorThunk (RuntimeObject * __this, AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E * _thisAdjusted = reinterpret_cast<AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E *>(__this + _offset);
return AnimationOffsetPlayable_Equals_m30B207FC6287EABF6FC1FDA47784322A3ABB98DF(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimationOffsetPlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationOffsetPlayable__cctor_m174AD41778526FA15E41C6A11303A4F190A4CEA6 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationOffsetPlayable__cctor_m174AD41778526FA15E41C6A11303A4F190A4CEA6_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E L_1;
memset((&L_1), 0, sizeof(L_1));
AnimationOffsetPlayable__ctor_m380B4761BE82E4684F82A18933DBBC79E3D5F607((&L_1), L_0, /*hidden argument*/NULL);
((AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_StaticFields*)il2cpp_codegen_static_fields_for(AnimationOffsetPlayable_t1534674D22C39D6ED74F24A108C3475C7301A93E_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimationPosePlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D (AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
bool L_0 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = V_0;
if (!L_1)
{
goto IL_0027;
}
}
{
bool L_2 = PlayableHandle_IsPlayableOfType_TisAnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_m35A103AAF8E80E7C007214546C71B4E90901C2A2((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_m35A103AAF8E80E7C007214546C71B4E90901C2A2_RuntimeMethod_var);
V_1 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0);
bool L_3 = V_1;
if (!L_3)
{
goto IL_0026;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_4 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_4, _stringLiteralFCF5307272E4A4426DDA9E4E6930E2B834B95B2C, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D_RuntimeMethod_var);
}
IL_0026:
{
}
IL_0027:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_5 = ___handle0;
__this->set_m_Handle_0(L_5);
return;
}
}
IL2CPP_EXTERN_C void AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * _thisAdjusted = reinterpret_cast<AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 *>(__this + _offset);
AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationPosePlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationPosePlayable_GetHandle_m9D856E83755A447ABCD6C0D8FE011AFF659A016E (AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationPosePlayable_GetHandle_m9D856E83755A447ABCD6C0D8FE011AFF659A016E_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * _thisAdjusted = reinterpret_cast<AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 *>(__this + _offset);
return AnimationPosePlayable_GetHandle_m9D856E83755A447ABCD6C0D8FE011AFF659A016E(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationPosePlayable::Equals(UnityEngine.Animations.AnimationPosePlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationPosePlayable_Equals_m4417430115DCF9B39D3E4B64424120CE7E555961 (AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * __this, AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationPosePlayable_Equals_m4417430115DCF9B39D3E4B64424120CE7E555961_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationPosePlayable_GetHandle_m9D856E83755A447ABCD6C0D8FE011AFF659A016E((AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 *)(&___other0), /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = L_0;
RuntimeObject * L_2 = Box(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var, &L_1);
RuntimeObject * L_3 = Box(AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_il2cpp_TypeInfo_var, __this);
NullCheck(L_3);
bool L_4 = VirtFuncInvoker1< bool, RuntimeObject * >::Invoke(0 /* System.Boolean System.Object::Equals(System.Object) */, L_3, L_2);
*__this = *(AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 *)UnBox(L_3);
V_0 = L_4;
goto IL_001c;
}
IL_001c:
{
bool L_5 = V_0;
return L_5;
}
}
IL2CPP_EXTERN_C bool AnimationPosePlayable_Equals_m4417430115DCF9B39D3E4B64424120CE7E555961_AdjustorThunk (RuntimeObject * __this, AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 * _thisAdjusted = reinterpret_cast<AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 *>(__this + _offset);
return AnimationPosePlayable_Equals_m4417430115DCF9B39D3E4B64424120CE7E555961(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimationPosePlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationPosePlayable__cctor_mDE42A26BC2624427AA8086C4AB69FB531949153F (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationPosePlayable__cctor_mDE42A26BC2624427AA8086C4AB69FB531949153F_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07 L_1;
memset((&L_1), 0, sizeof(L_1));
AnimationPosePlayable__ctor_mF02468DCD2C8C0226C89C4DF90454DD9D230595D((&L_1), L_0, /*hidden argument*/NULL);
((AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_StaticFields*)il2cpp_codegen_static_fields_for(AnimationPosePlayable_t92EAB5BB4093D236F90ED0242488039EA87AFA07_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimationRemoveScalePlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1 (AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
bool L_0 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = V_0;
if (!L_1)
{
goto IL_0027;
}
}
{
bool L_2 = PlayableHandle_IsPlayableOfType_TisAnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_m1E16540EE6283270E3DE85D46C3BE1F8B85E73C2((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_m1E16540EE6283270E3DE85D46C3BE1F8B85E73C2_RuntimeMethod_var);
V_1 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0);
bool L_3 = V_1;
if (!L_3)
{
goto IL_0026;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_4 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_4, _stringLiteralB9DF0CBB713EC6E9DFD70C9BFB0B820148433428, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1_RuntimeMethod_var);
}
IL_0026:
{
}
IL_0027:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_5 = ___handle0;
__this->set_m_Handle_0(L_5);
return;
}
}
IL2CPP_EXTERN_C void AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * _thisAdjusted = reinterpret_cast<AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B *>(__this + _offset);
AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationRemoveScalePlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationRemoveScalePlayable_GetHandle_mA5063F10E01C8546F88E9ABE07B71373BF290EED (AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationRemoveScalePlayable_GetHandle_mA5063F10E01C8546F88E9ABE07B71373BF290EED_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * _thisAdjusted = reinterpret_cast<AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B *>(__this + _offset);
return AnimationRemoveScalePlayable_GetHandle_mA5063F10E01C8546F88E9ABE07B71373BF290EED(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationRemoveScalePlayable::Equals(UnityEngine.Animations.AnimationRemoveScalePlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationRemoveScalePlayable_Equals_m58B139243E3B27CE86CA4CC470895BF719CD9BAD (AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * __this, AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationRemoveScalePlayable_Equals_m58B139243E3B27CE86CA4CC470895BF719CD9BAD_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationRemoveScalePlayable_GetHandle_mA5063F10E01C8546F88E9ABE07B71373BF290EED((AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B *)(&___other0), /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = L_0;
RuntimeObject * L_2 = Box(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var, &L_1);
RuntimeObject * L_3 = Box(AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_il2cpp_TypeInfo_var, __this);
NullCheck(L_3);
bool L_4 = VirtFuncInvoker1< bool, RuntimeObject * >::Invoke(0 /* System.Boolean System.Object::Equals(System.Object) */, L_3, L_2);
*__this = *(AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B *)UnBox(L_3);
V_0 = L_4;
goto IL_001c;
}
IL_001c:
{
bool L_5 = V_0;
return L_5;
}
}
IL2CPP_EXTERN_C bool AnimationRemoveScalePlayable_Equals_m58B139243E3B27CE86CA4CC470895BF719CD9BAD_AdjustorThunk (RuntimeObject * __this, AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B * _thisAdjusted = reinterpret_cast<AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B *>(__this + _offset);
return AnimationRemoveScalePlayable_Equals_m58B139243E3B27CE86CA4CC470895BF719CD9BAD(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimationRemoveScalePlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationRemoveScalePlayable__cctor_m7BA13559FDA2BF8E061839B333085C402DED6829 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationRemoveScalePlayable__cctor_m7BA13559FDA2BF8E061839B333085C402DED6829_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B L_1;
memset((&L_1), 0, sizeof(L_1));
AnimationRemoveScalePlayable__ctor_mB06216973E6B635E7F4A3C8E372E5F7E89D327E1((&L_1), L_0, /*hidden argument*/NULL);
((AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_StaticFields*)il2cpp_codegen_static_fields_for(AnimationRemoveScalePlayable_t02381EE856ADF73C82C1EA6D2AD1878EC5879A7B_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimationScriptPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412 (AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
bool L_0 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = V_0;
if (!L_1)
{
goto IL_0027;
}
}
{
bool L_2 = PlayableHandle_IsPlayableOfType_TisAnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_m1767ADED196AAA8B4D6FBB9313003E33A967E799((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_m1767ADED196AAA8B4D6FBB9313003E33A967E799_RuntimeMethod_var);
V_1 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0);
bool L_3 = V_1;
if (!L_3)
{
goto IL_0026;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_4 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_4, _stringLiteral4518459D262696CF9B5DAB1E0A1BC3AC2F9BD9DF, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412_RuntimeMethod_var);
}
IL_0026:
{
}
IL_0027:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_5 = ___handle0;
__this->set_m_Handle_0(L_5);
return;
}
}
IL2CPP_EXTERN_C void AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * _thisAdjusted = reinterpret_cast<AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E *>(__this + _offset);
AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimationScriptPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationScriptPlayable_GetHandle_m661730E4C17F10A8D3C46492A9AD1D61EF0F4315 (AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimationScriptPlayable_GetHandle_m661730E4C17F10A8D3C46492A9AD1D61EF0F4315_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * _thisAdjusted = reinterpret_cast<AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E *>(__this + _offset);
return AnimationScriptPlayable_GetHandle_m661730E4C17F10A8D3C46492A9AD1D61EF0F4315(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Animations.AnimationScriptPlayable::Equals(UnityEngine.Animations.AnimationScriptPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimationScriptPlayable_Equals_m4995D1AD353F43FE3FA854A8384601F58156E69E (AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * __this, AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationScriptPlayable_Equals_m4995D1AD353F43FE3FA854A8384601F58156E69E_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimationScriptPlayable_GetHandle_m661730E4C17F10A8D3C46492A9AD1D61EF0F4315((AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AnimationScriptPlayable_GetHandle_m661730E4C17F10A8D3C46492A9AD1D61EF0F4315((AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0016;
}
IL_0016:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AnimationScriptPlayable_Equals_m4995D1AD353F43FE3FA854A8384601F58156E69E_AdjustorThunk (RuntimeObject * __this, AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E * _thisAdjusted = reinterpret_cast<AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E *>(__this + _offset);
return AnimationScriptPlayable_Equals_m4995D1AD353F43FE3FA854A8384601F58156E69E(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimationScriptPlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimationScriptPlayable__cctor_m3FA9E1E2E1EADACBC718598BEFECB25F867E454E (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimationScriptPlayable__cctor_m3FA9E1E2E1EADACBC718598BEFECB25F867E454E_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E L_1;
memset((&L_1), 0, sizeof(L_1));
AnimationScriptPlayable__ctor_mDA5EA55852F0A1079954B2DCB90398C4D7FFC412((&L_1), L_0, /*hidden argument*/NULL);
((AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_StaticFields*)il2cpp_codegen_static_fields_for(AnimationScriptPlayable_t1EDF8E51A9ED180BB012656916323FA4F68CA27E_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.AnimatorControllerPlayable::.ctor(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimatorControllerPlayable__ctor_m739B1BFC592B6C160410141057F1B2BA1B971897 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimatorControllerPlayable__ctor_m739B1BFC592B6C160410141057F1B2BA1B971897_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
__this->set_m_Handle_0(L_0);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = ___handle0;
AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96((AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B *)__this, L_1, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void AnimatorControllerPlayable__ctor_m739B1BFC592B6C160410141057F1B2BA1B971897_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * _thisAdjusted = reinterpret_cast<AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B *>(__this + _offset);
AnimatorControllerPlayable__ctor_m739B1BFC592B6C160410141057F1B2BA1B971897(_thisAdjusted, ___handle0, method);
}
// UnityEngine.Playables.PlayableHandle UnityEngine.Animations.AnimatorControllerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimatorControllerPlayable_GetHandle_mB83731910E1534BECA36F64BA22AA68A71D08CA8 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AnimatorControllerPlayable_GetHandle_mB83731910E1534BECA36F64BA22AA68A71D08CA8_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * _thisAdjusted = reinterpret_cast<AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B *>(__this + _offset);
return AnimatorControllerPlayable_GetHandle_mB83731910E1534BECA36F64BA22AA68A71D08CA8(_thisAdjusted, method);
}
// System.Void UnityEngine.Animations.AnimatorControllerPlayable::SetHandle(UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
bool V_2 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * L_0 = __this->get_address_of_m_Handle_0();
bool L_1 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)L_0, /*hidden argument*/NULL);
V_0 = L_1;
bool L_2 = V_0;
if (!L_2)
{
goto IL_001b;
}
}
{
InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1 * L_3 = (InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1 *)il2cpp_codegen_object_new(InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1_il2cpp_TypeInfo_var);
InvalidOperationException__ctor_m72027D5F1D513C25C05137E203EEED8FD8297706(L_3, _stringLiteral7E3996230D9AF0349B43FF7B536FC25AF0C19C71, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_3, AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96_RuntimeMethod_var);
}
IL_001b:
{
bool L_4 = PlayableHandle_IsValid_mDA0A998EA6E2442C5F3B6CDFAF07EBA9A6873059((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/NULL);
V_1 = L_4;
bool L_5 = V_1;
if (!L_5)
{
goto IL_0041;
}
}
{
bool L_6 = PlayableHandle_IsPlayableOfType_TisAnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_mC6A8CB67F39B0B39BF77ED6177B3C2DF1BC91533((PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 *)(&___handle0), /*hidden argument*/PlayableHandle_IsPlayableOfType_TisAnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_mC6A8CB67F39B0B39BF77ED6177B3C2DF1BC91533_RuntimeMethod_var);
V_2 = (bool)((((int32_t)L_6) == ((int32_t)0))? 1 : 0);
bool L_7 = V_2;
if (!L_7)
{
goto IL_0040;
}
}
{
InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA * L_8 = (InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA *)il2cpp_codegen_object_new(InvalidCastException_t91DF9E7D7FCCDA6C562CB4A9A18903E016680FDA_il2cpp_TypeInfo_var);
InvalidCastException__ctor_m3795145150387C6C362DA693613505C604AB8812(L_8, _stringLiteralB47C26932C83DD7E0C54FC87EDDE2F3B50E5104C, /*hidden argument*/NULL);
IL2CPP_RAISE_MANAGED_EXCEPTION(L_8, AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96_RuntimeMethod_var);
}
IL_0040:
{
}
IL_0041:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_9 = ___handle0;
__this->set_m_Handle_0(L_9);
return;
}
}
IL2CPP_EXTERN_C void AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96_AdjustorThunk (RuntimeObject * __this, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___handle0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * _thisAdjusted = reinterpret_cast<AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B *>(__this + _offset);
AnimatorControllerPlayable_SetHandle_m2CAE8DABC4B19AB6BD90249D0D7FC7A9E07C3A96(_thisAdjusted, ___handle0, method);
}
// System.Boolean UnityEngine.Animations.AnimatorControllerPlayable::Equals(UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AnimatorControllerPlayable_Equals_m04685CCA5A5FC388A0387D3453A677C0CB47D173 (AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * __this, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimatorControllerPlayable_Equals_m04685CCA5A5FC388A0387D3453A677C0CB47D173_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AnimatorControllerPlayable_GetHandle_mB83731910E1534BECA36F64BA22AA68A71D08CA8((AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AnimatorControllerPlayable_GetHandle_mB83731910E1534BECA36F64BA22AA68A71D08CA8((AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0016;
}
IL_0016:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AnimatorControllerPlayable_Equals_m04685CCA5A5FC388A0387D3453A677C0CB47D173_AdjustorThunk (RuntimeObject * __this, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___other0, const RuntimeMethod* method)
{
int32_t _offset = 1;
AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B * _thisAdjusted = reinterpret_cast<AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B *>(__this + _offset);
return AnimatorControllerPlayable_Equals_m04685CCA5A5FC388A0387D3453A677C0CB47D173(_thisAdjusted, ___other0, method);
}
// System.Void UnityEngine.Animations.AnimatorControllerPlayable::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimatorControllerPlayable__cctor_m6FCC197F3BF33EAFC37D5217617FCDC64E8B304E (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AnimatorControllerPlayable__cctor_m6FCC197F3BF33EAFC37D5217617FCDC64E8B304E_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = PlayableHandle_get_Null_m09DE585EF795EFA2811950173C80F4FA24CBAAD1(/*hidden argument*/NULL);
AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B L_1;
memset((&L_1), 0, sizeof(L_1));
AnimatorControllerPlayable__ctor_m739B1BFC592B6C160410141057F1B2BA1B971897((&L_1), L_0, /*hidden argument*/NULL);
((AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_StaticFields*)il2cpp_codegen_static_fields_for(AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B_il2cpp_TypeInfo_var))->set_m_NullPlayable_1(L_1);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animations.NotKeyableAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NotKeyableAttribute__ctor_m22EC4E60A34691F7BB217BB16922BD63A9A9E4EA (NotKeyableAttribute_tC0F8DAA85C33BBE045EFE59BB65D9A060D4282BE * __this, const RuntimeMethod* method)
{
{
Attribute__ctor_m45CAD4B01265CC84CC5A84F62EE2DBE85DE89EC0(__this, /*hidden argument*/NULL);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Animator::SetTrigger(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_SetTrigger_m68D29B7FA54C2F230F5AD780D462612B18E74245 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___name0, const RuntimeMethod* method)
{
{
String_t* L_0 = ___name0;
Animator_SetTriggerString_m77CE57996467D0C973FA2D0CB4DF87BD062C8A1E(__this, L_0, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.Animator::ResetTrigger(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_ResetTrigger_m70120C9A00EA482BF0880D2C02EC814CE3D71FD1 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___name0, const RuntimeMethod* method)
{
{
String_t* L_0 = ___name0;
Animator_ResetTriggerString_m31B233F948D7551D220FEDA56B002E6724B89851(__this, L_0, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.Animator::Play(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_Play_m254CA699DF64E86856EC8C54D1A739E3C0A49793 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___stateName0, const RuntimeMethod* method)
{
float V_0 = 0.0f;
int32_t V_1 = 0;
{
V_0 = (-std::numeric_limits<float>::infinity());
V_1 = (-1);
String_t* L_0 = ___stateName0;
int32_t L_1 = V_1;
float L_2 = V_0;
Animator_Play_m1942D7FB37F84959D2C6A859E11F70791E95FA50(__this, L_0, L_1, L_2, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.Animator::Play(System.String,System.Int32,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_Play_m1942D7FB37F84959D2C6A859E11F70791E95FA50 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___stateName0, int32_t ___layer1, float ___normalizedTime2, const RuntimeMethod* method)
{
{
String_t* L_0 = ___stateName0;
int32_t L_1 = Animator_StringToHash_m80E4CCCB84AAD032A5D84EF5832B7F35C1E5AE3F(L_0, /*hidden argument*/NULL);
int32_t L_2 = ___layer1;
float L_3 = ___normalizedTime2;
Animator_Play_m20B525F785DA59888E645125DB2DDC071E924F3E(__this, L_1, L_2, L_3, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.Animator::Play(System.Int32,System.Int32,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_Play_m20B525F785DA59888E645125DB2DDC071E924F3E (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, int32_t ___stateNameHash0, int32_t ___layer1, float ___normalizedTime2, const RuntimeMethod* method)
{
typedef void (*Animator_Play_m20B525F785DA59888E645125DB2DDC071E924F3E_ftn) (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A *, int32_t, int32_t, float);
static Animator_Play_m20B525F785DA59888E645125DB2DDC071E924F3E_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Animator_Play_m20B525F785DA59888E645125DB2DDC071E924F3E_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::Play(System.Int32,System.Int32,System.Single)");
_il2cpp_icall_func(__this, ___stateNameHash0, ___layer1, ___normalizedTime2);
}
// System.Boolean UnityEngine.Animator::get_hasBoundPlayables()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Animator_get_hasBoundPlayables_m283AF0BA9B841E3FD1ADC5541C41B936A9D1EB05 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, const RuntimeMethod* method)
{
typedef bool (*Animator_get_hasBoundPlayables_m283AF0BA9B841E3FD1ADC5541C41B936A9D1EB05_ftn) (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A *);
static Animator_get_hasBoundPlayables_m283AF0BA9B841E3FD1ADC5541C41B936A9D1EB05_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Animator_get_hasBoundPlayables_m283AF0BA9B841E3FD1ADC5541C41B936A9D1EB05_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::get_hasBoundPlayables()");
bool retVal = _il2cpp_icall_func(__this);
return retVal;
}
// System.Int32 UnityEngine.Animator::StringToHash(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Animator_StringToHash_m80E4CCCB84AAD032A5D84EF5832B7F35C1E5AE3F (String_t* ___name0, const RuntimeMethod* method)
{
typedef int32_t (*Animator_StringToHash_m80E4CCCB84AAD032A5D84EF5832B7F35C1E5AE3F_ftn) (String_t*);
static Animator_StringToHash_m80E4CCCB84AAD032A5D84EF5832B7F35C1E5AE3F_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Animator_StringToHash_m80E4CCCB84AAD032A5D84EF5832B7F35C1E5AE3F_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::StringToHash(System.String)");
int32_t retVal = _il2cpp_icall_func(___name0);
return retVal;
}
// System.Void UnityEngine.Animator::SetTriggerString(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_SetTriggerString_m77CE57996467D0C973FA2D0CB4DF87BD062C8A1E (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___name0, const RuntimeMethod* method)
{
typedef void (*Animator_SetTriggerString_m77CE57996467D0C973FA2D0CB4DF87BD062C8A1E_ftn) (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A *, String_t*);
static Animator_SetTriggerString_m77CE57996467D0C973FA2D0CB4DF87BD062C8A1E_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Animator_SetTriggerString_m77CE57996467D0C973FA2D0CB4DF87BD062C8A1E_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::SetTriggerString(System.String)");
_il2cpp_icall_func(__this, ___name0);
}
// System.Void UnityEngine.Animator::ResetTriggerString(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Animator_ResetTriggerString_m31B233F948D7551D220FEDA56B002E6724B89851 (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * __this, String_t* ___name0, const RuntimeMethod* method)
{
typedef void (*Animator_ResetTriggerString_m31B233F948D7551D220FEDA56B002E6724B89851_ftn) (Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A *, String_t*);
static Animator_ResetTriggerString_m31B233F948D7551D220FEDA56B002E6724B89851_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Animator_ResetTriggerString_m31B233F948D7551D220FEDA56B002E6724B89851_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::ResetTriggerString(System.String)");
_il2cpp_icall_func(__this, ___name0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.AnimatorOverrideController::OnInvalidateOverrideController(UnityEngine.AnimatorOverrideController)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AnimatorOverrideController_OnInvalidateOverrideController_mA538F1349FCF3968C5042F2D8860114F51818CB2 (AnimatorOverrideController_t130F04B57E753FD4288EF3235699ABE7C88FF312 * ___controller0, const RuntimeMethod* method)
{
bool V_0 = false;
{
AnimatorOverrideController_t130F04B57E753FD4288EF3235699ABE7C88FF312 * L_0 = ___controller0;
NullCheck(L_0);
OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * L_1 = L_0->get_OnOverrideControllerDirty_4();
V_0 = (bool)((!(((RuntimeObject*)(OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E *)L_1) <= ((RuntimeObject*)(RuntimeObject *)NULL)))? 1 : 0);
bool L_2 = V_0;
if (!L_2)
{
goto IL_001a;
}
}
{
AnimatorOverrideController_t130F04B57E753FD4288EF3235699ABE7C88FF312 * L_3 = ___controller0;
NullCheck(L_3);
OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * L_4 = L_3->get_OnOverrideControllerDirty_4();
NullCheck(L_4);
OnOverrideControllerDirtyCallback_Invoke_m002CFC2CE3C42A058380BE98F015E654D5F9F177(L_4, /*hidden argument*/NULL);
}
IL_001a:
{
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
IL2CPP_EXTERN_C void DelegatePInvokeWrapper_OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E (OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * __this, const RuntimeMethod* method)
{
typedef void (DEFAULT_CALL *PInvokeFunc)();
PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method));
// Native function invocation
il2cppPInvokeFunc();
}
// System.Void UnityEngine.AnimatorOverrideController_OnOverrideControllerDirtyCallback::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void OnOverrideControllerDirtyCallback__ctor_m9277DED194C85B1C3B4C7ABBB1D54CCB43C724D8 (OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
__this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1));
__this->set_method_3(___method1);
__this->set_m_target_2(___object0);
}
// System.Void UnityEngine.AnimatorOverrideController_OnOverrideControllerDirtyCallback::Invoke()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void OnOverrideControllerDirtyCallback_Invoke_m002CFC2CE3C42A058380BE98F015E654D5F9F177 (OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * __this, const RuntimeMethod* method)
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11();
Delegate_t** delegatesToInvoke;
il2cpp_array_size_t length;
if (delegateArrayToInvoke != NULL)
{
length = delegateArrayToInvoke->max_length;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0));
}
else
{
length = 1;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this);
}
for (il2cpp_array_size_t i = 0; i < length; i++)
{
Delegate_t* currentDelegate = delegatesToInvoke[i];
Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0();
RuntimeObject* targetThis = currentDelegate->get_m_target_2();
RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3());
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 0)
{
// open
typedef void (*FunctionPointerType) (const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker0::Invoke(targetMethod, targetThis);
else
GenericVirtActionInvoker0::Invoke(targetMethod, targetThis);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis);
else
VirtActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis);
}
}
else
{
typedef void (*FunctionPointerType) (void*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod);
}
}
}
}
// System.IAsyncResult UnityEngine.AnimatorOverrideController_OnOverrideControllerDirtyCallback::BeginInvoke(System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* OnOverrideControllerDirtyCallback_BeginInvoke_m35CE43BF7D40E88192183CF666F2BB7EFE8C6F9D (OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * __this, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback0, RuntimeObject * ___object1, const RuntimeMethod* method)
{
void *__d_args[1] = {0};
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback0, (RuntimeObject*)___object1);
}
// System.Void UnityEngine.AnimatorOverrideController_OnOverrideControllerDirtyCallback::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void OnOverrideControllerDirtyCallback_EndInvoke_m39CFD9FD2CC3035CFF6809F56447932B1394C08E (OnOverrideControllerDirtyCallback_t73560E6E30067C09BC58A15F9D2726051B077E2E * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: UnityEngine.AnimatorTransitionInfo
IL2CPP_EXTERN_C void AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshal_pinvoke(const AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B& unmarshaled, AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_pinvoke& marshaled)
{
marshaled.___m_FullPath_0 = unmarshaled.get_m_FullPath_0();
marshaled.___m_UserName_1 = unmarshaled.get_m_UserName_1();
marshaled.___m_Name_2 = unmarshaled.get_m_Name_2();
marshaled.___m_HasFixedDuration_3 = static_cast<int32_t>(unmarshaled.get_m_HasFixedDuration_3());
marshaled.___m_Duration_4 = unmarshaled.get_m_Duration_4();
marshaled.___m_NormalizedTime_5 = unmarshaled.get_m_NormalizedTime_5();
marshaled.___m_AnyState_6 = static_cast<int32_t>(unmarshaled.get_m_AnyState_6());
marshaled.___m_TransitionType_7 = unmarshaled.get_m_TransitionType_7();
}
IL2CPP_EXTERN_C void AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshal_pinvoke_back(const AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_pinvoke& marshaled, AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B& unmarshaled)
{
int32_t unmarshaled_m_FullPath_temp_0 = 0;
unmarshaled_m_FullPath_temp_0 = marshaled.___m_FullPath_0;
unmarshaled.set_m_FullPath_0(unmarshaled_m_FullPath_temp_0);
int32_t unmarshaled_m_UserName_temp_1 = 0;
unmarshaled_m_UserName_temp_1 = marshaled.___m_UserName_1;
unmarshaled.set_m_UserName_1(unmarshaled_m_UserName_temp_1);
int32_t unmarshaled_m_Name_temp_2 = 0;
unmarshaled_m_Name_temp_2 = marshaled.___m_Name_2;
unmarshaled.set_m_Name_2(unmarshaled_m_Name_temp_2);
bool unmarshaled_m_HasFixedDuration_temp_3 = false;
unmarshaled_m_HasFixedDuration_temp_3 = static_cast<bool>(marshaled.___m_HasFixedDuration_3);
unmarshaled.set_m_HasFixedDuration_3(unmarshaled_m_HasFixedDuration_temp_3);
float unmarshaled_m_Duration_temp_4 = 0.0f;
unmarshaled_m_Duration_temp_4 = marshaled.___m_Duration_4;
unmarshaled.set_m_Duration_4(unmarshaled_m_Duration_temp_4);
float unmarshaled_m_NormalizedTime_temp_5 = 0.0f;
unmarshaled_m_NormalizedTime_temp_5 = marshaled.___m_NormalizedTime_5;
unmarshaled.set_m_NormalizedTime_5(unmarshaled_m_NormalizedTime_temp_5);
bool unmarshaled_m_AnyState_temp_6 = false;
unmarshaled_m_AnyState_temp_6 = static_cast<bool>(marshaled.___m_AnyState_6);
unmarshaled.set_m_AnyState_6(unmarshaled_m_AnyState_temp_6);
int32_t unmarshaled_m_TransitionType_temp_7 = 0;
unmarshaled_m_TransitionType_temp_7 = marshaled.___m_TransitionType_7;
unmarshaled.set_m_TransitionType_7(unmarshaled_m_TransitionType_temp_7);
}
// Conversion method for clean up from marshalling of: UnityEngine.AnimatorTransitionInfo
IL2CPP_EXTERN_C void AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshal_pinvoke_cleanup(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_pinvoke& marshaled)
{
}
// Conversion methods for marshalling of: UnityEngine.AnimatorTransitionInfo
IL2CPP_EXTERN_C void AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshal_com(const AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B& unmarshaled, AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_com& marshaled)
{
marshaled.___m_FullPath_0 = unmarshaled.get_m_FullPath_0();
marshaled.___m_UserName_1 = unmarshaled.get_m_UserName_1();
marshaled.___m_Name_2 = unmarshaled.get_m_Name_2();
marshaled.___m_HasFixedDuration_3 = static_cast<int32_t>(unmarshaled.get_m_HasFixedDuration_3());
marshaled.___m_Duration_4 = unmarshaled.get_m_Duration_4();
marshaled.___m_NormalizedTime_5 = unmarshaled.get_m_NormalizedTime_5();
marshaled.___m_AnyState_6 = static_cast<int32_t>(unmarshaled.get_m_AnyState_6());
marshaled.___m_TransitionType_7 = unmarshaled.get_m_TransitionType_7();
}
IL2CPP_EXTERN_C void AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshal_com_back(const AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_com& marshaled, AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B& unmarshaled)
{
int32_t unmarshaled_m_FullPath_temp_0 = 0;
unmarshaled_m_FullPath_temp_0 = marshaled.___m_FullPath_0;
unmarshaled.set_m_FullPath_0(unmarshaled_m_FullPath_temp_0);
int32_t unmarshaled_m_UserName_temp_1 = 0;
unmarshaled_m_UserName_temp_1 = marshaled.___m_UserName_1;
unmarshaled.set_m_UserName_1(unmarshaled_m_UserName_temp_1);
int32_t unmarshaled_m_Name_temp_2 = 0;
unmarshaled_m_Name_temp_2 = marshaled.___m_Name_2;
unmarshaled.set_m_Name_2(unmarshaled_m_Name_temp_2);
bool unmarshaled_m_HasFixedDuration_temp_3 = false;
unmarshaled_m_HasFixedDuration_temp_3 = static_cast<bool>(marshaled.___m_HasFixedDuration_3);
unmarshaled.set_m_HasFixedDuration_3(unmarshaled_m_HasFixedDuration_temp_3);
float unmarshaled_m_Duration_temp_4 = 0.0f;
unmarshaled_m_Duration_temp_4 = marshaled.___m_Duration_4;
unmarshaled.set_m_Duration_4(unmarshaled_m_Duration_temp_4);
float unmarshaled_m_NormalizedTime_temp_5 = 0.0f;
unmarshaled_m_NormalizedTime_temp_5 = marshaled.___m_NormalizedTime_5;
unmarshaled.set_m_NormalizedTime_5(unmarshaled_m_NormalizedTime_temp_5);
bool unmarshaled_m_AnyState_temp_6 = false;
unmarshaled_m_AnyState_temp_6 = static_cast<bool>(marshaled.___m_AnyState_6);
unmarshaled.set_m_AnyState_6(unmarshaled_m_AnyState_temp_6);
int32_t unmarshaled_m_TransitionType_temp_7 = 0;
unmarshaled_m_TransitionType_temp_7 = marshaled.___m_TransitionType_7;
unmarshaled.set_m_TransitionType_7(unmarshaled_m_TransitionType_temp_7);
}
// Conversion method for clean up from marshalling of: UnityEngine.AnimatorTransitionInfo
IL2CPP_EXTERN_C void AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshal_com_cleanup(AnimatorTransitionInfo_t66D37578B8898C817BD5A5781B420BF92F60AA6B_marshaled_com& marshaled)
{
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: UnityEngine.HumanBone
IL2CPP_EXTERN_C void HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshal_pinvoke(const HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995& unmarshaled, HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_pinvoke& marshaled)
{
marshaled.___m_BoneName_0 = il2cpp_codegen_marshal_string(unmarshaled.get_m_BoneName_0());
marshaled.___m_HumanName_1 = il2cpp_codegen_marshal_string(unmarshaled.get_m_HumanName_1());
marshaled.___limit_2 = unmarshaled.get_limit_2();
}
IL2CPP_EXTERN_C void HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshal_pinvoke_back(const HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_pinvoke& marshaled, HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995& unmarshaled)
{
unmarshaled.set_m_BoneName_0(il2cpp_codegen_marshal_string_result(marshaled.___m_BoneName_0));
unmarshaled.set_m_HumanName_1(il2cpp_codegen_marshal_string_result(marshaled.___m_HumanName_1));
HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 unmarshaled_limit_temp_2;
memset((&unmarshaled_limit_temp_2), 0, sizeof(unmarshaled_limit_temp_2));
unmarshaled_limit_temp_2 = marshaled.___limit_2;
unmarshaled.set_limit_2(unmarshaled_limit_temp_2);
}
// Conversion method for clean up from marshalling of: UnityEngine.HumanBone
IL2CPP_EXTERN_C void HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshal_pinvoke_cleanup(HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_pinvoke& marshaled)
{
il2cpp_codegen_marshal_free(marshaled.___m_BoneName_0);
marshaled.___m_BoneName_0 = NULL;
il2cpp_codegen_marshal_free(marshaled.___m_HumanName_1);
marshaled.___m_HumanName_1 = NULL;
}
// Conversion methods for marshalling of: UnityEngine.HumanBone
IL2CPP_EXTERN_C void HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshal_com(const HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995& unmarshaled, HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_com& marshaled)
{
marshaled.___m_BoneName_0 = il2cpp_codegen_marshal_bstring(unmarshaled.get_m_BoneName_0());
marshaled.___m_HumanName_1 = il2cpp_codegen_marshal_bstring(unmarshaled.get_m_HumanName_1());
marshaled.___limit_2 = unmarshaled.get_limit_2();
}
IL2CPP_EXTERN_C void HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshal_com_back(const HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_com& marshaled, HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995& unmarshaled)
{
unmarshaled.set_m_BoneName_0(il2cpp_codegen_marshal_bstring_result(marshaled.___m_BoneName_0));
unmarshaled.set_m_HumanName_1(il2cpp_codegen_marshal_bstring_result(marshaled.___m_HumanName_1));
HumanLimit_t6AB2A599FC9E1F7E1598954FA9A0E568ECA5B6F3 unmarshaled_limit_temp_2;
memset((&unmarshaled_limit_temp_2), 0, sizeof(unmarshaled_limit_temp_2));
unmarshaled_limit_temp_2 = marshaled.___limit_2;
unmarshaled.set_limit_2(unmarshaled_limit_temp_2);
}
// Conversion method for clean up from marshalling of: UnityEngine.HumanBone
IL2CPP_EXTERN_C void HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshal_com_cleanup(HumanBone_t2CE168CF8638CEABF48FB7B7CCF77BBE0CECF995_marshaled_com& marshaled)
{
il2cpp_codegen_marshal_free_bstring(marshaled.___m_BoneName_0);
marshaled.___m_BoneName_0 = NULL;
il2cpp_codegen_marshal_free_bstring(marshaled.___m_HumanName_1);
marshaled.___m_HumanName_1 = NULL;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: UnityEngine.SkeletonBone
IL2CPP_EXTERN_C void SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshal_pinvoke(const SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5& unmarshaled, SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_pinvoke& marshaled)
{
marshaled.___name_0 = il2cpp_codegen_marshal_string(unmarshaled.get_name_0());
marshaled.___parentName_1 = il2cpp_codegen_marshal_string(unmarshaled.get_parentName_1());
marshaled.___position_2 = unmarshaled.get_position_2();
marshaled.___rotation_3 = unmarshaled.get_rotation_3();
marshaled.___scale_4 = unmarshaled.get_scale_4();
}
IL2CPP_EXTERN_C void SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshal_pinvoke_back(const SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_pinvoke& marshaled, SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5& unmarshaled)
{
unmarshaled.set_name_0(il2cpp_codegen_marshal_string_result(marshaled.___name_0));
unmarshaled.set_parentName_1(il2cpp_codegen_marshal_string_result(marshaled.___parentName_1));
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 unmarshaled_position_temp_2;
memset((&unmarshaled_position_temp_2), 0, sizeof(unmarshaled_position_temp_2));
unmarshaled_position_temp_2 = marshaled.___position_2;
unmarshaled.set_position_2(unmarshaled_position_temp_2);
Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 unmarshaled_rotation_temp_3;
memset((&unmarshaled_rotation_temp_3), 0, sizeof(unmarshaled_rotation_temp_3));
unmarshaled_rotation_temp_3 = marshaled.___rotation_3;
unmarshaled.set_rotation_3(unmarshaled_rotation_temp_3);
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 unmarshaled_scale_temp_4;
memset((&unmarshaled_scale_temp_4), 0, sizeof(unmarshaled_scale_temp_4));
unmarshaled_scale_temp_4 = marshaled.___scale_4;
unmarshaled.set_scale_4(unmarshaled_scale_temp_4);
}
// Conversion method for clean up from marshalling of: UnityEngine.SkeletonBone
IL2CPP_EXTERN_C void SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshal_pinvoke_cleanup(SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_pinvoke& marshaled)
{
il2cpp_codegen_marshal_free(marshaled.___name_0);
marshaled.___name_0 = NULL;
il2cpp_codegen_marshal_free(marshaled.___parentName_1);
marshaled.___parentName_1 = NULL;
}
// Conversion methods for marshalling of: UnityEngine.SkeletonBone
IL2CPP_EXTERN_C void SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshal_com(const SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5& unmarshaled, SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_com& marshaled)
{
marshaled.___name_0 = il2cpp_codegen_marshal_bstring(unmarshaled.get_name_0());
marshaled.___parentName_1 = il2cpp_codegen_marshal_bstring(unmarshaled.get_parentName_1());
marshaled.___position_2 = unmarshaled.get_position_2();
marshaled.___rotation_3 = unmarshaled.get_rotation_3();
marshaled.___scale_4 = unmarshaled.get_scale_4();
}
IL2CPP_EXTERN_C void SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshal_com_back(const SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_com& marshaled, SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5& unmarshaled)
{
unmarshaled.set_name_0(il2cpp_codegen_marshal_bstring_result(marshaled.___name_0));
unmarshaled.set_parentName_1(il2cpp_codegen_marshal_bstring_result(marshaled.___parentName_1));
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 unmarshaled_position_temp_2;
memset((&unmarshaled_position_temp_2), 0, sizeof(unmarshaled_position_temp_2));
unmarshaled_position_temp_2 = marshaled.___position_2;
unmarshaled.set_position_2(unmarshaled_position_temp_2);
Quaternion_t319F3319A7D43FFA5D819AD6C0A98851F0095357 unmarshaled_rotation_temp_3;
memset((&unmarshaled_rotation_temp_3), 0, sizeof(unmarshaled_rotation_temp_3));
unmarshaled_rotation_temp_3 = marshaled.___rotation_3;
unmarshaled.set_rotation_3(unmarshaled_rotation_temp_3);
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 unmarshaled_scale_temp_4;
memset((&unmarshaled_scale_temp_4), 0, sizeof(unmarshaled_scale_temp_4));
unmarshaled_scale_temp_4 = marshaled.___scale_4;
unmarshaled.set_scale_4(unmarshaled_scale_temp_4);
}
// Conversion method for clean up from marshalling of: UnityEngine.SkeletonBone
IL2CPP_EXTERN_C void SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshal_com_cleanup(SkeletonBone_tCDF297229129311214294465F3FA353DB09726F5_marshaled_com& marshaled)
{
il2cpp_codegen_marshal_free_bstring(marshaled.___name_0);
marshaled.___name_0 = NULL;
il2cpp_codegen_marshal_free_bstring(marshaled.___parentName_1);
marshaled.___parentName_1 = NULL;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.StateMachineBehaviour::OnStateEnter(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateEnter_mAB25325C96611ADDF93038EC6792EC4F76AEF4EE (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateUpdate(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateUpdate_mE12079F72B209DDFFAB4088B2B210EA20C2C4266 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateExit(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateExit_m83F9656CE5265BD15F3B5D1AB91411A211922730 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateMove(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateMove_mAE38B3B50B0A495AF30E6711F52381668B63DAA2 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateIK(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateIK_mB977958BB73727EF2F721BB449DFEA781529785B (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateMachineEnter(UnityEngine.Animator,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateMachineEnter_m5497D76EAE53BEF94431E3C1AAD0B58B89E745C7 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, int32_t ___stateMachinePathHash1, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateMachineExit(UnityEngine.Animator,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateMachineExit_m8A0744B8E90157AE466269DF324C44BFCBB47FF3 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, int32_t ___stateMachinePathHash1, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateEnter(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32,UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateEnter_mAAD23D49A3F84438928677D2FA3F8E26CFDE2522 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___controller3, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateUpdate(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32,UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateUpdate_mF1E4E77449D427AE5DDD68FD8EECCAD1E54E1EE9 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___controller3, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateExit(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32,UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateExit_m43A13AA682B9E86F6D2952338F47CE1B2BF9D4A7 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___controller3, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateMove(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32,UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateMove_mD8060C6C70456CDC4D678184723C05A7750846F3 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___controller3, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateIK(UnityEngine.Animator,UnityEngine.AnimatorStateInfo,System.Int32,UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateIK_m09D6AC0300060ACF7B82283AD947E9A260585576 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, AnimatorStateInfo_tF6D8ADF771CD13DC578AC9A574FD33CC99AD46E2 ___stateInfo1, int32_t ___layerIndex2, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___controller3, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateMachineEnter(UnityEngine.Animator,System.Int32,UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateMachineEnter_m6DE0F767D565EFC33361BA13A6DCC65AC89D3D07 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, int32_t ___stateMachinePathHash1, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___controller2, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::OnStateMachineExit(UnityEngine.Animator,System.Int32,UnityEngine.Animations.AnimatorControllerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour_OnStateMachineExit_m01575716EA20F88A56C3CB778FACE2CBDA68EF26 (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, Animator_tF1A88E66B3B731DDA75A066DBAE9C55837660F5A * ___animator0, int32_t ___stateMachinePathHash1, AnimatorControllerPlayable_t352C2C3D059CFC0404FF4FBBA302F16C5966F44B ___controller2, const RuntimeMethod* method)
{
{
return;
}
}
// System.Void UnityEngine.StateMachineBehaviour::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StateMachineBehaviour__ctor_m60289315ADCB494227D881EEFA6C4458BACA79DB (StateMachineBehaviour_t698612ED92024B087045C388731B7673550C786C * __this, const RuntimeMethod* method)
{
{
ScriptableObject__ctor_m6E2B3821A4A361556FC12E9B1C71E1D5DC002C5B(__this, /*hidden argument*/NULL);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"yrnemmizer@gmail.com"
] | yrnemmizer@gmail.com |
26e8077da01266ba7601bcdee3acae1276a5b70f | 88b7ab3e12f66fcbe6cec332edf8fcede6fd2b6a | /src/main6.cpp | 8111d186f57b00c8453fb7d4d89c880139eb5de6 | [] | no_license | nashalagin/C-lab-3 | 1dbb0682cdbfe2f8cfdc823466d7b859a0debf56 | fd004c502badb9dcadb7fc982969da7c3eccda58 | refs/heads/master | 2020-04-16T14:35:33.623407 | 2019-01-16T09:21:42 | 2019-01-16T09:21:42 | 165,672,997 | 0 | 0 | null | 2019-01-14T14:11:55 | 2019-01-14T14:11:55 | null | UTF-8 | C++ | false | false | 515 | cpp | #include "task6.h"
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
//#define N 10
int generateMassiv(int arr[], int N)
{
int i = 0;
while (i < N)
{
if (rand() % 2 == 0)
arr[i] = rand() % 10;
else
arr[i] = (rand() % 10) * (-1);
i++;
}
return 0;
}
int main()
{
int N = 10;
int *arr;
arr = new int[N];
srand(time(0));
generateMassiv(arr, N);
int i = 0;
while (i < N)
{
printf("[%d]", arr[i]);
i++;
}
printf("\n");
printf("\nmax + min = %d", getSumMaxMin(arr, N));
return 0;
} | [
"qquikly@mail.ru"
] | qquikly@mail.ru |
22cc32f24a294d8a9dea4a7c7a41d57323671b45 | 4fa1e0711c3023a94035b58f6a66c9acd4a7f424 | /Microsoft/SAMPLES/INIEDIT/FILENAME/TEST.CPP | 319854c187ab5565f7c69f3717d666dfea4d69b7 | [
"MIT"
] | permissive | tig/Tigger | 4d1f5a2088468c75a7c21b103705445a93ec571c | 8e06d117a5b520c5fc9e37a710bf17aa51a9958c | refs/heads/master | 2023-06-09T01:59:43.167371 | 2020-08-19T15:21:53 | 2020-08-19T15:21:53 | 3,426,737 | 1 | 2 | null | 2023-05-31T18:56:36 | 2012-02-13T03:05:18 | C | UTF-8 | C++ | false | false | 855 | cpp | #include <afx.h>
#include <iostream.h>
#include "filename.h"
void main()
{
CFilename FileName ;
char sz[255] ;
while (FileName != "q")
{
cout << "\nEnter filename: " ;
cin >> sz ;
FileName = (CString)sz ;
cout << "\n" << FileName << "\n" ;
cout << "Filename.GetDrive = '" << FileName.GetDrive() << "'\n" ;
cout << "Filename.GetDir = '" << FileName.GetDir () << "'\n" ;
cout << "Filename.GetPath = '" << FileName.GetPath () << "'\n" ;
cout << "Filename.GetFname = '" << FileName.GetFname() << "'\n" ;
cout << "Filename.GetExt = '" << FileName.GetExt () << "'\n" ;
cout << "Filename.GetFilename = '" << FileName.GetFilename() << "'\n" ;
}
} | [
"charlie@kindel.com"
] | charlie@kindel.com |
a63281a568f2d6b15632aa5fe2140bbb36177d52 | b6d2cb74a76194fd25fdc3607ef828e94d98039e | /URI/2929.cpp | 36e269ca6bfba18fd4650d88530a096376270568 | [] | no_license | giovaneaf/CompetitiveProgramming | 22d63481015ab45a03d527c866cae339cffeb5fb | 863f6bc61497591cb98e50973aa23bfcb9879ab8 | refs/heads/master | 2021-06-07T20:28:45.116299 | 2021-05-25T00:38:16 | 2021-05-25T00:38:16 | 131,643,425 | 6 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 704 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define MAXN 200010
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
int n;
cin >> n;
stack<int> s;
multiset<int> m;
for(int i = 0; i < n; ++i)
{
string str;
cin >> str;
if(str == "PUSH")
{
int v;
cin >> v;
s.push(v);
m.insert(v);
}
else if(str == "MIN")
{
if(s.empty())
{
printf("EMPTY\n");
}
else
{
printf("%d\n", *m.begin());
}
}
else
{
if(s.empty())
{
printf("EMPTY\n");
}
else
{
int v = s.top();
s.pop();
m.erase(m.find(v));
}
}
}
return 0;
} | [
"giovaneaf1995@gmail.com"
] | giovaneaf1995@gmail.com |
cd9c2f1fbe41419613eab5e087dbac4b67bde3fb | 3cb02d8bfd827beaff8f5d284bfeee2099c173e6 | /ACM-ICPC 2018 青岛赛区现场赛/test.cpp | db25ea0665865e1a0461e3813da2f828b2e989c2 | [] | no_license | yyhaos/Competitions | 8a88ddfa0606e884c88f17ef391ffdd1ba32bf0f | d291be1327e895883b423eeebad943893f27e66e | refs/heads/master | 2021-06-12T13:14:22.354538 | 2020-08-18T05:24:24 | 2020-08-18T05:24:24 | 128,635,106 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 645 | cpp | #include<iostream>
using namespace std;
class Base
{
private:
int A;
public:
Base(){}
Base(int a):A(a){}
void show()
{
cout<<"A="<<A<<endl;
}
};
class Base2
{
private:
int A;
public:
Base2(){}
Base2(int a):A(a){}
void show()
{
cout<<"B2="<<A<<endl;
}
};
class Der:public Base
{
private:
int B;
Base2 em;
public:
Der(){}
Der(int a,int b,int c):em(b),Base(c)
{
B=a;
// Base(a);
}
void show()
{
Base::show();
em.show();
cout<<"B="<<B<<endl;
}
};
int main ()
{
Der a(1,2,3);
a.show();
return 0;
}
| [
"35396510+yyhaos@users.noreply.github.com"
] | 35396510+yyhaos@users.noreply.github.com |
f97e751917893535cc80f0de291ae325bdf3fae1 | cd20beb8d2fc2c0febb3358a8b272cd440915105 | /example/static/main.cxx | e2fdf2c4794a15e30ce16e49c3ddc34190ea7007 | [
"MIT"
] | permissive | mattn/clask | ed76b85917cfa295389d685f7551e14715bba378 | b3089ab5718aa268b5f0f8b25c1ba1aebffb19f8 | refs/heads/master | 2023-09-01T02:50:43.000812 | 2022-01-24T15:06:11 | 2022-01-24T15:06:11 | 270,303,482 | 128 | 8 | MIT | 2021-08-19T14:44:35 | 2020-06-07T12:45:08 | C++ | UTF-8 | C++ | false | false | 546 | cxx | #include <clask/core.hpp>
int main() {
auto s = clask::server();
s.log.default_level = clask::log_level::INFO;
s.static_dir("/", "./public");
s.GET("/api", [](clask::response_writer& resp, clask::request&) {
resp.set_header("content-type", "application/json");
time_t t;
struct tm* tm;
std::time(&t);
tm = std::gmtime(&t);
std::stringstream date;
date << R"({"time": ")"
<< std::put_time(tm, "%a, %d %B %Y %H:%M:%S GMT")
<< R"("})";
resp.write(date.str());
resp.end();
});
s.run();
}
| [
"mattn.jp@gmail.com"
] | mattn.jp@gmail.com |
30e3f4b0482d5fca3db995b21eaf0efb8cc8b2d0 | 6ae1aa70d46788fcfce031f51733b3c18715b45d | /include/jet/advection_solver2.h | c509e5e7cc4c94756a3b855f95fb9e2ad8301846 | [
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | dokipen3d/fluid-engine-dev | 3d4f3e4bb907feb00734e0fc1d47d2e86a89e3f0 | 0e26fbc19195ce4a21fb529a3de2d15b46c93050 | refs/heads/master | 2021-01-11T06:50:38.790287 | 2016-10-08T04:55:39 | 2016-10-08T04:55:39 | 72,378,941 | 4 | 1 | null | 2016-10-30T22:16:28 | 2016-10-30T22:16:28 | null | UTF-8 | C++ | false | false | 4,279 | h | // Copyright (c) 2016 Doyub Kim
#ifndef INCLUDE_JET_ADVECTION_SOLVER2_H_
#define INCLUDE_JET_ADVECTION_SOLVER2_H_
#include <jet/collocated_vector_grid2.h>
#include <jet/constant_scalar_field2.h>
#include <jet/constants.h>
#include <jet/face_centered_grid2.h>
#include <jet/scalar_grid2.h>
#include <limits>
#include <memory>
namespace jet {
//!
//! \brief Abstract based class for 2-D grid-based advection solver.
//!
//! The implementation of this abstract base class should solve 2-D advection
//! equation for scalar and vector fields.
//!
class AdvectionSolver2 {
public:
AdvectionSolver2();
virtual ~AdvectionSolver2();
//!
//! \brief Solves advection equation for given scalar grid.
//!
//! The implementation of this virtual function should solve advection
//! equation for given scalar field \p input and underlying vector field
//! \p flow that carries the input field. The solution after solving the
//! equation for given time-step \p dt should be stored in scalar field
//! \p output. The boundary interface is given by a signed-distance field.
//! The field is negative inside the boundary. By default, a constant field
//! with max double value (kMaxD) is used, meaning no boundary.
//!
//! \param input Input scalar grid.
//! \param flow Vector field that advects the input field.
//! \param dt Time-step for the advection.
//! \param output Output scalar grid.
//! \param boundarySdf Boundary interface defined by signed-distance
//! field.
//!
virtual void advect(
const ScalarGrid2& input,
const VectorField2& flow,
double dt,
ScalarGrid2* output,
const ScalarField2& boundarySdf
= ConstantScalarField2(kMaxD)) = 0;
//!
//! \brief Solves advection equation for given collocated vector grid.
//!
//! The implementation of this virtual function should solve advection
//! equation for given collocated vector grid \p input and underlying vector
//! field \p flow that carries the input field. The solution after solving
//! the equation for given time-step \p dt should be stored in vector field
//! \p output. The boundary interface is given by a signed-distance field.
//! The field is negative inside the boundary. By default, a constant field
//! with max double value (kMaxD) is used, meaning no boundary.
//!
//! \param input Input vector grid.
//! \param flow Vector field that advects the input field.
//! \param dt Time-step for the advection.
//! \param output Output vector grid.
//! \param boundarySdf Boundary interface defined by signed-distance
//! field.
//!
virtual void advect(
const CollocatedVectorGrid2& input,
const VectorField2& flow,
double dt,
CollocatedVectorGrid2* output,
const ScalarField2& boundarySdf
= ConstantScalarField2(kMaxD));
//!
//! \brief Solves advection equation for given face-centered vector grid.
//!
//! The implementation of this virtual function should solve advection
//! equation for given face-centered vector field \p input and underlying
//! vector field \p flow that carries the input field. The solution after
//! solving the equation for given time-step \p dt should be stored in
//! vector field \p output. The boundary interface is given by a
//! signed-distance field. The field is negative inside the boundary. By
//! default, a constant field with max double value (kMaxD) is used, meaning
//! no boundary.
//!
//! \param input Input vector grid.
//! \param flow Vector field that advects the input field.
//! \param dt Time-step for the advection.
//! \param output Output vector grid.
//! \param boundarySdf Boundary interface defined by signed-distance
//! field.
//!
virtual void advect(
const FaceCenteredGrid2& input,
const VectorField2& flow,
double dt,
FaceCenteredGrid2* output,
const ScalarField2& boundarySdf
= ConstantScalarField2(kMaxD));
};
typedef std::shared_ptr<AdvectionSolver2> AdvectionSolver2Ptr;
} // namespace jet
#endif // INCLUDE_JET_ADVECTION_SOLVER2_H_
| [
"doyubkim@gmail.com"
] | doyubkim@gmail.com |
182c2285582d95849c0e2554c0bba40928eee32f | f031279c14897b990519c7ba231a6aba8f1a8c69 | /devices/sensor/esp8266_sensor/esp8266_sensor_sketch.ino | c9ff260ca6978acbb749b20e785966f3e47ea7cd | [
"MIT"
] | permissive | ggvelev/smart-home | a5bdf2e45150298a6784499dfa6c359fd8da262b | 126c8f47cffc3eb59877a905ceb87bbcd6732c16 | refs/heads/main | 2023-08-28T21:29:07.562403 | 2021-11-05T18:36:02 | 2021-11-05T18:37:08 | 404,118,116 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,600 | ino | /*
A demo sketch for ESP8266 NodeMCU device with DHT11 sensor.
Device reports readings every 10 seconds and listens for incoming commands (only logging them to Serial output).
When connectivity is established, the device sends its network config to devices/{id}/config to let smarthome-api server
know it's address.
*/
#include "EspMQTTClient.h"
#include "DHT.h"
#define DHTTYPE DHT11 // Select DHT sensor model: DHT 11
char* deviceUuid = "caf703a4-44ab-4ac5-958b-0d1420167764";
char* mqttClientUsername = "ENTER_YOURS";
char* mqttClientPassword = "ENTER_YOURS!";
char* mqttBrokerAddress = "ENTER_YOURS";
char* wifiSSID = "ENTER_YOURS";
char* wifiPassword = "ENTER_YOURS";
EspMQTTClient client(
wifiSSID,
wifiPassword,
mqttBrokerAddress,
mqttClientUsername,
mqttClientPassword,
deviceUuid,
1883 // The MQTT broker port, default to 1883
);
// Initialize DHTPin with the pin number
// which DOUT (sensor's pin) is connected to:
uint8_t DHTPin = D8;
float hum = NAN, temp = NAN;
// Initialize DHT sensor object with pin and DHT model.
DHT dht(DHTPin, DHTTYPE);
void setup()
{
Serial.begin(115200);
client.enableDebuggingMessages();
client.enableLastWillMessage("smarthome/lwt", "ESP8266_SENSOR going offline");
}
void onConnectionEstablished()
{
Serial.printf("WiFi connected, IP address: %s\n", WiFi.localIP().toString().c_str());
Serial.printf("MAC address = %s\n", WiFi.softAPmacAddress().c_str());
Serial.println(getDeviceInfo());
// Listen for commands and display them on Serial output (for the sake of the demo)
client.subscribe("devices/caf703a4-44ab-4ac5-958b-0d1420167764/commands", [](const String & payload) {
Serial.println(payload);
});
// Report device network configuration once
client.executeDelayed(10 * 1000, []() {
client.publish("devices/caf703a4-44ab-4ac5-958b-0d1420167764/config", getDeviceInfo(), true);
});
}
String getDeviceInfo() {
String info = "{";
info += "\"ipAddress\": \"";
info += WiFi.localIP().toString().c_str();
info += "\",";
info += "\"macAddress\": \"";
info += WiFi.macAddress().c_str();
info += "\",";
info += "\"gatewayIpAddress\": \"";
info += WiFi.gatewayIP().toString().c_str();
info += "\",";
info += "\"gatewaySubnetMask\": \"";
info += WiFi.subnetMask().toString().c_str();
info += "\",";
info += "\"dnsIp\": \"";
info += WiFi.dnsIP().toString().c_str();
info += "\"}";
return info;
}
String getTempReading() {
String temperature = "{";
temperature += "\"value\": \"";
temperature += (float)temp;
temperature += "\",";
temperature += "\"type\": \"SENSOR_TEMPERATURE\",";
temperature += "\"valueType\": \"FLOAT\",";
temperature += "\"time\": null";
temperature += "}";
return temperature;
}
String getHumReading() {
String humidity = "{";
humidity += "\"value\": \"";
humidity += (float)hum;
humidity += "\",";
humidity += "\"type\": \"SENSOR_HUMIDITY\",";
humidity += "\"valueType\": \"FLOAT\",";
humidity += "\"time\": null";
humidity += "}";
return humidity;
}
void loop()
{
hum = dht.readHumidity(true);
temp = dht.readTemperature();
client.loop();
// a little hack because the old DHT11 sensor is giving up and not working as well as it used to
if (!isnan(hum) && hum <= 100 && hum >= 0) {
client.publish("devices/caf703a4-44ab-4ac5-958b-0d1420167764/state", getHumReading());
}
if (!isnan(temp) && temp <= 100 && temp >= -50) {
client.publish("devices/caf703a4-44ab-4ac5-958b-0d1420167764/state", getTempReading());
}
delay(10000);
}
| [
"39666872+ggvelev@users.noreply.github.com"
] | 39666872+ggvelev@users.noreply.github.com |
1606ff44fbb4999c2556c765156b8602785069a9 | 470f3d5c3bd8cfe07dc6744e4a8b58717c39c0f5 | /src/UnitTests/TestASCIICharClass.cpp | c0fce68ece0833f7a0367884ff3fd3758e93857b | [] | no_license | metaera/dynalib-utils | b6e36cfc52d469e1595164e463880b6e18ef5e58 | b837352e0c963ac8ef53829fb4e8274810ccc69a | refs/heads/master | 2022-12-31T01:50:29.409712 | 2020-10-15T01:40:00 | 2020-10-15T01:40:00 | 292,269,910 | 0 | 0 | null | 2020-10-13T10:44:38 | 2020-09-02T11:57:01 | C++ | UTF-8 | C++ | false | false | 2,504 | cpp | //
// Created by Ken Kopelson on 27/12/17.
//
#include <string>
#include <iostream>
using namespace std;
#include "catch.hpp"
#include "Utilities/Parser/ASCIICharClass.h"
SCENARIO("ASCII Character Class functions properly") {
GIVEN("a newly created Character Class") {
CharacterClass* charClass = new ASCIICharClass();
WHEN("a set of identifier characters is added") {
charClass->setIdentChars(String("_"));
THEN("all class checks must be valid") {
CHECK(charClass->isAlphaClass('a'));
CHECK(charClass->isAlphaClass('m'));
CHECK(charClass->isAlphaClass('z'));
CHECK(charClass->isAlphaClass('A'));
CHECK(charClass->isAlphaClass('M'));
CHECK(charClass->isAlphaClass('Z'));
CHECK(charClass->isDigitClass('0'));
CHECK(charClass->isDigitClass('9'));
CHECK(charClass->isHexClass('0'));
CHECK(charClass->isHexClass('9'));
CHECK(charClass->isHexClass('a'));
CHECK(charClass->isHexClass('f'));
CHECK(charClass->isHexClass('A'));
CHECK(charClass->isHexClass('F'));
CHECK(charClass->isVowelClass('a'));
CHECK(charClass->isVowelClass('e'));
CHECK(charClass->isVowelClass('i'));
CHECK(charClass->isVowelClass('o'));
CHECK(charClass->isVowelClass('u'));
CHECK(charClass->isVowelClass('A'));
CHECK(charClass->isVowelClass('E'));
CHECK(charClass->isVowelClass('I'));
CHECK(charClass->isVowelClass('O'));
CHECK(charClass->isVowelClass('U'));
CHECK(charClass->isConsonantClass('B'));
CHECK(charClass->isConsonantClass('C'));
CHECK(charClass->isConsonantClass('F'));
CHECK(charClass->isConsonantClass('G'));
CHECK(charClass->isConsonantClass('W'));
CHECK(charClass->isConsonantClass('Z'));
CHECK(charClass->isIdentClass('_'));
CHECK(charClass->isIdentClass('a'));
CHECK(charClass->isIdentClass('z'));
CHECK(charClass->isIdentClass('A'));
CHECK(charClass->isIdentClass('Z'));
CHECK(charClass->isIdentClass('0'));
CHECK(charClass->isIdentClass('9'));
}
}
}
}
| [
"kenbkop@gmail.com"
] | kenbkop@gmail.com |
c6e3a0724c2e3ae61c9deab0aa5ed1b96b3b1ba4 | 214f3bc0fff4e6fd9d2dbe2bea4524813e7907b1 | /mogupro/game/src/Sound/Wav.cpp | 348191c7bff21a5f3294b2fc0c70b7e85f51928a | [
"MIT"
] | permissive | yumayo/mogupro | 9d88676fc11da5f19b3f1f4a31129fdc911c610a | 33b67529624cb77f7259cb8420895dab6d229f2e | refs/heads/master | 2018-12-19T02:21:11.834285 | 2018-09-15T09:07:31 | 2018-09-15T09:07:31 | 106,014,321 | 3 | 5 | MIT | 2018-02-23T15:08:17 | 2017-10-06T14:30:39 | C++ | SHIFT_JIS | C++ | false | false | 2,971 | cpp | #include <Sound/Wav.h>
namespace Sound
{
unsigned int Wav::getValue(const char* p, const unsigned int num)
{
unsigned int value = 0;
for (unsigned int i = 0; i < num; ++i, ++p)
value += (static_cast<unsigned char>(*p) << (i * 8));
return value;
}
//!@TODO : 2byteのTagに対応していない
bool Wav::searchChunk(std::ifstream& fstr, const char* chunk)
{
fstr.seekg(WAV_HEADER_SIZE, fstr.beg);
while (1)
{
//Tag検索
char tag[4];
fstr.read(tag, 4);
if (!std::strncmp(tag, chunk, 4))
return true;
//次のチャンクまでに詰まっているものを飛ばす
char data[4];
fstr.read(data, 4);
unsigned int chunkSize = getValue(data, 4);
fstr.seekg(chunkSize, fstr.cur);
if (fstr.eof())
break;
}
return false;
}
bool Wav::read(const std::string& file)
{
std::ifstream fstr(file, std::ios::binary);
if (!fstr)
{
std::cout << "Can't open: " << file << std::endl;
return false;
}
char header[WAV_HEADER_SIZE];
fstr.read(header, WAV_HEADER_SIZE);
if (std::strncmp(&header[0], "RIFF", 4))
{
std::cout << "This file isn't RIFF format." << std::endl;
return false;
}
if (std::strncmp(&header[8], "WAVE", 4))
{
std::cout << "This file isn't WAVE format." << std::endl;
return false;
}
//!@ LookMe : fmt の文字位置が一定じゃない場合があるらしい
char data[4];
fstr.read(data, 4);
if (std::strncmp(&data[0], "fmt ", 4))
{
std::cout << "No chunk 'fmt'." << std::endl;
return false;
}
fstr.read(data, 4);
unsigned int chunkSize = getValue(data, 4);
std::vector<char> chunk(chunkSize);
fstr.read(&chunk[0], chunkSize);
chunkInfo.id = getValue(&chunk[0], 2);
if (chunkInfo.id != 1) {
// IDが1以外は扱わない
std::cout << "Wav's id error : " << chunkInfo.id << " : " << file << std::endl;
return false;
}
chunkInfo.ch = getValue(&chunk[2], 2);
chunkInfo.sampleRate = getValue(&chunk[4], 4);
chunkInfo.bit = getValue(&chunk[14], 2);
if (chunkInfo.bit != 16) {
// 量子化ビット数が16以外は扱わない
std::cout << "Wav's bit error : " << chunkInfo.bit << " : " << file << std::endl;
return false;
}
if (searchChunk(fstr, "data") == false)
{
std::cout << "No chank 'data'." << std::endl;
return false;
}
fstr.read(data, 4);
chunkInfo.size = getValue(data, 4);
time = chunkInfo.size / chunkInfo.ch / 2.0f / chunkInfo.sampleRate;
wavData.resize(chunkInfo.size);
fstr.read(&wavData[0], chunkInfo.size);
return true;
}
void Wav::bindAlShortData()
{
const char* t = data();
// キャスト
const ALshort* sample = (const ALshort*)t;
// データサイズ
int sampleSize = size() / 2;
// 配列の開始位置と終了位置から作成
alShortdata = std::vector<ALshort>(&sample[0], &sample[sampleSize]);
}
}
| [
"scha-taz0@outlook.jp"
] | scha-taz0@outlook.jp |
e5f66138e497305675b163c2040ff2a88e3934ec | 98eb6c6b571308f08c12eb4bc09ad4b61c055bab | /CxAODTools/Root/.svn/text-base/VHbb2lepEvtSelection.cxx.svn-base | 9e4a328cea7ece98f6798eb3af2ac174849bb78f | [] | no_license | abrennan87/Arturo_CxAODframework | 8f1b2a18a267acc573dbd7f937bd134f38672eb4 | 04ba03c6589a9f6b7af6d1da7059541bbd0093bb | refs/heads/master | 2016-09-05T20:31:03.558531 | 2015-04-14T08:55:37 | 2015-04-14T08:55:37 | 33,920,956 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,606 | #include "CxAODTools/VHbb2lepEvtSelection.h"
#include "xAODEgamma/Electron.h"
#include "xAODEgamma/Photon.h"
#include "xAODMuon/Muon.h"
#include "xAODJet/Jet.h"
#include "xAODEventInfo/EventInfo.h"
void VHbb2lepEvtSelection::clearResult() {
m_result.pass = false;
m_result.signalJets.clear();
m_result.forwardJets.clear();
m_result.el1 = nullptr;
m_result.el2 = nullptr;
m_result.mu1 = nullptr;
m_result.mu2 = nullptr;
m_result.met = nullptr;
}
bool VHbb2lepEvtSelection::passSelection(const xAOD::EventInfo* evtinfo,
const xAOD::MissingET* met,
const xAOD::ElectronContainer* electrons,
const xAOD::PhotonContainer* photons,
const xAOD::MuonContainer* muons,
const xAOD::TauJetContainer* taus,
const xAOD::JetContainer* jets) {
// here just as an example:
// if a new passKinematics() function is defined with some variables in the prototype,
// one needs to reimplement passSelection here
// otherwise, don't need to put any code
return VHbbEvtSelection<ResultVHbb2lep>::passSelection(evtinfo, met, electrons,
photons, muons, taus, jets);
}
bool VHbb2lepEvtSelection::passLeptonSelection(const xAOD::ElectronContainer* electrons,
const xAOD::MuonContainer* muons,
const xAOD::MissingET* met) {
int res = doVHLeptonSelection(electrons, muons, m_result.el1, m_result.el2,
m_result.mu1, m_result.mu2);
if(res != 2) {
return false;
}
m_result.met = met;
return true;
}
bool VHbb2lepEvtSelection::passKinematics() {
// MJ cuts, like MET / MPT etc...
// my advice is to add in passKinematics() prototype all the stuff that
// doesn't need to be put in the Result struct, like MPT
return true;
}
//
// Pre-selection versions
bool VHbb2lepEvtSelection::passPreSelection(const xAOD::EventInfo* evtinfo,
const xAOD::MissingET* met,
const xAOD::ElectronContainer* electrons,
const xAOD::PhotonContainer* photons,
const xAOD::MuonContainer* muons,
const xAOD::TauJetContainer* taus,
const xAOD::JetContainer* jets,
const xAOD::JetContainer* fatjets) {
// here just as an example:
// if a new passKinematics() function is defined with some variables in the prototype,
// one needs to reimplement passSelection here
// otherwise, don't need to put any code
return VHbbEvtSelection<ResultVHbb2lep>::passPreSelection(evtinfo, met, electrons, photons,
muons, taus, jets, fatjets);
}
bool VHbb2lepEvtSelection::passLeptonPreSelection(const xAOD::ElectronContainer* electrons,
const xAOD::MuonContainer* muons,
const xAOD::MissingET* met) {
int res = doVHLeptonPreSelection(electrons, muons, m_result.el1, m_result.el2,
m_result.mu1, m_result.mu2);
if(res != 2) {
return false;
}
return true;
}
void VHbb2lepEvtSelection::writeEventVariables(const xAOD::EventInfo* eventInfoIn,
xAOD::EventInfo* eventInfoOut,
bool isKinVar,
bool isWeightVar) {
// ensure to write all variables for all events
m_decorator.set(eventInfoOut, EventInfoFloatProps::leptonSF, 1);
if (!m_result.pass) return;
// lepton SF
if (m_result.type() == ResultVHbb2lep::Type::ee) {
float leptonSF = 1;
leptonSF *= m_decorator.get(m_result.el1, ElecFloatProps::effSFloose);
leptonSF *= m_decorator.get(m_result.el2, ElecFloatProps::effSFloose);
m_decorator.set(eventInfoOut, EventInfoFloatProps::leptonSF, leptonSF);
} else if (m_result.type() == ResultVHbb2lep::Type::mm) {
float leptonSF = 1;
leptonSF *= m_decorator.get(m_result.mu1, MuonFloatProps::effSF);
leptonSF *= m_decorator.get(m_result.mu2, MuonFloatProps::effSF);
m_decorator.set(eventInfoOut, EventInfoFloatProps::leptonSF, leptonSF);
} else if (m_result.type() == ResultVHbb2lep::Type::em) {
float leptonSF = 1;
leptonSF *= m_decorator.get(m_result.el1, ElecFloatProps::effSFloose);
leptonSF *= m_decorator.get(m_result.mu1, MuonFloatProps::effSF);
m_decorator.set(eventInfoOut, EventInfoFloatProps::leptonSF, leptonSF);
}
}
| [
"mia.brennan87@gmail.com"
] | mia.brennan87@gmail.com | |
eea236d224b5cc50873007ea2f3ab1bbb1b609c4 | df2e5b8f47b8785cab20999bc1cd465945926cb5 | /merge_sort.cpp | 17f365bfd8b3005a5c030e642a6ee0fbc113b807 | [] | no_license | Marcus-Jon/common_algorithms_cpp | 054009a0a4ac6370f87c29a07dc16753f75e49a3 | ed25a2338eb8f06ae0a8a5bfe3d9957c812ba22c | refs/heads/master | 2020-06-11T09:49:35.930297 | 2019-07-30T14:10:19 | 2019-07-30T14:10:19 | 193,922,423 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,374 | cpp | #include <iostream>
using namespace std;
void merge(int num_array[], int left, int midpoint, int right)
{
int x = 0;
int y = 0;
int z = left;
int val_1 = midpoint - left + 1;
int val_2 = right - midpoint;
int Left[val_1];
int Right[val_2];
for (int i = 0; i < val_1; i++) {Left[i] = num_array[left + i];}
for (int j = 0; j < val_2; j++) {Right[j] = num_array[midpoint + 1 + j];}
while(x < val_1 && y < val_2)
{
if(Left[x] <= Right[y])
{
num_array[z] = Left[x];
x++;
}
else
{
num_array[z] = Right[y];
y++;
}
z++;
}
while(x < val_1)
{
num_array[z] = Left[x];
x++;
z++;
}
while(y < val_2)
{
num_array[z] = Right[y];
y++;
z++;
}
}
void merge_sort(int num_array[], int left, int right)
{
if (left < right)
{
int midpoint = left + (right - left) / 2;
merge_sort(num_array, left, midpoint);
merge_sort(num_array, midpoint + 1, right);
merge(num_array, left, midpoint , right);
}
}
int main()
{
int num_array[10] = {1, 5, 3, 8, 6, 0, 9, 2, 4, 7};
int array_size = (sizeof(num_array)/sizeof(*num_array));
merge_sort(num_array, 0, array_size - 1);
for (int i = 0; i < array_size; i++)
{
cout << num_array[i] << ',';
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
fcff52cc95572f1eb3552ba1dca88358abd97e75 | 6a511c484fb2987b4c7650e617dd6f871345aeeb | /src/leetcode_linked-list-cycle.cc | c98dfdca749db392e4ebd02457025cc8e3fa7e9d | [] | no_license | ScarlletQueen/onlinejudge | 47d678bd4eb7c06d00754d41072394a364c50ac7 | 65b605e74bbb1ceab5568a059c6844fcd6c8abeb | refs/heads/master | 2021-01-20T23:32:42.377212 | 2014-04-04T03:31:54 | 2014-04-04T03:31:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 572 | cc | #include <stdio.h>
/**
* Definition for singly-linked list.
*/
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
bool hasCycle(ListNode *head) {
if(head == NULL || head->next == NULL) return false;
ListNode *p1 =head, *p2 = head->next->next;
while(p1 != NULL && p2 != NULL && p2->next != NULL)
{
if(p1 == p2) return true;
else
{
p1 = p1->next;
p2 = p2->next->next;
}
}
return false;
}
}; | [
"ScarlletQueen"
] | ScarlletQueen |
01a9b7bfe35645fd56e5292f610e7dd4ef51d496 | f960942fd5dff4e5815b35302b25b192e60d19c1 | /src/Shadows.h | f0eb1ad666cb12a087dc2b26c17fa66b422d43da | [] | no_license | DimO424/OpenGL-Project | 9dfacb6f14c9388f46a244fa613ad175adb7fe27 | 79fdd0bdb5fb9885fc6c43d1332f76b520678734 | refs/heads/master | 2020-05-30T18:33:28.564276 | 2015-04-02T06:04:59 | 2015-04-02T06:04:59 | 30,327,186 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 572 | h | #ifndef _SHADOWS_H_
#define _SHADOWS_H_
#include "Application.h"
#include "FlyCamera.h"
#include "Vertex.h"
class Shadows : public Application
{
public:
virtual bool Startup();
virtual void Shutdown();
virtual bool Update();
virtual void Draw();
void BuildMeshes();
void BuildShadowMap();
OpenGLData m_bunny;
OpenGLData m_plane;
unsigned int m_fbo;
unsigned int m_fbo_depth;
unsigned int m_shadowmap_program_id;
unsigned int m_diffuse_shadowed_program_id;
vec3 m_light_direction;
mat4 m_light_matrix;
FlyCamera m_Camera;
float m_timer;
};
#endif | [
"dmitri_davidov@hotmail.com"
] | dmitri_davidov@hotmail.com |
084c19ef2f42c4b2c52561a5e4932614670448c6 | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/httpd/gumtree/httpd_repos_function_3114_httpd-2.4.25.cpp | 23d3d9dc6a22bd22607edf3c08ea7c7588230460 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 687 | cpp | static void *merge_includes_dir_config(apr_pool_t *p, void *basev, void *overridesv)
{
include_dir_config *base = (include_dir_config *)basev,
*over = (include_dir_config *)overridesv,
*new = apr_palloc(p, sizeof(include_dir_config));
MERGE(base, over, new, default_error_msg, NULL);
MERGE(base, over, new, default_time_fmt, NULL);
MERGE(base, over, new, undefined_echo, NULL);
MERGE(base, over, new, xbithack, XBITHACK_UNSET);
MERGE(base, over, new, lastmodified, UNSET);
MERGE(base, over, new, etag, UNSET);
MERGE(base, over, new, legacy_expr, UNSET);
return new;
} | [
"993273596@qq.com"
] | 993273596@qq.com |
8646871779bbb18b6f5e4ad0b6f04eb9608ae081 | 8067f6c09f4f4ff406fcf0f9e3bf4f09278f8932 | /Semester 4/iLab/Teknik Pemrograman Terstruktur 2/Minggu 4/Activity M4/arraymatriks.cpp | c8d5ada6436cd3bbaee23eac7b9bc7d5a28f9d63 | [] | no_license | git04112019/College | 4f079693aa6581ebb48ff56ec453242d146e1c85 | 7598702581ac4cadb869eb84b4cc6f16f6354f5f | refs/heads/master | 2023-02-01T22:06:22.293542 | 2020-12-18T16:23:25 | 2020-12-18T16:23:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 272 | cpp | #include <iostream>
using namespace std;
int x,y;
int tabel[3] [5] = {
{1, 2, 3, 4, 5},
{2, 4, 6, 8, 10},
{3, 6, 9, 12, 15}
};
int main () {
for (x=0; x<3; x++) {
for (y=0; y<5; y++) {
cout << tabel[x][y] << " ";
}
cout << "\n";
}
} | [
"work.elmoallistair@gmail.com"
] | work.elmoallistair@gmail.com |
88523d5597d1f4e396a327f795b8b1de2bf61906 | 367d2670c75d385d122bca60b9f550ca5b3888c1 | /gem5/src/cpu/minor/decode.cc | b07ca4aa0f3a23e7282759cd03392a22c3a18b4c | [
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license",
"LGPL-2.0-or-later",
"MIT"
] | permissive | Anish-Saxena/aqua_rowhammer_mitigation | 4f060037d50fb17707338a6edcaa0ac33c39d559 | 3fef5b6aa80c006a4bd6ed4bedd726016142a81c | refs/heads/main | 2023-04-13T05:35:20.872581 | 2023-01-05T21:10:39 | 2023-01-05T21:10:39 | 519,395,072 | 4 | 3 | Unlicense | 2023-01-05T21:10:40 | 2022-07-30T02:03:02 | C++ | UTF-8 | C++ | false | false | 12,450 | cc | /*
* Copyright (c) 2013-2014 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
* not be construed as granting a license to any other intellectual
* property including but not limited to intellectual property relating
* to a hardware implementation of the functionality of the software
* licensed hereunder. You may use the software subject to the license
* terms below provided that you ensure that this notice is replicated
* unmodified and in its entirety in all distributions of the software,
* modified or unmodified, in source code or in binary form.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer;
* redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution;
* neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "cpu/minor/decode.hh"
#include "cpu/minor/pipeline.hh"
#include "debug/Decode.hh"
namespace Minor
{
Decode::Decode(const std::string &name,
MinorCPU &cpu_,
MinorCPUParams ¶ms,
Latch<ForwardInstData>::Output inp_,
Latch<ForwardInstData>::Input out_,
std::vector<InputBuffer<ForwardInstData>> &next_stage_input_buffer) :
Named(name),
cpu(cpu_),
inp(inp_),
out(out_),
nextStageReserve(next_stage_input_buffer),
outputWidth(params.executeInputWidth),
processMoreThanOneInput(params.decodeCycleInput),
decodeInfo(params.numThreads),
threadPriority(0)
{
if (outputWidth < 1)
fatal("%s: executeInputWidth must be >= 1 (%d)\n", name, outputWidth);
if (params.decodeInputBufferSize < 1) {
fatal("%s: decodeInputBufferSize must be >= 1 (%d)\n", name,
params.decodeInputBufferSize);
}
/* Per-thread input buffers */
for (ThreadID tid = 0; tid < params.numThreads; tid++) {
inputBuffer.push_back(
InputBuffer<ForwardInstData>(
name + ".inputBuffer" + std::to_string(tid), "insts",
params.decodeInputBufferSize));
}
}
const ForwardInstData *
Decode::getInput(ThreadID tid)
{
/* Get insts from the inputBuffer to work with */
if (!inputBuffer[tid].empty()) {
const ForwardInstData &head = inputBuffer[tid].front();
return (head.isBubble() ? NULL : &(inputBuffer[tid].front()));
} else {
return NULL;
}
}
void
Decode::popInput(ThreadID tid)
{
if (!inputBuffer[tid].empty())
inputBuffer[tid].pop();
decodeInfo[tid].inputIndex = 0;
decodeInfo[tid].inMacroop = false;
}
#if TRACING_ON
/** Add the tracing data to an instruction. This originates in
* decode because this is the first place that execSeqNums are known
* (these are used as the 'FetchSeq' in tracing data) */
static void
dynInstAddTracing(MinorDynInstPtr inst, StaticInstPtr static_inst,
MinorCPU &cpu)
{
inst->traceData = cpu.getTracer()->getInstRecord(curTick(),
cpu.getContext(inst->id.threadId),
inst->staticInst, inst->pc, static_inst);
/* Use the execSeqNum as the fetch sequence number as this most closely
* matches the other processor models' idea of fetch sequence */
if (inst->traceData)
inst->traceData->setFetchSeq(inst->id.execSeqNum);
}
#endif
void
Decode::evaluate()
{
/* Push input onto appropriate input buffer */
if (!inp.outputWire->isBubble())
inputBuffer[inp.outputWire->threadId].setTail(*inp.outputWire);
ForwardInstData &insts_out = *out.inputWire;
assert(insts_out.isBubble());
for (ThreadID tid = 0; tid < cpu.numThreads; tid++)
decodeInfo[tid].blocked = !nextStageReserve[tid].canReserve();
ThreadID tid = getScheduledThread();
if (tid != InvalidThreadID) {
DecodeThreadInfo &decode_info = decodeInfo[tid];
const ForwardInstData *insts_in = getInput(tid);
unsigned int output_index = 0;
/* Pack instructions into the output while we can. This may involve
* using more than one input line */
while (insts_in &&
decode_info.inputIndex < insts_in->width() && /* Still more input */
output_index < outputWidth /* Still more output to fill */)
{
MinorDynInstPtr inst = insts_in->insts[decode_info.inputIndex];
if (inst->isBubble()) {
/* Skip */
decode_info.inputIndex++;
decode_info.inMacroop = false;
} else {
StaticInstPtr static_inst = inst->staticInst;
/* Static inst of a macro-op above the output_inst */
StaticInstPtr parent_static_inst = NULL;
MinorDynInstPtr output_inst = inst;
if (inst->isFault()) {
DPRINTF(Decode, "Fault being passed: %d\n",
inst->fault->name());
decode_info.inputIndex++;
decode_info.inMacroop = false;
} else if (static_inst->isMacroop()) {
/* Generate a new micro-op */
StaticInstPtr static_micro_inst;
/* Set up PC for the next micro-op emitted */
if (!decode_info.inMacroop) {
decode_info.microopPC = inst->pc;
decode_info.inMacroop = true;
}
/* Get the micro-op static instruction from the
* static_inst. */
static_micro_inst =
static_inst->fetchMicroop(
decode_info.microopPC.microPC());
output_inst = new MinorDynInst(inst->id);
output_inst->pc = decode_info.microopPC;
output_inst->staticInst = static_micro_inst;
output_inst->fault = NoFault;
/* Allow a predicted next address only on the last
* microop */
if (static_micro_inst->isLastMicroop()) {
output_inst->predictedTaken = inst->predictedTaken;
output_inst->predictedTarget = inst->predictedTarget;
}
DPRINTF(Decode, "Microop decomposition inputIndex:"
" %d output_index: %d lastMicroop: %s microopPC:"
" %d.%d inst: %d\n",
decode_info.inputIndex, output_index,
(static_micro_inst->isLastMicroop() ?
"true" : "false"),
decode_info.microopPC.instAddr(),
decode_info.microopPC.microPC(),
*output_inst);
/* Acknowledge that the static_inst isn't mine, it's my
* parent macro-op's */
parent_static_inst = static_inst;
static_micro_inst->advancePC(decode_info.microopPC);
/* Step input if this is the last micro-op */
if (static_micro_inst->isLastMicroop()) {
decode_info.inputIndex++;
decode_info.inMacroop = false;
}
} else {
/* Doesn't need decomposing, pass on instruction */
DPRINTF(Decode, "Passing on inst: %s inputIndex:"
" %d output_index: %d\n",
*output_inst, decode_info.inputIndex, output_index);
parent_static_inst = static_inst;
/* Step input */
decode_info.inputIndex++;
decode_info.inMacroop = false;
}
/* Set execSeqNum of output_inst */
output_inst->id.execSeqNum = decode_info.execSeqNum;
/* Add tracing */
#if TRACING_ON
dynInstAddTracing(output_inst, parent_static_inst, cpu);
#endif
/* Step to next sequence number */
decode_info.execSeqNum++;
/* Correctly size the output before writing */
if (output_index == 0) insts_out.resize(outputWidth);
/* Push into output */
insts_out.insts[output_index] = output_inst;
output_index++;
}
/* Have we finished with the input? */
if (decode_info.inputIndex == insts_in->width()) {
/* If we have just been producing micro-ops, we *must* have
* got to the end of that for inputIndex to be pushed past
* insts_in->width() */
assert(!decode_info.inMacroop);
popInput(tid);
insts_in = NULL;
if (processMoreThanOneInput) {
DPRINTF(Decode, "Wrapping\n");
insts_in = getInput(tid);
}
}
}
/* The rest of the output (if any) should already have been packed
* with bubble instructions by insts_out's initialisation
*
* for (; output_index < outputWidth; output_index++)
* assert(insts_out.insts[output_index]->isBubble());
*/
}
/* If we generated output, reserve space for the result in the next stage
* and mark the stage as being active this cycle */
if (!insts_out.isBubble()) {
/* Note activity of following buffer */
cpu.activityRecorder->activity();
insts_out.threadId = tid;
nextStageReserve[tid].reserve();
}
/* If we still have input to process and somewhere to put it,
* mark stage as active */
for (ThreadID i = 0; i < cpu.numThreads; i++)
{
if (getInput(i) && nextStageReserve[i].canReserve()) {
cpu.activityRecorder->activateStage(Pipeline::DecodeStageId);
break;
}
}
/* Make sure the input (if any left) is pushed */
if (!inp.outputWire->isBubble())
inputBuffer[inp.outputWire->threadId].pushTail();
}
inline ThreadID
Decode::getScheduledThread()
{
/* Select thread via policy. */
std::vector<ThreadID> priority_list;
switch (cpu.threadPolicy) {
case Enums::SingleThreaded:
priority_list.push_back(0);
break;
case Enums::RoundRobin:
priority_list = cpu.roundRobinPriority(threadPriority);
break;
case Enums::Random:
priority_list = cpu.randomPriority();
break;
default:
panic("Unknown fetch policy");
}
for (auto tid : priority_list) {
if (getInput(tid) && !decodeInfo[tid].blocked) {
threadPriority = tid;
return tid;
}
}
return InvalidThreadID;
}
bool
Decode::isDrained()
{
for (const auto &buffer : inputBuffer) {
if (!buffer.empty())
return false;
}
return (*inp.outputWire).isBubble();
}
void
Decode::minorTrace() const
{
std::ostringstream data;
if (decodeInfo[0].blocked)
data << 'B';
else
(*out.inputWire).reportData(data);
MINORTRACE("insts=%s\n", data.str());
inputBuffer[0].minorTrace();
}
}
| [
"asaxena317@krishna-srv4.ece.gatech.edu"
] | asaxena317@krishna-srv4.ece.gatech.edu |
53f5af72bc725424f21011d5bc9f7f635b422265 | 393bd5915290e706b3112214ff40be7bf5cbfd51 | /include/mull/Mutators/MathMulMutator.h | 7715de93339300ad696a2dbdc73c39e6a9356540 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | LongJohnCoder/mull | 65bd7f8c6c7175e8aa178c79f619658130ca1f82 | 54969fd734544d460a551b07757567d9c0a32320 | refs/heads/master | 2020-05-22T00:42:38.040607 | 2019-05-11T09:29:02 | 2019-05-11T09:29:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 981 | h | #pragma once
#include "Mutator.h"
#include <vector>
namespace llvm {
class Instruction;
}
namespace mull {
class MullModule;
class MutationPoint;
class MutationPointAddress;
class MathMulMutator : public Mutator {
public:
static const std::string ID;
static const std::string description;
MutationPoint *getMutationPoint(MullModule *module, llvm::Function *function,
llvm::Instruction *instruction,
SourceLocation &sourceLocation,
MutationPointAddress &address) override;
std::string getUniqueIdentifier() override { return ID; }
std::string getUniqueIdentifier() const override { return ID; }
std::string getDescription() const override { return description; }
bool canBeApplied(llvm::Value &V) override;
llvm::Value *applyMutation(llvm::Function *function,
MutationPointAddress &address) override;
};
} // namespace mull
| [
"1101.debian@gmail.com"
] | 1101.debian@gmail.com |
938890e00a747f39a6c9f4f511b634c5b7bbb838 | b591fbbd37b9b5e81d8f308f61d607fe7b145ed7 | /include/RE/B/BGSLocAlias.h | a87ca854658ff2795d39072f27762d3185ae333c | [
"MIT"
] | permissive | aquilae/CommonLibSSE | f6a1d321b16f2eb1e296f1154d697bd4bed549b6 | b8e6a72875b22c91dd125202dfc6a54f91cda597 | refs/heads/master | 2023-02-02T16:45:00.368879 | 2020-12-15T03:58:22 | 2020-12-15T03:58:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 592 | h | #pragma once
#include "RE/B/BGSBaseAlias.h"
namespace RE
{
class TESCondition;
class BGSLocAlias : public BGSBaseAlias
{
public:
inline static constexpr auto RTTI = RTTI_BGSLocAlias;
inline static constexpr auto VMTYPEID = static_cast<VMTypeID>(141);
virtual ~BGSLocAlias(); // 00
// members
std::uint64_t unk28; // 28
std::uint64_t unk30; // 30
std::uint64_t unk38; // 38
std::uint64_t unk40; // 40
std::uint64_t unk48; // 48
std::uint64_t unk50; // 50
TESCondition* conditions; // 58
};
static_assert(sizeof(BGSLocAlias) == 0x60);
}
| [
"ryan__mckenzie@hotmail.com"
] | ryan__mckenzie@hotmail.com |
4162c939976abd30699e0848be55414c5e117eb7 | 6844e6ccf47fcfe54397dad8bd49d2d1243569c8 | /rational_eq_add_sub/stdafx.cpp | cd3f92699c6865dba5d40319d69314f37dc20270 | [] | no_license | onemoreuselessuser/rational | 89a8aaddf6c679398d26d7ab67865c3ec106da0e | 10069d4af1195ebea556deef95c756357b9ac4a0 | refs/heads/master | 2020-12-03T02:09:59.862094 | 2017-06-30T19:47:17 | 2017-06-30T19:47:17 | 95,912,204 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 298 | cpp | // stdafx.cpp : source file that includes just the standard includes
// rational_eq_add_sub.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
| [
"mail@dkuznetsov.info"
] | mail@dkuznetsov.info |
1b1fb6c8d6d5b718566d7cefa166a96b0b674701 | 2a2f8c6b4ac6a378506b5267af9b917d07a70907 | /cpp/marathon/Annealing.cpp | 8c0c6a24da407bf06ceac57a8d8c3ffeef34d18c | [
"MIT"
] | permissive | togatoga/competitive-lib | 25c5017ca0a08c6d8c41ad77ec3d1b97807bb118 | 760d0d32db36397bd1123591e0bc04c358571c37 | refs/heads/master | 2023-09-05T14:13:03.582696 | 2023-09-05T14:04:26 | 2023-09-05T14:04:26 | 77,304,994 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,429 | cpp | class Annealing {
public:
const double TEMP_CTRL_PARAM = 4.8;
double initial_temp, current_temp;
double simulate_time;
double start_time, end_time;
double best_score;
double param1, param2;
XorShift rnd;
Annealing(double initial_temp, double end_time, double start_time, XorShift rnd) {
this->initial_temp = initial_temp;
this->current_temp = initial_temp;
this->rnd = rnd;
this->best_score = 0;
this->start_time = start_time;
this->end_time = end_time;
this->simulate_time = end_time - start_time;
this->param1 = 1.0 / (simulate_time / TEMP_CTRL_PARAM);
this->param2 = 1.0 / exp(TEMP_CTRL_PARAM);
}
bool cool_down(double elapsed) {
if (elapsed >= end_time)
return false;
// linear function
// current_temp = initial_temp + (final_temp - initial_temp) * ((time
// -start_time) / simulate_time);
// exp function
current_temp = initial_temp * exp((end_time - elapsed) * param1) * param2;
return true;
}
bool transition(int current_s, int neighbor_s) {
// maximization problem
if (current_s < neighbor_s)
return true;
double provability = exp((neighbor_s - current_s) / current_temp);
// minimization problem
// if (current_s > neighbor_s) return true;
// double provability = exp((current_s - neighbor_s) / current_temp);
if (provability >= rnd.sample())
return true;
return false;
}
};
| [
"togasakitogatoga@gmail.com"
] | togasakitogatoga@gmail.com |
5dd19927bf6de0de7deac2984d54f31fae49fb09 | 61becb2d489c220ebab278f1299d1a63f3345c89 | /Header/Engines/GraphicEngine/Sprite.hpp | 6d77391a39da12615b8c51f52e39fc530c3e6084 | [] | no_license | exidhor/IA-Project | 9a64d69b29ff2aaf5d18a7922a8a6713f6b97357 | dc29d750788267f975fb493f996eee92d0f52670 | refs/heads/master | 2021-01-10T12:07:56.371070 | 2016-03-04T13:36:40 | 2016-03-04T13:36:40 | 52,808,776 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,048 | hpp | /*!
* \file Sprite.hpp
* \brief A unique texture symbolize by a QuadVertices
* It provides transformation like rotation
* or translation
* \author Exhidor
* \version 1.6
* \date 2016-02-01
*/
#pragma once
#include <SFML/Graphics.hpp>
#include <iostream>
#include "Engines/GraphicEngine/TextureCharacteristics.hpp"
#include "Engines/GraphicEngine/QuadVertices.hpp"
#include "Engines/GraphicEngine/RotationTransformation.hpp"
#include "Engines/GraphicEngine/TranslationTransformation.hpp"
#include "Engines/GraphicEngine/Drawable.hpp"
namespace fme
{
class Sprite : public Drawable
{
public:
Sprite();
Sprite(TextureCharacteristics* textureCharacteristics,
unsigned int layerLevel = 0);
Sprite(Sprite const& sprite);
virtual ~Sprite();
// method to provid a efficient polymorphism
virtual bool actualize(double timeSpent);
// transformation
void setRotationByTime(float speedPerSecond, double timeUntilTheEnd);
void setRotationByAngle(float speedPerSecond, float newFinalAngle);
void setInfiniteRotation(bool state);
void startRotation();
void stopRotation();
void setTranslationByTargetPoint(
double timeUntilTheEnd,
float abscissa,
float ordinate);
void setTranslationBySpeed(
double timeUntilTheEnd,
unsigned int pixelPerSecondInAbsciss,
unsigned int pixelPerSecondInOrdinate);
void startTranslation();
void stopTranslation();
// methods to provide a powerfull polymorphism
virtual bool isAnimation();
virtual bool isSprite();
virtual bool isShape();
// void method to use animation with polymorphism
virtual void goToLine(unsigned int indexLine);
virtual bool goToTheNextLine();
virtual void setRepeated(bool state);
virtual void setContinueSequence(bool state);
virtual void start();
virtual void stop();
virtual void restart();
virtual void softRestart();
protected:
TextureCharacteristics* m_textureCharacteristics;
//transformation
RotationTransformation m_rotationManager;
TranslationTransformation m_translationManager;
};
} | [
"jipay.detiege@cgmatane.qc.ca"
] | jipay.detiege@cgmatane.qc.ca |
bbfe16a6b5e68764f09cf7d9f2c802467deccc5c | bee6f82b27c772e06fa65f3b3ee90df03973efe8 | /ALander/bin/android/obj/src/spritesheet/data/BehaviorData.cpp | 8c9c10a3138f6fedd9bad9c1364179f7ad11451e | [] | no_license | jcgramos/CaveLander | 299c6198727fec547469dae4c69e01226da7a06a | 571029dea71f202ce28ec98f6917f3bf42cb4a90 | refs/heads/master | 2022-07-31T09:28:12.319372 | 2020-05-22T13:23:25 | 2020-05-22T13:23:25 | 266,115,855 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,108 | cpp | #include <hxcpp.h>
#ifndef INCLUDED_spritesheet_data_BehaviorData
#include <spritesheet/data/BehaviorData.h>
#endif
namespace spritesheet{
namespace data{
Void BehaviorData_obj::__construct(::String __o_name,Array< int > frames,hx::Null< bool > __o_loop,hx::Null< int > __o_frameRate,hx::Null< Float > __o_originX,hx::Null< Float > __o_originY)
{
HX_STACK_FRAME("spritesheet.data.BehaviorData","new",0xa87d92be,"spritesheet.data.BehaviorData.new","spritesheet/data/BehaviorData.hx",21,0x1f7f1e12)
HX_STACK_ARG(__o_name,"name")
HX_STACK_ARG(frames,"frames")
HX_STACK_ARG(__o_loop,"loop")
HX_STACK_ARG(__o_frameRate,"frameRate")
HX_STACK_ARG(__o_originX,"originX")
HX_STACK_ARG(__o_originY,"originY")
::String name = __o_name.Default(HX_CSTRING(""));
bool loop = __o_loop.Default(false);
int frameRate = __o_frameRate.Default(30);
Float originX = __o_originX.Default(0);
Float originY = __o_originY.Default(0);
{
HX_STACK_LINE(23)
if (((name == HX_CSTRING("")))){
HX_STACK_LINE(25)
name = (HX_CSTRING("behavior") + (::spritesheet::data::BehaviorData_obj::uniqueID)++);
}
HX_STACK_LINE(29)
if (((frames == null()))){
HX_STACK_LINE(31)
frames = Array_obj< int >::__new();
}
HX_STACK_LINE(35)
this->name = name;
HX_STACK_LINE(36)
this->frames = frames;
HX_STACK_LINE(37)
this->loop = loop;
HX_STACK_LINE(38)
this->frameRate = frameRate;
HX_STACK_LINE(39)
this->originX = originX;
HX_STACK_LINE(40)
this->originY = originY;
HX_STACK_LINE(42)
this->frameData = Dynamic( Array_obj<Dynamic>::__new() );
HX_STACK_LINE(44)
{
HX_STACK_LINE(44)
int _g1 = (int)0; HX_STACK_VAR(_g1,"_g1");
HX_STACK_LINE(44)
int _g = this->frames->length; HX_STACK_VAR(_g,"_g");
HX_STACK_LINE(44)
while(((_g1 < _g))){
HX_STACK_LINE(44)
int i = (_g1)++; HX_STACK_VAR(i,"i");
HX_STACK_LINE(46)
this->frameData->__Field(HX_CSTRING("push"),true)(null());
}
}
}
;
return null();
}
//BehaviorData_obj::~BehaviorData_obj() { }
Dynamic BehaviorData_obj::__CreateEmpty() { return new BehaviorData_obj; }
hx::ObjectPtr< BehaviorData_obj > BehaviorData_obj::__new(::String __o_name,Array< int > frames,hx::Null< bool > __o_loop,hx::Null< int > __o_frameRate,hx::Null< Float > __o_originX,hx::Null< Float > __o_originY)
{ hx::ObjectPtr< BehaviorData_obj > result = new BehaviorData_obj();
result->__construct(__o_name,frames,__o_loop,__o_frameRate,__o_originX,__o_originY);
return result;}
Dynamic BehaviorData_obj::__Create(hx::DynamicArray inArgs)
{ hx::ObjectPtr< BehaviorData_obj > result = new BehaviorData_obj();
result->__construct(inArgs[0],inArgs[1],inArgs[2],inArgs[3],inArgs[4],inArgs[5]);
return result;}
::spritesheet::data::BehaviorData BehaviorData_obj::clone( ){
HX_STACK_FRAME("spritesheet.data.BehaviorData","clone",0xa048a93b,"spritesheet.data.BehaviorData.clone","spritesheet/data/BehaviorData.hx",53,0x1f7f1e12)
HX_STACK_THIS(this)
HX_STACK_LINE(55)
::String _g = (HX_CSTRING("behavior") + (::spritesheet::data::BehaviorData_obj::uniqueID)++); HX_STACK_VAR(_g,"_g");
HX_STACK_LINE(55)
return ::spritesheet::data::BehaviorData_obj::__new(_g,this->frames->copy(),this->loop,this->frameRate,this->originX,this->originY);
}
HX_DEFINE_DYNAMIC_FUNC0(BehaviorData_obj,clone,return )
int BehaviorData_obj::uniqueID;
BehaviorData_obj::BehaviorData_obj()
{
}
void BehaviorData_obj::__Mark(HX_MARK_PARAMS)
{
HX_MARK_BEGIN_CLASS(BehaviorData);
HX_MARK_MEMBER_NAME(frameData,"frameData");
HX_MARK_MEMBER_NAME(frameRate,"frameRate");
HX_MARK_MEMBER_NAME(frames,"frames");
HX_MARK_MEMBER_NAME(loop,"loop");
HX_MARK_MEMBER_NAME(name,"name");
HX_MARK_MEMBER_NAME(originX,"originX");
HX_MARK_MEMBER_NAME(originY,"originY");
HX_MARK_END_CLASS();
}
void BehaviorData_obj::__Visit(HX_VISIT_PARAMS)
{
HX_VISIT_MEMBER_NAME(frameData,"frameData");
HX_VISIT_MEMBER_NAME(frameRate,"frameRate");
HX_VISIT_MEMBER_NAME(frames,"frames");
HX_VISIT_MEMBER_NAME(loop,"loop");
HX_VISIT_MEMBER_NAME(name,"name");
HX_VISIT_MEMBER_NAME(originX,"originX");
HX_VISIT_MEMBER_NAME(originY,"originY");
}
Dynamic BehaviorData_obj::__Field(const ::String &inName,bool inCallProp)
{
switch(inName.length) {
case 4:
if (HX_FIELD_EQ(inName,"loop") ) { return loop; }
if (HX_FIELD_EQ(inName,"name") ) { return name; }
break;
case 5:
if (HX_FIELD_EQ(inName,"clone") ) { return clone_dyn(); }
break;
case 6:
if (HX_FIELD_EQ(inName,"frames") ) { return frames; }
break;
case 7:
if (HX_FIELD_EQ(inName,"originX") ) { return originX; }
if (HX_FIELD_EQ(inName,"originY") ) { return originY; }
break;
case 8:
if (HX_FIELD_EQ(inName,"uniqueID") ) { return uniqueID; }
break;
case 9:
if (HX_FIELD_EQ(inName,"frameData") ) { return frameData; }
if (HX_FIELD_EQ(inName,"frameRate") ) { return frameRate; }
}
return super::__Field(inName,inCallProp);
}
Dynamic BehaviorData_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
switch(inName.length) {
case 4:
if (HX_FIELD_EQ(inName,"loop") ) { loop=inValue.Cast< bool >(); return inValue; }
if (HX_FIELD_EQ(inName,"name") ) { name=inValue.Cast< ::String >(); return inValue; }
break;
case 6:
if (HX_FIELD_EQ(inName,"frames") ) { frames=inValue.Cast< Array< int > >(); return inValue; }
break;
case 7:
if (HX_FIELD_EQ(inName,"originX") ) { originX=inValue.Cast< Float >(); return inValue; }
if (HX_FIELD_EQ(inName,"originY") ) { originY=inValue.Cast< Float >(); return inValue; }
break;
case 8:
if (HX_FIELD_EQ(inName,"uniqueID") ) { uniqueID=inValue.Cast< int >(); return inValue; }
break;
case 9:
if (HX_FIELD_EQ(inName,"frameData") ) { frameData=inValue.Cast< Dynamic >(); return inValue; }
if (HX_FIELD_EQ(inName,"frameRate") ) { frameRate=inValue.Cast< int >(); return inValue; }
}
return super::__SetField(inName,inValue,inCallProp);
}
void BehaviorData_obj::__GetFields(Array< ::String> &outFields)
{
outFields->push(HX_CSTRING("frameData"));
outFields->push(HX_CSTRING("frameRate"));
outFields->push(HX_CSTRING("frames"));
outFields->push(HX_CSTRING("loop"));
outFields->push(HX_CSTRING("name"));
outFields->push(HX_CSTRING("originX"));
outFields->push(HX_CSTRING("originY"));
super::__GetFields(outFields);
};
static ::String sStaticFields[] = {
HX_CSTRING("uniqueID"),
String(null()) };
#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
{hx::fsObject /*Dynamic*/ ,(int)offsetof(BehaviorData_obj,frameData),HX_CSTRING("frameData")},
{hx::fsInt,(int)offsetof(BehaviorData_obj,frameRate),HX_CSTRING("frameRate")},
{hx::fsObject /*Array< int >*/ ,(int)offsetof(BehaviorData_obj,frames),HX_CSTRING("frames")},
{hx::fsBool,(int)offsetof(BehaviorData_obj,loop),HX_CSTRING("loop")},
{hx::fsString,(int)offsetof(BehaviorData_obj,name),HX_CSTRING("name")},
{hx::fsFloat,(int)offsetof(BehaviorData_obj,originX),HX_CSTRING("originX")},
{hx::fsFloat,(int)offsetof(BehaviorData_obj,originY),HX_CSTRING("originY")},
{ hx::fsUnknown, 0, null()}
};
#endif
static ::String sMemberFields[] = {
HX_CSTRING("frameData"),
HX_CSTRING("frameRate"),
HX_CSTRING("frames"),
HX_CSTRING("loop"),
HX_CSTRING("name"),
HX_CSTRING("originX"),
HX_CSTRING("originY"),
HX_CSTRING("clone"),
String(null()) };
static void sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(BehaviorData_obj::__mClass,"__mClass");
HX_MARK_MEMBER_NAME(BehaviorData_obj::uniqueID,"uniqueID");
};
#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(BehaviorData_obj::__mClass,"__mClass");
HX_VISIT_MEMBER_NAME(BehaviorData_obj::uniqueID,"uniqueID");
};
#endif
Class BehaviorData_obj::__mClass;
void BehaviorData_obj::__register()
{
hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("spritesheet.data.BehaviorData"), hx::TCanCast< BehaviorData_obj> ,sStaticFields,sMemberFields,
&__CreateEmpty, &__Create,
&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
, sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
, sMemberStorageInfo
#endif
);
}
void BehaviorData_obj::__boot()
{
uniqueID= (int)0;
}
} // end namespace spritesheet
} // end namespace data
| [
"jcgramos@gmail.com"
] | jcgramos@gmail.com |
6e63a7b530005ce12774dd899677c25691078cdd | b0d9c8388aadf7fd6810146da42b3ffbf6cc7c3a | /18. Challenges - Bitmasking/5. uniqueNumber2.cpp | e20bd3f3ee790ffc84f2ce4fa9a80f71500cc9a3 | [] | no_license | iampreetsimar/dsa-practice | fad67d8727c2fd6a79fcf57d61b944860703ec8c | 4d3baa1a69dbb13b58b82614065532e73a0ee5bc | refs/heads/master | 2022-11-24T16:14:23.391810 | 2020-07-25T12:52:33 | 2020-07-25T12:52:33 | 280,460,546 | 0 | 0 | null | 2020-07-17T20:25:52 | 2020-07-17T15:29:57 | C++ | UTF-8 | C++ | false | false | 702 | cpp | #include <iostream>
using namespace std;
void printUniqueNumber(int *a, int n) {
int res = 0;
for(int i = 0; i < n; i++) {
res ^= a[i];
}
int pos = 0, temp = res;
while((temp & 1) != 1) {
pos++;
temp = (temp >> 1);
}
int mask = (1 << pos);
int x = 0, y = 0;
for(int i = 0; i < n; i++) {
if((a[i] & mask) > 0) {
x = (x ^ a[i]);
}
}
y = (x ^ res);
cout<<min(x, y)<<" "<<max(x, y);
}
int main() {
// your code goes here
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; i++) {
cin >> a[i];
}
printUniqueNumber(a, n);
return 0;
} | [
"iampreetsimar@gmail.com"
] | iampreetsimar@gmail.com |
ee85cf274cbaf846405825a353078c47b4528e1b | bc39cc4b23d3c0314a7d75ce98f9f36d042f2f8a | /201/lab_1/hello.cpp | 5f9dbabc29ab71ed666dff2d620dd263b7285edf | [] | no_license | jeromehayesjr/University | 1cfea478b0ccb72246e44806ecf25c2484e6662e | 11ffd2bbdf21cf279cbcfe2b927ebcd218a05ecf | refs/heads/master | 2021-08-08T08:02:51.554512 | 2017-11-10T00:00:24 | 2017-11-10T00:00:24 | 110,162,676 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 111 | cpp | #include <iostream>
using namespace std;
int main(int argc, char * args[])
{
cout << "hello, alice\n";
}
| [
"noreply@github.com"
] | noreply@github.com |
418f69196b6f5ca853f0058b85f845d57192a15d | 7698ab439c10b95502b30d785cb38ebfbc07ba62 | /Assignment3/SkeletonProject/Cone3D.h | 3f973a9e42e4c17beb850b8824b8e50b67e71be4 | [] | no_license | KyleStrader/Graphics-2 | ee75d5242f75ec56d7a6cd76efbf0f78be072858 | ea7452ef635f30553ea1ab58fc44d6bf27540a31 | refs/heads/master | 2020-05-31T11:34:49.176745 | 2015-04-05T06:35:19 | 2015-04-05T06:35:19 | 33,414,134 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 467 | h | #include "3DClasses/BaseObject3D.h"
#include "d3dUtil.h"
class Cone3D: public BaseObject3D
{
public:
Cone3D();
Cone3D(float bottomRadius, float length, int sliceCount, int stackCount);
~Cone3D();
virtual void Create(IDirect3DDevice9* gd3dDevice);
void buildTexCoords(IDirect3DDevice9* gd3dDevice);
void Update();
private:
float mLength;
float mRadiusTop;
float mRadiusBottom;
int mStackCount;
int mSliceCount;
int mNumVertices;
int mNumTriangles;
}; | [
"kylestrader94@gmail.com"
] | kylestrader94@gmail.com |
20f39537895ddd84e0068a2986c169b8bc2987d8 | e51d009c6c6a1633c2c11ea4e89f289ea294ec7e | /xr2-dsgn/sources/xray/editor/controls/sources/dock_panel_serializer.h | d9d7e0ffad015357c3c64ac98579291128fe4d38 | [] | no_license | avmal0-Cor/xr2-dsgn | a0c726a4d54a2ac8147a36549bc79620fead0090 | 14e9203ee26be7a3cb5ca5da7056ecb53c558c72 | refs/heads/master | 2023-07-03T02:05:00.566892 | 2021-08-06T03:10:53 | 2021-08-06T03:10:53 | 389,939,196 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 948 | h | ////////////////////////////////////////////////////////////////////////////
// Created : 09.12.2009
// Author : Evgeniy Obertyukh
// Copyright (C) GSC Game World - 2009
////////////////////////////////////////////////////////////////////////////
#ifndef DOCK_PANEL_SERIALIZER_H_INCLUDED
#define DOCK_PANEL_SERIALIZER_H_INCLUDED
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace WeifenLuo::WinFormsUI::Docking;
namespace xray {
namespace editor {
namespace controls{
public ref class serializer
{
public:
static void serialize_dock_panel_root(Form^ root, DockPanel^ panel, String^ window_name);
static bool deserialize_dock_panel_root(Form^ root, DockPanel^ panel, String^ window_name, DeserializeDockContent^ get_panel_for_setting_callback, bool reload);
};
}//namespace controls
}//namespace editor
}//namespace xray
#endif // #ifndef DOCK_PANEL_SERIALIZER_H_INCLUDED | [
"youalexandrov@icloud.com"
] | youalexandrov@icloud.com |
0bea60991b6f62a39fa55356a34c480f0cb45ba3 | 02d3decdd7709a5550a27df0d3c7f6fa935a6b2c | /atcoder/abc237/F.cpp | 0ec3b027690ce2dc4f413470b1fbc110974c6351 | [] | no_license | cdh981009/Algorithm | 8f3a587260774e61bccfe7910746b918672c29d8 | 4f7027da58012cee09d062f8556013b40ff59df8 | refs/heads/master | 2023-04-30T22:56:22.038983 | 2023-04-19T14:50:10 | 2023-04-19T14:50:10 | 240,855,517 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,248 | cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1e9
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FOR_(i, a, b) for (int i = (a); i <= (b); ++i)
using ll = long long;
using pii = pair<int, int>;
constexpr int N = 1000;
constexpr int M = 998244353;
int n, m;
ll ans;
ll dp[N][12][12][12];
// dp[i][a1][a2][a3]
// 길이가 x인 lis가 이미 array에 있을 때 해당 lis 의 끝 중 가장 작은것: ax
ll getDp(int i, int m1, int m2, int m3) {
if (i == n) return (m3 != 11 ? 1 : 0);
ll& ref = dp[i][m1][m2][m3];
if (ref != -1) return ref;
ref = 0;
FOR_(num, 1, m) {
if (num > m3) continue;
if (num > m2) { // (m2, m3]
ref += getDp(i + 1, m1, m2, num);
} else if (num > m1) { // (m1, m2]
ref += getDp(i + 1, m1, num, m3);
} else { // (1, m1]
ref += getDp(i + 1, num, m2, m3);
}
ref %= M;
}
return ref;
}
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
memset(dp, -1, sizeof(dp));
cin >> n >> m;
cout << getDp(0, 11, 11, 11) << '\n';
return 0;
} | [
"cdh981009@gmail.com"
] | cdh981009@gmail.com |
55260c996209385a92023937fd5e97ed4e614476 | 768902646f5cde477706061591c58b4a5c3fb2aa | /src/qt/splashscreen.cpp | 6d20943ba4429baa94eaa66c3cdbf0d0c71d6bc6 | [
"MIT"
] | permissive | kbsphp/bitcoinlove | 8faf35381c8972c5756cda1161eda8e28638a18c | 27cf6eaacf8cef72b0ea6181581ed199f5d4c354 | refs/heads/master | 2020-12-10T09:57:18.882648 | 2020-01-20T06:19:22 | 2020-01-20T06:19:22 | 233,560,306 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,050 | cpp | // Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "splashscreen.h"
#include "clientversion.h"
#include "util.h"
#include <QPainter>
#undef loop /* ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) :
QSplashScreen(pixmap, f)
{
// set reference point, paddings
int paddingLeftCol2 = 230;
int paddingTopCol2 = 376;
int line1 = 0;
int line2 = 13;
int line3 = 26;
float fontFactor = 1.0;
// define text to place
QString titleText = QString(QApplication::applicationName()).replace(QString("-testnet"), QString(""), Qt::CaseSensitive); // cut of testnet, place it as single object further down
QString versionText = QString("Version %1 ").arg(QString::fromStdString(FormatFullVersion()));
QString copyrightText1 = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin developers"));
QString copyrightText2 = QChar(0xA9)+QString(" 2011-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoinlove developers"));
QString font = "Arial";
// load the bitmap for writing some text over it
QPixmap newPixmap;
if(GetBoolArg("-testnet")) {
newPixmap = QPixmap(":/images/splash_testnet");
}
else {
newPixmap = QPixmap(":/images/splash");
}
QPainter pixPaint(&newPixmap);
pixPaint.setPen(QColor(70,70,70));
pixPaint.setFont(QFont(font, 9*fontFactor));
pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line3,versionText);
// draw copyright stuff
pixPaint.setFont(QFont(font, 9*fontFactor));
pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line1,copyrightText1);
pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line2,copyrightText2);
pixPaint.end();
this->setPixmap(newPixmap);
}
| [
"sharanjit@kbs.com"
] | sharanjit@kbs.com |
80891721b21b1b26c0f969056e33bd47b817a6d1 | 641fa8341d8c436ad24945bcbf8e7d7d1dd7dbb2 | /content/renderer/render_process_impl.cc | 0ad4d1b0066be8c76af12461a3d9c798bd51371a | [
"BSD-3-Clause"
] | permissive | massnetwork/mass-browser | 7de0dfc541cbac00ffa7308541394bac1e945b76 | 67526da9358734698c067b7775be491423884339 | refs/heads/master | 2022-12-07T09:01:31.027715 | 2017-01-19T14:29:18 | 2017-01-19T14:29:18 | 73,799,690 | 4 | 4 | BSD-3-Clause | 2022-11-26T11:53:23 | 2016-11-15T09:49:29 | null | UTF-8 | C++ | false | false | 4,259 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/render_process_impl.h"
#include "build/build_config.h"
#if defined(OS_WIN)
#include <windows.h>
#include <objidl.h>
#include <mlang.h>
#endif
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/feature_list.h"
#include "base/sys_info.h"
#include "content/child/site_isolation_stats_gatherer.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/renderer/content_renderer_client.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "v8/include/v8.h"
namespace {
const base::Feature kV8_ES2015_TailCalls_Feature {
"V8_ES2015_TailCalls", base::FEATURE_DISABLED_BY_DEFAULT
};
const base::Feature kV8_ES2016_ExplicitTailCalls_Feature{
"V8_ES2016_ExplicitTailCalls", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kV8SerializeEagerFeature{"V8_Serialize_Eager",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kV8SerializeAgeCodeFeature{
"V8_Serialize_Age_Code", base::FEATURE_DISABLED_BY_DEFAULT};
void SetV8FlagIfFeature(const base::Feature& feature, const char* v8_flag) {
if (base::FeatureList::IsEnabled(feature)) {
v8::V8::SetFlagsFromString(v8_flag, strlen(v8_flag));
}
}
void SetV8FlagIfHasSwitch(const char* switch_name, const char* v8_flag) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switch_name)) {
v8::V8::SetFlagsFromString(v8_flag, strlen(v8_flag));
}
}
} // namespace
namespace content {
RenderProcessImpl::RenderProcessImpl()
: enabled_bindings_(0) {
#if defined(OS_WIN)
// HACK: See http://b/issue?id=1024307 for rationale.
if (GetModuleHandle(L"LPK.DLL") == NULL) {
// Makes sure lpk.dll is loaded by gdi32 to make sure ExtTextOut() works
// when buffering into a EMF buffer for printing.
typedef BOOL (__stdcall *GdiInitializeLanguagePack)(int LoadedShapingDLLs);
GdiInitializeLanguagePack gdi_init_lpk =
reinterpret_cast<GdiInitializeLanguagePack>(GetProcAddress(
GetModuleHandle(L"GDI32.DLL"),
"GdiInitializeLanguagePack"));
DCHECK(gdi_init_lpk);
if (gdi_init_lpk) {
gdi_init_lpk(0);
}
}
#endif
if (base::SysInfo::IsLowEndDevice()) {
std::string optimize_flag("--optimize-for-size");
v8::V8::SetFlagsFromString(optimize_flag.c_str(),
static_cast<int>(optimize_flag.size()));
}
SetV8FlagIfFeature(kV8_ES2015_TailCalls_Feature, "--harmony-tailcalls");
SetV8FlagIfFeature(kV8_ES2016_ExplicitTailCalls_Feature,
"--harmony-explicit-tailcalls");
SetV8FlagIfFeature(kV8SerializeEagerFeature, "--serialize_eager");
SetV8FlagIfFeature(kV8SerializeAgeCodeFeature, "--serialize_age_code");
SetV8FlagIfHasSwitch(switches::kDisableJavaScriptHarmonyShipping,
"--noharmony-shipping");
SetV8FlagIfHasSwitch(switches::kJavaScriptHarmony, "--harmony");
SetV8FlagIfFeature(features::kAsmJsToWebAssembly, "--validate-asm");
SetV8FlagIfFeature(features::kWebAssembly, "--expose-wasm");
SetV8FlagIfFeature(features::kSharedArrayBuffer,
"--harmony-sharedarraybuffer");
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
std::string flags(
command_line.GetSwitchValueASCII(switches::kJavaScriptFlags));
v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
}
SiteIsolationStatsGatherer::SetEnabled(
GetContentClient()->renderer()->ShouldGatherSiteIsolationStats());
}
RenderProcessImpl::~RenderProcessImpl() {
#ifndef NDEBUG
int count = blink::WebFrame::instanceCount();
if (count)
DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES";
#endif
GetShutDownEvent()->Signal();
}
void RenderProcessImpl::AddBindings(int bindings) {
enabled_bindings_ |= bindings;
}
int RenderProcessImpl::GetEnabledBindings() const {
return enabled_bindings_;
}
} // namespace content
| [
"xElvis89x@gmail.com"
] | xElvis89x@gmail.com |
dc8f5e18bdb27e73fe018f55e8f8321e15432938 | 95f0993c1f84b66a308a723f1b5bd7e6b1f14fea | /Mostafa saad sheet a/001_Vanya_and_Fence.cpp | 6ffe3098882ea37361a8eccb484bb5a9873f65a4 | [] | no_license | Abd-ELrahmanHamza/Problem-solving | ab02fd0d0dfe01c236687b468ba61cb7843552cc | 06a3ac51063ece3cdd5d271e9a1fa0102fc1b57f | refs/heads/master | 2023-08-25T19:18:49.195959 | 2021-10-11T20:17:51 | 2021-10-11T20:17:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 329 | cpp | #include <iostream>
using namespace std;
int main()
{
int n, h;
int TotalWidth = 0;
cin >> n >> h;
for (int i = 0; i < n; i++)
{
int tempH;
cin >> tempH;
if (tempH > h)
TotalWidth += 2;
else
TotalWidth += 1;
}
cout << TotalWidth;
return 0;
} | [
"68310502+Abd-ELrahmanHamza@users.noreply.github.com"
] | 68310502+Abd-ELrahmanHamza@users.noreply.github.com |
b0cc8daf8013b619ef4ae23c6fbe4c783c36aad0 | 2b53a25a83b9aa3298f7cf976dc70c734dcdb157 | /OnlineJudgeCode/LC885. Boats to Save People.cpp | c20f112fb75d2019da7007428e87fdc4c7df42ee | [] | no_license | mopack/OnlineJudgeCode | 2e0ce6e77ad133e82f4d5ce3196b78b19a4631e5 | 7a8704b37a69323bd90ac885d1b90d409d877722 | refs/heads/master | 2020-03-20T16:39:46.304160 | 2018-11-23T17:06:22 | 2018-11-23T17:06:22 | 137,543,798 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 932 | cpp | //#include <iostream>
//#include <cstdlib>
//#include <vector>
//#include <string>
//#include <algorithm>
//#define max(a,b) (((a) > (b)) ? (a) : (b))
//using namespace std;
////Sol: Coding: min. Present: AC: Lines/ms/PR
////472ms
//static int fast = []() {ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); return 0; }();
//class Solution {
//public:
// int numRescueBoats(vector<int>&W, int Limit) {
// sort(W.begin(), W.end());
// int Ans = 0;
// while (!W.empty()) {
// Ans++;
// int x = Limit - W.back();
// W.pop_back();
//
// if (W.empty()) break;
// if (W.back() <= x) W.pop_back();
// else if(W.front() <= x) {
// auto it = lower_bound(W.begin(), W.end(), x);
// while (*it > x)it--;
// W.erase(it);
// }
// }
// return Ans;
// }
//};
//int main() {
// //freopen("in.txt", "rt", stdin); freopen("outwjio.txt", "wt", stdout);
// class Solution az;
// system("pause");
// return 0;
//} | [
"mopackp@gmail.com"
] | mopackp@gmail.com |
d41c49dcd4e674ead845505fe958954aa9929a2c | 67160b02a00c12d0680cc5a2291fc26798a56eda | /linux/my_application.cc | f38d0438b8a75a8befb055e32f59c5f091fa6355 | [
"MIT"
] | permissive | hyygetu/fldome | 924abc9e846e213f0040cc19364971a5844938cd | 043b6ddfdcc396ab6961911a2ad80d0363b310d7 | refs/heads/main | 2023-08-19T06:09:59.231903 | 2021-10-19T06:16:32 | 2021-10-19T06:16:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,710 | cc | #include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include "flutter/generated_plugin_registrant.h"
struct _MyApplication {
GtkApplication parent_instance;
char** dart_entrypoint_arguments;
};
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
// Implements GApplication::activate.
static void my_application_activate(GApplication* application) {
MyApplication* self = MY_APPLICATION(application);
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
// desktop).
// If running on X and not using GNOME then just use a traditional title bar
// in case the window manager does more exotic layout, e.g. tiling.
// If running on Wayland assume the header bar will work (may need changing
// if future cases occur).
gboolean use_header_bar = TRUE;
#ifdef GDK_WINDOWING_X11
GdkScreen* screen = gtk_window_get_screen(window);
if (GDK_IS_X11_SCREEN(screen)) {
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
use_header_bar = FALSE;
}
}
#endif
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "fldome");
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
} else {
gtk_window_set_title(window, "fldome");
}
gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
gtk_widget_grab_focus(GTK_WIDGET(view));
}
// Implements GApplication::local_command_line.
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
MyApplication* self = MY_APPLICATION(application);
// Strip out the first argument as it is the binary name.
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
g_autoptr(GError) error = nullptr;
if (!g_application_register(application, nullptr, &error)) {
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
}
g_application_activate(application);
*exit_status = 0;
return TRUE;
}
// Implements GObject::dispose.
static void my_application_dispose(GObject* object) {
MyApplication* self = MY_APPLICATION(object);
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
}
static void my_application_class_init(MyApplicationClass* klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
}
static void my_application_init(MyApplication* self) {}
MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID,
"flags", G_APPLICATION_NON_UNIQUE,
nullptr));
}
| [
"gdream@yeah.net"
] | gdream@yeah.net |
253e84e554e763ac7d2021ea62683c34231b883d | 6df45f4a51458cf480f3f05f1f326000b7d00a8f | /CallIn_Unit.h | 4cb3300e219fc80a693b7c5be6476960fcac8d74 | [] | no_license | pangeo-capital/phone-soft | 4e96f2e7f463835cac19626f7bc12ad3b9efae71 | 38e9f7f741b73eddbf2801b5d44561457be855fb | refs/heads/master | 2020-04-23T21:26:32.927520 | 2019-02-19T12:49:48 | 2019-02-19T12:49:48 | 171,470,776 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 4,561 | h | //---------------------------------------------------------------------------
#ifndef CallIn_UnitH
#define CallIn_UnitH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <ImgList.hpp>
//----------------------------------------------------------------------------
typedef enum{
CallBtnState_Active,
CallBtnState_Focus,
CallBtnState_Pressed,
CallBtnState_NotActive,
}CallBtnState;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
HWND MF_Handle;
CallBtnState ans_bs; //Answer button state
CallBtnState ans_video_bs; //Answer with video button state
CallBtnState dcl_bs; //Decline button state
int ans_bs_left; //left margin of telephone img
int ans_video_bs_left; //left margin of video cam img
int decl_bs_left; //left margin of decline img
TColor __btn_backgr_color;
int ans_base;
int ans_video_base;
int dcl_base;
unsigned _order;
Lang lng;
void __fastcall answer_incoming_call_with_video();
void __fastcall answer_incoming_call();
__published: // IDE-managed Components
TImage *ans_audio_img_static;
TImage *ans_video_img_static;
TImage *decline_img_static;
void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall FormShow(TObject *Sender);
private: // User declarations
public: // User declarations
TPanel* Panel1;
TLabel* Label1;
TImage* Image1;
TImage* Image2;
TImage* Image3;
string callingName;
string displayName; //Используется только в случае, если вызывающего абонента нет в личном списке контактов и в поступившем INVITE в заголовке From: есть поле Diplay Name
string callid;
bool closed_by_btn;
bool connected_to_pph; // pph - parallel phone
string callid_pph; // callid of call to parallel phone
void __fastcall AudioCall();
void __fastcall VideoCall();
void __fastcall answer_incoming_call_with_pph(const string&);
unsigned __fastcall get_order(){return _order;}
void __fastcall set_order(unsigned a){_order = a;}
void __fastcall decline_incoming_call();
void __fastcall DRAW_AUDIO_ANS_BTN__ACTIVE(int /* CURR_BTN_COLOR */);
void __fastcall DRAW_AUDIO_ANS_BTN__FOCUS(int /* CURR_BTN_COLOR */);
void __fastcall DRAW_AUDIO_ANS_BTN__PRESSED(int /* CURR_BTN_COLOR */);
void __fastcall DRAW_VIDEO_ANS_BTN(int /* CURR_BTN_COLOR */, CallBtnState /* new_btn_state */);
void __fastcall DRAW_DECLINE_BTN(int /* CURR_BTN_COLOR */, CallBtnState /* new_btn_state */);
//void __fastcall DRAW_DECLINE_BTN__FOCUS(int /* CURR_BTN_COLOR */);
//void __fastcall DRAW_DECLINE_BTN__PRESSED(int /* CURR_BTN_COLOR */);
void __fastcall Image1MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall Image1MouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
void __fastcall Image1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall Image2MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall Image2MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall Image2MouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
void __fastcall Image3MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall Image3MouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
void __fastcall Image3MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall Panel1MouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
| [
"aermilov@granit.io"
] | aermilov@granit.io |
0d534e718cf351ea9f30b26c3b8a24fee3530b0e | 82bcc0c9c11a3d8a3e0cbc5fc385e24418f79088 | /Lab3/src/stopwatch.cpp | de67a6899999a0d2e8d39576697a69162e6f9523 | [] | no_license | 226543/PAMSI | 128c0689edacae7c8a2b79657b516b41744dc64d | b8b465481d88b968d05df9e5f4db08dc997a876d | refs/heads/master | 2021-01-17T06:31:32.264016 | 2017-06-05T17:53:14 | 2017-06-05T17:53:14 | 83,698,901 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 512 | cpp | #include <iostream>
#include "stopwatch.hh"
void Stopwatch::start() {
gettimeofday(&startTime, NULL);
}
void Stopwatch::stop() {
gettimeofday(&endTime, NULL);
}
void Stopwatch::reset() {
startTime.tv_usec = 0;
startTime.tv_sec = 0;
endTime.tv_usec = 0;
endTime.tv_sec = 0;
}
double Stopwatch::result(){
double duration;
duration = (endTime.tv_sec - startTime.tv_sec) * 1000.0; // sec to ms
duration += (endTime.tv_usec - startTime.tv_usec) / 1000.0; // us to ms
return duration;
}
| [
"226543@student.pwr.edu.pl"
] | 226543@student.pwr.edu.pl |
19936b64b314d9cbdce317f7c383089cb00607da | 0440fcb4ff56e43c4faf855e441e70a99a30186a | /busmaster/Sources/DataTypes/MsgBufLINVFSE.h | d1ea4e23e305beca02860cc33000a4a7dfac4cd6 | [] | no_license | MarcSerraLear/UDS_Busmaster | 0383d1d1349dc3d0e29762c1457821807f530b5d | 9f624aa11ebc4041d6048088ac02960f38a80293 | refs/heads/master | 2020-05-17T12:35:02.189914 | 2014-04-14T13:44:27 | 2014-04-14T13:44:27 | 12,892,058 | 5 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 14,040 | h | /*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file MsgBufLINVFSE.h
* \brief Defines and implements the template class for circular queue
* \author Ratnadip Choudhury
* \copyright Copyright (c) 2011, Robert Bosch Engineering and Business Solutions. All rights reserved.
*
* Defines and implements the template class for circular queue
*/
#if !defined MSGBUFLINVFSE_H__INCLUDED_
#define MSGBUFLINVFSE_H__INCLUDED_
#include "include/Error.h"
#include "BaseMsgBufAll.h"
//#include "afxtempl.h"
const int SIZE_APP_LIN_BUFFER = 5000;
/* This is the concrete template class of a circular queue where each entry is
of fixed size. Implemented as a template class so as to cater to any data type.
Here SMSGBUFFER is the data type in operation. */
template <typename SMSGBUFFER>
class CMsgBufLINVFSE
{
protected:
SMSGBUFFER m_asMsgBuffer[SIZE_APP_LIN_BUFFER]; // The data buffer
CRITICAL_SECTION m_CritSectionForGB; // To make it thread safe
int m_nIndexRead; // Current read index
int m_nIndexWrite; // Current write index
int m_nMsgCount; // Number of message entries
int m_nMsgSize; /* At the beginning we need to
store size of a message entry. This information will be used frequently */
HANDLE m_hNotifyingEvent; // Event to be signalled when
// there is at least one message
public:
// Short explanation on each member function is present in the base class.
// That's why information are not repeated unnecessarily.
CMsgBufLINVFSE();
~CMsgBufLINVFSE();
int ReadFromBuffer(SMSGBUFFER* psMsgBuffer,__int64 nSlotId);
int ReadFromBuffer(SMSGBUFFER* psMsgBuffer,int nIndex);
int WriteIntoBuffer(const SMSGBUFFER* psMsg, __int64 nSlotId, int& nIndex);
int WriteIntoBuffer(const SMSGBUFFER* psMsg);
int GetBufferLength(void) const;
void vClearMessageBuffer(void);
HANDLE hGetNotifyingEvent(void) const;
void vDoSortBuffer(int nField,bool bAscending);
void vDoSortIndexMapArray();
void nGetMapIndexAtID(int nIndex,__int64& nMapIndex);
private:
CMap<__int64, __int64, int, int> m_omIdIndexMap;
};
/******************************************************************************
Function Name : CMsgBufLINVFSE
Input(s) : -
Output : -
Functionality : Standard constructor
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 1.12.2009
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER>
CMsgBufLINVFSE<SMSGBUFFER>::CMsgBufLINVFSE()
{
m_nMsgSize = sizeof(SMSGBUFFER);
vClearMessageBuffer();
InitializeCriticalSection(&m_CritSectionForGB);
m_hNotifyingEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
}
/******************************************************************************
Function Name : ~CMsgBufLINVFSE
Input(s) : -
Output : -
Functionality : Destructor
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 1.12.2009
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER>
CMsgBufLINVFSE<SMSGBUFFER>::~CMsgBufLINVFSE()
{
CloseHandle(m_hNotifyingEvent);
m_hNotifyingEvent = NULL;
DeleteCriticalSection(&m_CritSectionForGB);
}
/******************************************************************************
Function Name : vClearMessageBuffer
Input(s) : void
Output : void
Functionality : Clears the message buffer and resets the indices.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 1.12.2009
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER> void CMsgBufLINVFSE<SMSGBUFFER>::
vClearMessageBuffer(void)
{
memset((BYTE*) m_asMsgBuffer, 0, SIZE_APP_LIN_BUFFER * m_nMsgSize);
m_omIdIndexMap.RemoveAll();
m_nIndexRead = 0;
m_nIndexWrite = 0;
m_nMsgCount = 0;
}
/******************************************************************************
Function Name : ReadFromBuffer
Input(s) : psMsg - The target message entry. An [out] parameter.
Output : EMPTY_APP_BUFFER if buffer is empty; else CALL_SUCCESS.
Functionality : Reads a message entry and advances the read index. On
successful reading operation the present entry is
invalidated to make room for a new entry.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 1.12.2009
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER>
int CMsgBufLINVFSE<SMSGBUFFER>::ReadFromBuffer(SMSGBUFFER* psMsg, int nIndex)
{
HRESULT nResult = S_OK;
#ifdef _DEBUG
ASSERT(psMsg != NULL);
ASSERT(!(m_nIndexRead > SIZE_APP_LIN_BUFFER));
#endif
// Lock the buffer
EnterCriticalSection(&m_CritSectionForGB);
// Check entry indexed by m_nIndexRead. If this particular entry
if (m_nMsgCount == 0)
{
nResult = EMPTY_APP_BUFFER;
}
else if (nIndex >= SIZE_APP_LIN_BUFFER)
{
nResult = ERR_INVALID_INDEX;
}
else
{
INT TempIndex = m_nIndexRead + nIndex;
if (m_nIndexRead + nIndex >= SIZE_APP_LIN_BUFFER)
{
TempIndex -= SIZE_APP_LIN_BUFFER;
}
*psMsg = m_asMsgBuffer[TempIndex];
}
// Unlock the buffer
LeaveCriticalSection(&m_CritSectionForGB);
return nResult;
}
template <typename SMSGBUFFER>
int CMsgBufLINVFSE<SMSGBUFFER>::ReadFromBuffer(SMSGBUFFER* psMsg, __int64 nSlotId)
{
HRESULT nResult = CALL_SUCCESS;
int nIndex;
#ifdef _DEBUG
ASSERT(psMsg != NULL);
ASSERT(!(m_nIndexRead > SIZE_APP_LIN_BUFFER));
#endif
// Lock the buffer
EnterCriticalSection(&m_CritSectionForGB);
// Check entry indexed by m_nIndexRead. If this particular entry
if (m_nMsgCount == 0)
{
nResult = EMPTY_APP_BUFFER;
}
else
{
if (m_omIdIndexMap.Lookup(nSlotId, nIndex))
{
*psMsg = m_asMsgBuffer[nIndex];
}
else
{
nResult = ERR_INVALID_SLOT;
}
}
// Unlock the buffer
LeaveCriticalSection(&m_CritSectionForGB);
return nResult;
}
/******************************************************************************
Function Name : WriteIntoBuffer
Input(s) : psMsg - The source message entry. An [in] parameter.
Output : ERR_FULL_APP_BUFFER if buffer is full; else CALL_SUCCESS.
Functionality : Writes a message entry and advances the write index.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 1.12.2009
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER>
int CMsgBufLINVFSE<SMSGBUFFER>::WriteIntoBuffer(const SMSGBUFFER* psMsg,
__int64 nSlotId, int& nIndex)
{
int nResult = CALL_SUCCESS;
#ifdef _DEBUG
ASSERT(psMsg != NULL);
ASSERT(!(m_nIndexWrite > SIZE_APP_LIN_BUFFER));
#endif
EnterCriticalSection(&m_CritSectionForGB); // Lock the buffer
if (m_nMsgCount == SIZE_APP_LIN_BUFFER) // Check for buffer overflow
{
nResult = ERR_FULL_APP_BUFFER;
}
else
{
if (m_omIdIndexMap.Lookup(nSlotId, nIndex))
{
m_asMsgBuffer[nIndex] = *psMsg;
}
else
{
nIndex = m_nMsgCount;
m_asMsgBuffer[m_nMsgCount] = *psMsg;
m_omIdIndexMap[nSlotId] = m_nMsgCount;
++m_nMsgCount;
}
SetEvent(m_hNotifyingEvent);
}
LeaveCriticalSection(&m_CritSectionForGB); // Unlock the buffer
return nResult;
}
template <typename SMSGBUFFER>
int CMsgBufLINVFSE<SMSGBUFFER>::WriteIntoBuffer(const SMSGBUFFER* psMsg)
{
int nResult = CALL_SUCCESS;
#ifdef _DEBUG
ASSERT(psMsg != NULL);
ASSERT(!(m_nIndexWrite > SIZE_APP_LIN_BUFFER));
#endif
EnterCriticalSection(&m_CritSectionForGB); // Lock the buffer
if (m_nMsgCount == SIZE_APP_LIN_BUFFER) // Check for buffer overflow
{
m_asMsgBuffer[m_nIndexRead] = *psMsg;
m_nIndexRead++;
if (m_nIndexRead == SIZE_APP_LIN_BUFFER)
{
m_nIndexRead = 0;
}
nResult = ERR_FULL_APP_BUFFER;
}
else
{
m_asMsgBuffer[m_nMsgCount] = *psMsg;
++m_nMsgCount;
SetEvent(m_hNotifyingEvent);
}
LeaveCriticalSection(&m_CritSectionForGB); // Unlock the buffer
return nResult;
}
/******************************************************************************
Function Name : GetBufferLength
Input(s) : void
Output : Number of message entries (int)
Functionality : Returns the number of unread entries in the queue.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 1.12.2009
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER> int CMsgBufLINVFSE<SMSGBUFFER>::
GetBufferLength(void) const
{
return m_nMsgCount;
}
/******************************************************************************
Function Name : hGetNotifyingEvent
Input(s) : void
Output : The notifying event handle (HANDLE)
Functionality : Returns handle of the event that gets signalled when
a message entry is added.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 1.12.2009
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER> HANDLE CMsgBufLINVFSE<SMSGBUFFER>::
hGetNotifyingEvent(void) const
{
return m_hNotifyingEvent;
}
/******************************************************************************
Function Name : vDoSortBuffer
Input(s) : nField - The field to be used as the sorting key.
Output : -
Functionality : Reorders the list according to the sorting key specified.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Ratnadip Choudhury
Date Created : 21-06-2010
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER> void CMsgBufLINVFSE<SMSGBUFFER>::
vDoSortBuffer(int nField,bool bAscending)
{
SMSGBUFFER::vSetSortField(nField);
SMSGBUFFER::vSetSortAscending(bAscending);
qsort((void*) m_asMsgBuffer, (size_t) GetBufferLength(),
sizeof(SMSGBUFFER), SMSGBUFFER::DoCompareIndiv);
//After sorting Start index has to be reset
m_nIndexRead = 0;
//in case of Append Mode the count will be 0
if(m_omIdIndexMap.GetCount() ==0)
{
return;
}
vDoSortIndexMapArray();
}
/******************************************************************************
Function Name : vDoSortIndexMapArray
Input(s) :
Output : -
Functionality : Reorders the Index Map Array according to the order specified.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Arunkumar K
Date Created : 28-06-2010
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER> void CMsgBufLINVFSE<SMSGBUFFER>::
vDoSortIndexMapArray()
{
for(int nCnt = 0; nCnt< m_omIdIndexMap.GetCount(); nCnt++)
{
__int64 nSlotID = SMSGBUFFER::GetSlotID(m_asMsgBuffer[nCnt]);
m_omIdIndexMap.SetAt(nSlotID, nCnt);
}
}
/******************************************************************************
Function Name : nGetMapIndexAtID
Input(s) : nIndex - The Index at which the SlotID needs to be pickef from.
Output : -
Functionality : Returns the Slot ID of the index specified in m_omIdIndexMap.
Member of : CMsgBufLINVFSE
Friend of : -
Author(s) : Arunkumar K
Date Created : 28-06-2010
Modification date:
Modification By :
******************************************************************************/
template <typename SMSGBUFFER> void CMsgBufLINVFSE<SMSGBUFFER>::
nGetMapIndexAtID(int nIndex,__int64& nMapIndex)
{
POSITION pos = m_omIdIndexMap.GetStartPosition();
int nLocalIndex=0;
__int64 nSlotID;
while( pos != NULL )
{
m_omIdIndexMap.GetNextAssoc(pos, nSlotID, nLocalIndex);
if(nIndex == nLocalIndex)
{
nMapIndex = nSlotID;
return;
}
}
}
#endif //MSGBUFLINVFSE_H__INCLUDED_ | [
"mserrasunol@lear.com"
] | mserrasunol@lear.com |
23dc1876f2b7657f2a67349933d8dabc0453376c | b97d83635b0afaf76b22f5005a9f330e4c7d4fcf | /paintedwidget.cpp | bef36d3b34dfd1adf31b4d28d732b9f954b2bbe8 | [] | no_license | Deerdev/QT_study_4_QPainter | 0ae00146c27acff72c857b3967bd2566561de64d | ede8ecda97bb497e1592c664a69631535af887ec | refs/heads/master | 2021-05-27T19:52:00.133905 | 2014-05-22T11:57:15 | 2014-05-22T11:57:15 | 20,045,256 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 948 | cpp | #include "paintedwidget.h"
#include <QPainter>
/**********************
*QPainter画图的简单介绍*
**********************
*/
PaintedWidget::PaintedWidget(QWidget *parent)
: QWidget(parent)
{
resize(800,600);
setWindowTitle(tr("Paint Demo1"));
}
//qt绘图系统提供主要的的参数设置,画笔(pen)、画刷(brush)和字体(font)
void PaintedWidget::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.drawLine(10,10,650,500); //画线(x1,y1,x2,y2)
painter.setPen(Qt::red); //设置线条笔的颜色
painter.drawRect(10,10,100,400); //画矩形(x,y,宽,高),(x,y)left corner
painter.setPen(QPen(Qt::green,5)); //画轮廓线,设定颜色:绿色5px的轮廓
painter.setBrush(Qt::blue); //图形内部的填充颜色
painter.drawEllipse(10,10,400,200); //椭圆(x,y,宽,高),在矩形中画椭圆,概念同矩形
}
PaintedWidget::~PaintedWidget()
{
}
| [
"ludaoquan@163.com"
] | ludaoquan@163.com |
c9853bc2e54e7d4798aa50cb5092108ce010b341 | 1834c0796ee324243f550357c67d8bcd7c94de17 | /SDK/TCF_WBP_SettingsContent_Game_classes.hpp | c97503b6c1b029e2c2b719ed73b904fdadd1e448 | [] | no_license | DarkCodez/TCF-SDK | ce41cc7dab47c98b382ad0f87696780fab9898d2 | 134a694d3f0a42ea149a811750fcc945437a70cc | refs/heads/master | 2023-08-25T20:54:04.496383 | 2021-10-25T11:26:18 | 2021-10-25T11:26:18 | 423,337,506 | 1 | 0 | null | 2021-11-01T04:31:21 | 2021-11-01T04:31:20 | null | UTF-8 | C++ | false | false | 12,653 | hpp | #pragma once
// The Cycle Frontier (1.X) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "TCF_WBP_SettingsContent_Game_structs.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// WidgetBlueprintGeneratedClass WBP_SettingsContent_Game.WBP_SettingsContent_Game_C
// 0x00F0 (0x0430 - 0x0340)
class UWBP_SettingsContent_Game_C : public UWBP_SettingsContentBase_C
{
public:
struct FPointerToUberGraphFrame UberGraphFrame; // 0x0340(0x0008) (CPF_ZeroConstructor, CPF_Transient, CPF_DuplicateTransient, CPF_UObjectWrapper)
class UWBP_Dropdown_Btn_C* WBP_Dropdown_Btn_Language; // 0x0348(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_ChatEnabled; // 0x0350(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_FOVMovementChanges; // 0x0358(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinBrazilianPortugueseChannel; // 0x0360(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinChineseChannel; // 0x0368(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinEnglishChannel; // 0x0370(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinFrenchChannel; // 0x0378(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinGermanChannel; // 0x0380(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinPolishChannel; // 0x0388(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinRussianChannel; // 0x0390(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinSpanishChannel; // 0x0398(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_JoinTurkishChannel; // 0x03A0(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_Language; // 0x03A8(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_RotateMinimap; // 0x03B0(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingEntry_Item_C* WBP_SettingEntry_Item_Subtitles; // 0x03B8(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_SettingSectionHeader_Item_C* WBP_SettingSectionHeader_Chat; // 0x03C0(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_BrazilianPortugueseChannel; // 0x03C8(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_ChatEnabled; // 0x03D0(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_ChineseChannel; // 0x03D8(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_EnglishChannel; // 0x03E0(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_FOVMovementChanges; // 0x03E8(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_FrenchChannel; // 0x03F0(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_GermanChannel; // 0x03F8(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_PolishChannel; // 0x0400(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_RotateMinimap; // 0x0408(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_RussianChannel; // 0x0410(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_SpanishChannel; // 0x0418(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_Subtitles; // 0x0420(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
class UWBP_ToggleText_Btn_C* WBP_ToggleText_Btn_TurkishChannel; // 0x0428(0x0008) (CPF_BlueprintVisible, CPF_ExportObject, CPF_ZeroConstructor, CPF_InstancedReference, CPF_IsPlainOldData, CPF_RepSkip, CPF_NoDestructor, CPF_PersistentInstance, CPF_HasGetValueTypeHash)
static UClass* StaticClass()
{
static auto ptr = UObject::FindObject<UClass>("WidgetBlueprintGeneratedClass WBP_SettingsContent_Game.WBP_SettingsContent_Game_C");
return ptr;
}
void UpdateChatToggles();
void Provider_OnDataChanged(struct FName* DataName, struct FName* dataType);
void UpdateLanguages();
void Initialize();
void RegisterWidgets();
void BndEvt__WBP_ToggleText_Btn_BrazilianPortugueseChannel_K2Node_ComponentBoundEvent_1_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_ChatEnabled_K2Node_ComponentBoundEvent_2_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_ChineseChannel_K2Node_ComponentBoundEvent_3_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_EnglishChannel_K2Node_ComponentBoundEvent_4_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_FOVMovementChanges_K2Node_ComponentBoundEvent_5_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_FrenchChannel_K2Node_ComponentBoundEvent_6_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_GermanChannel_K2Node_ComponentBoundEvent_7_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_PolishChannel_K2Node_ComponentBoundEvent_8_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_RotateMinimap_K2Node_ComponentBoundEvent_9_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_RussianChannel_K2Node_ComponentBoundEvent_10_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_SpanishChannel_K2Node_ComponentBoundEvent_16_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_Subtitles_K2Node_ComponentBoundEvent_17_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_ToggleText_Btn_TurkishChannel_K2Node_ComponentBoundEvent_18_OnToggleChanged__DelegateSignature(class UWBP_ToggleText_Btn_C* Toggle, bool toggled);
void BndEvt__WBP_Dropdown_Btn_Language_K2Node_ComponentBoundEvent_0_OnSelectedOptionDelegate__DelegateSignature(class UWBP_DropdownBase_Btn_C* Dropdown, const struct FString& Option, int Index);
void ExecuteUbergraph_WBP_SettingsContent_Game(int EntryPoint);
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"30532128+pubgsdk@users.noreply.github.com"
] | 30532128+pubgsdk@users.noreply.github.com |
d6625e1be39ed4d2047e47a6bb92b346697f53ca | 704d1167ced0a2029561b3bd58fb3cf5b248f5cd | /OregonScientificExample/LCDHelper.ino | 9adc5ab8bc69d5161282dfa18f86c14e7d47f0dd | [] | no_license | WickedDevice/OregonRFM69 | 8317f520e9e7e212fe8e339c4b9d692e129ebbc9 | f96910b28cda1755cd1017c30f5294e99ffbc15f | refs/heads/master | 2016-09-05T15:34:02.203152 | 2014-07-23T16:02:43 | 2014-07-23T16:02:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,488 | ino | /** Contains the helper functions for the LCD.
* @file LCDHelper.ino */
/** Clears the entire screen then prints the specified string on the top line.
* @param message The message to be displayed on the top line of the screen. */
void lcd_print_top(char* message) {
lcd.clear();
lcd.print(message);
}
/** Clears the bottom line of the LCD screen before printing the desired message there.
* @param message The message to be printed on the bottom line of the LCD. */
void lcd_print_bottom(char* message) {
// Clears the bottom row of the lcd
lcd.setCursor(0,1);
lcd.print(" ");
// Prints the message
lcd.setCursor(0,1);
lcd.print(message);
}
/** Prints a countdown in the bottom left corner of the LCD display.
* @param val The value to be displayed in the bottom left corner. */
void lcd_print_countdown(uint16_t val){
uint8_t cursor_pos;
if(val > 9){
cursor_pos = 14;
}
else if(val > 100){
cursor_pos = 13;
}
else{
cursor_pos = 15;
}
lcd.setCursor(12, 1);
lcd.print(" ");
lcd.setCursor(cursor_pos, 1);
lcd.print(val);
}
/** A helper function that will print the DHT22 temperature and humidity to the LCD.
* @param temp The temperature provided by the DHT22.
* @param humid The humidity provided by the DHT22.*/
void lcd_print_dht22(double temp, double humid){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(temp);
lcd.setCursor(0,1);
lcd.print("Humid: ");
lcd.print(humid);
}
| [
"joel.sabol@wickeddevice.com"
] | joel.sabol@wickeddevice.com |
f35de8b6c6430e62acd06fead51cd6ad82b20f70 | 602e0f4bae605f59d23688cab5ad10c21fc5a34f | /MyToolKit/NumericalRecipes/examples/xrtsafe.cpp | 358a32a9dd38401d2f300c4ae5bbc18ca65266ef | [] | no_license | yanbcxf/cpp | d7f26056d51f85254ae1dd2c4e8e459cfefb2fb6 | e059b02e7f1509918bbc346c555d42e8d06f4b8f | refs/heads/master | 2023-08-04T04:40:43.475657 | 2023-08-01T14:03:44 | 2023-08-01T14:03:44 | 172,408,660 | 8 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 897 | cpp | #include <iostream>
#include <iomanip>
#include "nr.h"
using namespace std;
// Driver for routine rtsafe
DP fx(const DP x)
{
return NR::bessj0(x);
}
void funcd(const DP x,DP &fn, DP &df)
{
fn=NR::bessj0(x);
df = -NR::bessj1(x);
}
int main(void)
{
const int N=100,NBMAX=20;
const DP X1=1.0,X2=50.0;
int i,nb=NBMAX;
DP xacc,root;
Vec_DP xb1(NBMAX),xb2(NBMAX);
NR::zbrak(fx,X1,X2,N,xb1,xb2,nb);
cout << endl << "Roots of bessj0:" << endl;
cout << setw(20) << "x" << setw(16) << "f(x)" << endl;
cout << fixed << setprecision(6);
for (i=0;i<nb;i++) {
xacc=(1.0e-6)*(xb1[i]+xb2[i])/2.0;
root=NR::rtsafe(funcd,xb1[i],xb2[i],xacc);
cout << "root" << setw(4) << (i+1) << setw(15) << root;
cout << setw(15) << fx(root) << endl;
}
return 0;
}
| [
"yangbin@star-net.cn"
] | yangbin@star-net.cn |
ed0cdfad9b2af4a6bb8d4a17bd1fb43d9a5d2319 | 98eeed196b5cd88ee929a864e36d5ff43cce26ff | /Hismic2-Core/src/maths/maths_func.h | 6ecbf5d5c672636d98539a0d86e7de7f42904002 | [] | no_license | dimutch833/HismicEngine2 | 04d8ab2d9845d1bcf276cb258877aa50aebeb3ae | 8edaefe85a0f205ff3b46c7a0a8de99ba2281ef6 | refs/heads/master | 2023-03-18T16:07:02.320483 | 2021-03-06T14:03:34 | 2021-03-06T14:03:34 | 276,127,333 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 175 | h | #pragma once
#include <corecrt_math_defines.h>
namespace hismic {
namespace maths {
inline float ToRadians(float degrees) {
return degrees * (M_PI / 180.0f);
}
}
} | [
"48991276+dimutch833@users.noreply.github.com"
] | 48991276+dimutch833@users.noreply.github.com |
bae7a407041bb4da55855f218aa6fbd433b0a20c | bb5f55f6d0bd8bbb53e95c3a6def7f423e0e2234 | /it.unibo.finaltask.basicrobotcontroller/BasicRobotController/PID.cpp | e4aad4c87914ad93072e6a57d4f77d59a702f85c | [] | no_license | BMRTP/smartcleaner | 5ac314966f01ab1dd658c668136ece74aa9a431c | 792291d8f50bb71ad0eb45fd9203025553790335 | refs/heads/master | 2022-12-25T13:11:30.167444 | 2020-02-11T11:03:30 | 2020-02-11T11:03:30 | 235,150,365 | 5 | 0 | null | 2022-12-11T22:46:57 | 2020-01-20T16:51:07 | Java | UTF-8 | C++ | false | false | 1,401 | cpp | #include "PID.h"
#include "Utils.h"
#include "Arduino.h"
float absoluteBound(float v, float max) {
return abs(v) > max ? max * sign(v) : v;
}
float PID::p_term(float dt) {
return this->error;
}
float PID::d_term(float dt) {
return (this->error - this->lastError) / dt;
}
float PID::i_term(float dt) {
if(sign(this->error) != sign(this->lastError)) {
this->integral = 0;
} else {
this->integral += this->error * dt;
}
return integral;
}
PID::PID(float p, float i, float d, float maxOutput){
this->setParameters(p, i, d);
this->reset();
this->maxOutput = maxOutput;
}
float PID::update(float error) {
this->lastError = this->error;
this->lastErrorTime = this->errorTime;
this->error = error;
this->errorTime = micros();
if(this->first) {
this->first = false;
return 0.0;
} else {
float dt = (this->errorTime - this->lastErrorTime) / 1000000.0;
float P = this->p * this->p_term(dt);
float D = this->d * this->d_term(dt);
float I = absoluteBound(this->i * this->i_term(dt), this->maxOutput) / (abs(D)+1);
return absoluteBound(-(P + I + D), this->maxOutput);
}
}
void PID::setParameters(float p, float i, float d) {
this->p = p;
this->i = i;
this->d = d;
}
void PID::reset() {
this->error = 0;
this->errorTime = 0;
this->lastError = 0;
this->lastErrorTime = 0;
this->integral = 0;
this->first = true;
}
| [
"edoardo.barbieri4@studio.unibo.it"
] | edoardo.barbieri4@studio.unibo.it |
1a15c281db3412777df696ba50bc49d254f64150 | 0d805bb4929675dfc1280df7aa0aff4fdc8453c5 | /libraries/Statistic/Statistic.cpp | f1cffdc32fb19e709c21d1e4766c5e8500e5a20f | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | sdkn104/Arduino | d86e9be7ed10e493e85c997ec86352f18156033d | 68af30ae7d6c831ba1e51300e821bd09bd52cce2 | refs/heads/master | 2020-08-01T13:03:15.250828 | 2019-02-06T21:52:20 | 2019-02-06T21:52:20 | 73,575,542 | 7 | 1 | null | 2017-08-02T20:14:21 | 2016-11-12T20:06:19 | C++ | WINDOWS-1252 | C++ | false | false | 3,912 | cpp | //
// FILE: Statistic.cpp
// AUTHOR: Rob dot Tillaart at gmail dot com
// modified at 0.3 by Gil Ross at physics dot org
// VERSION: 0.3.4
// PURPOSE: Recursive statistical library for Arduino
//
// NOTE: 2011-01-07 Gill Ross
// Rob Tillaart's Statistic library uses one-pass of the data (allowing
// each value to be discarded), but expands the Sum of Squares Differences to
// difference the Sum of Squares and the Average Squared. This is susceptible
// to bit length precision errors with the float type (only 5 or 6 digits
// absolute precision) so for long runs and high ratios of
// the average value to standard deviation the estimate of the
// standard error (deviation) becomes the difference of two large
// numbers and will tend to zero.
//
// For small numbers of iterations and small Average/SE th original code is
// likely to work fine.
// It should also be recognised that for very large samples, questions
// of stability of the sample assume greater importance than the
// correctness of the asymptotic estimators.
//
// This recursive algorithm, which takes slightly more computation per
// iteration is numerically stable.
// It updates the number, mean, max, min and SumOfSquaresDiff each step to
// deliver max min average, population standard error (standard deviation) and
// unbiassed SE.
// -------------
//
// HISTORY:
// 0.1 - 2010-10-29 initial version
// 0.2 - 2010-10-29 stripped to minimal functionality
// 0.2.01 - 2010-10-30
// added minimim, maximum, unbiased stdev,
// changed counter to long -> int overflows @32K samples
// 0.3 - 2011-01-07
// branched from 0.2.01 version of Rob Tillaart's code
// 0.3.1 - minor edits
// 0.3.2 - 2012-11-10
// minor edits
// changed count -> unsigned long allows for 2^32 samples
// added variance()
// 0.3.3 - 2015-03-07
// float -> double to support ARM (compiles)
// moved count() sum() min() max() to .h; for optimizing compiler
// 0.3.4 - 2017-07-31
// Refactored const in many places
// [reverted] double to float on request as float is 99.99% of the cases
// good enough and float(32 bit) is supported in HW for some processors.
//
// Released to the public domain
//
#include "Statistic.h"
Statistic::Statistic()
{
clear();
}
// resets all counters
void Statistic::clear()
{
_cnt = 0;
_sum = 0;
_min = 0;
_max = 0;
#ifdef STAT_USE_STDEV
_ssqdif = 0.0; // not _ssq but sum of square differences
// which is SUM(from i = 1 to N) of
// (f(i)-_ave_N)**2
#endif
}
// adds a new value to the data-set
void Statistic::add(const float value)
{
if (_cnt == 0)
{
_min = value;
_max = value;
} else {
if (value < _min) _min = value;
else if (value > _max) _max = value;
}
_sum += value;
_cnt++;
#ifdef STAT_USE_STDEV
if (_cnt > 1)
{
float _store = (_sum / _cnt - value);
_ssqdif = _ssqdif + _cnt * _store * _store / (_cnt-1);
// ~10% faster but limits the amount of samples to 65K as _cnt*_cnt overflows
// float _store = _sum - _cnt * value;
// _ssqdif = _ssqdif + _store * _store / (_cnt*_cnt - _cnt);
}
#endif
}
// returns the average of the data-set added sofar
float Statistic::average() const
{
if (_cnt == 0) return NAN; // original code returned 0
return _sum / _cnt;
}
// Population standard deviation = s = sqrt [ S ( Xi - µ )2 / N ]
// http://www.suite101.com/content/how-is-standard-deviation-used-a99084
#ifdef STAT_USE_STDEV
float Statistic::variance() const
{
if (_cnt == 0) return NAN; // otherwise DIV0 error
return _ssqdif / _cnt;
}
float Statistic::pop_stdev() const
{
if (_cnt == 0) return NAN; // otherwise DIV0 error
return sqrt( _ssqdif / _cnt);
}
float Statistic::unbiased_stdev() const
{
if (_cnt < 2) return NAN; // otherwise DIV0 error
return sqrt( _ssqdif / (_cnt - 1));
}
#endif
// END OF FILE | [
"sdkn104@yahoo.co.jp"
] | sdkn104@yahoo.co.jp |
ea701591f74f6987406796a0056edc78a495db74 | adccbc75defc4934530fbe39fdd05352f5434066 | /learncpp01.cpp | 2419c6d7a1362057ea2ee6aa81c421c7f0bd0dd4 | [] | no_license | rsmina/opesystmi182_learncpp | b4ba78f68718dfcf9d0dc75fe2d090a8bfedfaba | e712c429663c2534b2448fbb4a29ecf0f8adb978 | refs/heads/master | 2020-09-20T17:51:32.489339 | 2019-12-02T02:37:59 | 2019-12-02T02:37:59 | 224,552,216 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 323 | cpp | #include <iostream>
using namespace std;
int main()
{
int x;
int y;
cout << "Enter a number: ";
cin >> x;
cout << "Enter another number: ";
cin >> y;
int sum = x + y;
int product = x * y;
cout << "Sum: " << sum << endl;
cout << "Product: " << product << endl;
return 0;
}
| [
"smreign@gmail.com"
] | smreign@gmail.com |
f139c273e4782fafed87a6552a9f88ad1cb96842 | 3f9d5b83b2f0472507e4bea18cb40401cbd4dabc | /mainwindow.cpp | 6cd7bc728b935e75e1238474e6219d4b470ac9a3 | [] | no_license | LightningFootball/BeijingSubwayInfoSystemApplication_Qt | 0e402fff296313b427581a22316d562623ff05b4 | d6ac5052007fdb4245484a9c2995cfcb9d82fd85 | refs/heads/main | 2023-02-04T16:12:35.709521 | 2020-12-17T13:01:12 | 2020-12-17T13:01:12 | 320,226,615 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,046 | cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(fareSearchWindow,SIGNAL(fareWindowCloseSignal()),this,SLOT(windowShow()));
connect(pathSearchWindow,SIGNAL(pathSearchWindowClosedSignal()),this,SLOT(windowShow()));
connect(mapWindow,SIGNAL(mapWindowReturned()),this,SLOT(windowShow()));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pathSearchButton_clicked()
{
this->hide();
//PathSearchWindow* window=new PathSearchWindow;
pathSearchWindow->show();
}
void MainWindow::on_fareSearchButto_clicked()
{
this->hide();
//FareSearchWindow* window=new FareSearchWindow;
fareSearchWindow->show();
}
void MainWindow::on_mapSearchButton_clicked()
{
this->hide();
//MapWindow* window=new MapWindow;
mapWindow->show();
}
void MainWindow::on_actionAbout_triggered()
{
//AboutWindow* window= new AboutWindow;
aboutWindow->show();
}
void MainWindow::windowShow()
{
this->show();
}
| [
"lizerun1999@outlook.com"
] | lizerun1999@outlook.com |
3dd8c98dd57d018ba6bb1330e4098f4ad230b385 | a06a9ae73af6690fabb1f7ec99298018dd549bb7 | /_Library/_Include/boost/thread/once.hpp | eafd230771a5c58b6bea07ebada33ff10e71f737 | [] | no_license | longstl/mus12 | f76de65cca55e675392eac162dcc961531980f9f | 9e1be111f505ac23695f7675fb9cefbd6fa876e9 | refs/heads/master | 2021-05-18T08:20:40.821655 | 2020-03-29T17:38:13 | 2020-03-29T17:38:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,358 | hpp | #ifndef BOOST_THREAD_ONCE_HPP
#define BOOST_THREAD_ONCE_HPP
// once.hpp
//
// (C) Copyright 2006-7 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/thread/detail/config.hpp>
#include <boost/thread/detail/platform.hpp>
#if defined(BOOST_THREAD_PLATFORM_WIN32)
#include <boost/thread/win32/once.hpp>
#elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
#if defined BOOST_THREAD_ONCE_FAST_EPOCH
#include <boost/thread/pthread/once.hpp>
#elif defined BOOST_THREAD_ONCE_ATOMIC
#include <boost/thread/pthread/once_atomic.hpp>
#else
#error "Once Not Implemented"
#endif
#else
#error "Boost threads unavailable on this platform"
#endif
#include <boost/config/abi_prefix.hpp>
namespace boost
{
// template<class Callable, class ...Args> void
// call_once(once_flag& flag, Callable&& func, Args&&... args);
template<typename Function>
inline void call_once(Function func,once_flag& flag)
//inline void call_once(void (*func)(),once_flag& flag)
{
call_once(flag,func);
}
}
#include <boost/config/abi_suffix.hpp>
#endif
/////////////////////////////////////////////////
// vnDev.Games - Trong.LIVE - DAO VAN TRONG //
////////////////////////////////////////////////////////////////////////////////
| [
"adm.fael.hs@gmail.com"
] | adm.fael.hs@gmail.com |
b7216db44ec81221203bbbf0d063e86f5154eebc | cb0fd7bd24243b0582f3d4ffb1826f839dd9f174 | /482.密钥格式化.cpp | 201b2cb131565dc64bf396b6ead42277e7def617 | [] | no_license | Maserhe/LeetCode | efde6e9e9e0eadc251c9e87d620986658acf4665 | 8bd29088d386df75ce4e3e0bad0a94d48799f435 | refs/heads/master | 2023-07-08T11:09:40.346412 | 2021-08-15T15:59:34 | 2021-08-15T15:59:34 | 279,108,901 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 840 | cpp | /*
* @lc app=leetcode.cn id=482 lang=cpp
*
* [482] 密钥格式化
*/
// @lc code=start
class Solution {
public:
string licenseKeyFormatting(string S, int K) {
// 这题本来写的没毛病,下次字符串相加 少再前面加。不然容易超时。
// ans = "123" + ans; // 这种最好最后 改成 ans += "123" 然后最后使用一边 reverse。
int n = S.size();
string ans;
int num = 0;
while (n -- )
{
if (S[n] == '-') continue;
if (S[n] >= 'a' && S[n] <= 'z') S[n] -= 32;
if ( num == K ){
ans += '-';
num -= K;
}
ans += S[n];
num ++ ;
}
reverse(ans.begin(), ans.end());
return ans;
}
};
// @lc code=end
| [
"982289931@qq.com"
] | 982289931@qq.com |
d21743f81fd12bfda3d880329d3d66f3dbfc9c8b | a7764174fb0351ea666faa9f3b5dfe304390a011 | /inc/BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape.hxx | 48907b66b6611a15bb1a732f684d17a240eabf78 | [] | no_license | uel-dataexchange/Opencascade_uel | f7123943e9d8124f4fa67579e3cd3f85cfe52d91 | 06ec93d238d3e3ea2881ff44ba8c21cf870435cd | refs/heads/master | 2022-11-16T07:40:30.837854 | 2020-07-08T01:56:37 | 2020-07-08T01:56:37 | 276,290,778 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,170 | hxx | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape_HeaderFile
#define _BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape_HeaderFile
#include <Handle_BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape.hxx>
#endif
#ifndef _Handle_MAT_BasicElt_HeaderFile
#include <Handle_MAT_BasicElt.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TCollection_MapNode_HeaderFile
#include <TCollection_MapNode.hxx>
#endif
#ifndef _TCollection_MapNodePtr_HeaderFile
#include <TCollection_MapNodePtr.hxx>
#endif
class MAT_BasicElt;
class TopoDS_Shape;
class TColStd_MapTransientHasher;
class BRepMAT2d_DataMapOfBasicEltShape;
class BRepMAT2d_DataMapIteratorOfDataMapOfBasicEltShape;
class BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape : public TCollection_MapNode {
public:
BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape(const Handle(MAT_BasicElt)& K,const TopoDS_Shape& I,const TCollection_MapNodePtr& n);
Handle_MAT_BasicElt& Key() const;
TopoDS_Shape& Value() const;
DEFINE_STANDARD_RTTI(BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape)
protected:
private:
Handle_MAT_BasicElt myKey;
TopoDS_Shape myValue;
};
#define TheKey Handle_MAT_BasicElt
#define TheKey_hxx <MAT_BasicElt.hxx>
#define TheItem TopoDS_Shape
#define TheItem_hxx <TopoDS_Shape.hxx>
#define Hasher TColStd_MapTransientHasher
#define Hasher_hxx <TColStd_MapTransientHasher.hxx>
#define TCollection_DataMapNode BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape
#define TCollection_DataMapNode_hxx <BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape.hxx>
#define TCollection_DataMapIterator BRepMAT2d_DataMapIteratorOfDataMapOfBasicEltShape
#define TCollection_DataMapIterator_hxx <BRepMAT2d_DataMapIteratorOfDataMapOfBasicEltShape.hxx>
#define Handle_TCollection_DataMapNode Handle_BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape
#define TCollection_DataMapNode_Type_() BRepMAT2d_DataMapNodeOfDataMapOfBasicEltShape_Type_()
#define TCollection_DataMap BRepMAT2d_DataMapOfBasicEltShape
#define TCollection_DataMap_hxx <BRepMAT2d_DataMapOfBasicEltShape.hxx>
#include <TCollection_DataMapNode.lxx>
#undef TheKey
#undef TheKey_hxx
#undef TheItem
#undef TheItem_hxx
#undef Hasher
#undef Hasher_hxx
#undef TCollection_DataMapNode
#undef TCollection_DataMapNode_hxx
#undef TCollection_DataMapIterator
#undef TCollection_DataMapIterator_hxx
#undef Handle_TCollection_DataMapNode
#undef TCollection_DataMapNode_Type_
#undef TCollection_DataMap
#undef TCollection_DataMap_hxx
// other Inline functions and methods (like "C++: function call" methods)
#endif
| [
"shoka.sho2@excel.co.jp"
] | shoka.sho2@excel.co.jp |
bcd06847353114800f0b5ca547bb1d578183955b | 63d8291850783397b2149b4f38d0b1919bf87e5c | /PobotKey/Projects/OpenCV/test_1/QOpenCVWidget.h | 4b22b4a746c6a5140e87147ce44e4891e0c24864 | [] | no_license | JulienHoltzer/Pobot-Playground | 8d0cb50edc5846d7fe717f467d5a9f07ad7e7979 | a4a9c6af9c8b2fec8e5782be86427620843f38df | refs/heads/master | 2021-05-28T04:54:03.737479 | 2011-11-11T10:32:43 | 2011-11-11T10:32:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 397 | h | #ifndef QOPENCVWIDGET_H
#define QOPENCVWIDGET_H
#include <opencv/cv.h>
#include <QPixmap>
#include <QLabel>
#include <QWidget>
#include <QVBoxLayout>
#include <QImage>
class QOpenCVWidget : public QLabel {
private:
//QLabel *imagelabel;
//QVBoxLayout *layout;
QImage image;
public:
QOpenCVWidget();
virtual ~QOpenCVWidget(void) {};
void putImage(IplImage *);
};
#endif
| [
"fabrice.rubino@c631b436-7905-11de-aab9-69570e6b7754"
] | fabrice.rubino@c631b436-7905-11de-aab9-69570e6b7754 |
c0b05f908644f92789e7d2a64e42a3b7dc157b7e | 7580f1d240c9df938ae1001902c0516a113747ce | /BTService_MonsterDetect.h | 7b530ba873e0d951c3b53a582a0a6e7c611e1ec8 | [] | no_license | sojae95/HongikFinalProject | 4c8573ea58c837327bdb5f61e16481d2ae77140a | d99b43da0beccbc3ea865e07b1e1b0638714e841 | refs/heads/main | 2023-04-26T01:14:48.606604 | 2021-05-21T05:01:16 | 2021-05-21T05:01:16 | 369,412,007 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 495 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "BehaviorTree/BTService.h"
#include "BTService_MonsterDetect.generated.h"
/**
*
*/
UCLASS()
class FINALPRO_API UBTService_MonsterDetect : public UBTService
{
GENERATED_BODY()
public:
UBTService_MonsterDetect();
protected:
virtual void TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;
};
| [
"noreply@github.com"
] | noreply@github.com |
5f1aa6ae292ede7d87eab9290f80e1587c2079e7 | 6b40e9dccf2edc767c44df3acd9b626fcd586b4d | /NT/base/cluster/mgmt/cluscfg/basecluster/cclussvc.cpp | 0448d8986874d0c664c360b265a8b4b42a3481e7 | [] | no_license | jjzhang166/WinNT5_src_20201004 | 712894fcf94fb82c49e5cd09d719da00740e0436 | b2db264153b80fbb91ef5fc9f57b387e223dbfc2 | refs/heads/Win2K3 | 2023-08-12T01:31:59.670176 | 2021-10-14T15:14:37 | 2021-10-14T15:14:37 | 586,134,273 | 1 | 0 | null | 2023-01-07T03:47:45 | 2023-01-07T03:47:44 | null | UTF-8 | C++ | false | false | 15,747 | cpp | //////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 1999-2002 Microsoft Corporation
//
// Module Name:
// CClusSvc.cpp
//
// Description:
// Contains the definition of the CClusSvc class.
//
// Maintained By:
// David Potter (DavidP) 14-JUN-2001
// Vij Vasu (Vvasu) 08-MAR-2000
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Include Files
//////////////////////////////////////////////////////////////////////////////
// The precompiled header.
#include "Pch.h"
// The header for this file
#include "CClusSvc.h"
// For DwRemoveDirectory()
#include "Common.h"
// For IDS_ERROR_IP_ADDRESS_IN_USE_REF
#include <CommonStrings.h>
#define SECURITY_WIN32
#include <Security.h>
//////////////////////////////////////////////////////////////////////////////
// Macros
//////////////////////////////////////////////////////////////////////////////
// Name of the NodeId cluster service parameter registry value.
#define CLUSSVC_NODEID_VALUE L"NodeId"
//////////////////////////////////////////////////////////////////////////////
//++
//
// CClusSvc::CClusSvc
//
// Description:
// Constructor of the CClusSvc class
//
// Arguments:
// pbcaParentActionIn
// Pointer to the base cluster action of which this action is a part.
//
// Return Value:
// None.
//
// Exceptions Thrown:
// CAssert
// If the parameters are incorrect.
//
// Any exceptions thrown by underlying functions
//
//--
//////////////////////////////////////////////////////////////////////////////
CClusSvc::CClusSvc(
CBaseClusterAction * pbcaParentActionIn
)
: m_cservClusSvc( CLUSTER_SERVICE_NAME )
, m_pbcaParentAction( pbcaParentActionIn )
{
TraceFunc( "" );
if ( m_pbcaParentAction == NULL)
{
LogMsg( "[BC] Pointers to the parent action is NULL. Throwing an exception." );
THROW_ASSERT(
E_INVALIDARG
, "CClusSvc::CClusSvc() => Required input pointer in NULL"
);
} // if: the parent action pointer is NULL
TraceFuncExit();
} //*** CClusSvc::CClusSvc
//////////////////////////////////////////////////////////////////////////////
//++
//
// CClusSvc::~CClusSvc
//
// Description:
// Destructor of the CClusSvc class.
//
// Arguments:
// None.
//
// Return Value:
// None.
//
// Exceptions Thrown:
// Any exceptions thrown by underlying functions
//
//--
//////////////////////////////////////////////////////////////////////////////
CClusSvc::~CClusSvc( void )
{
TraceFunc( "" );
TraceFuncExit();
} //*** CClusSvc::~CClusSvc
//////////////////////////////////////////////////////////////////////////////
//++
//
// CClusSvc::ConfigureService
//
// Description:
// Create the service, set the failure actions and the service account.
// Then start the service.
//
// Arguments:
// pszClusterDomainAccountNameIn
// pszClusterAccountPwdIn
// Information about the account to be used as the cluster service
// account.
//
// pszNodeIdString
// String containing the Id of this node.
//
// dwClusterIPAddress
// IP address of the cluster
//
// Return Value:
// None.
//
// Exceptions Thrown:
// CRuntimeError
// If any of the APIs fail.
//
// Any that are thrown by the underlying functions.
//
//--
//////////////////////////////////////////////////////////////////////////////
void
CClusSvc::ConfigureService(
const WCHAR * pszClusterDomainAccountNameIn
, const WCHAR * pszClusterAccountPwdIn
, const WCHAR * pszNodeIdStringIn
, bool fIsVersionCheckingDisabledIn
, DWORD dwClusterIPAddressIn
)
{
TraceFunc( "" );
DWORD sc = ERROR_SUCCESS;
CStatusReport srCreatingClusSvc(
PbcaGetParent()->PBcaiGetInterfacePointer()
, TASKID_Major_Configure_Cluster_Services
, TASKID_Minor_Creating_Cluster_Service
, 0, 2
, IDS_TASK_CREATING_CLUSSVC
);
LogMsg( "[BC] Configuring the Cluster service." );
// Send the next step of this status report.
srCreatingClusSvc.SendNextStep( S_OK );
// Create the cluster service.
m_cservClusSvc.Create( m_pbcaParentAction->HGetMainInfFileHandle() );
LogMsg( "[BC] Setting the Cluster service account information." );
// Open a smart handle to the cluster service.
SmartSCMHandle sscmhClusSvcHandle(
OpenService(
m_pbcaParentAction->HGetSCMHandle()
, CLUSTER_SERVICE_NAME
, SERVICE_CHANGE_CONFIG
)
);
if ( sscmhClusSvcHandle.FIsInvalid() )
{
sc = TW32( GetLastError() );
LogMsg( "[BC] Error %#08x opening the '%ws' service.", sc, CLUSTER_SERVICE_NAME );
goto Cleanup;
} // if: we could not open a handle to the cluster service.
//
// Set the service account information.
//
{
if (
ChangeServiceConfig(
sscmhClusSvcHandle
, SERVICE_NO_CHANGE
, SERVICE_NO_CHANGE
, SERVICE_NO_CHANGE
, NULL
, NULL
, NULL
, NULL
, pszClusterDomainAccountNameIn
, pszClusterAccountPwdIn
, NULL
)
== FALSE
)
{
sc = TW32( GetLastError() );
LogMsg(
"[BC] Error %#08x setting the service account information. Account = '%ws'."
, sc
, pszClusterDomainAccountNameIn
);
goto Cleanup;
} // if: we could not set the account information.
}
LogMsg( "[BC] Setting the Cluster service failure actions." );
// Set the failure actions of the cluster service service.
sc = TW32( ClRtlSetSCMFailureActions( NULL ) );
if ( sc != ERROR_SUCCESS )
{
LogMsg( "[BC] Error %#08x setting the failure actions of the cluster service.", sc );
goto Cleanup;
} // if: the service failure actions couldn't be set
LogMsg( "[BC] Setting the Cluster service parameters." );
// Send the next step of this status report.
srCreatingClusSvc.SendNextStep( S_OK );
{
CRegistryKey rkClusSvcParams;
CRegistryKey rkClusterParams;
UUID guid;
LPWSTR pszClusterInstanceId = NULL;
// Open the parameters key or create it if it does not exist.
rkClusSvcParams.CreateKey(
HKEY_LOCAL_MACHINE
, CLUSREG_KEYNAME_CLUSSVC_PARAMETERS
, KEY_WRITE
);
// Set the NodeId string.
rkClusSvcParams.SetValue(
CLUSSVC_NODEID_VALUE
, REG_SZ
, reinterpret_cast< const BYTE * >( pszNodeIdStringIn )
, ( (UINT) wcslen( pszNodeIdStringIn ) + 1 ) * sizeof( *pszNodeIdStringIn )
);
// If version checking has been disabled, set a flag in the service parameters
// to indicate this.
if ( fIsVersionCheckingDisabledIn )
{
DWORD dwNoVersionCheck = 1;
rkClusSvcParams.SetValue(
CLUSREG_NAME_SVC_PARAM_NOVER_CHECK
, REG_DWORD
, reinterpret_cast< const BYTE * >( &dwNoVersionCheck )
, sizeof( dwNoVersionCheck )
);
LogMsg( "[BC] Cluster version checking has been disabled on this computer." );
} // if: version checking has been disabled
//
// If we are creating a new cluster then create the cluster instance ID.
//
if ( m_pbcaParentAction->EbcaGetAction() == eCONFIG_ACTION_FORM )
{
// Generate a GUID for the cluster instance ID.
sc = UuidCreate( &guid );
if ( sc != RPC_S_OK )
{
LogMsg( "[BC] Error %#08x when creating a Uuid for the Cluster Instance ID.", sc );
goto Cleanup;
}
sc = UuidToString( &guid, &pszClusterInstanceId );
if ( sc != RPC_S_OK )
{
LogMsg( "[BC] Error %#08x when converting the uuid of the Cluster Instance ID to a string.", sc );
goto Cleanup;
}
// Open the parameters key in the cluster database or create it if it does not exist.
rkClusterParams.CreateKey(
HKEY_LOCAL_MACHINE
, CLUSREG_KEYNAME_CLUSTER_PARAMETERS
, KEY_WRITE
);
// Set the ClusterInstanceId string.
rkClusterParams.SetValue(
CLUSREG_NAME_CLUS_CLUSTER_INSTANCE_ID
, REG_SZ
, reinterpret_cast< const BYTE * >( pszClusterInstanceId )
, ( (UINT) wcslen( pszClusterInstanceId ) + 1 ) * sizeof( *pszClusterInstanceId )
);
} // if: creating a cluster
}
//
// Set the cluster installation state.
//
if ( ClRtlSetClusterInstallState( eClusterInstallStateConfigured ) == FALSE )
{
sc = TW32( GetLastError() );
LogMsg( "[BC] Could not set the cluster installation state. Throwing an exception." );
goto Cleanup;
} // ClRtlSetClusterInstallState() failed.
Cleanup:
if ( sc != ERROR_SUCCESS )
{
LogMsg( "[BC] Error %#08x occurred trying configure the ClusSvc service. Throwing an exception.", sc );
THROW_RUNTIME_ERROR(
HRESULT_FROM_WIN32( sc )
, IDS_ERROR_CLUSSVC_CONFIG
);
} // if; there was an error getting the handle.
// Send the next step of this status report.
srCreatingClusSvc.SendNextStep( S_OK );
{
UINT cQueryCount = 100;
CStatusReport srStartingClusSvc(
PbcaGetParent()->PBcaiGetInterfacePointer()
, TASKID_Major_Configure_Cluster_Services
, TASKID_Minor_Starting_Cluster_Service
, 0, cQueryCount + 2 // we will send at most cQueryCount reports while waiting for the service to start (the two extra sends are below)
, IDS_TASK_STARTING_CLUSSVC
);
// Send the next step of this status report.
srStartingClusSvc.SendNextStep( S_OK );
try
{
//
// Start the service.
//
m_cservClusSvc.Start(
m_pbcaParentAction->HGetSCMHandle()
, true // wait for the service to start
, 3000 // wait 3 seconds between queries for status.
, cQueryCount // query cQueryCount times
, &srStartingClusSvc // status report to be sent while waiting for the service to start
);
}
catch( ... )
{
//
// If IP Address is not NULL we are creating a new cluster; otherwise we are adding node to a cluster.
//
if ( dwClusterIPAddressIn != 0 )
{
BOOL fRet = FALSE;
fRet = ClRtlIsDuplicateTcpipAddress( dwClusterIPAddressIn );
//
// IP address already in use
//
if ( fRet == TRUE )
{
LogMsg( "[BC] The IP address specified for this cluster is already in use. Throwing an exception.");
THROW_RUNTIME_ERROR_REF( HRESULT_FROM_WIN32( ERROR_CLUSTER_IPADDR_IN_USE ), IDS_ERROR_IP_ADDRESS_IN_USE, IDS_ERROR_IP_ADDRESS_IN_USE_REF );
}
else
{
LogMsg( "[BC] Cluster Service Win32 Exit Code= %#08x", m_cservClusSvc.GetWin32ExitCode() );
LogMsg( "[BC] Cluster Service Specific Exit Code= %#08x", m_cservClusSvc.GetServiceExitCode() );
//
// Throw the error if we don't handle it.
//
throw;
}
} // if: cluster IP address was specified
else
{
LogMsg( "[BC] Cluster Service Win32 Exit Code= %#08x", m_cservClusSvc.GetWin32ExitCode() );
LogMsg( "[BC] Cluster Service Specific Exit Code= %#08x", m_cservClusSvc.GetServiceExitCode() );
//
// Throw the error if we don't handle it.
//
throw;
} // else: cluster IP address was not specified
} // catch: anything
// Send the last step of this status report.
srStartingClusSvc.SendLastStep( S_OK );
}
TraceFuncExit();
} //*** CClusSvc::ConfigureService
//////////////////////////////////////////////////////////////////////////////
//++
//
// CClusSvc::CleanupService
//
// Description:
// Stop, cleanup and remove the service.
//
// Arguments:
// None.
//
// Return Value:
// None.
//
// Exceptions Thrown:
// Any that are thrown by the underlying functions.
//
//--
//////////////////////////////////////////////////////////////////////////////
void
CClusSvc::CleanupService( void )
{
TraceFunc( "" );
LogMsg( "[BC] Trying to stop the Cluster Service." );
// Stop the service.
m_cservClusSvc.Stop(
m_pbcaParentAction->HGetSCMHandle()
, 5000 // wait 5 seconds between queries for status.
, 60 // query 60 times ( 5 minutes )
);
//
// Restore the cluster installation state.
//
if ( ClRtlSetClusterInstallState( eClusterInstallStateFilesCopied ) == FALSE )
{
DWORD sc = GetLastError();
LogMsg( "[BC] Could not set the cluster installation state. Throwing an exception." );
THROW_RUNTIME_ERROR(
HRESULT_FROM_WIN32( sc )
, IDS_ERROR_SETTING_INSTALL_STATE
);
} // ClRtlSetClusterInstallState() failed.
LogMsg( "[BC] Cleaning up Cluster Service." );
m_cservClusSvc.Cleanup( m_pbcaParentAction->HGetMainInfFileHandle() );
//
// KB: ozano 01-18-2002 - We need to sleep here in order to have the service cleanup take place.
// If we don't wait for some time and the user goes back, changes the IP address and hits re-analysis, service
// start fails with Win32ExitCode of ERROR_SERVICE_MARKED_FOR_DELETION.
//
Sleep( 10000 );
// Cleanup the local quorum directory.
{
DWORD sc = ERROR_SUCCESS;
const WCHAR * pcszQuorumDir = m_pbcaParentAction->RStrGetLocalQuorumDirectory().PszData();
sc = TW32( DwRemoveDirectory( pcszQuorumDir ) );
if ( sc != ERROR_SUCCESS )
{
LogMsg( "[BC] The local quorum directory '%s' cannot be removed. Non-fatal error %#08x occurred.\n", pcszQuorumDir, sc );
} // if: we could not remove the local quorum directory
}
TraceFuncExit();
} //*** CClusSvc::CleanupService
| [
"seta7D5@protonmail.com"
] | seta7D5@protonmail.com |
dc5dc8eeccbe51e38a628767d526ae6dcf95cb8d | 07db3df03f8d7081e72607ca91a25f9ff650ec82 | /include/Model/GameActors/lion.h | 0e634b1479631112c2236c13a1cf9f0d51f26ce7 | [] | no_license | zhengfish/BoidsTest | 9122c398b3aa384ab71c0476d4630d00a70691bf | cd954bc780979433b2e36ba3e8e188bc791306ec | refs/heads/master | 2021-10-01T16:09:05.136391 | 2017-11-11T15:29:30 | 2017-11-11T15:29:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 169 | h |
#ifndef lion_H
#define lion_H
#include "agent.h"
class CLion : public CAgent
{
private:
public:
CLion::CLion(CFlagStand* flagStand, CFlag* enemyFlag);
};
#endif
| [
"gnunez@europe.com"
] | gnunez@europe.com |
10c60328c189368a5800783a98610af43bff39db | 3c7d5e58709b0397166fabd16044c1aa4e214c38 | /MFC/Chart/ChartClient/ChartClientDlg.cpp | 4b518963c050e0f9759509706c23dd7ed01256a3 | [] | no_license | avvount/Practice | e2b81fe19a31225a4ed731586e31fe3b628f63aa | bb325ccdfecd5fccd7e69e084380a10a4b1b4328 | refs/heads/master | 2021-06-26T04:52:40.452452 | 2020-11-20T15:50:17 | 2020-11-20T15:50:17 | 146,430,181 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 4,949 | cpp |
// ChartClientDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "ChartClient.h"
#include "ChartClientDlg.h"
#include "LoginDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
TrafficMessage tfmg;
SOCKET sockClient;
sockaddr_in addrSrv;
// CChartClientDlg 对话框
CChartClientDlg::CChartClientDlg(CWnd *pParent /*=NULL*/)
: CDialog(CChartClientDlg::IDD, pParent), m_pdata(NULL)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
CChartClientDlg::~CChartClientDlg()
{
closesocket(sockClient);
}
void CChartClientDlg::DoDataExchange(CDataExchange *pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST1, m_List);
}
BEGIN_MESSAGE_MAP(CChartClientDlg, CDialog)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_BTNSEND, &CChartClientDlg::OnBnClickedBtnsend)
ON_BN_CLICKED(IDC_BTNLOGOUT, &CChartClientDlg::OnBnClickedBtnlogout)
END_MESSAGE_MAP()
// CChartClientDlg 消息处理程序
BOOL CChartClientDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
// 执行此操作
SetIcon(m_hIcon, TRUE); // 设置大图标
SetIcon(m_hIcon, FALSE); // 设置小图标
// TODO: 在此添加额外的初始化代码
//CListCtrl表头
m_List.ModifyStyle(0, LVS_REPORT); // 报表模式
m_List.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
m_List.InsertColumn(0, "编号");
m_List.InsertColumn(1, "第一组");
m_List.InsertColumn(2, "第二组");
m_List.InsertColumn(3, "第三组");
m_List.InsertColumn(4, "第四组");
m_List.InsertColumn(5, "第五组");
CRect rect;
GetClientRect(&rect);
for (int i = 0; i < 6; i++)
{
m_List.SetColumnWidth(i, rect.Width() / 7); //设置列的宽度。
}
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
}
// 如果向对话框添加最小化按钮,则需要下面的代码
// 来绘制该图标。对于使用文档/视图模型的 MFC 应用程序,
// 这将由框架自动完成。
void CChartClientDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
//当用户拖动最小化窗口时系统调用此函数取得光标
//显示。
HCURSOR CChartClientDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
void CChartClientDlg::OnBnClickedBtnsend()
{
// TODO: 在此添加控件通知处理程序代码
if (m_pdata)
{
for (int i = 0; i < tfmg.quantity; i++)
{
delete[] m_pdata[i];
}
delete[] m_pdata;
m_pdata = NULL;
}
CString strTemp;
GetDlgItemText(IDC_EDIT_COMMAND, strTemp);
SetDlgItemText(IDC_EDIT_COMMAND, "");
int firstIndex = strTemp.Find(' ', 0);
int lastIndex = strTemp.Find(' ', firstIndex + 1);
CString strCommand = strTemp.Left(firstIndex);
if (strCommand.Compare("test"))
{
MessageBox("test [column] [row]", "Usage");
return;
}
CString strQuantity = strTemp.Left(lastIndex).Right(lastIndex - firstIndex - 1);
CString strGroup = strTemp.Right(strTemp.GetLength() - lastIndex);
tfmg.quantity = atoi(strQuantity.GetBuffer());
tfmg.group = atoi(strGroup.GetBuffer());
if (!tfmg.quantity || !tfmg.group)
{
MessageBox("请输入正确参数", "参数错误");
return;
}
send(sockClient, (char *)&tfmg, sizeof(tfmg), 0);
char **recvBuf = new char *[sizeof(int *) * tfmg.quantity];
for (int i = 0; i < tfmg.quantity; i++)
{
recvBuf[i] = new char[sizeof(int) * tfmg.group];
if(recv(sockClient, recvBuf[i], tfmg.group * sizeof(int), 0)<=0)
{
MessageBox("连接中断");
return;
}
}
m_pdata = (int **)recvBuf;
m_List.DeleteAllItems();
CString str;
for (int i = 0; i < tfmg.quantity; i++)
{
str.Format("%d", i + 1);
m_List.InsertItem(i, str);
for (int j = 0; j < tfmg.group; j++)
{
str.Format("%d", m_pdata[i][j]);
m_List.SetItemText(i, j + 1, str);
}
for (int j = tfmg.group; j < 5; j++)
{
m_List.SetItemText(i, j + 1, "0");
}
}
}
void CChartClientDlg::OnBnClickedBtnlogout()
{
// TODO: 在此添加控件通知处理程序代码
WinExec(__argv[0], SW_SHOW);
exit(0);
}
| [
"mr.beta@outlook.com"
] | mr.beta@outlook.com |
13beaafb20ef289bd7ca91cbf76fcc202cd22837 | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/squid/gumtree/squid_repos_function_361_squid-3.4.14.cpp | 7dc85aa62a2fc1672f1b53ad03d290a3dc425b83 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 61 | cpp | void
timeout_during_auth(int signum)
{
dc_disconnect();
} | [
"993273596@qq.com"
] | 993273596@qq.com |
29b5146e4828281307d76bad4f87cb62f4e1f97b | 0d687dfd08842515405a40bef6a8d2720d9d669d | /arduinocode/analog_controller_microz/analog_controller_microz.ino | 427fb6669f1800c5b821c32ab2a934bb4d433803 | [] | no_license | LafeLabs/trashrobot5 | 437bc63102294d3ef1da5d11ebee463e3269af71 | 4a05d54a38d9acddf8d18efb0422502e05485c53 | refs/heads/master | 2022-05-07T23:52:01.128144 | 2022-04-21T01:25:55 | 2022-04-21T01:25:55 | 221,334,408 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,918 | ino | int controller = 0;
int delta = 16;
int AIN1 = 7;
int AIN2 = 8;
int PWMA = 9;
//there is a ladder of 9 10k resistors from 5v to ground, and the intermediate nodes all connect to buttons which connect to an analog pin which has a 1 megaohm pull down resistor
int value1 = 114;
int value2 = 2*114;
int value3 = 3*114;
int value4 = 4*114;
int value5 = 5*114;
int value6 = 6*114;
int value7 = 7*114;
int value8 = 8*114;
int button = 0; //0 means no press, 1 is start, 2 is stop, 3 is left, 4 is back 5 is forward, 6 is right, 7 is down 8 is up
int z = 0;
int zdelay = 0;// microseconds 1000 ms / 512 steps = 2 ms/step
void setup() {
// put your setup code here, to run once:
controller = analogRead(A0);
pinMode(AIN1,OUTPUT);
pinMode(AIN2,OUTPUT);
pinMode(PWMA,OUTPUT);
analogWrite(PWMA,0);
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,LOW);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
controller = analogRead(A0);
if(controller > value1 - delta && controller < value1 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value1 - delta && controller < value1 + delta){
button = 1;
}
}
if(controller > value2 - delta && controller < value2 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value2 - delta && controller < value2 + delta){
button = 2;
}
}
if(controller > value3 - delta && controller < value3 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value3 - delta && controller < value3 + delta){
button = 3;
}
}
if(controller > value4 - delta && controller < value4 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value4 - delta && controller < value4 + delta){
button = 4;
}
}
if(controller > value5 - delta && controller < value5 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value5 - delta && controller < value5 + delta){
button = 5;
}
}
if(controller > value6 - delta && controller < value6 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value6 - delta && controller < value6 + delta){
button = 6;
}
}
if(controller > value7 - delta && controller < value7 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value7 - delta && controller < value7 + delta){
button = 7;
}
}
if(controller > value8 - delta && controller < value8 + delta){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller > value8 - delta && controller < value8 + delta){
button = 8;
}
}
if(controller < 50){
delayMicroseconds(10);
controller = analogRead(A0);
if(controller < 50){
button = 0;
}
}
if(button == 1){
Serial.println("start");
}
if(button == 2){
Serial.println("stop");
}
if(button == 3){
Serial.println("left");
}
if(button == 4){
Serial.println("back");
}
if(button == 5){
Serial.println("forward");
}
if(button == 6){
Serial.println("right");
}
if(button == 7){
z = z - 1;
if(z < -255){
z = -255;
}
delayMicroseconds(zdelay);
// Serial.println("down");
}
if(button == 8){
//up
z = z + 1;
if(z > 255){
z = 255;
}
delayMicroseconds(zdelay);
// Serial.println("up");
}
// Serial.println(button);
if(z >= 0){
digitalWrite(AIN2,LOW);
digitalWrite(AIN1,HIGH);
}
else{
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,HIGH);
}
analogWrite(PWMA,abs(z));
Serial.println(z);
}
| [
"lafelabs@gmail.com"
] | lafelabs@gmail.com |
59476476e17cc818571e699279a5e5cfa7c99f30 | 41b4adb10cc86338d85db6636900168f55e7ff18 | /aws-cpp-sdk-waf/source/model/CreateSqlInjectionMatchSetResult.cpp | a98ddd48b9dcf4c0c2d18ec27b7f549fedbc9730 | [
"JSON",
"MIT",
"Apache-2.0"
] | permissive | totalkyos/AWS | 1c9ac30206ef6cf8ca38d2c3d1496fa9c15e5e80 | 7cb444814e938f3df59530ea4ebe8e19b9418793 | refs/heads/master | 2021-01-20T20:42:09.978428 | 2016-07-16T00:03:49 | 2016-07-16T00:03:49 | 63,465,708 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,569 | cpp | /*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 <aws/waf/model/CreateSqlInjectionMatchSetResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::WAF::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
CreateSqlInjectionMatchSetResult::CreateSqlInjectionMatchSetResult()
{
}
CreateSqlInjectionMatchSetResult::CreateSqlInjectionMatchSetResult(const AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
CreateSqlInjectionMatchSetResult& CreateSqlInjectionMatchSetResult::operator =(const AmazonWebServiceResult<JsonValue>& result)
{
const JsonValue& jsonValue = result.GetPayload();
if(jsonValue.ValueExists("SqlInjectionMatchSet"))
{
m_sqlInjectionMatchSet = jsonValue.GetObject("SqlInjectionMatchSet");
}
if(jsonValue.ValueExists("ChangeToken"))
{
m_changeToken = jsonValue.GetString("ChangeToken");
}
return *this;
}
| [
"henso@amazon.com"
] | henso@amazon.com |
6490682263a620b9233eac28b541771c411ca553 | 51b8bef3ef9451682118fd09aef72c7395d3448d | /src/memorymanagement.cpp | 2ef5ce07df31a54865e499a014158ba45fc6f0e9 | [] | no_license | aravie/myos | 7330386fa4f5dab5224a35a104f7997090ea3b26 | d15783a22157b1ae945a051ac11578d6f4c95c2d | refs/heads/master | 2020-08-05T13:46:01.247378 | 2019-10-30T19:49:06 | 2019-10-30T19:49:06 | 212,565,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,884 | cpp | #include <memorymanagement.h>
using namespace myos;
using namespace myos::common;
MemoryManager* MemoryManager::activeMemoryManager = 0;
MemoryManager::MemoryManager(size_t start, size_t size)
{
activeMemoryManager = this;
if(size < sizeof(MemoryChunk))
{
first = 0;
}
else
{
first = (MemoryChunk*)start;
first -> allocated = false;
first -> prev = 0;
first -> next = 0;
first -> size = size - sizeof(MemoryChunk);
}
}
MemoryManager::~MemoryManager()
{
if(activeMemoryManager == this)
activeMemoryManager = 0;
}
void* MemoryManager::malloc(size_t size)
{
MemoryChunk *result = 0;
for(MemoryChunk* chunk = first; chunk != 0 && result == 0; chunk = chunk->next)
if(chunk->size > size && !chunk->allocated)
result = chunk;
if(result == 0)
return 0;
if(result->size >= size + sizeof(MemoryChunk) + 1)
{
MemoryChunk* temp = (MemoryChunk*)((size_t)result + sizeof(MemoryChunk) + size);
temp->allocated = false;
temp->size = result->size - size - sizeof(MemoryChunk);
temp->prev = result;
temp->next = result->next;
if(temp->next != 0)
temp->next->prev = temp;
result->size = size;
result->next = temp;
}
result->allocated = true;
return (void*)(((size_t)result) + sizeof(MemoryChunk));
}
void MemoryManager::free(void* ptr)
{
MemoryChunk* chunk = (MemoryChunk*)((size_t)ptr - sizeof(MemoryChunk));
chunk -> allocated = false;
if(chunk->prev != 0 && !chunk->prev->allocated)
{
chunk->prev->next = chunk->next;
chunk->prev->size += chunk->size + sizeof(MemoryChunk);
if(chunk->next != 0)
chunk->next->prev = chunk->prev;
chunk = chunk->prev;
}
if(chunk->next != 0 && !chunk->next->allocated)
{
chunk->size += chunk->next->size + sizeof(MemoryChunk);
chunk->next = chunk->next->next;
if(chunk->next != 0)
chunk->next->prev = chunk;
}
}
void* operator new(unsigned size)
{
if(myos::MemoryManager::activeMemoryManager == 0)
return 0;
return myos::MemoryManager::activeMemoryManager->malloc(size);
}
void* operator new[](unsigned size)
{
if(myos::MemoryManager::activeMemoryManager == 0)
return 0;
return myos::MemoryManager::activeMemoryManager->malloc(size);
}
void* operator new(unsigned size, void* ptr)
{
return ptr;
}
void* operator new[](unsigned size, void* ptr)
{
return ptr;
}
void operator delete(void* ptr)
{
if(myos::MemoryManager::activeMemoryManager != 0)
myos::MemoryManager::activeMemoryManager->free(ptr);
}
void operator delete[](void* ptr)
{
if(myos::MemoryManager::activeMemoryManager != 0)
myos::MemoryManager::activeMemoryManager->free(ptr);
}
| [
"raviee@gmx.de"
] | raviee@gmx.de |
3da1494c1506e9f8443075f30e2d3b32bba42291 | d4112c60caf40833965547465532a59ede6adf71 | /generated/include/vnx/GatewayInterfaceAsyncClient.hxx | d6ca6903b3ba7cf1ec508e5d93dc474c4f97e172 | [] | no_license | automyinc/vnx-base | 1ab72dba6dc21053bd492cfd495f3b658a27b47c | 095c2f30fbfe3c8882c29851faf132adc5120928 | refs/heads/master | 2022-01-27T03:45:51.372036 | 2021-12-25T17:57:27 | 2021-12-25T17:57:27 | 141,748,820 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,105 | hxx |
// AUTO GENERATED by vnxcppcodegen
#ifndef INCLUDE_vnx_GatewayInterface_ASYNC_CLIENT_HXX_
#define INCLUDE_vnx_GatewayInterface_ASYNC_CLIENT_HXX_
#include <vnx/AsyncClient.h>
#include <vnx/Request.hxx>
namespace vnx {
class GatewayInterfaceAsyncClient : public vnx::AsyncClient {
public:
GatewayInterfaceAsyncClient(const std::string& service_name);
GatewayInterfaceAsyncClient(vnx::Hash64 service_addr);
uint64_t forward(std::shared_ptr<const ::vnx::Request> request = nullptr,
const std::function<void()>& _callback = std::function<void()>(),
const std::function<void(const vnx::exception&)>& _error_callback = std::function<void(const vnx::exception&)>());
protected:
int32_t vnx_purge_request(uint64_t _request_id, const vnx::exception& _ex) override;
int32_t vnx_callback_switch(uint64_t _request_id, std::shared_ptr<const vnx::Value> _value) override;
private:
std::unordered_map<uint64_t, std::pair<std::function<void()>, std::function<void(const vnx::exception&)>>> vnx_queue_forward;
};
} // namespace vnx
#endif // INCLUDE_vnx_GatewayInterface_ASYNC_CLIENT_HXX_
| [
"max.wittal@mwittal.de"
] | max.wittal@mwittal.de |
e0a34f59fa311d31df277d5bbf4a0c689905c87b | 6aca6f0d4dd61c7f4208015a04355361e5f0c988 | /4/include/device/PIC.h | 87fee90b4da18be9ac33a8663c2a865d56a8d656 | [] | no_license | bognari/CoStuBs | f1b9b9f1cba8c6047394c07743219b7d0c85b332 | ab2ac1738f0584bbdfdc1c048f3346b7d02fb969 | refs/heads/master | 2021-03-27T13:37:42.263672 | 2013-06-08T12:53:52 | 2013-06-08T12:53:52 | 10,547,883 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,745 | h | // This file is part of CoStuBS.
//
// CoStuBS 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.
//
// CoStuBS 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 CoStuBS. If not, see <http://www.gnu.org/licenses/>.
#ifndef PIC_h
#define PIC_h
/*!
* PIC: Diese Klasse ist der Treiber fuer den
* Programmable Interrupt Controler (PIC)
*
* Genaugenommen werden hier zwei kaskadierte PICs behandelt
*/
#include "io/IOPort.h"
class PIC {
public:
//! die Interrupt-Quellen von Co-Stubs
enum Interrupts
{
PIT = 0, // Programmable Interrupt Timer (PIT)
KEYBOARD = 1 // Tastatur
};
PIC(): imr1(IMR1), imr2(IMR2), ctrl1(CTRL1), ctrl2(CTRL2) {}
//! Anstellen von Interrupt "num"
void enable (int num);
//! Abstellen von Interrupt "num"
void disable (int num);
//! Die Behandlung von Interrupt "num" bestaetigen
void ack (int num);
//! Unspezifische Bestaetigung des aktuellen Interrupts
void ack ();
private:
enum Ports
{
IMR1 = 0x21, //! Interrupt Mask Register von PIC 1
IMR2 = 0xa1, //! " PIC2
CTRL1 = 0x20, //! Interrupt Control Register von PIC 1
CTRL2 = 0xa0 //! " PIC 2
};
enum Commands
{
ACK = 0x20 //! Bestaetigung fuer alle Interr.
};
IOPort8 imr1;
IOPort8 imr2;
IOPort8 ctrl1;
IOPort8 ctrl2;
};
extern PIC pic;
#endif
| [
"bognari.s@gmail.com"
] | bognari.s@gmail.com |
69a7dc45c8d650e9295e0d7abca127943660ebf0 | 3314a712901793e832d2fdc435ba4f89025318fd | /test/raii_counter.hpp | 5d454cca6a76f98f620c708fa85eab1432646d27 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | Beyond-Engine/Core | 5707b24afc8535d4811f0e3544133c17f2f81913 | 803c70598d4b25d235866367e669698fbc36cfc3 | refs/heads/main | 2023-08-31T11:44:19.436916 | 2023-08-18T07:29:57 | 2023-08-18T07:29:57 | 241,059,550 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 947 | hpp | #ifndef BEYOND_CORE_TEST_RAII_COUNTER_HPP
#define BEYOND_CORE_TEST_RAII_COUNTER_HPP
struct Counters {
int constructor = 0;
int destructor = 0;
int move = 0;
int copy = 0;
int invoke = 0;
};
struct Small {
Small(Counters& c) noexcept : counters{c}
{
++(counters.constructor);
}
~Small() noexcept
{
++(counters.destructor);
}
Small(const Small& other) noexcept : counters{other.counters}
{
++(counters.copy);
}
auto operator=(const Small& other) noexcept -> Small&
{
counters = other.counters;
++(counters.copy);
return *this;
}
Small(Small&& other) noexcept : counters{other.counters}
{
++(counters.move);
}
auto operator=(Small&& other) noexcept -> Small&
{
counters = other.counters;
++(counters.move);
return *this;
}
void operator()() noexcept
{
++(counters.invoke);
}
Counters& counters;
};
#endif // BEYOND_CORE_TEST_RAII_COUNTER_HPP
| [
"lesley@lesleylai.info"
] | lesley@lesleylai.info |
b87b36b6e17fd9b6fdbf479b15abb1cc807c5568 | 88ae8695987ada722184307301e221e1ba3cc2fa | /chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc | 22d05b1f4108500ef4df83a902b0b011e5bd9b0d | [
"BSD-3-Clause"
] | permissive | iridium-browser/iridium-browser | 71d9c5ff76e014e6900b825f67389ab0ccd01329 | 5ee297f53dc7f8e70183031cff62f37b0f19d25f | refs/heads/master | 2023-08-03T16:44:16.844552 | 2023-07-20T15:17:00 | 2023-07-23T16:09:30 | 220,016,632 | 341 | 40 | BSD-3-Clause | 2021-08-13T13:54:45 | 2019-11-06T14:32:31 | null | UTF-8 | C++ | false | false | 232,733 | cc | // Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/settings/site_settings_handler.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/barrier_closure.h"
#include "base/check_deref.h"
#include "base/command_line.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/json/json_reader.h"
#include "base/json/values_util.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/simple_test_clock.h"
#include "base/test/test_future.h"
#include "base/test/values_test_util.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/bluetooth/bluetooth_chooser_context_factory.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_model_delegate.h"
#include "chrome/browser/browsing_topics/browsing_topics_service_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/engagement/site_engagement_service_factory.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/file_system_access/chrome_file_system_access_permission_context.h"
#include "chrome/browser/file_system_access/file_system_access_permission_context_factory.h"
#include "chrome/browser/hid/hid_chooser_context.h"
#include "chrome/browser/hid/hid_chooser_context_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/permissions/notification_permission_review_service_factory.h"
#include "chrome/browser/permissions/notifications_engagement_service_factory.h"
#include "chrome/browser/permissions/permission_decision_auto_blocker_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/privacy_sandbox/mock_privacy_sandbox_service.h"
#include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h"
#include "chrome/browser/serial/serial_chooser_context.h"
#include "chrome/browser/serial/serial_chooser_context_factory.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h"
#include "chrome/browser/ui/webui/settings/site_settings_helper.h"
#include "chrome/browser/usb/usb_chooser_context.h"
#include "chrome/browser/usb/usb_chooser_context_factory.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/browser/web_applications/web_app_id.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/browsing_data/content/browsing_data_model.h"
#include "components/browsing_data/content/fake_browsing_data_model.h"
#include "components/browsing_data/content/mock_cookie_helper.h"
#include "components/browsing_data/content/mock_local_storage_helper.h"
#include "components/browsing_topics/browsing_topics_service.h"
#include "components/browsing_topics/test_util.h"
#include "components/client_hints/common/client_hints.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/history/core/browser/history_service.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/infobar.h"
#include "components/permissions/contexts/bluetooth_chooser_context.h"
#include "components/permissions/object_permission_context_base.h"
#include "components/permissions/permission_decision_auto_blocker.h"
#include "components/permissions/permission_uma_util.h"
#include "components/permissions/permission_util.h"
#include "components/permissions/test/object_permission_context_base_mock_permission_observer.h"
#include "components/permissions/test/permission_test_util.h"
#include "components/prefs/testing_pref_service.h"
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/app_update.h"
#include "components/site_engagement/content/site_engagement_score.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/browsing_data_remover.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_web_ui.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_builder.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "ppapi/buildflags/buildflags.h"
#include "services/device/public/cpp/test/fake_hid_manager.h"
#include "services/device/public/cpp/test/fake_serial_port_manager.h"
#include "services/device/public/cpp/test/fake_usb_device_manager.h"
#include "services/device/public/mojom/hid.mojom.h"
#include "services/device/public/mojom/serial.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/bluetooth/web_bluetooth.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/text/bytes_formatting.h"
#include "ui/webui/webui_allowlist.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h"
#include "components/account_id/account_id.h"
#include "components/user_manager/scoped_user_manager.h"
#endif
#if BUILDFLAG(ENABLE_PLUGINS)
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#endif
namespace {
using ::base::test::ParseJson;
using ::base::test::RunClosure;
using ::base::test::TestFuture;
using ::testing::_;
using ::testing::NiceMock;
using ::testing::Return;
using ::testing::UnorderedElementsAre;
using GroupingKey = settings::SiteSettingsHandler::GroupingKey;
constexpr char kCallbackId[] = "test-callback-id";
constexpr char kSetting[] = "setting";
constexpr char kSource[] = "source";
constexpr char kExtensionName[] = "Test Extension";
constexpr char kTestUserEmail[] = "user@example.com";
const struct PatternContentTypeTestCase {
struct {
const char* const pattern;
const char* const content_type;
} arguments;
struct {
const bool validity;
const char* const reason;
} expected;
} kPatternsAndContentTypeTestCases[]{
{{"https://google.com", "cookies"}, {true, ""}},
{{";", "cookies"}, {false, "Not a valid web address"}},
{{"*", "cookies"}, {false, "Not a valid web address"}},
{{"chrome://test", "popups"}, {false, "Not a valid web address"}},
{{"chrome-untrusted://test", "popups"}, {false, "Not a valid web address"}},
{{"devtools://devtools", "popups"}, {false, "Not a valid web address"}},
{{"chrome-search://search", "popups"}, {false, "Not a valid web address"}},
{{"http://google.com", "location"}, {false, "Origin must be secure"}},
{{"http://127.0.0.1", "location"}, {true, ""}}, // Localhost is secure.
{{"http://[::1]", "location"}, {true, ""}}};
// Matchers to make verifying GroupingKey contents easier.
MATCHER_P(IsEtldPlus1, etld_plus1, "") {
return arg == std::string("etld:") + etld_plus1;
}
MATCHER_P(IsOrigin, origin, "") {
return arg == std::string("origin:") + origin.spec();
}
// Converts |etld_plus1| into an HTTPS SchemefulSite.
net::SchemefulSite ConvertEtldToSchemefulSite(const std::string etld_plus1) {
return net::SchemefulSite(GURL(std::string(url::kHttpsScheme) +
url::kStandardSchemeSeparator + etld_plus1 +
"/"));
}
// Validates that the list of sites are aligned with the first party sets
// mapping.
void ValidateSitesWithFps(
const base::Value::List& storage_and_cookie_list,
base::flat_map<net::SchemefulSite, net::SchemefulSite>& first_party_sets) {
for (const base::Value& site_group_value : storage_and_cookie_list) {
const base::Value::Dict& site_group = site_group_value.GetDict();
GroupingKey grouping_key = GroupingKey::Deserialize(
CHECK_DEREF(site_group.FindString("groupingKey")));
if (!grouping_key.GetEtldPlusOne().has_value()) {
return;
}
std::string etld_plus1 = *grouping_key.GetEtldPlusOne();
auto schemeful_site = ConvertEtldToSchemefulSite(etld_plus1);
if (first_party_sets.count(schemeful_site)) {
// Ensure that the `fpsOwner` is set correctly and aligned with
// |first_party_sets| mapping of site group owners.
std::string owner_etldplus1 =
first_party_sets[schemeful_site].GetURL().host();
ASSERT_EQ(owner_etldplus1, *site_group.FindString("fpsOwner"));
if (owner_etldplus1 == "google.com") {
ASSERT_EQ(2, *site_group.FindInt("fpsNumMembers"));
ASSERT_EQ(false, *site_group.FindBool("fpsEnterpriseManaged"));
} else if (owner_etldplus1 == "example.com") {
ASSERT_EQ(1, *site_group.FindInt("fpsNumMembers"));
ASSERT_EQ(true, *site_group.FindBool("fpsEnterpriseManaged"));
}
} else {
// The site is not part of a FPS therefore doesn't have `fpsOwner` or
// `fpsNumMembers` set. `FindString` and `FindInt` should return null.
ASSERT_FALSE(site_group.FindString("fpsOwner"));
ASSERT_FALSE(site_group.FindInt("fpsNumMembers"));
ASSERT_FALSE(site_group.FindBool("fpsEnterpriseManaged"));
}
}
}
apps::AppPtr MakeApp(const std::string& app_id,
apps::AppType app_type,
const std::string& publisher_id,
apps::Readiness readiness,
apps::InstallReason install_reason) {
apps::AppPtr app = std::make_unique<apps::App>(app_type, app_id);
app->publisher_id = publisher_id;
app->readiness = readiness;
app->install_reason = install_reason;
return app;
}
void RegisterWebApp(Profile* profile, apps::AppPtr app) {
apps::AppRegistryCache& cache =
apps::AppServiceProxyFactory::GetForProfile(profile)->AppRegistryCache();
std::vector<apps::AppPtr> deltas;
deltas.push_back(std::move(app));
cache.OnApps(std::move(deltas), apps::AppType::kWeb,
/*should_notify_initialized=*/true);
}
struct TestModels {
scoped_refptr<browsing_data::MockCookieHelper> cookie_helper;
scoped_refptr<browsing_data::MockLocalStorageHelper> local_storage_helper;
const raw_ref<FakeBrowsingDataModel, ExperimentalAsh> browsing_data_model;
};
} // namespace
namespace settings {
// Helper class for setting ContentSettings via different sources.
class ContentSettingSourceSetter {
public:
ContentSettingSourceSetter(TestingProfile* profile,
ContentSettingsType content_type)
: prefs_(profile->GetTestingPrefService()), content_type_(content_type) {}
ContentSettingSourceSetter(const ContentSettingSourceSetter&) = delete;
ContentSettingSourceSetter& operator=(const ContentSettingSourceSetter&) =
delete;
void SetPolicyDefault(ContentSetting setting) {
prefs_->SetManagedPref(GetPrefNameForDefaultPermissionSetting(),
std::make_unique<base::Value>(setting));
}
const char* GetPrefNameForDefaultPermissionSetting() {
switch (content_type_) {
case ContentSettingsType::NOTIFICATIONS:
return prefs::kManagedDefaultNotificationsSetting;
default:
// Add support as needed.
NOTREACHED();
return "";
}
}
private:
raw_ptr<sync_preferences::TestingPrefServiceSyncable> prefs_;
ContentSettingsType content_type_;
};
class SiteSettingsHandlerBaseTest : public testing::Test {
public:
SiteSettingsHandlerBaseTest()
: kNotifications(site_settings::ContentSettingsTypeToGroupName(
ContentSettingsType::NOTIFICATIONS)),
kCookies(site_settings::ContentSettingsTypeToGroupName(
ContentSettingsType::COOKIES)) {
// Fully initialize |profile_| in the constructor since some children
// classes need it right away for SetUp().
testing_profile_manager_ = std::make_unique<TestingProfileManager>(
TestingBrowserProcess::GetGlobal());
EXPECT_TRUE(testing_profile_manager_->SetUp());
profile_ = testing_profile_manager_->CreateTestingProfile(
kTestUserEmail,
{{HistoryServiceFactory::GetInstance(),
HistoryServiceFactory::GetDefaultFactory()}},
/*is_main_profile=*/true);
EXPECT_TRUE(profile_);
#if BUILDFLAG(IS_CHROMEOS_ASH)
SetUpUserManager(profile_.get());
#endif
}
void SetUp() override {
browsing_topics::BrowsingTopicsServiceFactory::GetInstance()
->SetTestingFactoryAndUse(
profile(),
base::BindLambdaForTesting([this](content::BrowserContext* context)
-> std::unique_ptr<KeyedService> {
auto mock_browsing_topics_service = std::make_unique<
browsing_topics::MockBrowsingTopicsService>();
mock_browsing_topics_service_ =
mock_browsing_topics_service.get();
return mock_browsing_topics_service;
}));
mock_privacy_sandbox_service_ = static_cast<MockPrivacySandboxService*>(
PrivacySandboxServiceFactory::GetInstance()->SetTestingFactoryAndUse(
profile(), base::BindRepeating(&BuildMockPrivacySandboxService)));
profile()->SetPermissionControllerDelegate(
permissions::GetPermissionControllerDelegate(profile()));
handler_ = std::make_unique<SiteSettingsHandler>(profile());
handler()->set_web_ui(web_ui());
handler()->AllowJavascript();
// AllowJavascript() adds a callback to create leveldb_env::ChromiumEnv
// which reads the FeatureList. Wait for the callback to be finished so that
// we won't destruct |feature_list_| before the callback is executed.
base::RunLoop().RunUntilIdle();
web_ui()->ClearTrackedCalls();
}
void TearDown() override {
if (profile_) {
auto* partition = profile_->GetDefaultStoragePartition();
if (partition)
partition->WaitForDeletionTasksForTesting();
}
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
void SetUpUserManager(TestingProfile* profile) {
// On ChromeOS a user account is needed in order to check whether the user
// account is affiliated with the device owner for the purposes of applying
// enterprise policy.
constexpr char kTestUserGaiaId[] = "1111111111";
auto fake_user_manager = std::make_unique<ash::FakeChromeUserManager>();
auto* fake_user_manager_ptr = fake_user_manager.get();
scoped_user_manager_ = std::make_unique<user_manager::ScopedUserManager>(
std::move(fake_user_manager));
auto account_id =
AccountId::FromUserEmailGaiaId(kTestUserEmail, kTestUserGaiaId);
fake_user_manager_ptr->AddUserWithAffiliation(account_id,
/*is_affiliated=*/true);
fake_user_manager_ptr->LoginUser(account_id);
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
void RecordNotification(permissions::NotificationsEngagementService* service,
GURL url,
int daily_average_count) {
// This many notifications were recorded during the past week in total.
int total_count = daily_average_count * 7;
service->RecordNotificationDisplayed(url, total_count);
}
base::Time GetReferenceTime() {
base::Time time;
EXPECT_TRUE(base::Time::FromString("Sat, 1 Sep 2018 11:00:00 GMT", &time));
return time;
}
TestingProfile* profile() { return profile_.get(); }
Profile* incognito_profile() { return incognito_profile_; }
content::TestWebUI* web_ui() { return &web_ui_; }
SiteSettingsHandler* handler() { return handler_.get(); }
browsing_topics::MockBrowsingTopicsService* mock_browsing_topics_service() {
return mock_browsing_topics_service_;
}
MockPrivacySandboxService* mock_privacy_sandbox_service() {
return mock_privacy_sandbox_service_.get();
}
void ValidateBlockAutoplay(bool expected_value, bool expected_enabled) {
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ("onBlockAutoplayStatusChanged", data.arg1()->GetString());
const base::Value* event_data = data.arg2();
ASSERT_TRUE(event_data->is_dict());
absl::optional<bool> enabled = event_data->GetDict().FindBool("enabled");
ASSERT_TRUE(enabled.has_value());
EXPECT_EQ(expected_enabled, *enabled);
const base::Value::Dict* pref_data = event_data->GetDict().FindDict("pref");
ASSERT_TRUE(pref_data);
absl::optional<bool> value = pref_data->FindBool("value");
ASSERT_TRUE(value.has_value());
EXPECT_EQ(expected_value, *value);
}
void SetSoundContentSettingDefault(ContentSetting value) {
HostContentSettingsMap* content_settings =
HostContentSettingsMapFactory::GetForProfile(profile());
content_settings->SetDefaultContentSetting(ContentSettingsType::SOUND,
value);
}
void ValidateDefault(const ContentSetting expected_setting,
const site_settings::SiteSettingSource expected_source,
size_t expected_total_calls) {
EXPECT_EQ(expected_total_calls, web_ui()->call_data().size());
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_bool());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::Dict& default_value = data.arg3()->GetDict();
const std::string* setting = default_value.FindString(kSetting);
ASSERT_TRUE(setting);
EXPECT_EQ(content_settings::ContentSettingToString(expected_setting),
*setting);
const std::string* source = default_value.FindString(kSource);
if (source) {
EXPECT_EQ(site_settings::SiteSettingSourceToString(expected_source),
*source);
}
}
void ValidateOrigin(const std::string& expected_origin,
const std::string& expected_embedding,
const std::string& expected_display_name,
const ContentSetting expected_setting,
const site_settings::SiteSettingSource expected_source,
size_t expected_total_calls) {
EXPECT_EQ(expected_total_calls, web_ui()->call_data().size());
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_bool());
ASSERT_TRUE(data.arg2()->GetBool());
ASSERT_TRUE(data.arg3()->is_list());
EXPECT_EQ(1U, data.arg3()->GetList().size());
const base::Value::Dict& exception = data.arg3()->GetList()[0].GetDict();
const std::string* origin = exception.FindString(site_settings::kOrigin);
ASSERT_TRUE(origin);
ASSERT_EQ(expected_origin, *origin);
const std::string* display_name =
exception.FindString(site_settings::kDisplayName);
ASSERT_TRUE(display_name);
ASSERT_EQ(expected_display_name, *display_name);
const std::string* embedding_origin =
exception.FindString(site_settings::kEmbeddingOrigin);
ASSERT_TRUE(embedding_origin);
ASSERT_EQ(expected_embedding, *embedding_origin);
const std::string* setting = exception.FindString(site_settings::kSetting);
ASSERT_TRUE(setting);
ASSERT_EQ(content_settings::ContentSettingToString(expected_setting),
*setting);
const std::string* source = exception.FindString(site_settings::kSource);
ASSERT_TRUE(source);
ASSERT_EQ(site_settings::SiteSettingSourceToString(expected_source),
*source);
}
void ValidateNoOrigin(size_t expected_total_calls) {
EXPECT_EQ(expected_total_calls, web_ui()->call_data().size());
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_bool());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value& exceptions = *data.arg3();
ASSERT_TRUE(exceptions.is_list());
EXPECT_TRUE(exceptions.GetList().empty());
}
void ValidatePattern(bool expected_validity,
size_t expected_total_calls,
std::string expected_reason) {
EXPECT_EQ(expected_total_calls, web_ui()->call_data().size());
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_bool());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value* result = data.arg3();
ASSERT_TRUE(result->is_dict());
absl::optional<bool> valid = result->GetDict().FindBool("isValid");
ASSERT_TRUE(valid.has_value());
EXPECT_EQ(expected_validity, *valid);
const std::string* reason = result->GetDict().FindString("reason");
ASSERT_TRUE(reason);
EXPECT_EQ(expected_reason, *reason);
}
void ValidateIncognitoExists(bool expected_incognito,
size_t expected_total_calls) {
EXPECT_EQ(expected_total_calls, web_ui()->call_data().size());
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ("onIncognitoStatusChanged", data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_bool());
EXPECT_EQ(expected_incognito, data.arg2()->GetBool());
}
struct ZoomLevel {
std::string host_or_spec;
std::string display_name;
std::string zoom;
};
void ValidateZoom(const std::vector<ZoomLevel>& zoom_levels,
size_t expected_total_calls) {
EXPECT_EQ(expected_total_calls, web_ui()->call_data().size());
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ("onZoomLevelsChanged", data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_list());
const base::Value::List& exceptions = data.arg2()->GetList();
ASSERT_EQ(zoom_levels.size(), exceptions.size());
for (size_t i = 0; i < zoom_levels.size(); i++) {
const ZoomLevel& zoom_level = zoom_levels[i];
const base::Value::Dict& exception = exceptions[i].GetDict();
const std::string* host_or_spec = exception.FindString("hostOrSpec");
ASSERT_TRUE(host_or_spec);
ASSERT_EQ(zoom_level.host_or_spec, *host_or_spec);
const std::string* display_name = exception.FindString("displayName");
ASSERT_TRUE(display_name);
ASSERT_EQ(zoom_level.display_name, *display_name);
const std::string* zoom = exception.FindString("zoom");
ASSERT_TRUE(zoom);
ASSERT_EQ(zoom_level.zoom, *zoom);
}
}
void ValidateCookieSettingUpdate(const std::string expected_string,
const int expected_call_index) {
const content::TestWebUI::CallData& data =
*web_ui()->call_data()[expected_call_index];
ASSERT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_EQ("cookieSettingDescriptionChanged", data.arg1()->GetString());
ASSERT_EQ(expected_string, data.arg2()->GetString());
}
void ValidateUsageInfo(const std::string& expected_usage_origin,
const std::string& expected_usage_string,
const std::string& expected_cookie_string,
const std::string& expected_fps_member_count_string,
const bool expected_fps_policy) {
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_TRUE(data.arg_nth(0)->is_string());
EXPECT_EQ("usage-total-changed", data.arg_nth(0)->GetString());
ASSERT_TRUE(data.arg_nth(1)->is_string());
EXPECT_EQ(expected_usage_origin, data.arg_nth(1)->GetString());
ASSERT_TRUE(data.arg_nth(2)->is_string());
EXPECT_EQ(expected_usage_string, data.arg_nth(2)->GetString());
ASSERT_TRUE(data.arg_nth(3)->is_string());
EXPECT_EQ(expected_cookie_string, data.arg_nth(3)->GetString());
ASSERT_TRUE(data.arg_nth(4)->is_string());
EXPECT_EQ(expected_fps_member_count_string, data.arg_nth(4)->GetString());
ASSERT_TRUE(data.arg_nth(5)->is_bool());
EXPECT_EQ(expected_fps_policy, data.arg_nth(5)->GetBool());
}
void ValidateNotificationPermissionUpdate() {
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ("notification-permission-review-list-maybe-changed",
data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_list());
}
void CreateIncognitoProfile() {
incognito_profile_ = profile_->GetOffTheRecordProfile(
Profile::OTRProfileID::PrimaryID(), /*create_if_needed=*/true);
}
virtual void DestroyIncognitoProfile() {
if (incognito_profile_) {
profile_->DestroyOffTheRecordProfile(incognito_profile_);
incognito_profile_ = nullptr;
}
}
void SetupModels(base::OnceCallback<void(const TestModels& models)> setup) {
scoped_refptr<browsing_data::MockCookieHelper>
mock_browsing_data_cookie_helper;
scoped_refptr<browsing_data::MockLocalStorageHelper>
mock_browsing_data_local_storage_helper;
auto* storage_partition = profile()->GetDefaultStoragePartition();
mock_browsing_data_cookie_helper =
new browsing_data::MockCookieHelper(storage_partition);
mock_browsing_data_local_storage_helper =
new browsing_data::MockLocalStorageHelper(storage_partition);
auto container = std::make_unique<LocalDataContainer>(
mock_browsing_data_cookie_helper,
/*database_helper=*/nullptr, mock_browsing_data_local_storage_helper,
/*session_storage_helper=*/nullptr,
/*indexed_db_helper=*/nullptr,
/*file_system_helper=*/nullptr,
/*quota_helper=*/nullptr,
/*service_worker_helper=*/nullptr,
/*data_shared_worker_helper=*/nullptr,
/*cache_storage_helper=*/nullptr);
auto mock_cookies_tree_model = std::make_unique<CookiesTreeModel>(
std::move(container), profile()->GetExtensionSpecialStoragePolicy());
auto fake_browsing_data_model = std::make_unique<FakeBrowsingDataModel>(
ChromeBrowsingDataModelDelegate::CreateForProfile(profile()));
std::move(setup).Run(
{mock_browsing_data_cookie_helper,
mock_browsing_data_local_storage_helper,
ToRawRef<ExperimentalAsh>(*fake_browsing_data_model)});
mock_browsing_data_local_storage_helper->Notify();
mock_browsing_data_cookie_helper->Notify();
handler()->SetModelsForTesting(std::move(mock_cookies_tree_model),
std::move(fake_browsing_data_model));
}
// TODO(https://crbug.com/835712): Currently only set up the cookies and local
// storage nodes, will update all other nodes in the future.
void SetupModels() {
SetupModels(base::BindLambdaForTesting([](const TestModels& models) {
models.local_storage_helper->AddLocalStorageForStorageKey(
blink::StorageKey::CreateFromStringForTesting(
"https://www.example.com/"),
2);
models.cookie_helper->AddCookieSamples(GURL("http://example.com"), "A=1");
models.cookie_helper->AddCookieSamples(GURL("https://www.example.com/"),
"B=1");
models.cookie_helper->AddCookieSamples(GURL("http://abc.example.com"),
"C=1");
models.cookie_helper->AddCookieSamples(GURL("http://google.com"), "A=1");
models.cookie_helper->AddCookieSamples(GURL("http://google.com"), "B=1");
models.cookie_helper->AddCookieSamples(GURL("http://google.com.au"),
"A=1");
models.cookie_helper->AddCookieSamples(
GURL("https://www.example.com"),
"__Host-A=1; Path=/; Partitioned; Secure;",
net::CookiePartitionKey::FromURLForTesting(
GURL("https://google.com.au")));
models.cookie_helper->AddCookieSamples(
GURL("https://google.com.au"),
"__Host-A=1; Path=/; Partitioned; Secure;",
net::CookiePartitionKey::FromURLForTesting(
GURL("https://google.com.au")));
models.cookie_helper->AddCookieSamples(
GURL("https://www.another-example.com"),
"__Host-A=1; Path=/; Partitioned; Secure;",
net::CookiePartitionKey::FromURLForTesting(
GURL("https://google.com.au")));
models.cookie_helper->AddCookieSamples(
GURL("https://www.example.com"),
"__Host-A=1; Path=/; Partitioned; Secure;",
net::CookiePartitionKey::FromURLForTesting(
GURL("https://google.com")));
// Add an entry which will not be grouped with any other entries. This
// will require a placeholder origin to be correctly added & removed.
models.cookie_helper->AddCookieSamples(GURL("http://ungrouped.com"),
"A=1");
models.browsing_data_model->AddBrowsingData(
url::Origin::Create(GURL("https://www.google.com")),
BrowsingDataModel::StorageType::kTrustTokens, 50000000000);
}));
}
void SetupModelsWithIsolatedWebAppData(
const std::string& isolated_web_app_url,
int64_t usage) {
SetupModels(base::BindLambdaForTesting([&](const TestModels& models) {
models.browsing_data_model->AddBrowsingData(
url::Origin::Create(GURL(isolated_web_app_url)),
static_cast<BrowsingDataModel::StorageType>(
ChromeBrowsingDataModelDelegate::StorageType::kIsolatedWebApp),
usage);
}));
}
base::Value::List GetOnStorageFetchedSentList() {
handler()->ClearAllSitesMapForTesting();
auto get_all_sites_args = base::Value::List().Append(kCallbackId);
handler()->HandleGetAllSites(get_all_sites_args);
handler()->ServicePendingRequests();
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
return data.arg2()->GetList().Clone();
}
std::vector<CookieTreeNode*> GetHostNodes(GURL url) {
std::vector<CookieTreeNode*> nodes;
for (const auto& host_node :
handler()->cookies_tree_model_->GetRoot()->children()) {
if (host_node->GetDetailedInfo().origin.GetURL() == url) {
nodes.push_back(host_node.get());
}
}
return nodes;
}
void SetupDefaultFirstPartySets(MockPrivacySandboxService* mock_service) {
EXPECT_CALL(*mock_service, GetFirstPartySetOwner(_))
.WillRepeatedly(
[&](const GURL& url) -> absl::optional<net::SchemefulSite> {
auto first_party_sets = GetTestFirstPartySets();
if (first_party_sets.count(net::SchemefulSite(url))) {
return first_party_sets[net::SchemefulSite(url)];
}
return absl::nullopt;
});
}
base::flat_map<net::SchemefulSite, net::SchemefulSite>
GetTestFirstPartySets() {
base::flat_map<net::SchemefulSite, net::SchemefulSite> first_party_sets = {
{ConvertEtldToSchemefulSite("google.com"),
ConvertEtldToSchemefulSite("google.com")},
{ConvertEtldToSchemefulSite("google.com.au"),
ConvertEtldToSchemefulSite("google.com")},
{ConvertEtldToSchemefulSite("example.com"),
ConvertEtldToSchemefulSite("example.com")},
{ConvertEtldToSchemefulSite("unrelated.com"),
ConvertEtldToSchemefulSite("unrelated.com")}};
return first_party_sets;
}
base::Value::List GetOriginList(int size) {
base::Value::List origins;
for (int i = 0; i < size; i++) {
origins.Append("https://example" + base::NumberToString(i) + ".org:443");
}
return origins;
}
scoped_refptr<const extensions::Extension> LoadExtension(
const std::string& extension_name) {
auto extension = extensions::ExtensionBuilder()
.SetManifest(base::Value::Dict()
.Set("name", kExtensionName)
.Set("version", "1.0.0")
.Set("manifest_version", 3))
.Build();
extensions::TestExtensionSystem* extension_system =
static_cast<extensions::TestExtensionSystem*>(
extensions::ExtensionSystem::Get(profile()));
extensions::ExtensionService* extension_service =
extension_system->CreateExtensionService(
base::CommandLine::ForCurrentProcess(), base::FilePath(),
/*autoupdate_enabled=*/false);
extension_service->AddExtension(extension.get());
return extension;
}
void UnloadExtension(std::string extension_id) {
auto* extension_service =
extensions::ExtensionSystem::Get(profile())->extension_service();
ASSERT_TRUE(extension_service);
extension_service->UnloadExtension(
extension_id, extensions::UnloadedExtensionReason::DISABLE);
}
void ValidateCallbacksForNotificationPermission(int index) {
// When a notification permission is set or reset, there are two consecutive
// callbacks. The first one is to notify content setting observers, and
// the second one is to update safety check notification permission review.
ASSERT_EQ("contentSettingSitePermissionChanged",
web_ui()->call_data()[index]->arg1()->GetString());
ASSERT_EQ("notification-permission-review-list-maybe-changed",
web_ui()->call_data()[index + 1]->arg1()->GetString());
}
// Content setting group name for the relevant ContentSettingsType.
const std::string kNotifications;
const std::string kCookies;
const ContentSettingsType kPermissionNotifications =
ContentSettingsType::NOTIFICATIONS;
// The number of listeners that are expected to fire when any content setting
// is changed.
const size_t kNumberContentSettingListeners = 2;
private:
content::BrowserTaskEnvironment task_environment_;
std::unique_ptr<TestingProfileManager> testing_profile_manager_;
raw_ptr<TestingProfile> profile_ = nullptr;
raw_ptr<Profile> incognito_profile_ = nullptr;
content::TestWebUI web_ui_;
std::unique_ptr<SiteSettingsHandler> handler_;
#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_;
#endif
raw_ptr<browsing_topics::MockBrowsingTopicsService>
mock_browsing_topics_service_;
raw_ptr<MockPrivacySandboxService> mock_privacy_sandbox_service_;
};
class SiteSettingsHandlerTest : public SiteSettingsHandlerBaseTest,
public testing::WithParamInterface<bool> {};
// True if testing for handle clear unpartitioned usage with HTTPS scheme URL.
// When set to true, the tests use HTTPS scheme as origin. When set to
// false, the tests use HTTP scheme as origin.
INSTANTIATE_TEST_SUITE_P(All, SiteSettingsHandlerTest, testing::Bool());
TEST_F(SiteSettingsHandlerTest, GetAndSetDefault) {
// Test the JS -> C++ -> JS callback path for getting and setting defaults.
base::Value::List get_args;
get_args.Append(kCallbackId);
get_args.Append(kNotifications);
handler()->HandleGetDefaultValueForContentType(get_args);
ValidateDefault(CONTENT_SETTING_ASK,
site_settings::SiteSettingSource::kDefault, 1U);
// Set the default to 'Blocked'.
base::Value::List set_args;
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
handler()->HandleSetDefaultValueForContentType(set_args);
EXPECT_EQ(2U, web_ui()->call_data().size());
// Verify that the default has been set to 'Blocked'.
handler()->HandleGetDefaultValueForContentType(get_args);
ValidateDefault(CONTENT_SETTING_BLOCK,
site_settings::SiteSettingSource::kDefault, 3U);
}
// Flaky on CrOS and Linux. https://crbug.com/930481
TEST_F(SiteSettingsHandlerTest, GetAllSites) {
base::Value::List get_all_sites_args;
get_all_sites_args.Append(kCallbackId);
// Test all sites is empty when there are no preferences.
handler()->HandleGetAllSites(get_all_sites_args);
EXPECT_EQ(1U, web_ui()->call_data().size());
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_TRUE(site_groups.empty());
}
// Add a couple of exceptions and check they appear in all sites.
HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(profile());
const GURL url1("http://example.com");
const GURL url2("https://other.example.com");
map->SetContentSettingDefaultScope(
url1, url1, ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_BLOCK);
map->SetContentSettingDefaultScope(
url2, url2, ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_ALLOW);
handler()->HandleGetAllSites(get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_EQ(1UL, site_groups.size());
for (const base::Value& site_group_val : site_groups) {
const base::Value::Dict& site_group = site_group_val.GetDict();
const base::Value::List& origin_list =
CHECK_DEREF(site_group.FindList("origins"));
EXPECT_THAT(CHECK_DEREF(site_group.FindString("groupingKey")),
IsEtldPlus1("example.com"));
EXPECT_EQ(2UL, origin_list.size());
const base::Value::Dict& first_origin = origin_list[0].GetDict();
const base::Value::Dict& second_origin = origin_list[1].GetDict();
EXPECT_EQ(url1.spec(), CHECK_DEREF(first_origin.FindString("origin")));
EXPECT_EQ(0, first_origin.FindDouble("engagement"));
EXPECT_EQ(url2.spec(), CHECK_DEREF(second_origin.FindString("origin")));
EXPECT_EQ(0, second_origin.FindDouble("engagement"));
}
}
// Add an additional exception belonging to a different eTLD+1.
const GURL url3("https://example2.net");
map->SetContentSettingDefaultScope(
url3, url3, ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_BLOCK);
handler()->HandleGetAllSites(get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_EQ(2UL, site_groups.size());
for (const base::Value& site_group_val : site_groups) {
const base::Value::Dict& site_group = site_group_val.GetDict();
const std::string& grouping_key_string =
CHECK_DEREF(site_group.FindString("groupingKey"));
auto grouping_key = GroupingKey::Deserialize(grouping_key_string);
const base::Value::List& origin_list =
CHECK_DEREF(site_group.FindList("origins"));
if (grouping_key.GetEtldPlusOne() == "example2.net") {
EXPECT_EQ(1UL, origin_list.size());
const base::Value::Dict& first_origin = origin_list[0].GetDict();
EXPECT_EQ(url3.spec(), CHECK_DEREF(first_origin.FindString("origin")));
} else {
EXPECT_THAT(grouping_key_string, IsEtldPlus1("example.com"));
}
}
}
// Test embargoed settings also appear.
permissions::PermissionDecisionAutoBlocker* auto_blocker =
PermissionDecisionAutoBlockerFactory::GetForProfile(profile());
base::SimpleTestClock clock;
clock.SetNow(base::Time::Now());
auto_blocker->SetClockForTesting(&clock);
const GURL url4("https://example2.co.uk");
for (int i = 0; i < 3; ++i) {
auto_blocker->RecordDismissAndEmbargo(
url4, ContentSettingsType::NOTIFICATIONS, false);
}
EXPECT_EQ(
CONTENT_SETTING_BLOCK,
auto_blocker->GetEmbargoResult(url4, ContentSettingsType::NOTIFICATIONS)
->content_setting);
handler()->HandleGetAllSites(get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
EXPECT_EQ(3UL, data.arg3()->GetList().size());
}
// Check |url4| disappears from the list when its embargo expires.
clock.Advance(base::Days(8));
handler()->HandleGetAllSites(get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_EQ(2UL, site_groups.size());
EXPECT_THAT(CHECK_DEREF(site_groups[0].GetDict().FindString("groupingKey")),
IsEtldPlus1("example.com"));
EXPECT_THAT(CHECK_DEREF(site_groups[1].GetDict().FindString("groupingKey")),
IsEtldPlus1("example2.net"));
}
// Add an expired embargo setting to an existing eTLD+1 group and make sure it
// still appears.
for (int i = 0; i < 3; ++i) {
auto_blocker->RecordDismissAndEmbargo(
url3, ContentSettingsType::NOTIFICATIONS, false);
}
EXPECT_EQ(
CONTENT_SETTING_BLOCK,
auto_blocker->GetEmbargoResult(url3, ContentSettingsType::NOTIFICATIONS)
->content_setting);
clock.Advance(base::Days(8));
EXPECT_FALSE(
auto_blocker->GetEmbargoResult(url3, ContentSettingsType::NOTIFICATIONS)
.has_value());
handler()->HandleGetAllSites(get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_EQ(2UL, site_groups.size());
EXPECT_THAT(CHECK_DEREF(site_groups[0].GetDict().FindString("groupingKey")),
IsEtldPlus1("example.com"));
EXPECT_THAT(CHECK_DEREF(site_groups[1].GetDict().FindString("groupingKey")),
IsEtldPlus1("example2.net"));
}
// Add an expired embargo to a new eTLD+1 and make sure it doesn't appear.
const GURL url5("http://test.example5.com");
for (int i = 0; i < 3; ++i) {
auto_blocker->RecordDismissAndEmbargo(
url5, ContentSettingsType::NOTIFICATIONS, false);
}
EXPECT_EQ(
CONTENT_SETTING_BLOCK,
auto_blocker->GetEmbargoResult(url5, ContentSettingsType::NOTIFICATIONS)
->content_setting);
clock.Advance(base::Days(8));
EXPECT_FALSE(
auto_blocker->GetEmbargoResult(url5, ContentSettingsType::NOTIFICATIONS)
.has_value());
handler()->HandleGetAllSites(get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_EQ(2UL, site_groups.size());
EXPECT_THAT(CHECK_DEREF(site_groups[0].GetDict().FindString("groupingKey")),
IsEtldPlus1("example.com"));
EXPECT_THAT(CHECK_DEREF(site_groups[1].GetDict().FindString("groupingKey")),
IsEtldPlus1("example2.net"));
}
// Same extension url from different content setting types shows only one
// extension site group.
auto extension = LoadExtension(kExtensionName);
map->SetContentSettingDefaultScope(extension->url(), extension->url(),
ContentSettingsType::NOTIFICATIONS,
CONTENT_SETTING_BLOCK);
map->SetContentSettingDefaultScope(extension->url(), extension->url(),
ContentSettingsType::GEOLOCATION,
CONTENT_SETTING_BLOCK);
handler()->HandleGetAllSites(get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_EQ(3UL, site_groups.size());
// Extension groupingKey will be its origin with the pattern
// "chrome-extension://<extension_id>" so it is before other site groups in
// the list.
EXPECT_THAT(CHECK_DEREF(site_groups[0].GetDict().FindString("groupingKey")),
IsOrigin(extension->url()));
EXPECT_EQ(nullptr, site_groups[0].GetDict().FindString("etldPlus1"));
EXPECT_THAT(CHECK_DEREF(site_groups[1].GetDict().FindString("groupingKey")),
IsEtldPlus1("example.com"));
EXPECT_EQ("example.com",
CHECK_DEREF(site_groups[1].GetDict().FindString("etldPlus1")));
EXPECT_THAT(CHECK_DEREF(site_groups[2].GetDict().FindString("groupingKey")),
IsEtldPlus1("example2.net"));
EXPECT_EQ("example2.net",
CHECK_DEREF(site_groups[2].GetDict().FindString("etldPlus1")));
}
// Each call to HandleGetAllSites() above added a callback to the profile's
// browsing_data::LocalStorageHelper, so make sure these aren't stuck waiting
// to run at the end of the test.
base::RunLoop run_loop;
run_loop.RunUntilIdle();
}
TEST_F(SiteSettingsHandlerTest, Cookies) {
base::Value::List get_all_sites_args;
get_all_sites_args.Append(kCallbackId);
// Tests that a cookie eTLD+1 origin, which should use a placeholder in
// AllSitesMap, returns the correct origin in GetAllSites.
// This corresponds to case 1 in InsertOriginIntoGroup.
{
SetupModels(base::BindLambdaForTesting([](const TestModels& models) {
models.cookie_helper->AddCookieSamples(GURL("http://c1.com"), "A=1");
}));
base::Value::List site_groups = GetOnStorageFetchedSentList();
ASSERT_EQ(1UL, site_groups.size());
const base::Value::Dict& first_group = site_groups[0].GetDict();
EXPECT_THAT(CHECK_DEREF(first_group.FindString("groupingKey")),
IsEtldPlus1("c1.com"));
EXPECT_EQ(1, *first_group.FindInt("numCookies"));
const base::Value::List& first_group_origins =
CHECK_DEREF(first_group.FindList("origins"));
ASSERT_EQ(1UL, first_group_origins.size());
EXPECT_EQ(
"http://c1.com/",
CHECK_DEREF(first_group_origins[0].GetDict().FindString("origin")));
EXPECT_EQ(1, first_group_origins[0].GetDict().FindInt("numCookies"));
}
// Tests that multiple cookie eTLD+1 origins result in a single origin being
// returned in GetAllSites.
// This corresponds to case 2 in InsertOriginIntoGroup.
{
SetupModels(base::BindLambdaForTesting([](const TestModels& models) {
models.cookie_helper->AddCookieSamples(GURL("https://c2.com"), "A=1");
models.cookie_helper->AddCookieSamples(GURL("https://c2.com"), "B=1");
}));
base::Value::List site_groups = GetOnStorageFetchedSentList();
ASSERT_EQ(1UL, site_groups.size());
const base::Value::Dict& first_group = site_groups[0].GetDict();
EXPECT_THAT(CHECK_DEREF(first_group.FindString("groupingKey")),
IsEtldPlus1("c2.com"));
EXPECT_EQ(2, *first_group.FindInt("numCookies"));
const base::Value::List& first_group_origins =
CHECK_DEREF(first_group.FindList("origins"));
ASSERT_EQ(1UL, first_group_origins.size());
EXPECT_EQ(
"http://c2.com/",
CHECK_DEREF(first_group_origins[0].GetDict().FindString("origin")));
EXPECT_EQ(2, first_group_origins[0].GetDict().FindInt("numCookies"));
}
// Tests that an HTTP cookie origin will reuse an equivalent HTTPS origin if
// one exists.
// This corresponds to case 3 in InsertOriginIntoGroup.
{
SetupModels(base::BindLambdaForTesting([](const TestModels& models) {
models.browsing_data_model->AddBrowsingData(
url::Origin::Create(GURL("https://w.c3.com")),
BrowsingDataModel::StorageType::kTrustTokens, 50);
models.cookie_helper->AddCookieSamples(GURL("http://w.c3.com"), "A=1");
}));
base::Value::List site_groups = GetOnStorageFetchedSentList();
ASSERT_EQ(1UL, site_groups.size());
const base::Value::Dict& first_group = site_groups[0].GetDict();
EXPECT_THAT(CHECK_DEREF(first_group.FindString("groupingKey")),
IsEtldPlus1("c3.com"));
EXPECT_EQ(1, *first_group.FindInt("numCookies"));
const base::Value::List& first_group_origins =
CHECK_DEREF(first_group.FindList("origins"));
ASSERT_EQ(1UL, first_group_origins.size());
EXPECT_EQ(
"https://w.c3.com/",
CHECK_DEREF(first_group_origins[0].GetDict().FindString("origin")));
EXPECT_EQ(1, first_group_origins[0].GetDict().FindInt("numCookies"));
}
// Tests that placeholder cookie eTLD+1 origins get removed from AllSitesMap
// when a more specific origin is added later.
{
SetupModels(base::BindLambdaForTesting([](const TestModels& models) {
models.cookie_helper->AddCookieSamples(GURL("https://c4.com"), "B=1");
models.cookie_helper->AddCookieSamples(GURL("https://w.c4.com"), "A=1");
}));
base::Value::List site_groups = GetOnStorageFetchedSentList();
ASSERT_EQ(1UL, site_groups.size());
const base::Value::Dict& first_group = site_groups[0].GetDict();
EXPECT_THAT(CHECK_DEREF(first_group.FindString("groupingKey")),
IsEtldPlus1("c4.com"));
EXPECT_EQ(2, *first_group.FindInt("numCookies"));
const base::Value::List& first_group_origins =
CHECK_DEREF(first_group.FindList("origins"));
ASSERT_EQ(1UL, first_group_origins.size());
EXPECT_EQ(
"https://w.c4.com/",
CHECK_DEREF(first_group_origins[0].GetDict().FindString("origin")));
EXPECT_EQ(1, first_group_origins[0].GetDict().FindInt("numCookies"));
}
}
TEST_F(SiteSettingsHandlerTest, GetRecentSitePermissions) {
// Constants used only in this test.
std::string kAllowed = content_settings::ContentSettingToString(
ContentSetting::CONTENT_SETTING_ALLOW);
std::string kBlocked = content_settings::ContentSettingToString(
ContentSetting::CONTENT_SETTING_BLOCK);
std::string kEmbargo =
SiteSettingSourceToString(site_settings::SiteSettingSource::kEmbargo);
std::string kPreference =
SiteSettingSourceToString(site_settings::SiteSettingSource::kPreference);
base::Value::List get_recent_permissions_args;
get_recent_permissions_args.Append(kCallbackId);
get_recent_permissions_args.Append(3);
// Configure prefs and auto blocker with a controllable clock.
base::SimpleTestClock clock;
clock.SetNow(base::Time::Now());
HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(profile());
map->SetClockForTesting(&clock);
permissions::PermissionDecisionAutoBlocker* auto_blocker =
PermissionDecisionAutoBlockerFactory::GetForProfile(profile());
auto_blocker->SetClockForTesting(&clock);
clock.Advance(base::Hours(1));
// Test recent permissions is empty when there are no preferences.
handler()->HandleGetRecentSitePermissions(get_recent_permissions_args);
EXPECT_EQ(1U, web_ui()->call_data().size());
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& recent_permissions = data.arg3()->GetList();
EXPECT_TRUE(recent_permissions.empty());
}
// Add numerous permissions from different sources and confirm that the recent
// permissions are correctly transformed for usage by JS.
const GURL url1("https://example.com");
const GURL url2("http://example.com");
for (int i = 0; i < 3; ++i)
auto_blocker->RecordDismissAndEmbargo(
url1, ContentSettingsType::NOTIFICATIONS, false);
clock.Advance(base::Hours(2));
clock.Advance(base::Hours(1));
CreateIncognitoProfile();
HostContentSettingsMap* incognito_map =
HostContentSettingsMapFactory::GetForProfile(incognito_profile());
incognito_map->SetClockForTesting(&clock);
clock.Advance(base::Hours(1));
permissions::PermissionDecisionAutoBlocker* incognito_auto_blocker =
PermissionDecisionAutoBlockerFactory::GetForProfile(incognito_profile());
incognito_auto_blocker->SetClockForTesting(&clock);
for (int i = 0; i < 3; ++i)
incognito_auto_blocker->RecordDismissAndEmbargo(
url1, ContentSettingsType::NOTIFICATIONS, false);
handler()->HandleGetRecentSitePermissions(get_recent_permissions_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::List& recent_permissions = data.arg3()->GetList();
EXPECT_EQ(2UL, recent_permissions.size());
const base::Value::Dict& first_permission = recent_permissions[0].GetDict();
const base::Value::Dict& second_permission =
recent_permissions[1].GetDict();
EXPECT_EQ(url1.spec(), CHECK_DEREF(second_permission.FindString("origin")));
EXPECT_EQ(url1.spec(), CHECK_DEREF(first_permission.FindString("origin")));
EXPECT_TRUE(first_permission.FindBool("incognito").value_or(false));
EXPECT_FALSE(second_permission.FindBool("incognito").value_or(true));
const base::Value::List& incognito_url1_permissions =
CHECK_DEREF(first_permission.FindList("recentPermissions"));
const base::Value::List& url1_permissions =
CHECK_DEREF(second_permission.FindList("recentPermissions"));
EXPECT_EQ(1UL, incognito_url1_permissions.size());
const base::Value::Dict& first_incognito_permission =
incognito_url1_permissions[0].GetDict();
EXPECT_EQ(kNotifications,
CHECK_DEREF(first_incognito_permission.FindString("type")));
EXPECT_EQ(kBlocked,
CHECK_DEREF(first_incognito_permission.FindString("setting")));
EXPECT_EQ(kEmbargo,
CHECK_DEREF(first_incognito_permission.FindString("source")));
const base::Value::Dict& first_url_permission =
url1_permissions[0].GetDict();
EXPECT_EQ(kNotifications,
CHECK_DEREF(first_url_permission.FindString("type")));
EXPECT_EQ(kBlocked,
CHECK_DEREF(first_url_permission.FindString("setting")));
EXPECT_EQ(kEmbargo, CHECK_DEREF(first_url_permission.FindString("source")));
}
}
TEST_F(SiteSettingsHandlerTest, OnStorageFetched) {
SetupModels();
handler()->ClearAllSitesMapForTesting();
handler()->OnStorageFetched();
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ("onStorageListFetched", data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_list());
const base::Value::List& storage_and_cookie_list = data.arg2()->GetList();
EXPECT_EQ(4U, storage_and_cookie_list.size());
{
const base::Value& site_group_val = storage_and_cookie_list[0];
ASSERT_TRUE(site_group_val.is_dict());
const base::Value::Dict& site_group = site_group_val.GetDict();
ASSERT_THAT(CHECK_DEREF(site_group.FindString("groupingKey")),
IsEtldPlus1("example.com"));
EXPECT_EQ(3, site_group.FindDouble("numCookies"));
const base::Value::List* origin_list = site_group.FindList("origins");
ASSERT_TRUE(origin_list);
// There will be 2 origins in this case. Cookie node with url
// http://www.example.com/ will be treat as https://www.example.com/ because
// this url existed in the storage nodes.
EXPECT_EQ(2U, origin_list->size());
const base::Value::Dict& origin_info_0 = (*origin_list)[0].GetDict();
EXPECT_EQ("http://abc.example.com/",
CHECK_DEREF(origin_info_0.FindString("origin")));
EXPECT_EQ(0, origin_info_0.FindDouble("engagement"));
EXPECT_EQ(0, origin_info_0.FindDouble("usage"));
EXPECT_EQ(1, origin_info_0.FindDouble("numCookies"));
const base::Value::Dict& origin_info_1 = (*origin_list)[1].GetDict();
// Even though in the cookies the scheme is http, it still stored as https
// because there is https data stored.
EXPECT_EQ("https://www.example.com/",
CHECK_DEREF(origin_info_1.FindString("origin")));
EXPECT_EQ(0, origin_info_1.FindDouble("engagement"));
EXPECT_EQ(2, origin_info_1.FindDouble("usage"));
EXPECT_EQ(1, origin_info_1.FindDouble("numCookies"));
}
{
const base::Value::Dict& site_group = storage_and_cookie_list[1].GetDict();
ASSERT_THAT(CHECK_DEREF(site_group.FindString("groupingKey")),
IsEtldPlus1("google.com"));
EXPECT_EQ(3, site_group.FindDouble("numCookies"));
const base::Value::List* origin_list = site_group.FindList("origins");
ASSERT_TRUE(origin_list);
EXPECT_EQ(2U, origin_list->size());
const base::Value::Dict& partitioned_origin_info =
(*origin_list)[0].GetDict();
EXPECT_EQ("https://www.example.com/",
CHECK_DEREF(partitioned_origin_info.FindString("origin")));
EXPECT_EQ(0, partitioned_origin_info.FindDouble("engagement"));
EXPECT_EQ(0, partitioned_origin_info.FindDouble("usage"));
EXPECT_EQ(1, partitioned_origin_info.FindDouble("numCookies"));
EXPECT_TRUE(
partitioned_origin_info.FindBool("isPartitioned").value_or(false));
const base::Value::Dict& unpartitioned_origin_info =
(*origin_list)[1].GetDict();
EXPECT_EQ("https://www.google.com/",
CHECK_DEREF(unpartitioned_origin_info.FindString("origin")));
EXPECT_EQ(0, unpartitioned_origin_info.FindDouble("engagement"));
EXPECT_EQ(50000000000, unpartitioned_origin_info.FindDouble("usage"));
EXPECT_EQ(0, unpartitioned_origin_info.FindDouble("numCookies"));
EXPECT_FALSE(
unpartitioned_origin_info.FindBool("isPartitioned").value_or(true));
}
{
const base::Value& site_group_val = storage_and_cookie_list[2];
ASSERT_TRUE(site_group_val.is_dict());
const base::Value::Dict& site_group = site_group_val.GetDict();
ASSERT_THAT(CHECK_DEREF(site_group.FindString("groupingKey")),
IsEtldPlus1("google.com.au"));
EXPECT_EQ(4, site_group.FindDouble("numCookies"));
const base::Value::List* origin_list = site_group.FindList("origins");
ASSERT_TRUE(origin_list);
// The unpartitioned cookie set for google.com.au should be associated with
// the eTLD+1, and thus won't have an origin entry as other origin entries
// exist for the unpartitioned storage. The partitioned cookie for
// google.com.au, partitioned by google.com.au should have also created an
// entry.
EXPECT_EQ(3U, origin_list->size());
const base::Value::Dict& partitioned_origin_one_info =
(*origin_list)[0].GetDict();
EXPECT_EQ("https://google.com.au/",
CHECK_DEREF(partitioned_origin_one_info.FindString("origin")));
EXPECT_EQ(0, partitioned_origin_one_info.FindDouble("engagement"));
EXPECT_EQ(0, partitioned_origin_one_info.FindDouble("usage"));
EXPECT_EQ(1, partitioned_origin_one_info.FindDouble("numCookies"));
EXPECT_TRUE(
partitioned_origin_one_info.FindBool("isPartitioned").value_or(false));
const base::Value::Dict& partitioned_origin_two_info =
(*origin_list)[1].GetDict();
EXPECT_EQ("https://www.another-example.com/",
CHECK_DEREF(partitioned_origin_two_info.FindString("origin")));
EXPECT_EQ(0, partitioned_origin_two_info.FindDouble("engagement"));
EXPECT_EQ(0, partitioned_origin_two_info.FindDouble("usage"));
EXPECT_EQ(1, partitioned_origin_two_info.FindDouble("numCookies"));
EXPECT_TRUE(
partitioned_origin_two_info.FindBool("isPartitioned").value_or(false));
const base::Value::Dict& partitioned_origin_three_info =
(*origin_list)[2].GetDict();
EXPECT_EQ("https://www.example.com/",
CHECK_DEREF(partitioned_origin_three_info.FindString("origin")));
EXPECT_EQ(0, partitioned_origin_three_info.FindDouble("engagement"));
EXPECT_EQ(0, partitioned_origin_three_info.FindDouble("usage"));
EXPECT_EQ(1, partitioned_origin_three_info.FindDouble("numCookies"));
EXPECT_TRUE(partitioned_origin_three_info.FindBool("isPartitioned")
.value_or(false));
}
{
const base::Value& site_group_val = storage_and_cookie_list[3];
ASSERT_TRUE(site_group_val.is_dict());
const base::Value::Dict& site_group = site_group_val.GetDict();
ASSERT_THAT(CHECK_DEREF(site_group.FindString("groupingKey")),
IsEtldPlus1("ungrouped.com"));
EXPECT_EQ(1, site_group.FindDouble("numCookies"));
const base::Value::List* origin_list = site_group.FindList("origins");
ASSERT_TRUE(origin_list);
EXPECT_EQ(1U, origin_list->size());
const base::Value::Dict& origin_info = (*origin_list)[0].GetDict();
EXPECT_EQ("http://ungrouped.com/",
CHECK_DEREF(origin_info.FindString("origin")));
EXPECT_EQ(0, origin_info.FindDouble("engagement"));
EXPECT_EQ(0, origin_info.FindDouble("usage"));
EXPECT_EQ(1, origin_info.FindDouble("numCookies"));
}
}
TEST_F(SiteSettingsHandlerTest, InstalledApps) {
GURL start_url("http://abc.example.com/path");
RegisterWebApp(
profile(),
MakeApp(web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, start_url),
apps::AppType::kWeb, start_url.spec(), apps::Readiness::kReady,
apps::InstallReason::kSync));
SetupModels();
base::Value::List storage_and_cookie_list = GetOnStorageFetchedSentList();
EXPECT_EQ(4U, storage_and_cookie_list.size());
{
const base::Value& site_group_val = storage_and_cookie_list[0];
ASSERT_TRUE(site_group_val.is_dict());
const base::Value::Dict& site_group = site_group_val.GetDict();
ASSERT_THAT(CHECK_DEREF(site_group.FindString("groupingKey")),
IsEtldPlus1("example.com"));
ASSERT_TRUE(site_group.FindBool("hasInstalledPWA").value_or(false));
const base::Value::List* origin_list = site_group.FindList("origins");
ASSERT_TRUE(origin_list);
const base::Value::Dict& origin_info = (*origin_list)[0].GetDict();
EXPECT_EQ("http://abc.example.com/",
CHECK_DEREF(origin_info.FindString("origin")));
EXPECT_TRUE(origin_info.FindBool("isInstalled").value_or(false));
}
// Verify that installed booleans are false for other siteGroups/origins
{
const base::Value& site_group_val = storage_and_cookie_list[1];
ASSERT_TRUE(site_group_val.is_dict());
const base::Value::Dict& site_group = site_group_val.GetDict();
ASSERT_THAT(CHECK_DEREF(site_group.FindString("groupingKey")),
IsEtldPlus1("google.com"));
EXPECT_FALSE(site_group.FindBool("hasInstalledPWA").value_or(true));
const base::Value::List* origin_list = site_group.FindList("origins");
ASSERT_TRUE(origin_list);
for (const auto& origin_info : *origin_list) {
ASSERT_TRUE(origin_info.is_dict());
EXPECT_FALSE(
origin_info.GetDict().FindBool("isInstalled").value_or(true));
}
}
}
TEST_F(SiteSettingsHandlerTest, IncognitoExceptions) {
constexpr char kOriginToBlock[] = "https://www.blocked.com:443";
auto validate_exception = [&kOriginToBlock](const base::Value& exception) {
ASSERT_TRUE(exception.is_dict());
ASSERT_TRUE(exception.GetDict().FindString(site_settings::kOrigin));
ASSERT_EQ(kOriginToBlock,
*exception.GetDict().FindString(site_settings::kOrigin));
};
CreateIncognitoProfile();
{
base::Value::List set_args;
set_args.Append(kOriginToBlock); // Primary pattern.
set_args.Append(std::string()); // Secondary pattern.
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
set_args.Append(true); // Incognito.
handler()->HandleSetCategoryPermissionForPattern(set_args);
base::Value::List get_exception_list_args;
get_exception_list_args.Append(kCallbackId);
get_exception_list_args.Append(kNotifications);
handler()->HandleGetExceptionList(get_exception_list_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
ASSERT_TRUE(data.arg3()->is_list());
const base::Value::List& exceptions = data.arg3()->GetList();
ASSERT_EQ(1U, exceptions.size());
validate_exception(exceptions[0]);
}
{
base::Value::List set_args;
set_args.Append(kOriginToBlock); // Primary pattern.
set_args.Append(std::string()); // Secondary pattern.
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
set_args.Append(false); // Incognito.
handler()->HandleSetCategoryPermissionForPattern(set_args);
base::Value::List get_exception_list_args;
get_exception_list_args.Append(kCallbackId);
get_exception_list_args.Append(kNotifications);
handler()->HandleGetExceptionList(get_exception_list_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
ASSERT_TRUE(data.arg3()->is_list());
const base::Value::List& exceptions = data.arg3()->GetList();
ASSERT_EQ(2U, exceptions.size());
validate_exception(exceptions[0]);
validate_exception(exceptions[1]);
}
DestroyIncognitoProfile();
}
TEST_F(SiteSettingsHandlerTest, ResetCategoryPermissionForEmbargoedOrigins) {
constexpr char kOriginToBlock[] = "https://www.blocked.com:443";
constexpr char kOriginToEmbargo[] = "https://embargoed.co.uk";
// Add and test 1 blocked origin
{
base::Value::List set_args;
set_args.Append(kOriginToBlock); // Primary pattern.
set_args.Append(std::string()); // Secondary pattern.
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
set_args.Append(false); // Incognito.
handler()->HandleSetCategoryPermissionForPattern(set_args);
ASSERT_EQ(2U, web_ui()->call_data().size());
// When HandleSetCategoryPermissionForPattern is called for a notification
// permission, there are two callbacks that make call_data size increase
// by 2 instead of 1.
ValidateCallbacksForNotificationPermission(0);
}
// Add and test 1 embargoed origin.
{
auto* auto_blocker =
PermissionDecisionAutoBlockerFactory::GetForProfile(profile());
for (size_t i = 0; i < 3; ++i) {
auto_blocker->RecordDismissAndEmbargo(GURL(kOriginToEmbargo),
kPermissionNotifications, false);
}
// Check that origin is under embargo.
EXPECT_EQ(
CONTENT_SETTING_BLOCK,
auto_blocker
->GetEmbargoResult(GURL(kOriginToEmbargo), kPermissionNotifications)
->content_setting);
}
// Check there are 2 blocked origins.
{
base::Value::List exceptions;
site_settings::GetExceptionsForContentType(
kPermissionNotifications, profile(), web_ui(),
/*incognito=*/false, &exceptions);
// The size should be 2, 1st is blocked origin, 2nd is embargoed origin.
ASSERT_EQ(2U, exceptions.size());
}
{
// Reset blocked origin.
base::Value::List reset_args;
reset_args.Append(kOriginToBlock);
reset_args.Append(std::string());
reset_args.Append(kNotifications);
reset_args.Append(false); // Incognito.
handler()->HandleResetCategoryPermissionForPattern(reset_args);
// Check there is 1 blocked origin.
base::Value::List exceptions;
site_settings::GetExceptionsForContentType(
kPermissionNotifications, profile(), web_ui(),
/*incognito=*/false, &exceptions);
ASSERT_EQ(1U, exceptions.size());
}
{
// Reset embargoed origin.
base::Value::List reset_args;
reset_args.Append(kOriginToEmbargo);
reset_args.Append(std::string());
reset_args.Append(kNotifications);
reset_args.Append(false); // Incognito.
handler()->HandleResetCategoryPermissionForPattern(reset_args);
// Check that there are no blocked or embargoed origins.
base::Value::List exceptions;
site_settings::GetExceptionsForContentType(
kPermissionNotifications, profile(), web_ui(),
/*incognito=*/false, &exceptions);
ASSERT_TRUE(exceptions.empty());
}
}
TEST_F(SiteSettingsHandlerTest, ResetCategoryPermissionForInvalidOrigins) {
constexpr char kInvalidOrigin[] = "example.com";
auto url = GURL(kInvalidOrigin);
EXPECT_FALSE(url.is_valid());
EXPECT_TRUE(url.is_empty());
base::Value::List set_args;
set_args.Append(kInvalidOrigin); // Primary pattern.
set_args.Append(std::string()); // Secondary pattern.
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
set_args.Append(false); // Incognito.
handler()->HandleSetCategoryPermissionForPattern(set_args);
ASSERT_EQ(2U, web_ui()->call_data().size());
// When HandleSetCategoryPermissionForPattern is called for a notification
// permission, there are two callbacks that make call_data size increase
// by 2 instead of 1.
ValidateCallbacksForNotificationPermission(0);
// Reset blocked origin.
base::Value::List reset_args;
reset_args.Append(kInvalidOrigin);
reset_args.Append(std::string());
reset_args.Append(kNotifications);
reset_args.Append(false); // Incognito.
// Check that this method is not crashing for an invalid origin.
handler()->HandleResetCategoryPermissionForPattern(reset_args);
}
TEST_F(SiteSettingsHandlerTest, Origins) {
const std::string google("https://www.google.com:443");
{
// Test the JS -> C++ -> JS callback path for configuring origins, by
// setting Google.com to blocked.
base::Value::List set_args;
set_args.Append(google); // Primary pattern.
set_args.Append(std::string()); // Secondary pattern.
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
set_args.Append(false); // Incognito.
handler()->HandleSetCategoryPermissionForPattern(set_args);
EXPECT_EQ(2U, web_ui()->call_data().size());
// When HandleSetCategoryPermissionForPattern is called for a notification
// permission, there are two callbacks that make call_data size increase
// by 2 instead of 1.
ValidateCallbacksForNotificationPermission(0);
}
base::Value::List get_exception_list_args;
get_exception_list_args.Append(kCallbackId);
get_exception_list_args.Append(kNotifications);
handler()->HandleGetExceptionList(get_exception_list_args);
ValidateOrigin(google, "", google, CONTENT_SETTING_BLOCK,
site_settings::SiteSettingSource::kPreference, 3U);
{
// Reset things back to how they were.
base::Value::List reset_args;
reset_args.Append(google);
reset_args.Append(std::string());
reset_args.Append(kNotifications);
reset_args.Append(false); // Incognito.
handler()->HandleResetCategoryPermissionForPattern(reset_args);
EXPECT_EQ(5U, web_ui()->call_data().size());
// When HandleResetCategoryPermissionForPattern is called for a notification
// permission, there are two callbacks that make call_data size increase
// by 2 instead of 1.
ValidateCallbacksForNotificationPermission(3);
}
// Verify the reset was successful.
handler()->HandleGetExceptionList(get_exception_list_args);
ValidateNoOrigin(6U);
}
TEST_F(SiteSettingsHandlerTest, NotificationPermissionRevokeUkm) {
const std::string google("https://www.google.com");
ukm::TestAutoSetUkmRecorder ukm_recorder;
auto* history_service = HistoryServiceFactory::GetForProfile(
profile(), ServiceAccessType::EXPLICIT_ACCESS);
history_service->AddPage(GURL(google), base::Time::Now(),
history::SOURCE_BROWSED);
base::RunLoop origin_queried_waiter;
history_service->set_origin_queried_closure_for_testing(
origin_queried_waiter.QuitClosure());
{
base::Value::List set_notification_origin_args;
set_notification_origin_args.Append(google);
set_notification_origin_args.Append("");
set_notification_origin_args.Append(kNotifications);
set_notification_origin_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_ALLOW));
set_notification_origin_args.Append(false /* incognito */);
handler()->HandleSetCategoryPermissionForPattern(
set_notification_origin_args);
}
{
base::Value::List set_notification_origin_args;
set_notification_origin_args.Append(google);
set_notification_origin_args.Append("");
set_notification_origin_args.Append(kNotifications);
set_notification_origin_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
set_notification_origin_args.Append(false /* incognito */);
handler()->HandleSetCategoryPermissionForPattern(
set_notification_origin_args);
}
origin_queried_waiter.Run();
auto entries = ukm_recorder.GetEntriesByName("Permission");
EXPECT_EQ(1u, entries.size());
auto* entry = entries.front();
ukm_recorder.ExpectEntrySourceHasUrl(entry, GURL(google));
EXPECT_EQ(
*ukm_recorder.GetEntryMetric(entry, "Source"),
static_cast<int64_t>(permissions::PermissionSourceUI::SITE_SETTINGS));
EXPECT_EQ(
*ukm_recorder.GetEntryMetric(entry, "PermissionType"),
ContentSettingTypeToHistogramValue(ContentSettingsType::NOTIFICATIONS));
EXPECT_EQ(*ukm_recorder.GetEntryMetric(entry, "Action"),
static_cast<int64_t>(permissions::PermissionAction::REVOKED));
}
// TODO(crbug.com/1076294): Test flakes on TSAN and ASAN.
#if defined(THREAD_SANITIZER) || defined(ADDRESS_SANITIZER)
#define MAYBE_DefaultSettingSource DISABLED_DefaultSettingSource
#else
#define MAYBE_DefaultSettingSource DefaultSettingSource
#endif
TEST_F(SiteSettingsHandlerTest, MAYBE_DefaultSettingSource) {
// Use a non-default port to verify the display name does not strip this
// off.
const std::string google("https://www.google.com:183");
const std::string expected_display_name("www.google.com:183");
ContentSettingSourceSetter source_setter(profile(),
ContentSettingsType::NOTIFICATIONS);
base::Value::List get_origin_permissions_args;
get_origin_permissions_args.Append(kCallbackId);
get_origin_permissions_args.Append(google);
base::Value::List category_list;
category_list.Append(kNotifications);
get_origin_permissions_args.Append(std::move(category_list));
// Test Chrome built-in defaults are marked as default.
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
ValidateOrigin(google, google, expected_display_name, CONTENT_SETTING_ASK,
site_settings::SiteSettingSource::kDefault, 1U);
base::Value::List default_value_args;
default_value_args.Append(kNotifications);
default_value_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
handler()->HandleSetDefaultValueForContentType(default_value_args);
// A user-set global default should also show up as default.
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
ValidateOrigin(google, google, expected_display_name, CONTENT_SETTING_BLOCK,
site_settings::SiteSettingSource::kDefault, 3U);
base::Value::List set_notification_pattern_args;
set_notification_pattern_args.Append("[*.]google.com");
set_notification_pattern_args.Append("");
set_notification_pattern_args.Append(kNotifications);
set_notification_pattern_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_ALLOW));
set_notification_pattern_args.Append(false);
handler()->HandleSetCategoryPermissionForPattern(
set_notification_pattern_args);
ASSERT_EQ(5U, web_ui()->call_data().size());
// When HandleSetCategoryPermissionForPattern is called for a notification
// permission, there are two callbacks that make call_data size increase
// by 2 instead of 1.
ValidateCallbacksForNotificationPermission(3);
// A user-set pattern should not show up as default.
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
ValidateOrigin(google, google, expected_display_name, CONTENT_SETTING_ALLOW,
site_settings::SiteSettingSource::kPreference, 6U);
base::Value::List set_notification_origin_args;
set_notification_origin_args.Append(google);
set_notification_origin_args.Append("");
set_notification_origin_args.Append(kNotifications);
set_notification_origin_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
set_notification_origin_args.Append(false);
handler()->HandleSetCategoryPermissionForPattern(
set_notification_origin_args);
ASSERT_EQ(8U, web_ui()->call_data().size());
// When HandleSetCategoryPermissionForPattern is called for a notification
// permission, there are two callbacks that make call_data size increase
// by 2 instead of 1.
ValidateCallbacksForNotificationPermission(6);
// A user-set per-origin permission should not show up as default.
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
ValidateOrigin(google, google, expected_display_name, CONTENT_SETTING_BLOCK,
site_settings::SiteSettingSource::kPreference, 9U);
// Enterprise-policy set defaults should not show up as default.
source_setter.SetPolicyDefault(CONTENT_SETTING_ALLOW);
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
ValidateOrigin(google, google, expected_display_name, CONTENT_SETTING_ALLOW,
site_settings::SiteSettingSource::kPolicy, 10U);
}
TEST_F(SiteSettingsHandlerTest, GetAndSetOriginPermissions) {
const std::string origin_with_port("https://www.example.com:443");
// The display name won't show the port if it's default for that scheme.
const std::string origin("www.example.com");
base::Value::List get_args;
get_args.Append(kCallbackId);
get_args.Append(origin_with_port);
{
base::Value::List category_list;
category_list.Append(kNotifications);
get_args.Append(std::move(category_list));
}
handler()->HandleGetOriginPermissions(get_args);
ValidateOrigin(origin_with_port, origin_with_port, origin,
CONTENT_SETTING_ASK,
site_settings::SiteSettingSource::kDefault, 1U);
// Block notifications.
base::Value::List set_args;
set_args.Append(origin_with_port);
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
handler()->HandleSetOriginPermissions(set_args);
EXPECT_EQ(2U, web_ui()->call_data().size());
// Reset things back to how they were.
base::Value::List reset_args;
reset_args.Append(origin_with_port);
reset_args.Append(std::move(kNotifications));
reset_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_DEFAULT));
handler()->HandleSetOriginPermissions(reset_args);
EXPECT_EQ(3U, web_ui()->call_data().size());
// Verify the reset was successful.
handler()->HandleGetOriginPermissions(get_args);
ValidateOrigin(origin_with_port, origin_with_port, origin,
CONTENT_SETTING_ASK,
site_settings::SiteSettingSource::kDefault, 4U);
}
TEST_F(SiteSettingsHandlerTest, GetAndSetForInvalidURLs) {
const std::string origin("arbitrary string");
EXPECT_FALSE(GURL(origin).is_valid());
base::Value::List get_args;
get_args.Append(kCallbackId);
get_args.Append(origin);
{
base::Value::List category_list;
category_list.Append(kNotifications);
get_args.Append(std::move(category_list));
}
handler()->HandleGetOriginPermissions(get_args);
// Verify that it'll return CONTENT_SETTING_BLOCK as |origin| is not a secure
// context, a requirement for notifications. Note that the display string
// will be blank since it's an invalid URL.
ValidateOrigin(origin, origin, "", CONTENT_SETTING_BLOCK,
site_settings::SiteSettingSource::kInsecureOrigin, 1U);
// Make sure setting a permission on an invalid origin doesn't crash.
base::Value::List set_args;
set_args.Append(origin);
{
base::Value::List category_list;
category_list.Append(kNotifications);
set_args.Append(std::move(category_list));
}
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_ALLOW));
handler()->HandleSetOriginPermissions(set_args);
// Also make sure the content setting for |origin| wasn't actually changed.
handler()->HandleGetOriginPermissions(get_args);
ValidateOrigin(origin, origin, "", CONTENT_SETTING_BLOCK,
site_settings::SiteSettingSource::kInsecureOrigin, 2U);
}
TEST_F(SiteSettingsHandlerTest, ExceptionHelpers) {
ContentSettingsPattern pattern =
ContentSettingsPattern::FromString("[*.]google.com");
base::Value::Dict exception = site_settings::GetExceptionForPage(
ContentSettingsType::NOTIFICATIONS, /*profile=*/nullptr, pattern,
ContentSettingsPattern::Wildcard(), pattern.ToString(),
CONTENT_SETTING_BLOCK,
site_settings::SiteSettingSourceToString(
site_settings::SiteSettingSource::kPreference),
false);
CHECK(exception.FindString(site_settings::kOrigin));
CHECK(exception.FindString(site_settings::kDisplayName));
CHECK(exception.FindString(site_settings::kEmbeddingOrigin));
CHECK(exception.FindString(site_settings::kSetting));
CHECK(exception.FindBool(site_settings::kIncognito).has_value());
base::Value::List args;
args.Append(*exception.FindString(site_settings::kOrigin));
args.Append(*exception.FindString(site_settings::kEmbeddingOrigin));
args.Append(kNotifications); // Chosen arbitrarily.
args.Append(*exception.FindString(site_settings::kSetting));
args.Append(*exception.FindBool(site_settings::kIncognito));
// We don't need to check the results. This is just to make sure it doesn't
// crash on the input.
handler()->HandleSetCategoryPermissionForPattern(args);
scoped_refptr<const extensions::Extension> extension;
extension = extensions::ExtensionBuilder()
.SetManifest(base::Value::Dict()
.Set("name", kExtensionName)
.Set("version", "1.0.0")
.Set("manifest_version", 2))
.SetID("ahfgeienlihckogmohjhadlkjgocpleb")
.Build();
base::Value::List exceptions;
site_settings::AddExceptionForHostedApp("[*.]google.com", *extension.get(),
&exceptions);
const base::Value& dictionary_value = exceptions[0];
CHECK(dictionary_value.is_dict());
const base::Value::Dict& dictionary = dictionary_value.GetDict();
CHECK(dictionary.FindString(site_settings::kOrigin));
CHECK(dictionary.FindString(site_settings::kDisplayName));
CHECK(dictionary.FindString(site_settings::kEmbeddingOrigin));
CHECK(dictionary.FindString(site_settings::kSetting));
CHECK(dictionary.FindBool(site_settings::kIncognito).has_value());
// Again, don't need to check the results.
handler()->HandleSetCategoryPermissionForPattern(args);
}
TEST_F(SiteSettingsHandlerTest, ExtensionDisplayName) {
// When the extension is loaded, displayName is the extension's name and id.
auto extension = LoadExtension(kExtensionName);
auto extension_url = extension->url().spec();
{
base::Value::List get_origin_permissions_args;
get_origin_permissions_args.Append(kCallbackId);
get_origin_permissions_args.Append(extension_url);
{
base::Value::List category_list;
category_list.Append(kNotifications);
get_origin_permissions_args.Append(std::move(category_list));
}
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
std::string expected_display_name =
base::StringPrintf("Test Extension (ID: %s)", extension->id().c_str());
ValidateOrigin(extension_url, extension_url, expected_display_name,
CONTENT_SETTING_ASK,
site_settings::SiteSettingSource::kDefault, 1U);
}
// When the extension is unloaded, the displayName is the extension's origin.
UnloadExtension(extension->id());
{
base::Value::List get_origin_permissions_args;
get_origin_permissions_args.Append(kCallbackId);
get_origin_permissions_args.Append(extension_url);
{
base::Value::List category_list;
category_list.Append(kNotifications);
get_origin_permissions_args.Append(std::move(category_list));
}
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
ValidateOrigin(
extension_url, extension_url,
base::StringPrintf("chrome-extension://%s", extension->id().c_str()),
CONTENT_SETTING_ASK, site_settings::SiteSettingSource::kDefault, 2U);
}
}
TEST_F(SiteSettingsHandlerTest, PatternsAndContentType) {
unsigned counter = 1;
for (const auto& test_case : kPatternsAndContentTypeTestCases) {
base::Value::List args;
args.Append(kCallbackId);
args.Append(test_case.arguments.pattern);
args.Append(test_case.arguments.content_type);
handler()->HandleIsPatternValidForType(args);
ValidatePattern(test_case.expected.validity, counter,
test_case.expected.reason);
++counter;
}
}
TEST_F(SiteSettingsHandlerTest, Incognito) {
base::Value::List args;
handler()->HandleUpdateIncognitoStatus(args);
ValidateIncognitoExists(false, 1U);
CreateIncognitoProfile();
ValidateIncognitoExists(true, 2U);
DestroyIncognitoProfile();
ValidateIncognitoExists(false, 3U);
}
TEST_F(SiteSettingsHandlerTest, ZoomLevels) {
std::string http_host("www.google.com");
std::string error_host("chromewebdata");
std::string data_url("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==");
double zoom_level = 1.1;
content::HostZoomMap* host_zoom_map =
content::HostZoomMap::GetDefaultForBrowserContext(profile());
host_zoom_map->SetZoomLevelForHost(http_host, zoom_level);
host_zoom_map->SetZoomLevelForHost(error_host, zoom_level);
host_zoom_map->SetZoomLevelForHost(data_url, zoom_level);
ValidateZoom({{error_host, "(Chrome error pages)", "122%"},
{data_url, data_url, "122%"},
{http_host, http_host, "122%"}},
3U);
base::Value::List args;
handler()->HandleFetchZoomLevels(args);
ValidateZoom({{error_host, "(Chrome error pages)", "122%"},
{data_url, data_url, "122%"},
{http_host, http_host, "122%"}},
4U);
args.Append(http_host);
handler()->HandleRemoveZoomLevel(args);
args.front() = base::Value(error_host);
handler()->HandleRemoveZoomLevel(args);
args.front() = base::Value(data_url);
handler()->HandleRemoveZoomLevel(args);
ValidateZoom({}, 7U);
double default_level = host_zoom_map->GetDefaultZoomLevel();
double level = host_zoom_map->GetZoomLevelForHostAndScheme("http", http_host);
EXPECT_EQ(default_level, level);
}
class SiteSettingsHandlerIsolatedWebAppTest : public SiteSettingsHandlerTest {
public:
void SetUp() override {
web_app::test::AwaitStartWebAppProviderAndSubsystems(profile());
InstallIsolatedWebApp(iwa_url(), "IWA Name");
SiteSettingsHandlerTest::SetUp();
}
protected:
GURL iwa_url() {
return GURL(
"isolated-app://"
"aerugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic");
}
web_app::AppId InstallIsolatedWebApp(const GURL& iwa_url,
const std::string& name) {
web_app::AppId app_id =
web_app::AddDummyIsolatedAppToRegistry(profile(), iwa_url, name);
RegisterWebApp(profile(), MakeApp(app_id, apps::AppType::kWeb,
iwa_url.spec(), apps::Readiness::kReady,
apps::InstallReason::kUser));
return app_id;
}
content::HostZoomMap* GetIwaHostZoomMap(const GURL& url) {
auto url_info = *web_app::IsolatedWebAppUrlInfo::Create(url);
content::StoragePartition* iwa_partition = profile()->GetStoragePartition(
url_info.storage_partition_config(profile()));
return content::HostZoomMap::GetForStoragePartition(iwa_partition);
}
};
TEST_F(SiteSettingsHandlerIsolatedWebAppTest, AllSitesDisplaysAppName) {
GURL https_url("https://" + iwa_url().host());
SetupModelsWithIsolatedWebAppData(iwa_url().spec(), 50);
HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(profile());
map->SetContentSettingDefaultScope(iwa_url(), iwa_url(),
ContentSettingsType::NOTIFICATIONS,
CONTENT_SETTING_BLOCK);
map->SetContentSettingDefaultScope(https_url, https_url,
ContentSettingsType::NOTIFICATIONS,
CONTENT_SETTING_BLOCK);
base::Value::List site_groups = GetOnStorageFetchedSentList();
ASSERT_EQ(site_groups.size(), 2u);
const base::Value::Dict& group1 = site_groups[0].GetDict();
const base::Value::Dict& origin1 =
CHECK_DEREF(group1.FindList("origins"))[0].GetDict();
EXPECT_THAT(CHECK_DEREF(group1.FindString("groupingKey")),
IsOrigin(iwa_url()));
EXPECT_EQ(group1.FindString("etldPlus1"), nullptr);
EXPECT_EQ(CHECK_DEREF(group1.FindString("displayName")), "IWA Name");
EXPECT_EQ(CHECK_DEREF(origin1.FindString("origin")), iwa_url());
EXPECT_EQ(origin1.FindDouble("usage").value(), 50.0);
const base::Value::Dict& group2 = site_groups[1].GetDict();
const base::Value::Dict& origin2 =
CHECK_DEREF(group2.FindList("origins"))[0].GetDict();
EXPECT_THAT(CHECK_DEREF(group2.FindString("groupingKey")),
IsEtldPlus1(iwa_url().host()));
EXPECT_EQ(CHECK_DEREF(group2.FindString("etldPlus1")), iwa_url().host());
EXPECT_EQ(CHECK_DEREF(group2.FindString("displayName")), iwa_url().host());
EXPECT_EQ(CHECK_DEREF(origin2.FindString("origin")), https_url);
EXPECT_EQ(origin2.FindDouble("usage").value(), 0.0);
}
TEST_F(SiteSettingsHandlerIsolatedWebAppTest, ZoomLevel) {
content::HostZoomMap* iwa_host_zoom_map = GetIwaHostZoomMap(iwa_url());
std::string host_or_spec = url::Origin::Create(iwa_url()).Serialize();
iwa_host_zoom_map->SetZoomLevelForHost(iwa_url().host(), 1.1);
ValidateZoom({{host_or_spec, "IWA Name", "122%"}}, 1U);
base::Value::List args;
handler()->HandleFetchZoomLevels(args);
ValidateZoom({{host_or_spec, "IWA Name", "122%"}}, 2U);
args.Append(host_or_spec);
handler()->HandleRemoveZoomLevel(args);
ValidateZoom({}, 3U);
double default_level = iwa_host_zoom_map->GetDefaultZoomLevel();
double level = iwa_host_zoom_map->GetZoomLevelForHostAndScheme(
"isolated-app", iwa_url().host());
EXPECT_EQ(default_level, level);
}
TEST_F(SiteSettingsHandlerIsolatedWebAppTest, ZoomLevelsSortedByAppName) {
GetIwaHostZoomMap(iwa_url())->SetZoomLevelForHost(iwa_url().host(), 1.1);
// Install 3 more IWAs.
GURL iwa3_url(
"isolated-app://"
"cerugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic");
InstallIsolatedWebApp(iwa3_url, "IWA Name 3");
GetIwaHostZoomMap(iwa3_url)->SetZoomLevelForHost(iwa3_url.host(), 1.1);
GURL iwa2_url(
"isolated-app://"
"berugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic");
InstallIsolatedWebApp(iwa2_url, "IWA Name 2");
GetIwaHostZoomMap(iwa2_url)->SetZoomLevelForHost(iwa2_url.host(), 1.1);
// Don't set a zoom for this app to make sure it's not in the list.
GURL iwa4_url(
"isolated-app://"
"derugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic");
InstallIsolatedWebApp(iwa4_url, "IWA Name 4");
base::Value::List args;
handler()->HandleFetchZoomLevels(args);
ValidateZoom(
{{url::Origin::Create(iwa_url()).Serialize(), "IWA Name", "122%"},
{url::Origin::Create(iwa2_url).Serialize(), "IWA Name 2", "122%"},
{url::Origin::Create(iwa3_url).Serialize(), "IWA Name 3", "122%"}},
2U);
}
class SiteSettingsHandlerInfobarTest : public BrowserWithTestWindowTest {
public:
SiteSettingsHandlerInfobarTest()
: kNotifications(site_settings::ContentSettingsTypeToGroupName(
ContentSettingsType::NOTIFICATIONS)) {}
SiteSettingsHandlerInfobarTest(const SiteSettingsHandlerInfobarTest&) =
delete;
SiteSettingsHandlerInfobarTest& operator=(
const SiteSettingsHandlerInfobarTest&) = delete;
void SetUp() override {
BrowserWithTestWindowTest::SetUp();
#if BUILDFLAG(IS_CHROMEOS_ASH)
SetUpUserManager(profile());
#endif
handler_ = std::make_unique<SiteSettingsHandler>(profile());
handler()->set_web_ui(web_ui());
handler()->AllowJavascript();
web_ui()->ClearTrackedCalls();
window2_ = CreateBrowserWindow();
browser2_ =
CreateBrowser(profile(), browser()->type(), false, window2_.get());
window3_ = CreateBrowserWindow();
TestingProfile* profile2_ = CreateProfile2();
browser3_ =
CreateBrowser(profile2_, browser()->type(), false, window3_.get());
extensions::TestExtensionSystem* extension_system =
static_cast<extensions::TestExtensionSystem*>(
extensions::ExtensionSystem::Get(profile()));
extension_system->CreateExtensionService(
base::CommandLine::ForCurrentProcess(), base::FilePath(), false);
}
void TearDown() override {
// SiteSettingsHandler maintains a HostZoomMap::Subscription internally, so
// make sure that's cleared before BrowserContext / profile destruction.
handler()->DisallowJavascript();
// Also destroy `browser2_` before the profile.
browser2()->tab_strip_model()->CloseAllTabs();
browser2_.reset();
// Destroy `browser3_`.
browser3()->tab_strip_model()->CloseAllTabs();
browser3_.reset();
// Browser()'s destruction is handled in
// BrowserWithTestWindowTest::TearDown()
BrowserWithTestWindowTest::TearDown();
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
void SetUpUserManager(TestingProfile* profile) {
// On ChromeOS a user account is needed in order to check whether the user
// account is affiliated with the device owner for the purposes of applying
// enterprise policy.
constexpr char kTestUserGaiaId[] = "1111111111";
auto fake_user_manager = std::make_unique<ash::FakeChromeUserManager>();
auto* fake_user_manager_ptr = fake_user_manager.get();
scoped_user_manager_ = std::make_unique<user_manager::ScopedUserManager>(
std::move(fake_user_manager));
auto account_id =
AccountId::FromUserEmailGaiaId(kTestUserEmail, kTestUserGaiaId);
fake_user_manager_ptr->AddUserWithAffiliation(account_id,
/*is_affiliated=*/true);
fake_user_manager_ptr->LoginUser(account_id);
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
infobars::ContentInfoBarManager* GetInfoBarManagerForTab(Browser* browser,
int tab_index,
GURL* tab_url) {
content::WebContents* web_contents =
browser->tab_strip_model()->GetWebContentsAt(tab_index);
if (tab_url)
*tab_url = web_contents->GetLastCommittedURL();
return infobars::ContentInfoBarManager::FromWebContents(web_contents);
}
content::TestWebUI* web_ui() { return &web_ui_; }
SiteSettingsHandler* handler() { return handler_.get(); }
Browser* browser2() { return browser2_.get(); }
// browser3 is from a different profile `profile2_` than
// browser2 and browser() which are from profile()
Browser* browser3() { return browser3_.get(); }
// Creates the second profile used by this test. The caller doesn't own the
// return value.
TestingProfile* CreateProfile2() {
return profile_manager()->CreateTestingProfile("testing_profile2@test",
nullptr, std::u16string(), 0,
GetTestingFactories());
}
const std::string kNotifications;
private:
content::TestWebUI web_ui_;
std::unique_ptr<SiteSettingsHandler> handler_;
std::unique_ptr<BrowserWindow> window2_;
std::unique_ptr<Browser> browser2_;
std::unique_ptr<BrowserWindow> window3_;
std::unique_ptr<Browser> browser3_;
#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_;
#endif
};
TEST_F(SiteSettingsHandlerInfobarTest, SettingPermissionsTriggersInfobar) {
// Note all GURLs starting with 'origin' below belong to the same origin.
// _____ _______________ ________ ________ ___________
// Window 1: / foo \' origin_anchor \' chrome \' origin \' extension \
// ------------- -----------------------------------------------------
std::string origin_anchor_string =
"https://www.example.com/with/path/blah#heading";
const GURL foo("http://foo");
const GURL origin_anchor(origin_anchor_string);
const GURL chrome("chrome://about");
const GURL origin("https://www.example.com/");
const GURL extension(
"chrome-extension://fooooooooooooooooooooooooooooooo/bar.html");
// Make sure |extension|'s extension ID exists before navigating to it. This
// fixes a test timeout that occurs with --enable-browser-side-navigation on.
scoped_refptr<const extensions::Extension> test_extension =
extensions::ExtensionBuilder("Test")
.SetID("fooooooooooooooooooooooooooooooo")
.Build();
extensions::ExtensionSystem::Get(profile())
->extension_service()
->AddExtension(test_extension.get());
// __________ ______________ ___________________ _______
// Window 2: / insecure '/ origin_query \' example_subdomain \' about \
// ------------------------- --------------------------------
const GURL insecure("http://www.example.com/");
const GURL origin_query("https://www.example.com/?param=value");
const GURL example_subdomain("https://subdomain.example.com/");
const GURL about(url::kAboutBlankURL);
// Set up. Note AddTab() adds tab at index 0, so add them in reverse order.
AddTab(browser(), extension);
AddTab(browser(), origin);
AddTab(browser(), chrome);
AddTab(browser(), origin_anchor);
AddTab(browser(), foo);
for (int i = 0; i < browser()->tab_strip_model()->count(); ++i) {
EXPECT_EQ(0u,
GetInfoBarManagerForTab(browser(), i, nullptr)->infobar_count());
}
AddTab(browser2(), about);
AddTab(browser2(), example_subdomain);
AddTab(browser2(), origin_query);
AddTab(browser2(), insecure);
for (int i = 0; i < browser2()->tab_strip_model()->count(); ++i) {
EXPECT_EQ(0u,
GetInfoBarManagerForTab(browser2(), i, nullptr)->infobar_count());
}
// Block notifications.
base::Value::List set_args;
set_args.Append(origin_anchor_string);
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
handler()->HandleSetOriginPermissions(set_args);
// Make sure all tabs belonging to the same origin as |origin_anchor| have an
// infobar shown.
GURL tab_url;
for (int i = 0; i < browser()->tab_strip_model()->count(); ++i) {
if (i == /*origin_anchor=*/1 || i == /*origin=*/3) {
EXPECT_EQ(
1u, GetInfoBarManagerForTab(browser(), i, &tab_url)->infobar_count());
EXPECT_TRUE(url::IsSameOriginWith(origin, tab_url));
} else {
EXPECT_EQ(
0u, GetInfoBarManagerForTab(browser(), i, &tab_url)->infobar_count());
EXPECT_FALSE(url::IsSameOriginWith(origin, tab_url));
}
}
for (int i = 0; i < browser2()->tab_strip_model()->count(); ++i) {
if (i == /*origin_query=*/1) {
EXPECT_EQ(
1u,
GetInfoBarManagerForTab(browser2(), i, &tab_url)->infobar_count());
EXPECT_TRUE(url::IsSameOriginWith(origin, tab_url));
} else {
EXPECT_EQ(
0u,
GetInfoBarManagerForTab(browser2(), i, &tab_url)->infobar_count());
EXPECT_FALSE(url::IsSameOriginWith(origin, tab_url));
}
}
// Navigate the |foo| tab to the same origin as |origin_anchor|, and the
// |origin_query| tab to a different origin.
const GURL origin_path("https://www.example.com/path/to/page.html");
content::WebContents* foo_contents =
browser()->tab_strip_model()->GetWebContentsAt(/*index=*/0);
NavigateAndCommit(foo_contents, origin_path);
const GURL example_without_www("https://example.com/");
content::WebContents* origin_query_contents =
browser2()->tab_strip_model()->GetWebContentsAt(/*index=*/1);
NavigateAndCommit(origin_query_contents, example_without_www);
// Reset all permissions.
base::Value::List reset_args;
reset_args.Append(origin_anchor_string);
base::Value::List category_list;
category_list.Append(kNotifications);
reset_args.Append(std::move(category_list));
reset_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_DEFAULT));
handler()->HandleSetOriginPermissions(reset_args);
// Check the same tabs (plus the tab navigated to |origin_path|) still have
// infobars showing.
for (int i = 0; i < browser()->tab_strip_model()->count(); ++i) {
if (i == /*origin_path=*/0 || i == /*origin_anchor=*/1 ||
i == /*origin=*/3) {
EXPECT_EQ(
1u, GetInfoBarManagerForTab(browser(), i, &tab_url)->infobar_count());
EXPECT_TRUE(url::IsSameOriginWith(origin, tab_url));
} else {
EXPECT_EQ(
0u, GetInfoBarManagerForTab(browser(), i, &tab_url)->infobar_count());
EXPECT_FALSE(url::IsSameOriginWith(origin, tab_url));
}
}
// The infobar on the original |origin_query| tab (which has now been
// navigated to |example_without_www|) should disappear.
for (int i = 0; i < browser2()->tab_strip_model()->count(); ++i) {
EXPECT_EQ(
0u, GetInfoBarManagerForTab(browser2(), i, &tab_url)->infobar_count());
EXPECT_FALSE(url::IsSameOriginWith(origin, tab_url));
}
// Make sure it's the correct infobar that's being shown.
EXPECT_EQ(infobars::InfoBarDelegate::PAGE_INFO_INFOBAR_DELEGATE,
GetInfoBarManagerForTab(browser(), /*tab_index=*/0, &tab_url)
->infobar_at(0)
->delegate()
->GetIdentifier());
EXPECT_TRUE(url::IsSameOriginWith(origin, tab_url));
}
TEST_F(SiteSettingsHandlerInfobarTest,
SettingPermissionsDoesNotTriggerInfobarOnDifferentProfile) {
// Note all GURLs starting with 'origin' below belong to the same origin.
// _______________
// Window 1: / origin_anchor \
// ------------- -----------------------------------------------------
const GURL origin("https://www.example.com/");
std::string origin_anchor_string =
"https://www.example.com/with/path/blah#heading";
const GURL origin_anchor(origin_anchor_string);
// Different
// Profile (2) ______________
// Window 3: / origin_query \
// -------------------------------------------------------------------------
const GURL origin_query("https://www.example.com/?param=value");
// Set up. No info bars.
AddTab(browser(), origin_anchor);
EXPECT_EQ(0u,
GetInfoBarManagerForTab(browser(), 0, nullptr)->infobar_count());
AddTab(browser3(), origin_query);
EXPECT_EQ(0u,
GetInfoBarManagerForTab(browser3(), 0, nullptr)->infobar_count());
// Block notifications.
base::Value::List set_args;
set_args.Append(origin_anchor_string);
set_args.Append(kNotifications);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK));
handler()->HandleSetOriginPermissions(set_args);
// Make sure all tabs within the same profile belonging to the same origin
// as `origin_anchor` have an infobar shown.
GURL tab_url;
EXPECT_EQ(1u,
GetInfoBarManagerForTab(browser(), 0, &tab_url)->infobar_count());
EXPECT_TRUE(url::IsSameOriginWith(origin, tab_url));
// Make sure all tabs with the same origin as `origin_anchor` that don't
// belong to the same profile don't have an infobar shown
EXPECT_EQ(0u,
GetInfoBarManagerForTab(browser3(), 0, &tab_url)->infobar_count());
EXPECT_TRUE(url::IsSameOriginWith(origin, tab_url));
}
TEST_F(SiteSettingsHandlerTest, SessionOnlyException) {
const std::string google_with_port("https://www.google.com:443");
base::Value::List set_args;
set_args.Append(google_with_port); // Primary pattern.
set_args.Append(std::string()); // Secondary pattern.
set_args.Append(kCookies);
set_args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_SESSION_ONLY));
set_args.Append(false); // Incognito.
handler()->HandleSetCategoryPermissionForPattern(set_args);
EXPECT_EQ(kNumberContentSettingListeners, web_ui()->call_data().size());
}
TEST_F(SiteSettingsHandlerTest, BlockAutoplay_SendOnRequest) {
base::Value::List args;
handler()->HandleFetchBlockAutoplayStatus(args);
// Check that we are checked and enabled.
ValidateBlockAutoplay(true, true);
}
TEST_F(SiteSettingsHandlerTest, BlockAutoplay_SoundSettingUpdate) {
SetSoundContentSettingDefault(CONTENT_SETTING_BLOCK);
base::RunLoop().RunUntilIdle();
// Check that we are not checked or enabled.
ValidateBlockAutoplay(false, false);
SetSoundContentSettingDefault(CONTENT_SETTING_ALLOW);
base::RunLoop().RunUntilIdle();
// Check that we are checked and enabled.
ValidateBlockAutoplay(true, true);
}
TEST_F(SiteSettingsHandlerTest, BlockAutoplay_PrefUpdate) {
profile()->GetPrefs()->SetBoolean(prefs::kBlockAutoplayEnabled, false);
base::RunLoop().RunUntilIdle();
// Check that we are not checked but are enabled.
ValidateBlockAutoplay(false, true);
profile()->GetPrefs()->SetBoolean(prefs::kBlockAutoplayEnabled, true);
base::RunLoop().RunUntilIdle();
// Check that we are checked and enabled.
ValidateBlockAutoplay(true, true);
}
TEST_F(SiteSettingsHandlerTest, BlockAutoplay_Update) {
EXPECT_TRUE(profile()->GetPrefs()->GetBoolean(prefs::kBlockAutoplayEnabled));
base::Value::List data;
data.Append(false);
handler()->HandleSetBlockAutoplayEnabled(data);
EXPECT_FALSE(profile()->GetPrefs()->GetBoolean(prefs::kBlockAutoplayEnabled));
}
TEST_F(SiteSettingsHandlerTest, ExcludeWebUISchemesInLists) {
const ContentSettingsType content_settings_type =
ContentSettingsType::NOTIFICATIONS;
// Register WebUIAllowlist auto-granted permissions.
const url::Origin kWebUIOrigins[] = {
url::Origin::Create(GURL("chrome://test")),
url::Origin::Create(GURL("chrome-untrusted://test")),
url::Origin::Create(GURL("devtools://devtools")),
};
WebUIAllowlist* allowlist = WebUIAllowlist::GetOrCreate(profile());
for (const url::Origin& origin : kWebUIOrigins)
allowlist->RegisterAutoGrantedPermission(origin, content_settings_type);
// Verify the auto-granted permissions are registered, and they are indeed
// provided by WebUIAllowlist.
HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(profile());
content_settings::SettingInfo info;
base::Value value = map->GetWebsiteSetting(kWebUIOrigins[0].GetURL(),
kWebUIOrigins[0].GetURL(),
content_settings_type, &info);
EXPECT_EQ(CONTENT_SETTING_ALLOW, value.GetInt());
EXPECT_EQ(content_settings::SETTING_SOURCE_ALLOWLIST, info.source);
// Register an ordinary website permission.
const GURL kWebUrl = GURL("https://example.com");
map->SetContentSettingDefaultScope(kWebUrl, kWebUrl, content_settings_type,
CONTENT_SETTING_ALLOW);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
map->GetContentSetting(kWebUrl, kWebUrl, content_settings_type));
// GetAllSites() only returns website exceptions.
{
base::Value::List get_all_sites_args;
get_all_sites_args.Append(kCallbackId);
handler()->HandleGetAllSites(get_all_sites_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
const base::Value::List& site_groups = data.arg3()->GetList();
EXPECT_EQ(1UL, site_groups.size());
const base::Value::Dict& first_site_group = site_groups[0].GetDict();
EXPECT_THAT(CHECK_DEREF(first_site_group.FindString("groupingKey")),
IsEtldPlus1("example.com"));
const base::Value::List& origin_list =
CHECK_DEREF(first_site_group.FindList("origins"));
EXPECT_EQ(1UL, origin_list.size());
EXPECT_EQ(kWebUrl.spec(),
CHECK_DEREF(origin_list[0].GetDict().FindString("origin")));
}
// GetExceptionList() only returns website exceptions.
{
base::Value::List get_exception_list_args;
get_exception_list_args.Append(kCallbackId);
get_exception_list_args.Append(kNotifications);
handler()->HandleGetExceptionList(get_exception_list_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
const base::Value::List& exception_list = data.arg3()->GetList();
EXPECT_EQ(1UL, exception_list.size());
EXPECT_EQ("https://example.com:443",
CHECK_DEREF(exception_list[0].GetDict().FindString("origin")));
}
// GetRecentSitePermissions() only returns website exceptions.
{
base::Value::List get_recent_permissions_args;
get_recent_permissions_args.Append(kCallbackId);
get_recent_permissions_args.Append(3);
handler()->HandleGetRecentSitePermissions(get_recent_permissions_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
const base::Value::List& recent_permission_list = data.arg3()->GetList();
EXPECT_EQ(1UL, recent_permission_list.size());
EXPECT_EQ(
kWebUrl.spec(),
CHECK_DEREF(recent_permission_list[0].GetDict().FindString("origin")));
}
}
// GetOriginPermissions() returns the allowlisted exception. We explicitly
// return this, so developers can easily test things (e.g. by navigating to
// chrome://settings/content/siteDetails?site=chrome://example).
TEST_F(SiteSettingsHandlerTest, IncludeWebUISchemesInGetOriginPermissions) {
const ContentSettingsType content_settings_type =
ContentSettingsType::NOTIFICATIONS;
// Register WebUIAllowlist auto-granted permissions.
const url::Origin kWebUIOrigins[] = {
url::Origin::Create(GURL("chrome://test")),
url::Origin::Create(GURL("chrome-untrusted://test")),
url::Origin::Create(GURL("devtools://devtools")),
};
WebUIAllowlist* allowlist = WebUIAllowlist::GetOrCreate(profile());
for (const url::Origin& origin : kWebUIOrigins)
allowlist->RegisterAutoGrantedPermission(origin, content_settings_type);
for (const url::Origin& origin : kWebUIOrigins) {
base::Value::List get_origin_permissions_args;
get_origin_permissions_args.Append(kCallbackId);
get_origin_permissions_args.Append(origin.GetURL().spec());
base::Value::List category_list;
category_list.Append(kNotifications);
get_origin_permissions_args.Append(std::move(category_list));
handler()->HandleGetOriginPermissions(get_origin_permissions_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
const base::Value::List& exception_list = data.arg3()->GetList();
EXPECT_EQ(1UL, exception_list.size());
const base::Value::Dict& first_exception = exception_list[0].GetDict();
EXPECT_EQ(origin.GetURL().spec(),
CHECK_DEREF(first_exception.FindString("origin")));
EXPECT_EQ("allowlist", CHECK_DEREF(first_exception.FindString("source")));
}
}
class PersistentPermissionsSiteSettingsHandlerTest
: public SiteSettingsHandlerTest {
void SetUp() override {
SiteSettingsHandlerTest::SetUp();
handler_ = std::make_unique<SiteSettingsHandler>(&profile_);
handler_->set_web_ui(web_ui());
handler_->AllowJavascript();
web_ui()->ClearTrackedCalls();
}
void TearDown() override { handler_->DisallowJavascript(); }
public:
PersistentPermissionsSiteSettingsHandlerTest() {
// TODO(crbug.com/1373962): Remove this feature list enabler
// when Persistent Permissions is launched.
// Enable Persisted Permissions.
feature_list_.InitAndEnableFeature(
features::kFileSystemAccessPersistentPermissions);
}
protected:
std::unique_ptr<SiteSettingsHandler> handler_;
TestingProfile profile_;
private:
base::test::ScopedFeatureList feature_list_;
};
// GetFileSystemGrants() returns the allowed grants for a given origin
// based on the File System Access persistent permissions policy.
TEST_F(PersistentPermissionsSiteSettingsHandlerTest,
HandleGetFileSystemGrants) {
ChromeFileSystemAccessPermissionContext* context =
FileSystemAccessPermissionContextFactory::GetForProfile(&profile_);
auto kTestOrigin1 = url::Origin::Create(GURL("https://www.a.com"));
auto kTestOrigin2 = url::Origin::Create(GURL("https://www.b.com"));
const base::FilePath kTestPath = base::FilePath(FILE_PATH_LITERAL("/a/b"));
const base::FilePath kTestPath2 = base::FilePath(FILE_PATH_LITERAL("/c/d"));
const base::FilePath kTestPath3 = base::FilePath(FILE_PATH_LITERAL("/e/"));
const base::FilePath kTestPath4 =
base::FilePath(FILE_PATH_LITERAL("/f/g/h/"));
// Populate the `grants` object with permissions.
auto file_read_grant = context->GetPersistedReadPermissionGrantForTesting(
kTestOrigin1, kTestPath,
ChromeFileSystemAccessPermissionContext::HandleType::kFile);
auto file_write_grant = context->GetPersistedWritePermissionGrantForTesting(
kTestOrigin2, kTestPath2,
ChromeFileSystemAccessPermissionContext::HandleType::kFile);
auto directory_read_grant =
context->GetPersistedReadPermissionGrantForTesting(
kTestOrigin1, kTestPath3,
ChromeFileSystemAccessPermissionContext::HandleType::kDirectory);
auto directory_write_grant =
context->GetPersistedWritePermissionGrantForTesting(
kTestOrigin2, kTestPath4,
ChromeFileSystemAccessPermissionContext::HandleType::kDirectory);
EXPECT_EQ(context->GetPermissionGrants(kTestOrigin1).file_read_grants.size(),
1UL);
EXPECT_EQ(context->GetPermissionGrants(kTestOrigin2).file_read_grants.size(),
0UL);
EXPECT_EQ(context->GetPermissionGrants(kTestOrigin1).file_write_grants.size(),
0UL);
EXPECT_EQ(context->GetPermissionGrants(kTestOrigin2).file_write_grants.size(),
1UL);
EXPECT_EQ(
context->GetPermissionGrants(kTestOrigin1).directory_read_grants.size(),
1UL);
EXPECT_EQ(
context->GetPermissionGrants(kTestOrigin2).directory_read_grants.size(),
0UL);
EXPECT_EQ(
context->GetPermissionGrants(kTestOrigin1).directory_write_grants.size(),
0UL);
EXPECT_EQ(
context->GetPermissionGrants(kTestOrigin2).directory_write_grants.size(),
1UL);
base::Value::List get_file_system_permissions_args;
get_file_system_permissions_args.Append(kCallbackId);
handler_->HandleGetFileSystemGrants(get_file_system_permissions_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
const base::Value::List& grants = data.arg3()->GetList();
EXPECT_EQ(grants.size(), 2UL);
const base::Value::Dict& first_grant = grants[0].GetDict();
const base::Value::Dict& second_grant = grants[1].GetDict();
EXPECT_EQ(CHECK_DEREF(first_grant.FindString(site_settings::kOrigin)),
"https://www.a.com/");
EXPECT_EQ(CHECK_DEREF(second_grant.FindString(site_settings::kOrigin)),
"https://www.b.com/");
const base::Value::List* kTestOrigin1FileReadGrants =
first_grant.FindList(site_settings::kFileReadGrants);
const base::Value::List* kTestOrigin1FileWriteGrants =
first_grant.FindList(site_settings::kFileWriteGrants);
const base::Value::List* kTestOrigin1DirectoryReadGrants =
first_grant.FindList(site_settings::kDirectoryReadGrants);
const base::Value::List* kTestOrigin1DirectoryWriteGrants =
first_grant.FindList(site_settings::kDirectoryWriteGrants);
const base::Value::List* kTestOrigin2FileReadGrants =
second_grant.FindList(site_settings::kFileReadGrants);
const base::Value::List* kTestOrigin2FileWriteGrants =
second_grant.FindList(site_settings::kFileWriteGrants);
const base::Value::List* kTestOrigin2DirectoryReadGrants =
second_grant.FindList(site_settings::kDirectoryReadGrants);
const base::Value::List* kTestOrigin2DirectoryWriteGrants =
second_grant.FindList(site_settings::kDirectoryWriteGrants);
// Checks that the grants for test origins are populated as expected.
EXPECT_FALSE(CHECK_DEREF(kTestOrigin1FileReadGrants)[0]
.GetDict()
.FindBool(site_settings::kIsDirectory)
.value_or(true));
ASSERT_TRUE(kTestOrigin1FileWriteGrants != nullptr);
EXPECT_TRUE(kTestOrigin1FileWriteGrants->empty());
EXPECT_EQ(
CHECK_DEREF(
CHECK_DEREF(kTestOrigin1DirectoryReadGrants)[0].GetDict().FindString(
site_settings::kFilePath)),
"/e/");
ASSERT_TRUE(kTestOrigin1DirectoryWriteGrants != nullptr);
EXPECT_TRUE(kTestOrigin1DirectoryWriteGrants->empty());
// In the case of kTestOrigin2, check that when an origin has an
// associated 'write' grant, that the grant is only recorded in the
// respective write grants list, and is not recorded in the origin's
// read grants list.
ASSERT_TRUE(kTestOrigin2FileReadGrants != nullptr);
EXPECT_TRUE(kTestOrigin2FileReadGrants->empty());
EXPECT_TRUE(CHECK_DEREF(kTestOrigin2FileWriteGrants)[0]
.GetDict()
.FindBool(site_settings::kIsWritable)
.value_or(false));
ASSERT_TRUE(kTestOrigin2DirectoryReadGrants != nullptr);
EXPECT_TRUE(kTestOrigin2DirectoryReadGrants->empty());
EXPECT_TRUE(CHECK_DEREF(kTestOrigin2DirectoryWriteGrants)[0]
.GetDict()
.FindBool(site_settings::kIsDirectory)
.value_or(false));
}
// RevokeGrant() revokes a single File System Access permission grant,
// for a given origin and file path.
TEST_F(PersistentPermissionsSiteSettingsHandlerTest,
HandleRevokeFileSystemGrant) {
ChromeFileSystemAccessPermissionContext* context =
FileSystemAccessPermissionContextFactory::GetForProfile(&profile_);
auto kTestOrigin1 = url::Origin::Create(GURL("https://www.a.com"));
auto kTestOrigin2 = url::Origin::Create(GURL("https://www.b.com"));
const base::FilePath kTestPath = base::FilePath(FILE_PATH_LITERAL("/a/b"));
const base::FilePath kTestPath2 = base::FilePath(FILE_PATH_LITERAL("/c/d/"));
const base::FilePath kTestPath3 = base::FilePath(FILE_PATH_LITERAL("/e/"));
const base::FilePath kTestPath4 =
base::FilePath(FILE_PATH_LITERAL("/f/g/h/"));
// Populate the `grants` object with permissions.
auto file_read_grant = context->GetPersistedReadPermissionGrantForTesting(
kTestOrigin1, kTestPath,
ChromeFileSystemAccessPermissionContext::HandleType::kFile);
auto directory_read_grant =
context->GetPersistedReadPermissionGrantForTesting(
kTestOrigin1, kTestPath2,
ChromeFileSystemAccessPermissionContext::HandleType::kDirectory);
auto directory_write_grant =
context->GetPersistedWritePermissionGrantForTesting(
kTestOrigin2, kTestPath3,
ChromeFileSystemAccessPermissionContext::HandleType::kDirectory);
auto second_directory_write_grant =
context->GetPersistedWritePermissionGrantForTesting(
kTestOrigin2, kTestPath4,
ChromeFileSystemAccessPermissionContext::HandleType::kDirectory);
base::Value::List revoke_origin1_grant_permissions_args;
revoke_origin1_grant_permissions_args.Append("https://www.a.com");
revoke_origin1_grant_permissions_args.Append("/a/b");
base::Value::List get_file_system_grants_permissions_args;
get_file_system_grants_permissions_args.Append(kCallbackId);
handler_->HandleRevokeFileSystemGrant(revoke_origin1_grant_permissions_args);
handler_->HandleGetFileSystemGrants(get_file_system_grants_permissions_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
const base::Value::List& grants = data.arg3()->GetList();
// After revoking the `file_read_grant` for kTestOrigin1, only one
// `directory_read_grant` should remain when retrieving the file system grants
// for kTestOrigin1.
EXPECT_TRUE(
grants[0].GetDict().FindList(site_settings::kFileReadGrants)->empty());
EXPECT_EQ(
grants[0].GetDict().FindList(site_settings::kDirectoryReadGrants)->size(),
1UL);
// Revoking a single grant from an origin with multiple grants in a given
// grants list only revokes the grant with the given file path.
// In this case, for kTestOrigin2, only the directory write grant for
// kTestPath2 is revoked, and the directory write grant with kTestPath4
// remains in the `directory_write_grants` list.
base::Value::List revoke_origin2_grant_permissions_args;
revoke_origin2_grant_permissions_args.Append("https://www.b.com");
revoke_origin2_grant_permissions_args.Append("/e/");
handler_->HandleRevokeFileSystemGrant(revoke_origin2_grant_permissions_args);
handler_->HandleGetFileSystemGrants(get_file_system_grants_permissions_args);
const content::TestWebUI::CallData& updated_data =
*web_ui()->call_data().back();
const base::Value::List& updated_grants = updated_data.arg3()->GetList();
EXPECT_EQ(updated_grants[1]
.GetDict()
.FindList(site_settings::kDirectoryWriteGrants)
->size(),
1UL);
EXPECT_EQ(CHECK_DEREF(CHECK_DEREF(updated_grants[1].GetDict().FindList(
site_settings::kDirectoryWriteGrants))[0]
.GetDict()
.FindString(site_settings::kFilePath)),
"/f/g/h/");
}
// RevokeGrants() revokes all File System Access permission grants,
// for a given origin.
TEST_F(PersistentPermissionsSiteSettingsHandlerTest,
HandleRevokeFileSystemGrants) {
ChromeFileSystemAccessPermissionContext* context =
FileSystemAccessPermissionContextFactory::GetForProfile(&profile_);
auto kTestOrigin1 = url::Origin::Create(GURL("https://www.a.com"));
auto kTestOrigin2 = url::Origin::Create(GURL("https://www.b.com"));
const base::FilePath kTestPath = base::FilePath(FILE_PATH_LITERAL("/a/b"));
const base::FilePath kTestPath2 = base::FilePath(FILE_PATH_LITERAL("/c/d"));
const base::FilePath kTestPath3 = base::FilePath(FILE_PATH_LITERAL("/e/"));
const base::FilePath kTestPath4 =
base::FilePath(FILE_PATH_LITERAL("/f/g/h/"));
// Populate the `grants` object with permissions.
auto file_read_grant = context->GetPersistedReadPermissionGrantForTesting(
kTestOrigin1, kTestPath,
ChromeFileSystemAccessPermissionContext::HandleType::kFile);
auto file_write_grant = context->GetPersistedWritePermissionGrantForTesting(
kTestOrigin2, kTestPath2,
ChromeFileSystemAccessPermissionContext::HandleType::kFile);
auto directory_read_grant =
context->GetPersistedReadPermissionGrantForTesting(
kTestOrigin1, kTestPath3,
ChromeFileSystemAccessPermissionContext::HandleType::kDirectory);
auto directory_write_grant =
context->GetPersistedWritePermissionGrantForTesting(
kTestOrigin2, kTestPath4,
ChromeFileSystemAccessPermissionContext::HandleType::kDirectory);
base::Value::List get_file_system_grants_permissions_args;
get_file_system_grants_permissions_args.Append(kCallbackId);
handler_->HandleGetFileSystemGrants(get_file_system_grants_permissions_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
const base::Value::List& grants = data.arg3()->GetList();
// The number of entries in grants is equal to the number of origins with
// permission grants, before revoking grants for a given origin.
EXPECT_EQ(grants.size(), 2UL);
base::Value::List revoke_origin1_grants_permissions_args;
revoke_origin1_grants_permissions_args.Append("https://www.a.com");
handler_->HandleRevokeFileSystemGrants(
revoke_origin1_grants_permissions_args);
handler_->HandleGetFileSystemGrants(get_file_system_grants_permissions_args);
const content::TestWebUI::CallData& updated_data =
*web_ui()->call_data().back();
const base::Value::List& updated_grants = updated_data.arg3()->GetList();
// All grants are revoked for kTestOrigin1, and the grants for kTestOrigin2
// are unaffected.
EXPECT_EQ(updated_grants.size(), 1UL);
EXPECT_EQ(updated_grants[0]
.GetDict()
.FindList(site_settings::kFileWriteGrants)
->size(),
1UL);
EXPECT_EQ(updated_grants[0]
.GetDict()
.FindList(site_settings::kDirectoryWriteGrants)
->size(),
1UL);
}
namespace {
std::vector<std::string> GetExceptionDisplayNames(
const base::Value::List& exceptions) {
std::vector<std::string> display_names;
for (const base::Value& exception : exceptions) {
const std::string* display_name =
exception.GetDict().FindString(site_settings::kDisplayName);
if (display_name) {
display_names.push_back(*display_name);
}
}
return display_names;
}
} // namespace
class SiteSettingsHandlerChooserExceptionTest
: public SiteSettingsHandlerBaseTest {
protected:
const GURL kAndroidUrl{"https://android.com"};
const GURL kChromiumUrl{"https://chromium.org"};
const GURL kGoogleUrl{"https://google.com"};
const GURL kWebUIUrl{"chrome://test"};
void SetUp() override {
SiteSettingsHandlerBaseTest::SetUp();
SetUpChooserContext();
SetUpPolicyGrantedPermissions();
// Add the observer for permission changes.
GetChooserContext(profile())->AddObserver(&observer_);
}
void TearDown() override {
GetChooserContext(profile())->RemoveObserver(&observer_);
SiteSettingsHandlerBaseTest::TearDown();
}
void DestroyIncognitoProfile() override {
GetChooserContext(incognito_profile())->RemoveObserver(&observer_);
SiteSettingsHandlerBaseTest::DestroyIncognitoProfile();
}
// Call SiteSettingsHandler::HandleGetChooserExceptionList for |chooser_type|
// and return the exception list received by the WebUI.
void ValidateChooserExceptionList(const std::string& chooser_type,
size_t expected_total_calls) {
base::Value::List args;
args.Append(kCallbackId);
args.Append(chooser_type);
handler()->HandleGetChooserExceptionList(args);
EXPECT_EQ(web_ui()->call_data().size(), expected_total_calls);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
ASSERT_TRUE(data.arg1());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ(data.arg1()->GetString(), kCallbackId);
ASSERT_TRUE(data.arg2());
ASSERT_TRUE(data.arg2()->is_bool());
EXPECT_TRUE(data.arg2()->GetBool());
ASSERT_TRUE(data.arg3());
ASSERT_TRUE(data.arg3()->is_list());
}
const base::Value::List& GetChooserExceptionListFromWebUiCallData(
const std::string& chooser_type,
size_t expected_total_calls) {
ValidateChooserExceptionList(chooser_type, expected_total_calls);
return web_ui()->call_data().back()->arg3()->GetList();
}
// Iterate through the exception's sites array and return true if a site
// exception matches |requesting_origin| and |embedding_origin|.
bool ChooserExceptionContainsSiteException(const base::Value::Dict& exception,
base::StringPiece origin) {
const base::Value::List* sites = exception.FindList(site_settings::kSites);
if (!sites)
return false;
for (const auto& site : *sites) {
const std::string* exception_origin =
site.GetDict().FindString(site_settings::kOrigin);
if (!exception_origin)
continue;
if (*exception_origin == origin)
return true;
}
return false;
}
// Iterate through the |exception_list| array and return true if there is a
// chooser exception with |display_name| that contains a site exception for
// |origin|.
bool ChooserExceptionContainsSiteException(
const base::Value::List& exceptions,
base::StringPiece display_name,
base::StringPiece origin) {
for (const auto& exception : exceptions) {
const std::string* exception_display_name =
exception.GetDict().FindString(site_settings::kDisplayName);
if (!exception_display_name)
continue;
if (*exception_display_name == display_name) {
return ChooserExceptionContainsSiteException(exception.GetDict(),
origin);
}
}
return false;
}
void TestHandleGetChooserExceptionList() {
AddPersistentDevice();
AddEphemeralDevice();
AddUserGrantedDevice();
base::RunLoop().RunUntilIdle();
SetUpUserGrantedPermissions();
base::RunLoop().RunUntilIdle();
web_ui()->ClearTrackedCalls();
const std::string group_name(
site_settings::ContentSettingsTypeToGroupName(content_type()));
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/1u);
// There are 9 granted permissions:
// 1. Persistent permission for persistent-device on kChromiumOrigin
// 2. Persistent permission for persistent-device on kGoogleOrigin
// 3. Persistent permission for persistent-device on kWebUIOrigin
// 4. Persistent permission for user-granted-device on kAndroidOrigin
// 5. Ephemeral permission for ephemeral-device on kAndroidOrigin
// 6. Policy-granted permission for any device on kGoogleOrigin
// 7. Policy-granted permission for vendor 18D1 on kAndroidOrigin
// 8. Policy-granted permission for vendor 18D2 on kAndroidOrigin
// 9. Policy-granted permission for device 18D1:162E on kChromiumOrigin
//
// Permission 3 is ignored by GetChooserExceptionListFromProfile because its
// origin has a WebUI scheme (chrome://).
//
// Some of the user-granted permissions are redundant due to policy-granted
// permissions. Permission 1 is redundant due to permission 9; 2 is
// redundant due to 6; 5 is redundant due to 8. UsbChooserContext omits
// redundant items but other APIs do not. This causes
// GetChooserExceptionListForProfile to return a different number of
// exceptions depending on the API.
//
// UsbChooserContext also detects when a policy-granted permission refers to
// the same origin and device IDs as a user-granted permission. When
// deduplicating redundant exceptions, the user-granted exception display
// name is used because it contains the device name.
//
// TODO(https://crbug.com/1392442): Update SerialChooserContext and
// HidChooserContext to deduplicate redundant exceptions.
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
// BluetoothChooserContext creates a different permission object for
// each (device,origin) pair, so persistent-device shows up for each of
// kChromiumOrigin and kGoogleOrigin.
//
// TODO(https://crbug.com/1040174): No policy-granted exceptions are
// included because Web Bluetooth does not support granting device
// permissions by policy.
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "persistent-device",
"ephemeral-device", "user-granted-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "user-granted-device",
"ephemeral-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "user-granted-device",
GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName()));
break;
default:
NOTREACHED();
break;
}
// Don't include WebUI schemes.
const std::string kWebUIOriginStr =
kWebUIUrl.DeprecatedGetOriginAsURL().spec();
EXPECT_FALSE(ChooserExceptionContainsSiteException(
exceptions, "persistent-device", kWebUIOriginStr));
}
void TestHandleGetChooserExceptionListForOffTheRecord() {
SetUpOffTheRecordChooserContext();
AddPersistentDevice();
AddEphemeralDevice();
AddUserGrantedDevice();
AddOffTheRecordDevice();
base::RunLoop().RunUntilIdle();
SetUpUserGrantedPermissions();
base::RunLoop().RunUntilIdle();
web_ui()->ClearTrackedCalls();
const std::string group_name(
site_settings::ContentSettingsTypeToGroupName(content_type()));
// The objects returned by GetChooserExceptionListFromProfile should also
// include the incognito permissions.
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/1u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "persistent-device",
"ephemeral-device", "user-granted-device",
"off-the-record-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"persistent-device", "ephemeral-device",
"user-granted-device", "off-the-record-device",
GetAllDevicesDisplayName(), GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"persistent-device", "user-granted-device",
"off-the-record-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
default:
NOTREACHED();
break;
}
}
// Destroy the off the record profile and check that the objects returned do
// not include incognito permissions anymore. The destruction of the profile
// causes the "onIncognitoStatusChanged" WebUIListener callback to fire.
DestroyIncognitoProfile();
EXPECT_EQ(web_ui()->call_data().size(), 2u);
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/3u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "persistent-device",
"ephemeral-device", "user-granted-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"persistent-device", "ephemeral-device",
"user-granted-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "user-granted-device",
GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName()));
break;
default:
NOTREACHED();
break;
}
}
}
void TestHandleResetChooserExceptionForSite() {
AddPersistentDevice();
AddEphemeralDevice();
AddUserGrantedDevice();
base::RunLoop().RunUntilIdle();
SetUpUserGrantedPermissions();
base::RunLoop().RunUntilIdle();
web_ui()->ClearTrackedCalls();
const std::string group_name(
site_settings::ContentSettingsTypeToGroupName(content_type()));
const auto kAndroidOrigin = url::Origin::Create(kAndroidUrl);
const auto kChromiumOrigin = url::Origin::Create(kChromiumUrl);
const auto kGoogleOrigin = url::Origin::Create(kGoogleUrl);
const std::string kAndroidOriginStr =
kAndroidUrl.DeprecatedGetOriginAsURL().spec();
const std::string kChromiumOriginStr =
kChromiumUrl.DeprecatedGetOriginAsURL().spec();
const std::string kGoogleOriginStr =
kGoogleUrl.DeprecatedGetOriginAsURL().spec();
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/1u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "persistent-device",
"ephemeral-device", "user-granted-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"persistent-device", "ephemeral-device",
"user-granted-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "user-granted-device",
GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName()));
break;
default:
NOTREACHED();
break;
}
}
// User granted USB permissions for devices also containing policy
// permissions should be able to be reset without removing the chooser
// exception object from the list.
base::Value::List args;
args.Append(group_name);
args.Append(kGoogleOriginStr);
args.Append(GetPersistentDeviceValueForOrigin(kGoogleOrigin));
EXPECT_CALL(observer_,
OnObjectPermissionChanged({guard_type()}, content_type()));
EXPECT_CALL(observer_, OnPermissionRevoked(kGoogleOrigin));
handler()->HandleResetChooserExceptionForSite(args);
GetChooserContext(profile())->FlushScheduledSaveSettingsCalls();
// The HandleResetChooserExceptionForSite() method should have also caused
// the WebUIListenerCallbacks for contentSettingSitePermissionChanged and
// contentSettingChooserPermissionChanged to fire.
EXPECT_EQ(web_ui()->call_data().size(), 3u);
{
// The exception list size should not have been reduced since there is
// still a policy granted permission for "persistent-device".
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/4u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "ephemeral-device",
"user-granted-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"persistent-device", "ephemeral-device",
"user-granted-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("persistent-device", "user-granted-device",
GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName()));
break;
default:
NOTREACHED();
break;
}
// Ensure that the sites list does not contain the URLs of the removed
// permission.
EXPECT_FALSE(ChooserExceptionContainsSiteException(
exceptions, "persistent-device", kGoogleOriginStr));
// User granted exceptions that are also granted by policy are only
// displayed through the policy granted site exception, so ensure that the
// policy exception is present under "persistent-device".
if (content_type() != ContentSettingsType::BLUETOOTH_CHOOSER_DATA) {
EXPECT_TRUE(ChooserExceptionContainsSiteException(
exceptions, "persistent-device", kChromiumOriginStr));
}
}
// Try revoking the user-granted permission for persistent-device. There is
// also a policy-granted permission for the same device.
args.clear();
args.Append(group_name);
args.Append(kChromiumOriginStr);
args.Append(GetPersistentDeviceValueForOrigin(kChromiumOrigin));
EXPECT_CALL(observer_,
OnObjectPermissionChanged({guard_type()}, content_type()));
EXPECT_CALL(observer_, OnPermissionRevoked(kChromiumOrigin));
handler()->HandleResetChooserExceptionForSite(args);
GetChooserContext(profile())->FlushScheduledSaveSettingsCalls();
// The HandleResetChooserExceptionForSite() method should have also caused
// the WebUIListenerCallbacks for contentSettingSitePermissionChanged and
// contentSettingChooserPermissionChanged to fire.
EXPECT_EQ(web_ui()->call_data().size(), 6u);
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/7u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("ephemeral-device", "user-granted-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("ephemeral-device", "user-granted-device",
GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"user-granted-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
default:
NOTREACHED();
break;
}
// Ensure that the sites list still displays a site exception entry for an
// origin of kGoogleOriginStr. Since now the device has had its
// permission revoked, the policy-provided object will not be able to
// deduce the name "persistent-device" from the connected device. As such
// we check that the policy is still active by looking for the genericly
// constructed name.
if (content_type() != ContentSettingsType::BLUETOOTH_CHOOSER_DATA) {
EXPECT_TRUE(ChooserExceptionContainsSiteException(
exceptions, GetUnknownProductDisplayName(), kChromiumOriginStr));
EXPECT_FALSE(ChooserExceptionContainsSiteException(
exceptions, "persistent-device", kGoogleOriginStr));
}
// Ensure the exception for user-granted-device on kAndroidOrigin is
// present since we will try to revoke it.
EXPECT_TRUE(ChooserExceptionContainsSiteException(
exceptions, "user-granted-device", kAndroidOriginStr));
}
// User granted USB permissions that are not covered by policy should be
// able to be reset and the chooser exception entry should be removed from
// the list when the exception only has one site exception granted to it.
args.clear();
args.Append(group_name);
args.Append(kAndroidOriginStr);
args.Append(GetUserGrantedDeviceValueForOrigin(kAndroidOrigin));
EXPECT_CALL(observer_,
OnObjectPermissionChanged({guard_type()}, content_type()));
EXPECT_CALL(observer_, OnPermissionRevoked(kAndroidOrigin));
handler()->HandleResetChooserExceptionForSite(args);
GetChooserContext(profile())->FlushScheduledSaveSettingsCalls();
// The HandleResetChooserExceptionForSite() method should have also caused
// the WebUIListenerCallbacks for contentSettingSitePermissionChanged and
// contentSettingChooserPermissionChanged to fire.
EXPECT_EQ(web_ui()->call_data().size(), 9u);
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(
group_name, /*expected_total_calls=*/10u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("ephemeral-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"ephemeral-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
default:
NOTREACHED();
break;
}
EXPECT_FALSE(ChooserExceptionContainsSiteException(
exceptions, "user-granted-device", kAndroidOriginStr));
}
}
void TestHandleSetOriginPermissions() {
constexpr base::StringPiece kYoutubeOriginStr = "https://youtube.com/";
const GURL kYoutubeUrl{kYoutubeOriginStr};
const auto kYoutubeOrigin = url::Origin::Create(kYoutubeUrl);
// Grant permissions for user-granted-device on `kYoutubeOrigin`.
AddUserGrantedDevice();
SetUpUserGrantedPermissionForOrigin(kYoutubeOrigin);
base::RunLoop().RunUntilIdle();
web_ui()->ClearTrackedCalls();
const std::string group_name(
site_settings::ContentSettingsTypeToGroupName(content_type()));
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/1u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre("user-granted-device"));
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(
"user-granted-device", GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
default:
NOTREACHED();
break;
}
EXPECT_TRUE(ChooserExceptionContainsSiteException(
exceptions, "user-granted-device", kYoutubeOriginStr));
}
// Clear data for kYoutubeOrigin. The permission should be revoked.
base::Value::List args;
args.Append(kYoutubeOriginStr);
args.Append(base::Value());
args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_DEFAULT));
EXPECT_CALL(observer_,
OnObjectPermissionChanged({guard_type()}, content_type()));
EXPECT_CALL(observer_, OnPermissionRevoked(kYoutubeOrigin));
handler()->HandleSetOriginPermissions(args);
GetChooserContext(profile())->FlushScheduledSaveSettingsCalls();
// HandleSetOriginPermissions caused WebUIListenerCallbacks:
// * contentSettingsChooserPermissionChanged once
// * contentSettingsSitePermissionChanged for each visible content type
// * contentSettingsSitePermissionChanged again for `content_type()`
const size_t kContentSettingsTypeCount =
site_settings::GetVisiblePermissionCategories().size();
EXPECT_EQ(kContentSettingsTypeCount + 3, web_ui()->call_data().size());
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(
group_name,
/*expected_total_calls=*/kContentSettingsTypeCount + 4);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_TRUE(exceptions.empty());
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
default:
NOTREACHED();
break;
}
EXPECT_FALSE(ChooserExceptionContainsSiteException(
exceptions, "user-granted-device", kYoutubeOriginStr));
}
}
void TestHandleSetOriginPermissionsPolicyOnly() {
const auto kGoogleOrigin = url::Origin::Create(kGoogleUrl);
const std::string kGoogleOriginStr =
kGoogleUrl.DeprecatedGetOriginAsURL().spec();
base::RunLoop().RunUntilIdle();
web_ui()->ClearTrackedCalls();
const std::string group_name(
site_settings::ContentSettingsTypeToGroupName(content_type()));
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(group_name,
/*expected_total_calls=*/1u);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_TRUE(exceptions.empty());
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
default:
NOTREACHED();
break;
}
}
// Clear data for kGoogleOrigin.
base::Value::List args;
args.Append(kGoogleOriginStr);
args.Append(base::Value());
args.Append(
content_settings::ContentSettingToString(CONTENT_SETTING_DEFAULT));
EXPECT_CALL(observer_, OnObjectPermissionChanged).Times(0);
EXPECT_CALL(observer_, OnPermissionRevoked).Times(0);
handler()->HandleSetOriginPermissions(args);
GetChooserContext(profile())->FlushScheduledSaveSettingsCalls();
// HandleSetOriginPermissions caused WebUIListenerCallbacks:
// * contentSettingsSitePermissionChanged for each visible content type
const size_t kContentSettingsTypeCount =
site_settings::GetVisiblePermissionCategories().size();
EXPECT_EQ(kContentSettingsTypeCount + 1, web_ui()->call_data().size());
{
const base::Value::List& exceptions =
GetChooserExceptionListFromWebUiCallData(
group_name,
/*expected_total_calls=*/kContentSettingsTypeCount + 2);
switch (content_type()) {
case ContentSettingsType::BLUETOOTH_CHOOSER_DATA:
EXPECT_TRUE(exceptions.empty());
break;
case ContentSettingsType::HID_CHOOSER_DATA:
case ContentSettingsType::SERIAL_CHOOSER_DATA:
case ContentSettingsType::USB_CHOOSER_DATA:
EXPECT_THAT(
GetExceptionDisplayNames(exceptions),
UnorderedElementsAre(GetAllDevicesDisplayName(),
GetDevicesFromGoogleDisplayName(),
GetDevicesFromVendor18D2DisplayName(),
GetUnknownProductDisplayName()));
break;
default:
NOTREACHED();
break;
}
}
}
// Returns the ContentSettingsType for the chooser data (device permissions).
virtual ContentSettingsType content_type() = 0;
// Returns the ContentSettingsType for the guard permission.
virtual ContentSettingsType guard_type() = 0;
// Returns the chooser context for `profile`.
virtual permissions::ObjectPermissionContextBase* GetChooserContext(
Profile* profile) = 0;
// Sets up the chooser context.
virtual void SetUpChooserContext() = 0;
// Creates an incognito profile and sets up the chooser context for that
// profile. Tests must call DestroyIncognitoProfile before exiting.
virtual void SetUpOffTheRecordChooserContext() {}
// Grants permissions used by tests. There are four devices that are
// granted user permissions. Two (persistent-device and ephemeral-device) are
// covered by different policy permissions, while the third
// (user-granted-device) is not covered by policy at all. If the
// off-the-record-device is present, a user-granted permission is granted for
// the incognito profile.
virtual void SetUpUserGrantedPermissions() = 0;
// Configures policies to automatically grant device permissions.
virtual void SetUpPolicyGrantedPermissions() {}
// Grants device permissions for user-granted-device on `origin`.
virtual void SetUpUserGrantedPermissionForOrigin(
const url::Origin& origin) = 0;
// Create and add a device eligible for persistent permissions. The device
// name is "persistent-device".
virtual void AddPersistentDevice() = 0;
// Create and add a device ineligible for persistent permissions. The device
// name is "ephemeral-device".
virtual void AddEphemeralDevice() = 0;
// Create and add a device. The permission policies added in
// `SetUpPolicyGrantedPermissions` should not grant permissions for this
// device except for policies which affect all devices. The device name is
// "user-granted-device".
virtual void AddUserGrantedDevice() = 0;
// Create and add a device. Tests should only grant permissions for this
// device using the off the record profile. The device name is
// "off-the-record-device".
virtual void AddOffTheRecordDevice() = 0;
// Returns the permission object representing persistent-device granted to
// `origin`.
virtual base::Value GetPersistentDeviceValueForOrigin(
const url::Origin& origin) = 0;
// Returns the permission object representing user-granted-device granted to
// `origin`.
virtual base::Value GetUserGrantedDeviceValueForOrigin(
const url::Origin& origin) = 0;
// Returns the display name for a chooser exception that allows an origin to
// access any device.
virtual std::string GetAllDevicesDisplayName() { return {}; }
// Returns the display name for a chooser exception that allows an origin to
// access any device with the Google vendor ID.
virtual std::string GetDevicesFromGoogleDisplayName() { return {}; }
// Returns the display name for a chooser exception that allows an origin to
// access any device from vendor 0x18D2.
virtual std::string GetDevicesFromVendor18D2DisplayName() { return {}; }
// Returns the display name for a chooser exception that allows an origin to
// access a specific device by its vendor and product IDs.
virtual std::string GetUnknownProductDisplayName() { return {}; }
permissions::MockPermissionObserver observer_;
};
class SiteSettingsHandlerBluetoothTest
: public SiteSettingsHandlerChooserExceptionTest {
protected:
SiteSettingsHandlerBluetoothTest()
: SiteSettingsHandlerChooserExceptionTest() {
feature_list_.InitAndEnableFeature(
features::kWebBluetoothNewPermissionsBackend);
}
permissions::ObjectPermissionContextBase* GetChooserContext(
Profile* profile) override {
return BluetoothChooserContextFactory::GetForProfile(profile);
}
void SetUpChooserContext() override {
adapter_ = base::MakeRefCounted<NiceMock<device::MockBluetoothAdapter>>();
EXPECT_CALL(*adapter_, IsPresent).WillRepeatedly(Return(true));
EXPECT_CALL(*adapter_, IsPowered).WillRepeatedly(Return(true));
device::BluetoothAdapterFactory::SetAdapterForTesting(adapter_);
base::RunLoop().RunUntilIdle();
}
void SetUpOffTheRecordChooserContext() override {
CreateIncognitoProfile();
GetChooserContext(incognito_profile())->AddObserver(&observer_);
}
void AddPersistentDevice() override {
persistent_device_ =
std::make_unique<NiceMock<device::MockBluetoothDevice>>(
adapter_.get(), /*bluetooth_class=*/0, /*name=*/"persistent-device",
/*address=*/"1", /*paired=*/false, /*connected=*/false);
}
void AddEphemeralDevice() override {
ephemeral_device_ = std::make_unique<NiceMock<device::MockBluetoothDevice>>(
adapter_.get(), /*bluetooth_class=*/0, /*name=*/"ephemeral-device",
/*address=*/"2", /*paired=*/false, /*connected=*/false);
}
void AddUserGrantedDevice() override {
user_granted_device_ =
std::make_unique<NiceMock<device::MockBluetoothDevice>>(
adapter_.get(), /*bluetooth_class=*/0,
/*name=*/"user-granted-device", /*address=*/"3", /*paired=*/false,
/*connected=*/false);
}
void AddOffTheRecordDevice() override {
off_the_record_device_ =
std::make_unique<NiceMock<device::MockBluetoothDevice>>(
adapter_.get(), /*bluetooth_class=*/0,
/*name=*/"off-the-record-device", /*address=*/"4", /*paired=*/false,
/*connected=*/false);
}
void SetUpUserGrantedPermissions() override {
const auto kAndroidOrigin = url::Origin::Create(kAndroidUrl);
const auto kChromiumOrigin = url::Origin::Create(kChromiumUrl);
const auto kGoogleOrigin = url::Origin::Create(kGoogleUrl);
const auto kWebUIOrigin = url::Origin::Create(kWebUIUrl);
auto options = blink::mojom::WebBluetoothRequestDeviceOptions::New();
options->accept_all_devices = true;
{
base::RunLoop loop;
auto barrier_closure = base::BarrierClosure(5, loop.QuitClosure());
auto* bluetooth_chooser_context =
BluetoothChooserContextFactory::GetForProfile(profile());
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::BLUETOOTH_GUARD},
ContentSettingsType::BLUETOOTH_CHOOSER_DATA))
.Times(5)
.WillRepeatedly(RunClosure(barrier_closure));
bluetooth_chooser_context->GrantServiceAccessPermission(
kChromiumOrigin, persistent_device_.get(), options.get());
bluetooth_chooser_context->GrantServiceAccessPermission(
kGoogleOrigin, persistent_device_.get(), options.get());
bluetooth_chooser_context->GrantServiceAccessPermission(
kWebUIOrigin, persistent_device_.get(), options.get());
bluetooth_chooser_context->GrantServiceAccessPermission(
kAndroidOrigin, ephemeral_device_.get(), options.get());
bluetooth_chooser_context->GrantServiceAccessPermission(
kAndroidOrigin, user_granted_device_.get(), options.get());
loop.Run();
}
if (off_the_record_device_) {
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::BLUETOOTH_GUARD},
ContentSettingsType::BLUETOOTH_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
BluetoothChooserContextFactory::GetForProfile(incognito_profile())
->GrantServiceAccessPermission(
kChromiumOrigin, off_the_record_device_.get(), options.get());
loop.Run();
}
}
void SetUpUserGrantedPermissionForOrigin(const url::Origin& origin) override {
auto* bluetooth_chooser_context =
BluetoothChooserContextFactory::GetForProfile(profile());
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::BLUETOOTH_GUARD},
ContentSettingsType::BLUETOOTH_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
auto options = blink::mojom::WebBluetoothRequestDeviceOptions::New();
options->accept_all_devices = true;
bluetooth_chooser_context->GrantServiceAccessPermission(
origin, user_granted_device_.get(), options.get());
loop.Run();
}
base::Value GetPersistentDeviceValueForOrigin(
const url::Origin& origin) override {
auto options = blink::mojom::WebBluetoothRequestDeviceOptions::New();
options->accept_all_devices = true;
auto device_id =
BluetoothChooserContextFactory::GetForProfile(profile())
->GetWebBluetoothDeviceId(origin, persistent_device_->GetAddress());
return base::Value(permissions::BluetoothChooserContext::DeviceInfoToValue(
persistent_device_.get(), options.get(), device_id));
}
base::Value GetUserGrantedDeviceValueForOrigin(
const url::Origin& origin) override {
auto options = blink::mojom::WebBluetoothRequestDeviceOptions::New();
options->accept_all_devices = true;
auto device_id = BluetoothChooserContextFactory::GetForProfile(profile())
->GetWebBluetoothDeviceId(
origin, user_granted_device_->GetAddress());
return base::Value(permissions::BluetoothChooserContext::DeviceInfoToValue(
user_granted_device_.get(), options.get(), device_id));
}
ContentSettingsType content_type() override {
return ContentSettingsType::BLUETOOTH_CHOOSER_DATA;
}
ContentSettingsType guard_type() override {
return ContentSettingsType::BLUETOOTH_GUARD;
}
base::test::ScopedFeatureList feature_list_;
scoped_refptr<NiceMock<device::MockBluetoothAdapter>> adapter_;
std::unique_ptr<NiceMock<device::MockBluetoothDevice>> ephemeral_device_;
std::unique_ptr<NiceMock<device::MockBluetoothDevice>> off_the_record_device_;
std::unique_ptr<NiceMock<device::MockBluetoothDevice>> persistent_device_;
std::unique_ptr<NiceMock<device::MockBluetoothDevice>> user_granted_device_;
};
TEST_F(SiteSettingsHandlerBluetoothTest, HandleGetChooserExceptionList) {
TestHandleGetChooserExceptionList();
}
TEST_F(SiteSettingsHandlerBluetoothTest,
HandleGetChooserExceptionListForOffTheRecord) {
TestHandleGetChooserExceptionListForOffTheRecord();
}
TEST_F(SiteSettingsHandlerBluetoothTest, HandleResetChooserExceptionForSite) {
TestHandleResetChooserExceptionForSite();
}
TEST_F(SiteSettingsHandlerBluetoothTest, HandleSetOriginPermissions) {
TestHandleSetOriginPermissions();
}
TEST_F(SiteSettingsHandlerBluetoothTest, HandleSetOriginPermissionsPolicyOnly) {
TestHandleSetOriginPermissionsPolicyOnly();
}
class SiteSettingsHandlerHidTest
: public SiteSettingsHandlerChooserExceptionTest {
protected:
void SetUpChooserContext() override {
mojo::PendingRemote<device::mojom::HidManager> hid_manager;
hid_manager_.AddReceiver(hid_manager.InitWithNewPipeAndPassReceiver());
HidChooserContext* hid_chooser_context =
HidChooserContextFactory::GetForProfile(profile());
TestFuture<std::vector<device::mojom::HidDeviceInfoPtr>> get_devices_future;
hid_chooser_context->SetHidManagerForTesting(
std::move(hid_manager), get_devices_future.GetCallback());
EXPECT_TRUE(get_devices_future.Wait());
}
void SetUpPolicyGrantedPermissions() override {
auto* local_state = TestingBrowserProcess::GetGlobal()->local_state();
ASSERT_TRUE(local_state);
local_state->Set(prefs::kManagedWebHidAllowDevicesForUrls, ParseJson(R"(
[
{
"devices": [{ "vendor_id": 6353, "product_id": 5678 }],
"urls": ["https://chromium.org"]
}, {
"devices": [{ "vendor_id": 6353 }],
"urls": ["https://android.com"]
}, {
"devices": [{ "vendor_id": 6354 }],
"urls": ["https://android.com"]
}
])"));
local_state->Set(prefs::kManagedWebHidAllowAllDevicesForUrls,
ParseJson(R"([ "https://google.com" ])"));
}
void SetUpOffTheRecordChooserContext() override {
CreateIncognitoProfile();
mojo::PendingRemote<device::mojom::HidManager> hid_manager;
hid_manager_.AddReceiver(hid_manager.InitWithNewPipeAndPassReceiver());
HidChooserContext* hid_chooser_context =
HidChooserContextFactory::GetForProfile(incognito_profile());
TestFuture<std::vector<device::mojom::HidDeviceInfoPtr>> get_devices_future;
hid_chooser_context->SetHidManagerForTesting(
std::move(hid_manager), get_devices_future.GetCallback());
EXPECT_TRUE(get_devices_future.Wait());
GetChooserContext(incognito_profile())->AddObserver(&observer_);
}
void AddPersistentDevice() override {
persistent_device_ = hid_manager_.CreateAndAddDevice(
/*physical_device_id=*/"1", /*vendor_id=*/6353, /*product_id=*/5678,
/*product_name=*/"persistent-device", /*serial_number=*/"123ABC",
device::mojom::HidBusType::kHIDBusTypeUSB);
}
void AddEphemeralDevice() override {
ephemeral_device_ = hid_manager_.CreateAndAddDevice(
/*physical_device_id=*/"2", /*vendor_id=*/6354, /*product_id=*/0,
/*product_name=*/"ephemeral-device", /*serial_number=*/"",
device::mojom::HidBusType::kHIDBusTypeUSB);
}
void AddUserGrantedDevice() override {
user_granted_device_ = hid_manager_.CreateAndAddDevice(
/*physical_device_id=*/"3", /*vendor_id=*/6355, /*product_id=*/0,
/*product_name=*/"user-granted-device", /*serial_number=*/"789XYZ",
device::mojom::HidBusType::kHIDBusTypeUSB);
}
void AddOffTheRecordDevice() override {
off_the_record_device_ = hid_manager_.CreateAndAddDevice(
/*physical_device_id=*/"4", /*vendor_id=*/6353,
/*product_id=*/8765, /*product_name=*/"off-the-record-device",
/*serial_number=*/"A9B8C7", device::mojom::HidBusType::kHIDBusTypeUSB);
}
void SetUpUserGrantedPermissions() override {
const auto kAndroidOrigin = url::Origin::Create(kAndroidUrl);
const auto kChromiumOrigin = url::Origin::Create(kChromiumUrl);
const auto kGoogleOrigin = url::Origin::Create(kGoogleUrl);
const auto kWebUIOrigin = url::Origin::Create(kWebUIUrl);
// Add the user granted permissions for testing.
// These two persistent device permissions should be lumped together
// with the policy permissions, since they apply to the same device and
// URL.
{
base::RunLoop loop;
auto barrier_closure = base::BarrierClosure(5, loop.QuitClosure());
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::HID_GUARD},
ContentSettingsType::HID_CHOOSER_DATA))
.Times(5)
.WillRepeatedly(RunClosure(barrier_closure));
auto* hid_chooser_context =
HidChooserContextFactory::GetForProfile(profile());
hid_chooser_context->GrantDevicePermission(kChromiumOrigin,
*persistent_device_);
hid_chooser_context->GrantDevicePermission(kGoogleOrigin,
*persistent_device_);
hid_chooser_context->GrantDevicePermission(kWebUIOrigin,
*persistent_device_);
hid_chooser_context->GrantDevicePermission(kAndroidOrigin,
*ephemeral_device_);
hid_chooser_context->GrantDevicePermission(kAndroidOrigin,
*user_granted_device_);
loop.Run();
}
if (off_the_record_device_) {
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::HID_GUARD},
ContentSettingsType::HID_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
HidChooserContextFactory::GetForProfile(incognito_profile())
->GrantDevicePermission(kChromiumOrigin, *off_the_record_device_);
loop.Run();
}
}
void SetUpUserGrantedPermissionForOrigin(const url::Origin& origin) override {
auto* hid_chooser_context =
HidChooserContextFactory::GetForProfile(profile());
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::HID_GUARD},
ContentSettingsType::HID_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
hid_chooser_context->GrantDevicePermission(origin, *user_granted_device_);
loop.Run();
}
base::Value GetPersistentDeviceValueForOrigin(
const url::Origin& origin) override {
return base::Value(
HidChooserContext::DeviceInfoToValue(*persistent_device_));
}
base::Value GetUserGrantedDeviceValueForOrigin(
const url::Origin& origin) override {
return base::Value(
HidChooserContext::DeviceInfoToValue(*user_granted_device_));
}
std::string GetAllDevicesDisplayName() override { return "Any HID device"; }
std::string GetDevicesFromGoogleDisplayName() override {
return "HID devices from vendor 18D1";
}
std::string GetDevicesFromVendor18D2DisplayName() override {
return "HID devices from vendor 18D2";
}
std::string GetUnknownProductDisplayName() override {
return "HID device (18D1:162E)";
}
permissions::ObjectPermissionContextBase* GetChooserContext(
Profile* profile) override {
return HidChooserContextFactory::GetForProfile(profile);
}
ContentSettingsType content_type() override {
return ContentSettingsType::HID_CHOOSER_DATA;
}
ContentSettingsType guard_type() override {
return ContentSettingsType::HID_GUARD;
}
device::FakeHidManager hid_manager_;
device::mojom::HidDeviceInfoPtr ephemeral_device_;
device::mojom::HidDeviceInfoPtr off_the_record_device_;
device::mojom::HidDeviceInfoPtr persistent_device_;
device::mojom::HidDeviceInfoPtr user_granted_device_;
};
TEST_F(SiteSettingsHandlerHidTest, HandleGetChooserExceptionList) {
TestHandleGetChooserExceptionList();
}
TEST_F(SiteSettingsHandlerHidTest,
HandleGetChooserExceptionListForOffTheRecord) {
TestHandleGetChooserExceptionListForOffTheRecord();
}
TEST_F(SiteSettingsHandlerHidTest, HandleResetChooserExceptionForSite) {
TestHandleResetChooserExceptionForSite();
}
TEST_F(SiteSettingsHandlerHidTest, HandleSetOriginPermissions) {
TestHandleSetOriginPermissions();
}
TEST_F(SiteSettingsHandlerHidTest, HandleSetOriginPermissionsPolicyOnly) {
TestHandleSetOriginPermissionsPolicyOnly();
}
class SiteSettingsHandlerSerialTest
: public SiteSettingsHandlerChooserExceptionTest {
protected:
void SetUpChooserContext() override {
mojo::PendingRemote<device::mojom::SerialPortManager> serial_port_manager;
serial_port_manager_.AddReceiver(
serial_port_manager.InitWithNewPipeAndPassReceiver());
SerialChooserContext* serial_chooser_context =
SerialChooserContextFactory::GetForProfile(profile());
serial_chooser_context->SetPortManagerForTesting(
std::move(serial_port_manager));
base::RunLoop().RunUntilIdle();
}
void SetUpPolicyGrantedPermissions() override {
auto* local_state = TestingBrowserProcess::GetGlobal()->local_state();
ASSERT_TRUE(local_state);
local_state->Set(prefs::kManagedSerialAllowUsbDevicesForUrls, ParseJson(R"(
[
{
"devices": [{ "vendor_id": 6353, "product_id": 5678 }],
"urls": ["https://chromium.org"]
}, {
"devices": [{ "vendor_id": 6353 }],
"urls": ["https://android.com"]
}, {
"devices": [{ "vendor_id": 6354 }],
"urls": ["https://android.com"]
}
])"));
local_state->Set(prefs::kManagedSerialAllowAllPortsForUrls,
ParseJson(R"([ "https://google.com" ])"));
}
void SetUpOffTheRecordChooserContext() override {
CreateIncognitoProfile();
mojo::PendingRemote<device::mojom::SerialPortManager> serial_port_manager;
serial_port_manager_.AddReceiver(
serial_port_manager.InitWithNewPipeAndPassReceiver());
SerialChooserContext* serial_chooser_context =
SerialChooserContextFactory::GetForProfile(incognito_profile());
serial_chooser_context->SetPortManagerForTesting(
std::move(serial_port_manager));
base::RunLoop().RunUntilIdle();
GetChooserContext(incognito_profile())->AddObserver(&observer_);
}
void AddPersistentDevice() override {
persistent_port_ = device::mojom::SerialPortInfo::New();
persistent_port_->token = base::UnguessableToken::Create();
persistent_port_->display_name = "persistent-device";
#if BUILDFLAG(IS_WIN)
persistent_port_->device_instance_id = "1";
#else
persistent_port_->has_vendor_id = true;
persistent_port_->vendor_id = 6353;
persistent_port_->has_product_id = true;
persistent_port_->product_id = 5678;
persistent_port_->serial_number = "123ABC";
#if BUILDFLAG(IS_MAC)
persistent_port_->usb_driver_name = "AppleUSBCDC";
#endif
#endif // BUILDFLAG(IS_WIN)
serial_port_manager_.AddPort(persistent_port_.Clone());
}
void AddEphemeralDevice() override {
ephemeral_port_ = device::mojom::SerialPortInfo::New();
ephemeral_port_->token = base::UnguessableToken::Create();
ephemeral_port_->display_name = "ephemeral-device";
#if BUILDFLAG(IS_WIN)
ephemeral_port_->device_instance_id = "2";
#else
ephemeral_port_->has_vendor_id = true;
ephemeral_port_->vendor_id = 6354;
ephemeral_port_->has_product_id = true;
ephemeral_port_->product_id = 0;
#if BUILDFLAG(IS_MAC)
ephemeral_port_->usb_driver_name = "AppleUSBCDC";
#endif
#endif // BUILDFLAG(IS_WIN)
serial_port_manager_.AddPort(ephemeral_port_.Clone());
}
void AddUserGrantedDevice() override {
user_granted_port_ = device::mojom::SerialPortInfo::New();
user_granted_port_->token = base::UnguessableToken::Create();
user_granted_port_->display_name = "user-granted-device";
#if BUILDFLAG(IS_WIN)
user_granted_port_->device_instance_id = "3";
#else
user_granted_port_->has_vendor_id = true;
user_granted_port_->vendor_id = 6355;
user_granted_port_->has_product_id = true;
user_granted_port_->product_id = 0;
user_granted_port_->serial_number = "789XYZ";
#if BUILDFLAG(IS_MAC)
user_granted_port_->usb_driver_name = "AppleUSBCDC";
#endif
#endif // BUILDFLAG(IS_WIN)
serial_port_manager_.AddPort(user_granted_port_.Clone());
}
void AddOffTheRecordDevice() override {
off_the_record_port_ = device::mojom::SerialPortInfo::New();
off_the_record_port_->token = base::UnguessableToken::Create();
off_the_record_port_->display_name = "off-the-record-device";
#if BUILDFLAG(IS_WIN)
off_the_record_port_->device_instance_id = "4";
#else
off_the_record_port_->has_vendor_id = true;
off_the_record_port_->vendor_id = 6353;
off_the_record_port_->has_product_id = true;
off_the_record_port_->product_id = 8765;
off_the_record_port_->serial_number = "A9B8C7";
#if BUILDFLAG(IS_MAC)
off_the_record_port_->usb_driver_name = "AppleUSBCDC";
#endif
#endif // BUILDFLAG(IS_WIN)
serial_port_manager_.AddPort(off_the_record_port_.Clone());
}
void SetUpUserGrantedPermissions() override {
const auto kAndroidOrigin = url::Origin::Create(kAndroidUrl);
const auto kChromiumOrigin = url::Origin::Create(kChromiumUrl);
const auto kGoogleOrigin = url::Origin::Create(kGoogleUrl);
const auto kWebUIOrigin = url::Origin::Create(kWebUIUrl);
// Add the user granted permissions for testing.
// These two persistent device permissions should be lumped together
// with the policy permissions, since they apply to the same device and
// URL.
{
base::RunLoop loop;
auto barrier_closure = base::BarrierClosure(5, loop.QuitClosure());
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::SERIAL_GUARD},
ContentSettingsType::SERIAL_CHOOSER_DATA))
.Times(5)
.WillRepeatedly(RunClosure(barrier_closure));
auto* serial_chooser_context =
SerialChooserContextFactory::GetForProfile(profile());
serial_chooser_context->GrantPortPermission(kChromiumOrigin,
*persistent_port_);
serial_chooser_context->GrantPortPermission(kGoogleOrigin,
*persistent_port_);
serial_chooser_context->GrantPortPermission(kWebUIOrigin,
*persistent_port_);
serial_chooser_context->GrantPortPermission(kAndroidOrigin,
*ephemeral_port_);
serial_chooser_context->GrantPortPermission(kAndroidOrigin,
*user_granted_port_);
loop.Run();
}
if (off_the_record_port_) {
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::SERIAL_GUARD},
ContentSettingsType::SERIAL_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
SerialChooserContextFactory::GetForProfile(incognito_profile())
->GrantPortPermission(kChromiumOrigin, *off_the_record_port_);
loop.Run();
}
}
void SetUpUserGrantedPermissionForOrigin(const url::Origin& origin) override {
auto* serial_chooser_context =
SerialChooserContextFactory::GetForProfile(profile());
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::SERIAL_GUARD},
ContentSettingsType::SERIAL_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
serial_chooser_context->GrantPortPermission(origin, *user_granted_port_);
loop.Run();
}
base::Value GetPersistentDeviceValueForOrigin(
const url::Origin& origin) override {
return base::Value(
SerialChooserContext::PortInfoToValue(*persistent_port_));
}
base::Value GetUserGrantedDeviceValueForOrigin(
const url::Origin& origin) override {
return base::Value(
SerialChooserContext::PortInfoToValue(*user_granted_port_));
}
std::string GetAllDevicesDisplayName() override { return "Any serial port"; }
std::string GetDevicesFromGoogleDisplayName() override {
return "USB devices from Google Inc.";
}
std::string GetDevicesFromVendor18D2DisplayName() override {
return "USB devices from vendor 18D2";
}
std::string GetUnknownProductDisplayName() override {
return "USB device from Google Inc. (product 162E)";
}
permissions::ObjectPermissionContextBase* GetChooserContext(
Profile* profile) override {
return SerialChooserContextFactory::GetForProfile(profile);
}
ContentSettingsType content_type() override {
return ContentSettingsType::SERIAL_CHOOSER_DATA;
}
ContentSettingsType guard_type() override {
return ContentSettingsType::SERIAL_GUARD;
}
device::FakeSerialPortManager serial_port_manager_;
device::mojom::SerialPortInfoPtr ephemeral_port_;
device::mojom::SerialPortInfoPtr off_the_record_port_;
device::mojom::SerialPortInfoPtr persistent_port_;
device::mojom::SerialPortInfoPtr user_granted_port_;
};
TEST_F(SiteSettingsHandlerSerialTest, HandleGetChooserExceptionList) {
TestHandleGetChooserExceptionList();
}
TEST_F(SiteSettingsHandlerSerialTest,
HandleGetChooserExceptionListForOffTheRecord) {
TestHandleGetChooserExceptionListForOffTheRecord();
}
TEST_F(SiteSettingsHandlerSerialTest, HandleResetChooserExceptionForSite) {
TestHandleResetChooserExceptionForSite();
}
TEST_F(SiteSettingsHandlerSerialTest, HandleSetOriginPermissions) {
TestHandleSetOriginPermissions();
}
TEST_F(SiteSettingsHandlerSerialTest, HandleSetOriginPermissionsPolicyOnly) {
TestHandleSetOriginPermissionsPolicyOnly();
}
class SiteSettingsHandlerUsbTest
: public SiteSettingsHandlerChooserExceptionTest {
protected:
void SetUpChooserContext() override {
mojo::PendingRemote<device::mojom::UsbDeviceManager> device_manager;
usb_device_manager_.AddReceiver(
device_manager.InitWithNewPipeAndPassReceiver());
UsbChooserContext* usb_chooser_context =
UsbChooserContextFactory::GetForProfile(profile());
usb_chooser_context->SetDeviceManagerForTesting(std::move(device_manager));
TestFuture<std::vector<device::mojom::UsbDeviceInfoPtr>> get_devices_future;
usb_chooser_context->GetDevices(get_devices_future.GetCallback());
EXPECT_TRUE(get_devices_future.Wait());
}
void SetUpPolicyGrantedPermissions() override {
profile()->GetPrefs()->Set(prefs::kManagedWebUsbAllowDevicesForUrls,
ParseJson(R"(
[
{
"devices": [{ "vendor_id": 6353, "product_id": 5678 }],
"urls": ["https://chromium.org"]
}, {
"devices": [{ "vendor_id": 6353 }],
"urls": ["https://google.com,https://android.com"]
}, {
"devices": [{ "vendor_id": 6354 }],
"urls": ["https://android.com,"]
}, {
"devices": [{}],
"urls": ["https://google.com,https://google.com"]
}
])"));
}
void SetUpOffTheRecordChooserContext() override {
CreateIncognitoProfile();
mojo::PendingRemote<device::mojom::UsbDeviceManager> device_manager;
usb_device_manager_.AddReceiver(
device_manager.InitWithNewPipeAndPassReceiver());
UsbChooserContext* usb_chooser_context =
UsbChooserContextFactory::GetForProfile(incognito_profile());
usb_chooser_context->SetDeviceManagerForTesting(std::move(device_manager));
TestFuture<std::vector<device::mojom::UsbDeviceInfoPtr>> get_devices_future;
usb_chooser_context->GetDevices(get_devices_future.GetCallback());
EXPECT_TRUE(get_devices_future.Wait());
GetChooserContext(incognito_profile())->AddObserver(&observer_);
}
void AddPersistentDevice() override {
persistent_device_ = usb_device_manager_.CreateAndAddDevice(
/*vendor_id=*/6353, /*product_id=*/5678,
/*manufacturer_string=*/"Google",
/*product_string=*/"persistent-device", /*serial_number=*/"123ABC");
}
void AddEphemeralDevice() override {
ephemeral_device_ = usb_device_manager_.CreateAndAddDevice(
/*vendor_id=*/6354, /*product_id=*/0,
/*manufacturer_string=*/"Google",
/*product_string=*/"ephemeral-device", /*serial_number=*/"");
}
void AddUserGrantedDevice() override {
user_granted_device_ = usb_device_manager_.CreateAndAddDevice(
/*vendor_id=*/6355, /*product_id=*/0,
/*manufacturer_string=*/"Google",
/*product_string=*/"user-granted-device",
/*serial_number=*/"789XYZ");
}
void AddOffTheRecordDevice() override {
off_the_record_device_ = usb_device_manager_.CreateAndAddDevice(
/*vendor_id=*/6353, /*product_id=*/8765,
/*manufacturer_string=*/"Google",
/*product_string=*/"off-the-record-device",
/*serial_number=*/"A9B8C7");
}
void SetUpUserGrantedPermissions() override {
const auto kAndroidOrigin = url::Origin::Create(kAndroidUrl);
const auto kChromiumOrigin = url::Origin::Create(kChromiumUrl);
const auto kGoogleOrigin = url::Origin::Create(kGoogleUrl);
const auto kWebUIOrigin = url::Origin::Create(kWebUIUrl);
// Add the user granted permissions for testing.
// These two persistent device permissions should be lumped together
// with the policy permissions, since they apply to the same device and
// URL.
{
base::RunLoop loop;
auto barrier_closure = base::BarrierClosure(5, loop.QuitClosure());
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::USB_GUARD},
ContentSettingsType::USB_CHOOSER_DATA))
.Times(5)
.WillRepeatedly(RunClosure(barrier_closure));
auto* usb_chooser_context =
UsbChooserContextFactory::GetForProfile(profile());
usb_chooser_context->GrantDevicePermission(kChromiumOrigin,
*persistent_device_);
usb_chooser_context->GrantDevicePermission(kGoogleOrigin,
*persistent_device_);
usb_chooser_context->GrantDevicePermission(kWebUIOrigin,
*persistent_device_);
usb_chooser_context->GrantDevicePermission(kAndroidOrigin,
*ephemeral_device_);
usb_chooser_context->GrantDevicePermission(kAndroidOrigin,
*user_granted_device_);
loop.Run();
}
if (off_the_record_device_) {
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::USB_GUARD},
ContentSettingsType::USB_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
UsbChooserContextFactory::GetForProfile(incognito_profile())
->GrantDevicePermission(kChromiumOrigin, *off_the_record_device_);
loop.Run();
}
}
void SetUpUserGrantedPermissionForOrigin(const url::Origin& origin) override {
auto* usb_chooser_context =
UsbChooserContextFactory::GetForProfile(profile());
base::RunLoop loop;
EXPECT_CALL(observer_, OnObjectPermissionChanged(
{ContentSettingsType::USB_GUARD},
ContentSettingsType::USB_CHOOSER_DATA))
.WillOnce(RunClosure(loop.QuitClosure()));
usb_chooser_context->GrantDevicePermission(origin, *user_granted_device_);
loop.Run();
}
base::Value GetPersistentDeviceValueForOrigin(
const url::Origin& origin) override {
return base::Value(
UsbChooserContext::DeviceInfoToValue(*persistent_device_));
}
base::Value GetUserGrantedDeviceValueForOrigin(
const url::Origin& origin) override {
return base::Value(
UsbChooserContext::DeviceInfoToValue(*user_granted_device_));
}
std::string GetAllDevicesDisplayName() override {
return "Devices from any vendor";
}
std::string GetDevicesFromGoogleDisplayName() override {
return "Devices from Google Inc.";
}
std::string GetDevicesFromVendor18D2DisplayName() override {
return "Devices from vendor 0x18D2";
}
std::string GetUnknownProductDisplayName() override {
return "Unknown product 0x162E from Google Inc.";
}
permissions::ObjectPermissionContextBase* GetChooserContext(
Profile* profile) override {
return UsbChooserContextFactory::GetForProfile(profile);
}
ContentSettingsType content_type() override {
return ContentSettingsType::USB_CHOOSER_DATA;
}
ContentSettingsType guard_type() override {
return ContentSettingsType::USB_GUARD;
}
device::FakeUsbDeviceManager usb_device_manager_;
device::mojom::UsbDeviceInfoPtr ephemeral_device_;
device::mojom::UsbDeviceInfoPtr off_the_record_device_;
device::mojom::UsbDeviceInfoPtr persistent_device_;
device::mojom::UsbDeviceInfoPtr user_granted_device_;
};
TEST_F(SiteSettingsHandlerUsbTest, HandleGetChooserExceptionList) {
TestHandleGetChooserExceptionList();
}
TEST_F(SiteSettingsHandlerUsbTest,
HandleGetChooserExceptionListForOffTheRecord) {
TestHandleGetChooserExceptionListForOffTheRecord();
}
TEST_F(SiteSettingsHandlerUsbTest, HandleResetChooserExceptionForSite) {
TestHandleResetChooserExceptionForSite();
}
TEST_F(SiteSettingsHandlerUsbTest, HandleSetOriginPermissions) {
TestHandleSetOriginPermissions();
}
TEST_F(SiteSettingsHandlerUsbTest, HandleSetOriginPermissionsPolicyOnly) {
TestHandleSetOriginPermissionsPolicyOnly();
}
TEST_F(SiteSettingsHandlerTest, HandleClearSiteGroupDataAndCookies) {
SetupModels();
EXPECT_EQ(28u,
handler()->cookies_tree_model_->GetRoot()->GetTotalNodeCount());
auto verify_site_group = [](const base::Value& site_group,
std::string expected_etld_plus1) {
ASSERT_TRUE(site_group.is_dict());
ASSERT_THAT(CHECK_DEREF(site_group.GetDict().FindString("groupingKey")),
IsEtldPlus1(expected_etld_plus1));
};
base::Value::List storage_and_cookie_list = GetOnStorageFetchedSentList();
EXPECT_EQ(4U, storage_and_cookie_list.size());
verify_site_group(storage_and_cookie_list[0], "example.com");
base::Value::List args;
args.Append(GroupingKey::CreateFromEtldPlus1("example.com").Serialize());
handler()->HandleClearSiteGroupDataAndCookies(args);
// All host nodes for non-secure example.com, and abc.example.com, which do
// not have any unpartitioned storage, should have been removed.
ASSERT_EQ(0u, GetHostNodes(GURL("http://example.com")).size());
ASSERT_EQ(0u, GetHostNodes(GURL("http://abc.example.com")).size());
// Confirm that partitioned cookies for www.example.com have not been deleted,
auto remaining_host_nodes = GetHostNodes(GURL("https://www.example.com"));
// example.com storage partitioned on other sites should still remain.
{
ASSERT_EQ(1u, remaining_host_nodes.size());
ASSERT_EQ(1u, remaining_host_nodes[0]->children().size());
const auto& storage_node = remaining_host_nodes[0]->children()[0];
ASSERT_EQ(CookieTreeNode::DetailedInfo::TYPE_COOKIES,
storage_node->GetDetailedInfo().node_type);
ASSERT_EQ(2u, storage_node->children().size());
for (const auto& cookie_node : storage_node->children()) {
const auto& cookie = cookie_node->GetDetailedInfo().cookie;
EXPECT_EQ("www.example.com", cookie->Domain());
EXPECT_TRUE(cookie->IsPartitioned());
}
}
EXPECT_EQ(19u,
handler()->cookies_tree_model_->GetRoot()->GetTotalNodeCount());
storage_and_cookie_list = GetOnStorageFetchedSentList();
EXPECT_EQ(3U, storage_and_cookie_list.size());
verify_site_group(storage_and_cookie_list[0], "google.com");
args.clear();
args.Append(GroupingKey::CreateFromEtldPlus1("google.com").Serialize());
handler()->HandleClearSiteGroupDataAndCookies(args);
EXPECT_EQ(14u,
handler()->cookies_tree_model_->GetRoot()->GetTotalNodeCount());
storage_and_cookie_list = GetOnStorageFetchedSentList();
EXPECT_EQ(2U, storage_and_cookie_list.size());
verify_site_group(storage_and_cookie_list[0], "google.com.au");
args.clear();
args.Append(GroupingKey::CreateFromEtldPlus1("google.com.au").Serialize());
handler()->HandleClearSiteGroupDataAndCookies(args);
// No nodes representing storage partitioned on google.com.au should be
// present.
for (const auto& host_node :
handler()->cookies_tree_model_->GetRoot()->children()) {
for (const auto& storage_node : host_node->children()) {
if (storage_node->GetDetailedInfo().node_type !=
CookieTreeNode::DetailedInfo::TYPE_COOKIES) {
continue;
}
for (const auto& cookie_node : storage_node->children()) {
const auto& cookie = cookie_node->GetDetailedInfo().cookie;
if (cookie->IsPartitioned()) {
EXPECT_NE("google.com.au",
cookie->PartitionKey()->site().GetURL().host());
}
}
}
}
storage_and_cookie_list = GetOnStorageFetchedSentList();
EXPECT_EQ(1U, storage_and_cookie_list.size());
verify_site_group(storage_and_cookie_list[0], "ungrouped.com");
args.clear();
args.Append(GroupingKey::CreateFromEtldPlus1("ungrouped.com").Serialize());
handler()->HandleClearSiteGroupDataAndCookies(args);
storage_and_cookie_list = GetOnStorageFetchedSentList();
EXPECT_EQ(0U, storage_and_cookie_list.size());
}
TEST_P(SiteSettingsHandlerTest, HandleClearUnpartitionedUsage) {
SetupModels();
EXPECT_EQ(28u,
handler()->cookies_tree_model_->GetRoot()->GetTotalNodeCount());
EXPECT_EQ(1, std::distance(handler()->browsing_data_model_->begin(),
handler()->browsing_data_model_->end()));
base::Value::List args;
args.Append(GetParam() ? "https://www.example.com/"
: "http://www.example.com/");
handler()->HandleClearUnpartitionedUsage(args);
EXPECT_EQ(1, std::distance(handler()->browsing_data_model_->begin(),
handler()->browsing_data_model_->end()));
// Confirm that only the unpartitioned items for example.com have been
// cleared.
auto remaining_host_nodes = GetHostNodes(GURL("https://www.example.com"));
// There should only be partitioned cookie entries remaining for the site.
ASSERT_EQ(1u, remaining_host_nodes.size());
ASSERT_EQ(1u, remaining_host_nodes[0]->children().size());
const auto& storage_node = remaining_host_nodes[0]->children()[0];
ASSERT_EQ(CookieTreeNode::DetailedInfo::TYPE_COOKIES,
storage_node->GetDetailedInfo().node_type);
ASSERT_EQ(2u, storage_node->children().size());
for (const auto& cookie_node : storage_node->children()) {
const auto& cookie = cookie_node->GetDetailedInfo().cookie;
EXPECT_EQ("www.example.com", cookie->Domain());
EXPECT_TRUE(cookie->IsPartitioned());
}
// Partitioned storage, even when keyed on the cookie domain site, should
// not be cleared.
args = base::Value::List();
args.Append("https://google.com.au/");
handler()->HandleClearUnpartitionedUsage(args);
remaining_host_nodes = GetHostNodes(GURL("https://google.com.au"));
// A single partitioned cookie should remain.
ASSERT_EQ(1u, remaining_host_nodes.size());
ASSERT_EQ(1u, remaining_host_nodes[0]->children().size());
const auto& cookies_node = remaining_host_nodes[0]->children()[0];
ASSERT_EQ(1u, cookies_node->children().size());
const auto& cookie_node = cookies_node->children()[0];
const auto& cookie = cookie_node->GetDetailedInfo().cookie;
EXPECT_TRUE(cookie->IsPartitioned());
args = base::Value::List();
args.Append("https://www.google.com/");
handler()->HandleClearUnpartitionedUsage(args);
EXPECT_EQ(0, std::distance(handler()->browsing_data_model_->begin(),
handler()->browsing_data_model_->end()));
// Clearing Site Specific Media Licenses Tests
#if BUILDFLAG(IS_WIN)
PrefService* user_prefs = profile()->GetPrefs();
// In the beginning, there should be nothing stored in the origin data.
ASSERT_EQ(0u, user_prefs->GetDict(prefs::kMediaCdmOriginData).size());
auto entry_google = base::Value::Dict().Set(
"https://www.google.com/",
base::UnguessableTokenToValue(base::UnguessableToken::Create()));
base::Value::Dict entry_example;
entry_example.Set(
"https://www.example.com/",
base::UnguessableTokenToValue(base::UnguessableToken::Create()));
{
ScopedDictPrefUpdate update(user_prefs, prefs::kMediaCdmOriginData);
base::Value::Dict& dict = update.Get();
dict.Set("https://www.google.com/", std::move(entry_google));
dict.Set("https://www.example.com/", std::move(entry_example));
}
// The code above adds origin data for both google and example.com
EXPECT_EQ(2u, user_prefs->GetDict(prefs::kMediaCdmOriginData).size());
args = base::Value::List();
args.Append("https://www.google.com/");
handler()->HandleClearUnpartitionedUsage(args);
// The code clears the origin data for just google.com, so there should still
// be the origin data for example.com left.
EXPECT_EQ(1u, user_prefs->GetDict(prefs::kMediaCdmOriginData).size());
EXPECT_TRUE(user_prefs->GetDict(prefs::kMediaCdmOriginData)
.contains("https://www.example.com/"));
#endif // BUILDFLAG(IS_WIN)
}
TEST_F(SiteSettingsHandlerTest, ClearClientHints) {
// Confirm that when the user clears unpartitioned storage, or the eTLD+1
// group, client hints are also cleared.
SetupModels();
handler()->OnStorageFetched();
GURL hosts[] = {GURL("https://example.com/"), GURL("https://www.example.com"),
GURL("https://google.com/"), GURL("https://www.google.com/")};
HostContentSettingsMap* host_content_settings_map =
HostContentSettingsMapFactory::GetForProfile(profile());
ContentSettingsForOneType client_hints_settings;
// Add setting for the two hosts host[0], host[1].
base::Value client_hint_platform_version(14);
base::Value client_hint_bitness(16);
base::Value::List client_hints_list;
client_hints_list.Append(std::move(client_hint_platform_version));
client_hints_list.Append(std::move(client_hint_bitness));
base::Value::Dict client_hints_dictionary;
client_hints_dictionary.Set(client_hints::kClientHintsSettingKey,
std::move(client_hints_list));
// Add setting for the hosts.
for (const auto& host : hosts) {
host_content_settings_map->SetWebsiteSettingDefaultScope(
host, GURL(), ContentSettingsType::CLIENT_HINTS,
base::Value(client_hints_dictionary.Clone()));
}
// Clear at the eTLD+1 level and ensure affected origins are cleared.
base::Value::List args;
args.Append(GroupingKey::CreateFromEtldPlus1("example.com").Serialize());
handler()->HandleClearSiteGroupDataAndCookies(args);
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::CLIENT_HINTS, &client_hints_settings);
EXPECT_EQ(2U, client_hints_settings.size());
EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(hosts[2]),
client_hints_settings.at(0).primary_pattern);
EXPECT_EQ(ContentSettingsPattern::Wildcard(),
client_hints_settings.at(0).secondary_pattern);
EXPECT_EQ(client_hints_dictionary, client_hints_settings.at(0).setting_value);
EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(hosts[3]),
client_hints_settings.at(1).primary_pattern);
EXPECT_EQ(ContentSettingsPattern::Wildcard(),
client_hints_settings.at(1).secondary_pattern);
EXPECT_EQ(client_hints_dictionary, client_hints_settings.at(1).setting_value);
// Clear unpartitioned usage data, which should only affect the specific
// origin.
args.clear();
args.Append("https://google.com/");
handler()->HandleClearUnpartitionedUsage(args);
// Validate the client hint has been cleared.
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::CLIENT_HINTS, &client_hints_settings);
EXPECT_EQ(1U, client_hints_settings.size());
// www.google.com should be the only remaining entry.
EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(hosts[3]),
client_hints_settings.at(0).primary_pattern);
EXPECT_EQ(ContentSettingsPattern::Wildcard(),
client_hints_settings.at(0).secondary_pattern);
EXPECT_EQ(client_hints_dictionary, client_hints_settings.at(0).setting_value);
// Clear unpartitioned usage data through HTTPS scheme, make sure https site
// client hints have been cleared when the specific origin HTTPS scheme
// exist.
args.clear();
args.Append("http://www.google.com/");
handler()->HandleClearUnpartitionedUsage(args);
// Validate the client hint has been cleared.
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::CLIENT_HINTS, &client_hints_settings);
EXPECT_EQ(0U, client_hints_settings.size());
}
TEST_F(SiteSettingsHandlerTest, ClearReducedAcceptLanguage) {
// Confirm that when the user clears unpartitioned storage, or the eTLD+1
// group, reduce accept language are also cleared.
SetupModels();
handler()->OnStorageFetched();
GURL hosts[] = {GURL("https://example.com/"), GURL("https://www.example.com"),
GURL("https://google.com/"), GURL("https://www.google.com/")};
HostContentSettingsMap* host_content_settings_map =
HostContentSettingsMapFactory::GetForProfile(profile());
ContentSettingsForOneType accept_language_settings;
std::string language = "en-us";
base::Value::Dict accept_language_dictionary;
accept_language_dictionary.Set("reduce-accept-language", language);
// Add setting for the hosts.
for (const auto& host : hosts) {
host_content_settings_map->SetWebsiteSettingDefaultScope(
host, GURL(), ContentSettingsType::REDUCED_ACCEPT_LANGUAGE,
base::Value(accept_language_dictionary.Clone()));
}
// Clear at the eTLD+1 level and ensure affected origins are cleared.
base::Value::List args;
args.Append(GroupingKey::CreateFromEtldPlus1("example.com").Serialize());
handler()->HandleClearSiteGroupDataAndCookies(args);
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::REDUCED_ACCEPT_LANGUAGE, &accept_language_settings);
EXPECT_EQ(2U, accept_language_settings.size());
EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(hosts[2]),
accept_language_settings.at(0).primary_pattern);
EXPECT_EQ(ContentSettingsPattern::Wildcard(),
accept_language_settings.at(0).secondary_pattern);
EXPECT_EQ(accept_language_dictionary,
accept_language_settings.at(0).setting_value);
EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(hosts[3]),
accept_language_settings.at(1).primary_pattern);
EXPECT_EQ(ContentSettingsPattern::Wildcard(),
accept_language_settings.at(1).secondary_pattern);
EXPECT_EQ(accept_language_dictionary,
accept_language_settings.at(1).setting_value);
// Clear unpartitioned usage data, which should only affect the specific
// origin.
args.clear();
args.Append("https://google.com/");
handler()->HandleClearUnpartitionedUsage(args);
// Validate the reduce accept language has been cleared.
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::REDUCED_ACCEPT_LANGUAGE, &accept_language_settings);
EXPECT_EQ(1U, accept_language_settings.size());
// www.google.com should be the only remaining entry.
EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(hosts[3]),
accept_language_settings.at(0).primary_pattern);
EXPECT_EQ(ContentSettingsPattern::Wildcard(),
accept_language_settings.at(0).secondary_pattern);
EXPECT_EQ(accept_language_dictionary,
accept_language_settings.at(0).setting_value);
// Clear unpartitioned usage data through HTTPS scheme, make sure https site
// reduced accept language have been cleared when the specific origin HTTPS
// scheme exist.
args.clear();
args.Append("http://www.google.com/");
handler()->HandleClearUnpartitionedUsage(args);
// Validate the reduced accept language has been cleared.
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::REDUCED_ACCEPT_LANGUAGE, &accept_language_settings);
EXPECT_EQ(0U, accept_language_settings.size());
}
TEST_F(SiteSettingsHandlerTest, HandleClearPartitionedUsage) {
// Confirm that removing unpartitioned storage correctly removes the
// appropriate nodes.
SetupModels();
EXPECT_EQ(28u,
handler()->cookies_tree_model_->GetRoot()->GetTotalNodeCount());
EXPECT_EQ(1, std::distance(handler()->browsing_data_model_->begin(),
handler()->browsing_data_model_->end()));
base::Value::List args;
args.Append("https://www.example.com/");
args.Append(GroupingKey::CreateFromEtldPlus1("google.com").Serialize());
handler()->HandleClearPartitionedUsage(args);
// This should have only removed cookies for embedded.com partitioned on
// google.com, leaving other cookies and storage untouched.
auto remaining_host_nodes = GetHostNodes(GURL("https://www.example.com"));
ASSERT_EQ(1u, remaining_host_nodes.size());
// Both cookies and local storage type nodes should remain.
ASSERT_EQ(2u, remaining_host_nodes[0]->children().size());
for (const auto& storage_node : remaining_host_nodes[0]->children()) {
if (storage_node->GetDetailedInfo().node_type ==
CookieTreeNode::DetailedInfo::TYPE_COOKIES) {
// Two cookies should remain, one unpartitioned and one partitioned on
// a different site.
ASSERT_EQ(2u, storage_node->children().size());
for (const auto& cookie_node : storage_node->children()) {
const auto& cookie = cookie_node->GetDetailedInfo().cookie;
if (cookie->IsPartitioned())
ASSERT_EQ("google.com.au",
cookie->PartitionKey()->site().GetURL().host());
}
} else {
ASSERT_EQ(storage_node->GetDetailedInfo().node_type,
CookieTreeNode::DetailedInfo::TYPE_LOCAL_STORAGES);
}
}
// Should not have affected the browsing data model.
// TODO(crbug.com/1271155): Update when partitioned storage is represented
// by the browsing data model.
EXPECT_EQ(1, std::distance(handler()->browsing_data_model_->begin(),
handler()->browsing_data_model_->end()));
}
TEST_F(SiteSettingsHandlerTest, CookieSettingDescription) {
const auto kBlocked = [](int num) {
return l10n_util::GetPluralStringFUTF8(
IDS_SETTINGS_SITE_SETTINGS_COOKIES_BLOCK, num);
};
const auto kAllowed = [](int num) {
return l10n_util::GetPluralStringFUTF8(
IDS_SETTINGS_SITE_SETTINGS_COOKIES_ALLOW, num);
};
const std::string kBlockThirdParty = l10n_util::GetStringUTF8(
IDS_SETTINGS_SITE_SETTINGS_COOKIES_BLOCK_THIRD_PARTY);
const std::string kBlockThirdPartyIncognito = l10n_util::GetStringUTF8(
IDS_SETTINGS_SITE_SETTINGS_COOKIES_BLOCK_THIRD_PARTY_INCOGNITO);
// Enforce expected default profile setting.
profile()->GetPrefs()->SetInteger(
prefs::kCookieControlsMode,
static_cast<int>(content_settings::CookieControlsMode::kIncognitoOnly));
auto* content_settings =
HostContentSettingsMapFactory::GetForProfile(profile());
content_settings->SetDefaultContentSetting(
ContentSettingsType::COOKIES, ContentSetting::CONTENT_SETTING_ALLOW);
web_ui()->ClearTrackedCalls();
// Validate get method works.
base::Value::List get_args;
get_args.Append(kCallbackId);
handler()->HandleGetCookieSettingDescription(get_args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
EXPECT_EQ(kBlockThirdPartyIncognito, data.arg3()->GetString());
// Multiple listeners will be called when prefs and content settings are
// changed in this test. Increment our expected call_data index accordingly.
int expected_call_index = 0;
const int kPrefListenerIndex = 1;
const int kContentSettingListenerIndex = 2;
// Check updates are working,
profile()->GetPrefs()->SetInteger(
prefs::kCookieControlsMode,
static_cast<int>(content_settings::CookieControlsMode::kBlockThirdParty));
expected_call_index += kPrefListenerIndex;
ValidateCookieSettingUpdate(kBlockThirdParty, expected_call_index);
content_settings->SetDefaultContentSetting(
ContentSettingsType::COOKIES, ContentSetting::CONTENT_SETTING_BLOCK);
expected_call_index += kContentSettingListenerIndex;
ValidateCookieSettingUpdate(kBlocked(0), expected_call_index);
// Check changes which do not affect the effective cookie setting.
profile()->GetPrefs()->SetInteger(
prefs::kCookieControlsMode,
static_cast<int>(content_settings::CookieControlsMode::kOff));
expected_call_index += kPrefListenerIndex;
ValidateCookieSettingUpdate(kBlocked(0), expected_call_index);
// Set to allow and check previous changes are respected.
content_settings->SetDefaultContentSetting(
ContentSettingsType::COOKIES, ContentSetting::CONTENT_SETTING_ALLOW);
expected_call_index += kContentSettingListenerIndex;
ValidateCookieSettingUpdate(kAllowed(0), expected_call_index);
// Confirm exceptions are counted correctly.
GURL url1("https://example.com");
GURL url2("http://example.com");
GURL url3("http://another.example.com");
content_settings->SetContentSettingDefaultScope(
url1, url1, ContentSettingsType::COOKIES,
ContentSetting::CONTENT_SETTING_BLOCK);
expected_call_index += kContentSettingListenerIndex;
ValidateCookieSettingUpdate(kAllowed(1), expected_call_index);
content_settings->SetContentSettingDefaultScope(
url2, url2, ContentSettingsType::COOKIES,
ContentSetting::CONTENT_SETTING_ALLOW);
expected_call_index += kContentSettingListenerIndex;
ValidateCookieSettingUpdate(kAllowed(1), expected_call_index);
content_settings->SetContentSettingDefaultScope(
url3, url3, ContentSettingsType::COOKIES,
ContentSetting::CONTENT_SETTING_SESSION_ONLY);
expected_call_index += kContentSettingListenerIndex;
ValidateCookieSettingUpdate(kAllowed(1), expected_call_index);
content_settings->SetDefaultContentSetting(
ContentSettingsType::COOKIES, ContentSetting::CONTENT_SETTING_BLOCK);
expected_call_index += kContentSettingListenerIndex;
ValidateCookieSettingUpdate(kBlocked(2), expected_call_index);
}
TEST_F(SiteSettingsHandlerTest, HandleGetFpsMembershipLabel) {
base::Value::List args;
args.Append("getFpsMembershipLabel");
args.Append(5);
args.Append("google.com");
handler()->HandleGetFpsMembershipLabel(args);
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ("getFpsMembershipLabel", data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
EXPECT_EQ("5 sites in google.com's group", data.arg3()->GetString());
}
TEST_F(SiteSettingsHandlerTest, HandleGetFormattedBytes) {
const double size = 120000000000;
base::Value::List get_args;
get_args.Append(kCallbackId);
get_args.Append(size);
handler()->HandleGetFormattedBytes(get_args);
// Validate that this method can handle large data.
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
EXPECT_EQ(kCallbackId, data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->GetBool());
EXPECT_EQ(base::UTF16ToUTF8(ui::FormatBytes(int64_t(size))),
data.arg3()->GetString());
}
TEST_F(SiteSettingsHandlerTest, HandleGetUsageInfo) {
SetupDefaultFirstPartySets(mock_privacy_sandbox_service());
EXPECT_CALL(*mock_privacy_sandbox_service(), IsPartOfManagedFirstPartySet(_))
.Times(1)
.WillOnce(Return(false));
EXPECT_CALL(
*mock_privacy_sandbox_service(),
IsPartOfManagedFirstPartySet(ConvertEtldToSchemefulSite("example.com")))
.Times(2)
.WillRepeatedly(Return(true));
// Confirm that usage info only returns unpartitioned storage.
SetupModels();
EXPECT_EQ(28u,
handler()->cookies_tree_model_->GetRoot()->GetTotalNodeCount());
EXPECT_EQ(1, std::distance(handler()->browsing_data_model_->begin(),
handler()->browsing_data_model_->end()));
base::Value::List args;
args.Append("http://www.example.com");
handler()->HandleFetchUsageTotal(args);
handler()->ServicePendingRequests();
ValidateUsageInfo("http://www.example.com", "2 B", "1 cookie",
"1 site in example.com's group", true);
args.clear();
args.Append("http://example.com");
handler()->HandleFetchUsageTotal(args);
handler()->ServicePendingRequests();
ValidateUsageInfo("http://example.com", "", "1 cookie",
"1 site in example.com's group", true);
args.clear();
args.Append("http://google.com");
handler()->HandleFetchUsageTotal(args);
handler()->ServicePendingRequests();
ValidateUsageInfo("http://google.com", "", "2 cookies",
"2 sites in google.com's group", false);
args.clear();
args.Append("http://ungrouped.com");
handler()->HandleFetchUsageTotal(args);
handler()->ServicePendingRequests();
ValidateUsageInfo("http://ungrouped.com", "", "1 cookie", "", false);
// Test that the argument URL formatting is preserved in the response because
// the UI ignores responses with different URL strings.
args.clear();
args.Append("http://ungrouped.com//");
handler()->HandleFetchUsageTotal(args);
handler()->ServicePendingRequests();
ValidateUsageInfo("http://ungrouped.com//", "", "1 cookie", "", false);
}
TEST_F(SiteSettingsHandlerTest, NonTreeModelDeletion) {
// Confirm that a BrowsingDataRemover task is started to remove Privacy
// Sandbox APIs that are not integrated with the tree model.
SetupModels();
base::Value::List storage_and_cookie_list = GetOnStorageFetchedSentList();
EXPECT_EQ(4U, storage_and_cookie_list.size());
EXPECT_CALL(*mock_browsing_topics_service(),
ClearTopicsDataForOrigin(
url::Origin::Create(GURL("https://www.google.com"))));
EXPECT_CALL(*mock_browsing_topics_service(),
ClearTopicsDataForOrigin(
url::Origin::Create(GURL("https://google.com"))));
base::Value::List args;
args.Append(GroupingKey::CreateFromEtldPlus1("google.com").Serialize());
handler()->HandleClearSiteGroupDataAndCookies(args);
auto* browsing_data_remover = profile()->GetBrowsingDataRemover();
EXPECT_EQ(content::BrowsingDataRemover::DATA_TYPE_PRIVACY_SANDBOX &
~content::BrowsingDataRemover::DATA_TYPE_TRUST_TOKENS,
browsing_data_remover->GetLastUsedRemovalMaskForTesting());
EXPECT_EQ(base::Time::Min(),
browsing_data_remover->GetLastUsedBeginTimeForTesting());
EXPECT_EQ(content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB,
browsing_data_remover->GetLastUsedOriginTypeMaskForTesting());
}
TEST_F(SiteSettingsHandlerTest, FirstPartySetsMembership) {
SetupDefaultFirstPartySets(mock_privacy_sandbox_service());
EXPECT_CALL(*mock_privacy_sandbox_service(), IsPartOfManagedFirstPartySet(_))
.Times(2)
.WillRepeatedly(Return(false));
EXPECT_CALL(
*mock_privacy_sandbox_service(),
IsPartOfManagedFirstPartySet(ConvertEtldToSchemefulSite("example.com")))
.Times(1)
.WillOnce(Return(true));
SetupModels();
handler()->ClearAllSitesMapForTesting();
handler()->OnStorageFetched();
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
ASSERT_TRUE(data.arg1()->is_string());
EXPECT_EQ("onStorageListFetched", data.arg1()->GetString());
ASSERT_TRUE(data.arg2()->is_list());
const base::Value::List& storage_and_cookie_list = data.arg2()->GetList();
EXPECT_EQ(4U, storage_and_cookie_list.size());
auto first_party_sets = GetTestFirstPartySets();
ValidateSitesWithFps(storage_and_cookie_list, first_party_sets);
}
TEST_F(SiteSettingsHandlerTest,
HandleIgnoreOriginsForNotificationPermissionReview) {
base::test::ScopedFeatureList scoped_feature;
scoped_feature.InitAndEnableFeature(
::features::kSafetyCheckNotificationPermissions);
HostContentSettingsMap* content_settings =
HostContentSettingsMapFactory::GetForProfile(profile());
ContentSettingsForOneType ignored_patterns;
content_settings->GetSettingsForOneType(
ContentSettingsType::NOTIFICATION_PERMISSION_REVIEW, &ignored_patterns);
ASSERT_EQ(0U, ignored_patterns.size());
base::Value::List args;
args.Append(GetOriginList(1));
handler()->HandleIgnoreOriginsForNotificationPermissionReview(args);
// Check there is 1 origin in ignore list.
content_settings->GetSettingsForOneType(
ContentSettingsType::NOTIFICATION_PERMISSION_REVIEW, &ignored_patterns);
ASSERT_EQ(1U, ignored_patterns.size());
ValidateNotificationPermissionUpdate();
}
TEST_F(SiteSettingsHandlerTest, HandleBlockNotificationPermissionForOrigins) {
base::test::ScopedFeatureList scoped_feature;
scoped_feature.InitAndEnableFeature(
::features::kSafetyCheckNotificationPermissions);
base::Value::List args;
base::Value::List origins = GetOriginList(2);
args.Append(origins.Clone());
handler()->HandleBlockNotificationPermissionForOrigins(args);
// Check the permission for the two origins is block.
HostContentSettingsMap* content_settings =
HostContentSettingsMapFactory::GetForProfile(profile());
ContentSettingsForOneType notification_permissions;
content_settings->GetSettingsForOneType(ContentSettingsType::NOTIFICATIONS,
¬ification_permissions);
auto type = content_settings->GetContentSetting(
GURL(origins[0].GetString()), GURL(), ContentSettingsType::NOTIFICATIONS);
ASSERT_EQ(CONTENT_SETTING_BLOCK, type);
type = content_settings->GetContentSetting(
GURL(origins[1].GetString()), GURL(), ContentSettingsType::NOTIFICATIONS);
ASSERT_EQ(CONTENT_SETTING_BLOCK, type);
ValidateNotificationPermissionUpdate();
}
TEST_F(SiteSettingsHandlerTest, HandleAllowNotificationPermissionForOrigins) {
base::test::ScopedFeatureList scoped_feature;
scoped_feature.InitAndEnableFeature(
::features::kSafetyCheckNotificationPermissions);
base::Value::List args;
base::Value::List origins = GetOriginList(2);
args.Append(origins.Clone());
handler()->HandleAllowNotificationPermissionForOrigins(args);
// Check the permission for the two origins is allow.
HostContentSettingsMap* content_settings =
HostContentSettingsMapFactory::GetForProfile(profile());
ContentSettingsForOneType notification_permissions;
content_settings->GetSettingsForOneType(ContentSettingsType::NOTIFICATIONS,
¬ification_permissions);
auto type = content_settings->GetContentSetting(
GURL(origins[0].GetString()), GURL(), ContentSettingsType::NOTIFICATIONS);
ASSERT_EQ(CONTENT_SETTING_ALLOW, type);
type = content_settings->GetContentSetting(
GURL(origins[1].GetString()), GURL(), ContentSettingsType::NOTIFICATIONS);
ASSERT_EQ(CONTENT_SETTING_ALLOW, type);
ValidateNotificationPermissionUpdate();
}
TEST_F(SiteSettingsHandlerTest, HandleResetNotificationPermissionForOrigins) {
base::test::ScopedFeatureList scoped_feature;
scoped_feature.InitAndEnableFeature(
::features::kSafetyCheckNotificationPermissions);
HostContentSettingsMap* content_settings =
HostContentSettingsMapFactory::GetForProfile(profile());
base::Value::List args;
base::Value::List origins = GetOriginList(1);
args.Append(origins.Clone());
content_settings->SetContentSettingCustomScope(
ContentSettingsPattern::FromString(origins[0].GetString()),
ContentSettingsPattern::Wildcard(), ContentSettingsType::NOTIFICATIONS,
CONTENT_SETTING_ALLOW);
handler()->HandleResetNotificationPermissionForOrigins(args);
// Check the permission for the origin is reset.
auto type = content_settings->GetContentSetting(
GURL(origins[0].GetString()), GURL(), ContentSettingsType::NOTIFICATIONS);
ASSERT_EQ(CONTENT_SETTING_ASK, type);
ValidateNotificationPermissionUpdate();
}
TEST_F(SiteSettingsHandlerTest, PopulateNotificationPermissionReviewData) {
base::test::ScopedFeatureList scoped_feature;
scoped_feature.InitAndEnableFeature(
::features::kSafetyCheckNotificationPermissions);
// Add a couple of notification permission and check they appear in review
// list.
HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(profile());
GURL urls[] = {GURL("https://google.com:443"),
GURL("https://www.youtube.com:443"),
GURL("https://www.example.com:443")};
map->SetContentSettingDefaultScope(urls[0], GURL(),
ContentSettingsType::NOTIFICATIONS,
CONTENT_SETTING_ALLOW);
map->SetContentSettingDefaultScope(urls[1], GURL(),
ContentSettingsType::NOTIFICATIONS,
CONTENT_SETTING_ALLOW);
map->SetContentSettingDefaultScope(urls[2], GURL(),
ContentSettingsType::NOTIFICATIONS,
CONTENT_SETTING_ALLOW);
// Record initial display date to enable comparing dictionaries for
// NotificationEngagementService.
auto* notification_engagement_service =
NotificationsEngagementServiceFactory::GetForProfile(profile());
std::string displayedDate =
notification_engagement_service->GetBucketLabel(base::Time::Now());
auto* site_engagement_service =
site_engagement::SiteEngagementServiceFactory::GetForProfile(profile());
// Set a host to have minimum engagement. This should be in review list.
RecordNotification(notification_engagement_service, urls[0], 1);
site_engagement::SiteEngagementScore score =
site_engagement_service->CreateEngagementScore(urls[0]);
score.Reset(0.5, GetReferenceTime());
score.Commit();
EXPECT_EQ(blink::mojom::EngagementLevel::MINIMAL,
site_engagement_service->GetEngagementLevel(urls[0]));
// Set a host to have large number of notifications, but low engagement. This
// should be in review list.
RecordNotification(notification_engagement_service, urls[1], 5);
site_engagement_service->AddPointsForTesting(urls[1], 1.0);
EXPECT_EQ(blink::mojom::EngagementLevel::LOW,
site_engagement_service->GetEngagementLevel(urls[1]));
// Set a host to have medium engagement and high notification count. This
// should not be in review list.
RecordNotification(notification_engagement_service, urls[2], 5);
site_engagement_service->AddPointsForTesting(urls[2], 50.0);
EXPECT_EQ(blink::mojom::EngagementLevel::MEDIUM,
site_engagement_service->GetEngagementLevel(urls[2]));
const auto& notification_permissions =
handler()->PopulateNotificationPermissionReviewData();
// Check if resulting list contains only the expected URLs. They should be in
// descending order of notification count.
EXPECT_EQ(2UL, notification_permissions.size());
EXPECT_EQ("https://www.youtube.com:443",
*notification_permissions[0].GetDict().FindString(
site_settings::kOrigin));
EXPECT_EQ("https://google.com:443",
*notification_permissions[1].GetDict().FindString(
site_settings::kOrigin));
// Increasing notification count also promotes host in the list.
RecordNotification(notification_engagement_service,
GURL("https://google.com:443"), 10);
const auto& updated_notification_permissions =
handler()->PopulateNotificationPermissionReviewData();
EXPECT_EQ(2UL, updated_notification_permissions.size());
EXPECT_EQ("https://google.com:443",
*updated_notification_permissions[0].GetDict().FindString(
site_settings::kOrigin));
EXPECT_EQ("https://www.youtube.com:443",
*updated_notification_permissions[1].GetDict().FindString(
site_settings::kOrigin));
}
TEST_F(SiteSettingsHandlerTest,
HandleUndoIgnoreOriginsForNotificationPermissionReview) {
base::Value::List args;
args.Append(GetOriginList(1));
handler()->HandleIgnoreOriginsForNotificationPermissionReview(args);
// Check there is 1 origin in ignore list.
HostContentSettingsMap* content_settings =
HostContentSettingsMapFactory::GetForProfile(profile());
ContentSettingsForOneType ignored_patterns;
ASSERT_EQ(0U, ignored_patterns.size());
content_settings->GetSettingsForOneType(
ContentSettingsType::NOTIFICATION_PERMISSION_REVIEW, &ignored_patterns);
ASSERT_EQ(1U, ignored_patterns.size());
// Check there are no origins in ignore list.
handler()->HandleUndoIgnoreOriginsForNotificationPermissionReview(args);
content_settings->GetSettingsForOneType(
ContentSettingsType::NOTIFICATION_PERMISSION_REVIEW, &ignored_patterns);
ASSERT_EQ(0U, ignored_patterns.size());
}
TEST_F(SiteSettingsHandlerTest,
SendNotificationPermissionReviewList_FeatureEnabled) {
base::test::ScopedFeatureList scoped_feature;
scoped_feature.InitAndEnableFeature(
::features::kSafetyCheckNotificationPermissions);
handler()->SendNotificationPermissionReviewList();
ValidateNotificationPermissionUpdate();
}
TEST_F(SiteSettingsHandlerTest,
SendNotificationPermissionReviewList_FeatureDisabled) {
base::test::ScopedFeatureList scoped_feature;
scoped_feature.InitAndDisableFeature(
::features::kSafetyCheckNotificationPermissions);
handler()->SendNotificationPermissionReviewList();
ASSERT_EQ(0U, web_ui()->call_data().size());
}
TEST_F(SiteSettingsHandlerTest, IsolatedWebAppUsageInfo) {
std::string iwa_url =
"isolated-app://"
"aerugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic/";
SetupModelsWithIsolatedWebAppData(iwa_url, 1000);
base::Value::List args;
args.Append(iwa_url);
handler()->HandleFetchUsageTotal(args);
handler()->ServicePendingRequests();
ValidateUsageInfo(
/*expected_usage_host=*/iwa_url, /*expected_usage_string=*/"1,000 B",
/*expected_cookie_string=*/"",
/*expected_fps_member_count_string=*/"", /*expected_fps_policy=*/false);
}
} // namespace settings
| [
"jengelh@inai.de"
] | jengelh@inai.de |
53fee5e6cb03898f3fbbac3421e8accf4b278492 | 9c5840c7c649833a4ab64185ede1d922edaeac29 | /Classes/Screens/Preloader.cpp | 380eb4313c4be6450ea99f381ca8847da9c17403 | [] | no_license | tooflya/roger-in-trouble | 41a09da3c165fb0ba8da6859fb79f5054900ad80 | 2df9605e0c58ce5635fb35d75d32b530d44e7457 | refs/heads/master | 2020-04-20T14:53:15.771730 | 2013-05-22T12:32:11 | 2013-05-22T12:32:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,535 | cpp | #ifndef CONST_PRELOADER
#define CONST_PRELOADER
#include "Preloader.h"
// ===========================================================
// Init
// ===========================================================
// ===========================================================
// Constructors
// ===========================================================
Preloader::Preloader(void)
{
this->mNumberOfLoadedSprites = 0;
this->mNumberOfSprites = 1;
this->mBackground = new Entity("start-preloader/preloader-bg.png");
this->mBarBackground = new Entity("start-preloader/preloader-bar.png");
this->mBar = new Entity("start-preloader/preloader-fill.png");
this->mLoadingText = CCLabelTTF::create("00 %", "Fonts/Franchise-Bold.ttf", 36);
this->mBackground->create()->setCenterPosition(Options::CAMERA_CENTER_X, Options::CAMERA_CENTER_Y);
this->mBarBackground->create()->setCenterPosition(Options::CAMERA_CENTER_X, Options::CAMERA_CENTER_Y - Utils::coord(230));
this->mBar->create()->setCenterPosition(Options::CAMERA_CENTER_X, Options::CAMERA_CENTER_Y - Utils::coord(230));
this->mLoadingText->setPosition(ccp(this->mBar->getCenterX(), this->mBar->getCenterY()));
this->addChild(this->mBackground);
this->addChild(this->mBarBackground);
this->addChild(this->mBar);
this->addChild(this->mLoadingText);
CCTextureCache::sharedTextureCache()->addImageAsync("base/cherry.png", this, callfuncO_selector(Preloader::loadingCallBack));
}
// ===========================================================
// Getters
// ===========================================================
// ===========================================================
// Setters
// ===========================================================
// ===========================================================
// Methods
// ===========================================================
void Preloader::loadingCallBack(CCObject *obj)
{
++mNumberOfLoadedSprites;
int percent = (int) (((float) mNumberOfLoadedSprites / mNumberOfSprites) * 100);
this->mLoadingText->setString((Utils::intToString(percent) + " %").c_str());
if(mNumberOfLoadedSprites == mNumberOfSprites)
{
AppDelegate::screens = new ScreenManager();
AppDelegate::screens->set(1.0f, 0);
}
else
{
}
}
// ===========================================================
// Virtual methods
// ===========================================================
void Preloader::update(float pDeltaTime)
{
Screen::update(pDeltaTime);
this->mBar->setRotation(this->mBar->getRotation() + 1);
}
#endif | [
"igor.mats@yandex.ru"
] | igor.mats@yandex.ru |
79f97b08975f6572f54c758abdada1a140f65ce7 | ae41889e79243a2df1ec03848ace958a05012d62 | /AFM_Soft/AFM_arduino_soft/AFM_arduino_soft.ino | 1cf65d5485ff58f4e73378c9e946266a6c6b20f6 | [] | no_license | Barglak/Project_AFM | 01cd1e0881e662ebb08be3f6e2300bae0be39e25 | 1939e3286e96e81496da5ea3b7f69dffaa024cc9 | refs/heads/master | 2020-07-16T02:37:54.856900 | 2020-03-02T20:59:55 | 2020-03-02T20:59:55 | 205,701,569 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,970 | ino | #include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
#define push 48
#define time_interval 40
const int PinA = 3;
const int PinB = 2;
int k;
const int dirPin_x = 6;
const int stepPin_x = 7;
const int dirPin_y = 4;
const int stepPin_y = 5;
const int dirPin_z = 9;
const int stepPin_z = 8;
const int x2_end = 40;
const int x1_end = 38;
const int y2_end = 36;
const int y1_end = 34;
volatile int lastCount = 0;
volatile int last_counter = 0;
volatile int page = 1;
volatile int pushed = 0;
volatile int menu = 0;
volatile int MENU = 0;
volatile int frame = 0;
volatile int counter = 0;
volatile int x_length_step = 5;
volatile int y_length_step = 5;
volatile int x_max = 50;
volatile int y_max = 50;
volatile bool direct = 0; // 0 forward, 1 backward
const int opto[12] = {A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11};
void isr () {
static unsigned long lastInterruptTime = 0;
unsigned long interruptTime = millis();
if (interruptTime - lastInterruptTime > 5) {
if (digitalRead(PinB) == LOW)
{
counter-- ;
}
else {
counter++ ;
}
}
lastInterruptTime = interruptTime;
if (counter != lastCount) {
lastCount = counter ;
}
}
void setup() {
Serial.begin(115200);
randomSeed(analogRead(0));
pinMode(dirPin_x, OUTPUT);
pinMode(stepPin_x, OUTPUT);
pinMode(dirPin_y, OUTPUT);
pinMode(stepPin_y, OUTPUT);
pinMode(dirPin_z, OUTPUT);
pinMode(stepPin_z, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(x1_end, INPUT);
pinMode(x2_end, INPUT);
pinMode(y1_end, INPUT);
pinMode(y2_end, INPUT);
pinMode(PinA, INPUT);
pinMode(PinB, INPUT);
pinMode(push, INPUT);
attachInterrupt(digitalPinToInterrupt(PinA), isr, LOW);
lcd.init();
lcd.backlight();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" AFM ");
lcd.setCursor(14, 1);
lcd.print("DB");
}
void blink() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(100);
}
void loop() {
if((last_counter > counter) || (last_counter < counter) || (pushed)) {
menu = 1;
//************************************** MENU = 0
if(MENU == 0){
if(0 <= counter && counter < 1){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("> Set steps length");
lcd.setCursor(0, 1);
lcd.print(" Set field size");
page = 1;
if(pushed){
pushed = 0;
}
}
if(1 <= counter && counter < 2){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Set steps length");
lcd.setCursor(0, 1);
lcd.print("> Set field size");
page = 2;
if(pushed) {
pushed = 0;
}
}
if(2 <= counter && counter < 3){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("> Start");
lcd.setCursor(0, 1);
lcd.print(" Reset");
page = 3;
if(pushed){
pushed = 0;
}
}
if(3 <= counter && counter < 4){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Start");
lcd.setCursor(0, 1);
lcd.print("> Reset");
page = 4;
if(pushed){
pushed = 0;
}
}
if(4 <= counter && counter < 5){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("> Back");
page = 5;
if(pushed){
pushed = 0;
}
}
if(counter > 5){
counter = 5;
}
if(counter <= 0){
counter = 0;
}
}//if menu ==0
if(MENU == 1){
if((page == 1)){
if(0 <= counter && counter < 1){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("> Set X step");
lcd.setCursor(0, 1);
lcd.print(" Set Y step");
frame = 1;
if(pushed){
pushed = 0;
}
}
if(1 <= counter && counter < 2){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Set X step");
lcd.setCursor(0, 1);
lcd.print("> Set Y step");
frame = 2;
if(pushed){
pushed = 0;
}
}
if(2 <= counter && counter < 3){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("> Back");
frame = 3;
if(pushed){
pushed = 0;
}
}
}
if((page == 2)){
if(0 <= counter && counter < 1){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("> Set X_max");
lcd.setCursor(0, 1);
lcd.print(" Set Y_max");
frame = 1;
if(pushed){
pushed = 0;
}
}
if(1 <= counter && counter < 2){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Set X_max");
lcd.setCursor(0, 1);
lcd.print("> Set Y_max");
frame = 2;
if(pushed){
pushed = 0;
}
}
if(2 <= counter && counter < 3){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("> Back");
frame = 3;
if(pushed){
pushed = 0;
}
}
}
if(counter > 3){
counter = 3;
}
if(counter < 0){
counter = 0;
}
}//If menu==1
if(MENU == 2){
if(page == 1){
lcd.clear();
lcd.setCursor(7, 0);
if(counter > 9){
lcd.setCursor(6, 0);
}
lcd.print(counter);
lcd.setCursor(8, 0);
lcd.print("mm");
if(counter > 19){
counter = 19;
}
if(counter < 1){
counter = 1;
}
}
if(page == 2){
lcd.clear();
lcd.setCursor(7, 0);
if(counter > 9){
lcd.setCursor(6, 0);
}
lcd.print(counter);
lcd.setCursor(8, 0);
lcd.print("cm");
if(counter > 18){
counter = 18;
}
if(counter < 1){
counter = 1;
}
}
}// end of MENU = 2
}// end of 1 if
last_counter = counter;
if(digitalRead(push)){
if(MENU == 1){
if(page == 1){
if(frame == 1){
counter = 0;
pushed = 0;
menu = 0;
MENU = 2;
delay(300);
}
if(frame == 2){
counter = 0;
pushed = 0;
menu = 0;
MENU = 2;
delay(300);
}
if(frame == 3){
pushed = 1;
MENU = 0;
counter = 0;
menu = 0;
delay(200);
}
}
if(page == 2){
if(frame == 1){
counter = 0;
pushed = 0;
menu = 0;
MENU = 2;
delay(300);
}
if(frame == 2){
counter = 0;
pushed = 0;
menu = 0;
MENU = 2;
delay(300);
}
if(frame == 3){
pushed = 1;
MENU = 0;
counter = 0;
menu = 0;
delay(200);
}
}
}
if(MENU == 2 && menu == 1){
if(page == 1){
pushed = 0;
MENU = 1;
if(frame == 1){
x_length_step = counter;
// Serial.println("X_length_step:");
// Serial.println(x_length_step);
}
if(frame == 2){
y_length_step = counter;
//Serial.println("Y_length_step:");
/// Serial.println(y_length_step);
}
counter = 0;
delay(200);
}
if(page == 2){
pushed = 0;
MENU = 1;
if(frame == 1){
x_max = 10*counter;
// Serial.println("X_max:");
// Serial.println(x_max);
}
if(frame == 2){
y_max = 10*counter;
// Serial.println("Y_max:");
// Serial.println(y_max);
}
counter = 0;
delay(200);
}
}
if(MENU == 0 && menu == 1){
if(page == 1){
pushed = 1;
counter = 0;
menu = 0;
MENU = 1;
delay(300);
}
if(page == 2){
pushed = 1;
counter = 0;
menu = 0;
MENU = 1;
delay(300);
}
if(page == 3){ //*****************START
/* Serial.println("X_max:");
Serial.println(x_max);
Serial.println("Y_max:");
Serial.println(y_max);
Serial.println("X_length_step:");
Serial.println(x_length_step);
Serial.println("Y_length_step:");
Serial.println(y_length_step);*/
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Progressing..");
unsigned long time1 = millis();
measure();
unsigned long time2 = millis();
lcd.clear();
lcd.setCursor(2, 0);
lcd.print("End measure");
lcd.setCursor(0, 1);
lcd.print("Time[s]:");
lcd.setCursor(9, 1);
lcd.print((time2-time1)/1000);
MENU = 0;
// counter = 1;
pushed = 0;
menu = 0;
}
if(page == 4){
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Reseting..");
while(digitalRead(x2_end) != HIGH){
move_forward(dirPin_x, stepPin_x, 4);
}
while(digitalRead(y2_end) != HIGH){
move_forward(dirPin_y, stepPin_y, 4);
}
move_backward(dirPin_x, stepPin_x, 5);
move_backward(dirPin_y, stepPin_y, 5);
MENU = 0;
counter = 1;
pushed = 0;
menu = 0;
}
if(page == 5){
counter = 0;
last_counter = counter;
pushed = 0;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" AFM ");
lcd.setCursor(14, 1);
lcd.print("DB");
delay(2000);
}
}
}// end if push
}//loop end
void move_forward(int dirPin, int stepPin, int angle) {
digitalWrite(dirPin, HIGH);
for (int x = 0; x < angle * 25*16; x++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(time_interval);
digitalWrite(stepPin, LOW);
delayMicroseconds(time_interval);
}
}
void move_backward(int dirPin, int stepPin, int angle) {
digitalWrite(dirPin, LOW);
for (int x = 0; x < angle * 25*16; x++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(time_interval);
digitalWrite(stepPin, LOW);
delayMicroseconds(time_interval);
}
}
void move(int dirPin, int stepPin, int angle, int value) {
digitalWrite(dirPin, value); // direct 0 forward, 1 backward
for (int x = 0; x < angle * 25*16; x++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(time_interval);
digitalWrite(stepPin, LOW);
delayMicroseconds(time_interval);
}
}
void move_z() {
digitalWrite(dirPin_z, HIGH);
for (int x = 0; x<1600; x++) {
digitalWrite(stepPin_z, HIGH);
delayMicroseconds(30);
digitalWrite(stepPin_z, LOW);
delayMicroseconds(30);
}
}
void measure() {
for( k = 0; k < x_max/x_length_step + 1; k++){
for(int j = 0; j < y_max/y_length_step; j++){
Serial.print((j + direct*(y_max/y_length_step -(j*2)))*x_length_step);// dac ewentualnie -1
Serial.print(" ");
Serial.print(k*y_length_step);
Serial.print(" ");
Read();
if((digitalRead(y1_end) == HIGH) || (digitalRead(y2_end) == HIGH)){
break;
}
move(dirPin_y, stepPin_y, y_length_step, direct);
}
direct = !direct;
if(digitalRead(x1_end) != HIGH){
move_backward(dirPin_x, stepPin_x, x_length_step);
}
if(digitalRead(push)){
break;
}
}
} // end void measure
void Read(){
move_z();
delay(20);
//delay(500);
int a = 1;
for(int i=1;i<13;i++){
if(analogRead(opto[i-1])>700){
Serial.print((i-1)*4);
a = 0;
break;
}
}
if(a){
Serial.print("0");
}
Serial.print('\n');
move_z();
delay(20);
}
| [
"noreply@github.com"
] | noreply@github.com |
42e2d926b8299a7c9a2aa2524a1641f7636f0b4a | e6974df9aa856e939e252831fd34489c89c49ce7 | /Commands/SpinnerDoNothing.cpp | 0fde3da1ac2d69a7599f56ae1896f79fc367a1ad | [] | no_license | GreenBlitz/2013-Robot-Code | dd1dc280a023560c7fb8bb563d0bcfc3a587dad8 | 5ba663ffe105f179bfd403589cc9a4d76c5ee50d | refs/heads/master | 2022-09-15T00:05:42.412743 | 2016-07-30T14:24:57 | 2016-07-30T14:24:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 712 | cpp | #include "SpinnerDoNothing.h"
SpinnerDoNothing::SpinnerDoNothing() : CommandBase("SpinnerDoNothing") {
Requires(spinner);
}
// Called just before this Command runs the first time
void SpinnerDoNothing::Initialize() {
}
// Called repeatedly when this Command is scheduled to run
void SpinnerDoNothing::Execute() {
spinner->SetMotorSpeed(-0.3f);
}
// Make this return true when this Command no longer needs to run execute()
bool SpinnerDoNothing::IsFinished() {
return false;
}
// Called once after isFinished returns true
void SpinnerDoNothing::End() {
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void SpinnerDoNothing::Interrupted() {
}
| [
"greenblitz.programms@gmail.com"
] | greenblitz.programms@gmail.com |
5540233cd87a5c8adb4553a407358e56805d89b0 | 25e99a0af5751865bce1702ee85cc5c080b0715c | /c++/data/cpp-concurrency-in-action/src/source/listing_c.4.cpp | 2d15c34830e27be0c9fd18ec5899dacb0162bdd4 | [
"BSL-1.0"
] | permissive | jasonblog/note | 215837f6a08d07abe3e3d2be2e1f183e14aa4a30 | 4471f95736c60969a718d854cab929f06726280a | refs/heads/master | 2023-05-31T13:02:27.451743 | 2022-04-04T11:28:06 | 2022-04-04T11:28:06 | 35,311,001 | 130 | 67 | null | 2023-02-10T21:26:36 | 2015-05-09T02:04:40 | C | UTF-8 | C++ | false | false | 1,248 | cpp | namespace messaging
{
class close_queue
{};
class dispatcher
{
queue* q;
bool chained;
dispatcher(dispatcher const&) = delete;
dispatcher& operator=(dispatcher const&) = delete;
template <
typename Dispatcher,
typename Msg,
typename Func >
friend class TemplateDispatcher;
void wait_and_dispatch()
{
for (;;) {
auto msg = q->wait_and_pop();
dispatch(msg);
}
}
bool dispatch(
std::shared_ptr<message_base> const& msg)
{
if (dynamic_cast<wrapped_message<close_queue>*>(msg.get())) {
throw close_queue();
}
return false;
}
public:
dispatcher(dispatcher&& other):
q(other.q), chained(other.chained)
{
other.chained = true;
}
explicit dispatcher(queue* q_):
q(q_), chained(false)
{}
template<typename Message, typename Func>
TemplateDispatcher<dispatcher, Message, Func>
handle(Func&& f)
{
return TemplateDispatcher<dispatcher, Message, Func>(
q, this, std::forward<Func>(f));
}
~dispatcher() noexcept(false)
{
if (!chained) {
wait_and_dispatch();
}
}
};
}
| [
"jason_yao"
] | jason_yao |
e465c9ee1c2c678819723adc87e4fd9b8c529a57 | 1e8bc724d3c69300a55e3f4c42945db167158a82 | /src/plugins/organisation/PMRWindow/src/pmrwindowplugin.cpp | 042e882e581b02a8ac9021936364c43de8fa7b9f | [
"Apache-2.0"
] | permissive | mirams/opencor | 9104d821a16da92b5023e98ab1c3a07f8b8fbf1d | 71dd884194ec8080f96f8e982c5afedec8473405 | refs/heads/master | 2021-01-18T10:49:32.934690 | 2016-07-21T10:30:57 | 2016-07-21T10:30:57 | 9,960,636 | 0 | 0 | null | 2016-07-21T10:30:57 | 2013-05-09T14:18:17 | C++ | UTF-8 | C++ | false | false | 5,335 | cpp | /*******************************************************************************
Copyright The University of Auckland
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.
*******************************************************************************/
//==============================================================================
// PMR window plugin
//==============================================================================
#include "coreguiutils.h"
#include "pmrwindowplugin.h"
#include "pmrwindowwindow.h"
//==============================================================================
#include <Qt>
//==============================================================================
#include <QMainWindow>
#include <QSettings>
//==============================================================================
namespace OpenCOR {
namespace PMRWindow {
//==============================================================================
PLUGININFO_FUNC PMRWindowPluginInfo()
{
Descriptions descriptions;
descriptions.insert("en", QString::fromUtf8("a plugin to access the <a href=\"https://models.physiomeproject.org/\">Physiome Model Repository</a>."));
descriptions.insert("fr", QString::fromUtf8("une extension pour accéder le <a href=\"https://models.physiomeproject.org/\">Répertoire de Modèles Physiome</a>."));
return new PluginInfo("Organisation", true, false,
QStringList() << "PMRSupport" << "WebViewerWidget",
descriptions,
QStringList() << "FileBrowserWindow" << "FileOrganiserWindow");
}
//==============================================================================
// I18n interface
//==============================================================================
void PMRWindowPlugin::retranslateUi()
{
// Retranslate our PMR window action
retranslateAction(mPmrWindowAction,
tr("Physiome Model Repository"),
tr("Show/hide the Physiome Model Repository window"));
// Retranslate our PMR window
mPmrWindowWindow->retranslateUi();
}
//==============================================================================
// Plugin interface
//==============================================================================
void PMRWindowPlugin::initializePlugin()
{
// Create an action to show/hide our PMR window
mPmrWindowAction = Core::newAction(true, Core::mainWindow());
// Create our PMR window
mPmrWindowWindow = new PmrWindowWindow(Core::mainWindow());
}
//==============================================================================
void PMRWindowPlugin::finalizePlugin()
{
// We don't handle this interface...
}
//==============================================================================
void PMRWindowPlugin::pluginsInitialized(const Plugins &pLoadedPlugins)
{
Q_UNUSED(pLoadedPlugins);
// We don't handle this interface...
}
//==============================================================================
void PMRWindowPlugin::loadSettings(QSettings *pSettings)
{
// Retrieve our PMR window settings
pSettings->beginGroup(mPmrWindowWindow->objectName());
mPmrWindowWindow->loadSettings(pSettings);
pSettings->endGroup();
}
//==============================================================================
void PMRWindowPlugin::saveSettings(QSettings *pSettings) const
{
// Keep track of our PMR window settings
pSettings->beginGroup(mPmrWindowWindow->objectName());
mPmrWindowWindow->saveSettings(pSettings);
pSettings->endGroup();
}
//==============================================================================
void PMRWindowPlugin::handleUrl(const QUrl &pUrl)
{
Q_UNUSED(pUrl);
// We don't handle this interface...
}
//==============================================================================
// Window interface
//==============================================================================
Qt::DockWidgetArea PMRWindowPlugin::windowDefaultDockArea() const
{
// Return our default dock area
return Qt::LeftDockWidgetArea;
}
//==============================================================================
QAction * PMRWindowPlugin::windowAction() const
{
// Return our window action
return mPmrWindowAction;
}
//==============================================================================
QDockWidget * PMRWindowPlugin::windowWidget() const
{
// Return our window widget
return mPmrWindowWindow;
}
//==============================================================================
} // namespace PMRWindow
} // namespace OpenCOR
//==============================================================================
// End of file
//==============================================================================
| [
"agarny@hellix.com"
] | agarny@hellix.com |
c380e51e35b6624393ab4c0302240ad3c12e9831 | 78d53121b39e56b3903c8ef9a93ca2defc1c7e52 | /udpReceiver/widget.cpp | e3489e1069ecb1bdc21af4628ea3f21a1fcf38f1 | [] | no_license | idcpj/hello_qt | 622c8cd10ad463b69e00737869561063ef3059b6 | 97c38bff73176821b16a3bb662fb4e40ea31ca48 | refs/heads/master | 2023-08-11T22:35:30.597699 | 2021-10-10T03:00:17 | 2021-10-10T03:00:17 | 383,953,361 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 650 | cpp | #include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
receiver=new QUdpSocket(this);
receiver->bind(45454,QUdpSocket::ShareAddress);
connect(receiver,SIGNAL(readyRead()),this,SLOT(processPendingDatagram()));
}
Widget::~Widget()
{
delete ui;
}
void Widget::processPendingDatagram()
{
while (receiver->hasPendingDatagrams()) {
QByteArray data;
data.resize(receiver->pendingDatagramSize());
qDebug()<<"receiver:" <<receiver->readDatagram(data.data(),data.size());
ui->label->setText(data);
}
}
| [
"260083304@qq.com"
] | 260083304@qq.com |
e3972d7dc23a95167bf3f085fe13c307d64a82a7 | da7ad84936816cbf9388df36ec18aa2c2d789325 | /src/HIV/helper-ARTEligible.cpp | 9bd5f0f9e48c836c33dca2d2d510ecf173bf4b47 | [] | no_license | yaesoubilab/TBABM | 14fbf673c9b4fc8b8b1462d30dc3782ae6c7aa18 | 7c8165db1a86f2f011a10601602c46b85a7bdc90 | refs/heads/master | 2023-08-09T02:27:45.410474 | 2023-07-26T01:26:40 | 2023-07-26T01:26:40 | 114,150,710 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,062 | cpp | #include "../../include/TBABM/TBABM.h"
#include <Bernoulli.h>
using namespace StatisticalDistributions;
using EventFunc = TBABM::EventFunc;
using SchedulerT = EventQueue<double,bool>::SchedulerT;
bool TBABM::ARTEligible(int t, weak_p<Individual> idv_w)
{
// Ensure individual is still alive, and has HIV
auto idv = idv_w.lock();
if (!idv)
return true;
if (idv->dead || idv->hivStatus == HIVStatus::Negative)
return false;
int year = constants["startYear"] + (int)t/365;
bool coin = Bernoulli(0.5)(rng.mt_); // Flip a fair coin
double m_30 = params["HIV_m_30"].Sample(rng);
int CD4 = idv->CD4count(t, m_30);
bool pregnant = idv->pregnant;
if (1990 <= year && year < 2009)
return CD4 < 200;
else if (2009 == year)
return (CD4 < 200) \
|| (coin && pregnant && 200 <= CD4 && CD4 < 350);
else if (2010 == year)
return (CD4 < 200)
|| (pregnant && 200 <= CD4 && CD4 < 350);
else if (2011 == year)
return CD4 < 350;
else if (2012 <= year)
return CD4 < 350;
return false;
}
| [
"marcusrussi@gmail.com"
] | marcusrussi@gmail.com |
531d1701b9db35fb95f57bc1b25744c4ac199fd8 | a07247c9af8282e4d1ba88ba4315498d4f1d5d38 | /XTree.cpp | be202943e455d0304c7c3dd503f2a9180da565ab | [] | no_license | Rodarc20/XTree | e1943608e1f693940c306c85231506214928a590 | 2f06aea62ac7954248a1611949972451f5ba4409 | refs/heads/master | 2020-03-22T02:17:20.721499 | 2018-07-02T02:16:13 | 2018-07-02T02:16:13 | 139,297,875 | 0 | 0 | null | null | null | null | ISO-8859-10 | C++ | false | false | 8,863 | cpp | #include "stdafx.h"
#include "XTree.h"
#include <limits>
XTree::XTree(int Dimensiones) {
Dimensions = Dimensiones;
M = 4;
m = 2;
Root = nullptr;
}
XTree::XTree() {
Dimensions = 3;
M = 4;
m = 2;
Root = nullptr;
}
XTree::~XTree() {
}
Nodo * XTree::ChooseLeaf(Nodo * Data) {
Nodo * N = Root;
//return nullptr;
while (!N->bHoja) {
//busco la entrada en la que al insertar se produzca el menor enlargement, en caso de empate, escober el rectangulo que de menor area
//calrcular enlargement
//calcular area
//cambiar N por el nodo escogido, este sera el numeo N, repetir hasta que sea una hoja.
//int iMin = 100000000;
//double dMin = 100000000;//deberia ser el double maximo
//double areaMin = 100000000;
int iMin = numeric_limits<int>::max();
double dMin = numeric_limits<double>::max();
double areaMin = numeric_limits<double>::max();
for (int i = 0; i < N->Hijos.size(); i++) {
//ver que area crece mas
vector<double> DN (Dimensions);
vector<double> DP (Dimensions);
ComponerRegion(N->Hijos[i]->PointN, N->Hijos[i]->PointP, Data->PointN, Data->PointP, DN, DP);
double area = AreaRegion(DN, DP);
double d = area - N->Hijos[i]->CoverageArea();
if (d < dMin) {
iMin = i;
dMin = d;
areaMin = area;
}
else if (d == dMin) {
if (area < areaMin) {
iMin = i;
dMin = d;
areaMin = area;
}
}
}
N = N->Hijos[iMin];
}
return N;
}
Nodo * XTree::SplitNodo(Nodo * nodo) {
vector<int> seeds = PickSeeds(nodo->Hijos);
vector<Nodo *> EntradasRestantes = nodo->Hijos;
Nodo * G1 = nodo->Hijos[seeds[0]];
Nodo * G2 = nodo->Hijos[seeds[1]];
nodo->Hijos.clear();
nodo->CalcularCoverage();
Nodo * NN = new Nodo();
NN->bHoja = nodo->bHoja;
nodo->AddHijo(G1);
NN->AddHijo(G2);
NN->CalcularCoverage();
EntradasRestantes.erase(find(EntradasRestantes.begin(), EntradasRestantes.end(), G1));
EntradasRestantes.erase(find(EntradasRestantes.begin(), EntradasRestantes.end(), G2));
while (!EntradasRestantes.empty()) {
//falta un if aqui, segun el paper, es uno que conrtola que ambos grupos tenga el minimo
int next = PickNext(EntradasRestantes, nodo, NN);
Nodo * nodonext = EntradasRestantes[next];
//ver que area crece mas
vector<double> DN (Dimensions);
vector<double> DP (Dimensions);
ComponerRegion(nodo->PointN, nodo->PointP, nodonext->PointN, nodonext->PointP, DN, DP);
double area1 = AreaRegion(DN, DP);
double d1 = area1 - nodo->CoverageArea();
ComponerRegion(NN->PointN, NN->PointP, nodonext->PointN, nodonext->PointP, DN, DP);
double area2 = AreaRegion(DN, DP);
double d2 = area2 - NN->CoverageArea();
if (d1 < d2) {
nodo->AddHijo(nodonext);
nodo->CalcularCoverage();
}
else if (d2 < d1) {
NN->AddHijo(nodonext);
NN->CalcularCoverage();
}
else{
if (area1 < area2) {
nodo->AddHijo(nodonext);
nodo->CalcularCoverage();
}
else {
NN->AddHijo(nodonext);
NN->CalcularCoverage();
}
}
EntradasRestantes.erase(find(EntradasRestantes.begin(), EntradasRestantes.end(), nodonext));
}
return NN;
}
void XTree::Insert(vector<double> point) {
Nodo * Data = new Nodo(point);
if (Root == nullptr) {//caso base
Root = new Nodo();
Root->bHoja = true;
Root->AddHijo(Data);
AdjustTree(Root, nullptr);
return;
}
Nodo * N = ChooseLeaf(Data);//quiza deberia recibir Data para que ese chooseleaf trabaje con rectangulos no con punto
//add record to leaf
if (N->Hijos.size() < M) {
//insertar
N->AddHijo(Data);//se entiende que n es una hoja
AdjustTree(N, nullptr);
}
else {
N->AddHijo(Data);//se entiende que n es una hoja
Nodo * NN = SplitNodo(N);
//inserta en N y NN
AdjustTree(N, NN);
//NN es unido al padre dengro de la funcion adjustTree
}
//Propagar el split si es necesario
}
void XTree::AdjustTree(Nodo * N, Nodo * NN) {
//como esta funcion solo se llama al insertar un nuevo punto, y se llama despues de agregar un hijo a un nodo, puedo hacer aqui la actualizacion del overage, en lugar de la funcion addHijo
//actualizar el covering rectangle
N->CalcularCoverage();//hace lo que el for comentado
if (Root == N) {//o si N no tiene padre
if (NN) {//nuevonivel
Root = new Nodo;
Root->AddHijo(N);
Root->AddHijo(NN);
Root->CalcularCoverage();
}
return;
}
if (NN) {
Nodo * P = N->Padre;
if (P->Hijos.size() < M) {
//insertar
P->AddHijo(NN);
AdjustTree(P, nullptr);
}
else {
P->AddHijo(NN);
Nodo * PP = SplitNodo(P);
AdjustTree(P, PP);
//y a donde debo unir NN?// lo unise al padre pero lo hace la funcion AdjustTree
}
}
else{//no hubo un split en el hijo N
Nodo * P = N->Padre;
AdjustTree(P, nullptr);
}
}
vector<int> XTree::PickSeeds(vector<Nodo*>& Entradas) {
int iMax = 0;
int jMax = 1;
double dMax = 0;
vector<double> JN (Dimensions);
vector<double> JP (Dimensions);
for (int i = 0; i < Entradas.size(); i++) {
for (int j = i + 1; j < Entradas.size(); j++) {
for (int k = 0; k < Dimensions; k++) {
if (Entradas[i]->PointN[k] < Entradas[j]->PointN[k]) {
JN[k] = Entradas[i]->PointN[k];
}
else {
JN[k] = Entradas[j]->PointN[k];
}
if (Entradas[i]->PointP[k] > Entradas[j]->PointP[k]) {
JP[k] = Entradas[i]->PointP[k];
}
else {
JP[k] = Entradas[j]->PointP[k];
}
}
//calculado J
double areaJ = AreaRegion(JN, JP);
double areaEI = Entradas[i]->CoverageArea();
double areaEJ = Entradas[j]->CoverageArea();
double d = areaJ - areaEI - areaEJ;
if (d > dMax) {
dMax = d;
iMax = i;
jMax = j;
}
}
}
vector<int>res;
res.push_back(iMax);
res.push_back(jMax);
return res;
}
int XTree::PickNext(vector<Nodo*>& Entradas, Nodo * G1, Nodo * G2) {
vector<double> d1s(Entradas.size(), 0);
vector<double> d2s(Entradas.size(), 0);
int iMax = 0;
double dMax = 0;
for (int i = 0; i < Entradas.size(); i++) {
vector<double> DN (Dimensions);
vector<double> DP (Dimensions);
ComponerRegion(G1->PointN, G1->PointP, Entradas[i]->PointN, Entradas[i]->PointP, DN, DP);
double d1 = AreaRegion(DN, DP) - G1->CoverageArea();
ComponerRegion(G2->PointN, G2->PointP, Entradas[i]->PointN, Entradas[i]->PointP, DN, DP);
double d2 = AreaRegion(DN, DP) - G2->CoverageArea();
double d = abs(d1 - d2);
if (d > dMax) {
dMax = d;
iMax = i;
}
}
return iMax;//retornar el i con la diferencia maxima, ese es el indicie de las entradas que debo escoger como siguiente
}
void XTree::ComponerRegion(vector<double> & R1N, vector<double> & R1P, vector<double> & R2N, vector<double> & R2P, vector<double>& RN, vector<double>& RP) {//evitar recibir copias
for (int i = 0; i < R1N.size(); i++) {
if (R1N[i] < R2N[i]) {
RN[i] = R1N[i];
}
else {
RN[i] = R2N[i];
}
if (R1P[i] > R2P[i]) {
RP[i] = R1P[i];
}
else {
RP[i] = R2P[i];
}
}
}
double XTree::AreaRegion(vector<double> & N, vector<double> & P) {
double acum = 1;
for (int i = 0; i < N.size(); i++) {//pintLu tiene el mismo tamaņo que potinRB y data point
//tener cuidado con el sistema de coordenas, de pronto alguno tiene el ordn invertido, es decir Point LU podria estar en los negativos en un eje, pero podria estar en los positivos en otro eje,
//lo importante es que LU y RB son vertices opuestos del hypercubo, les cambiare el nombre
acum *= P[i] - N[i];
}
return acum;
}
void XTree::Imprimir() {
Root->Imprimir(0);
}
string XTree::Identacion(int Tam) {
return string(Tam * 4, ' ');
}
| [
"rodrigo.gutierrez.k@gmail.com"
] | rodrigo.gutierrez.k@gmail.com |
f10c0468e7a7a2e34ec6f259f7947516ef7c1f1b | b212afc0b36b0aca92671cc16f1a1e46fc332fac | /users.h | 99839251eaf3031f3fe74f380e36270215ef74e2 | [] | no_license | rayyanahmed021/tic-tac-toe | b1c850fe98bf45b66a470d19a4b8eaefe279d277 | b4c5beffc5cd774e4405102b456a4f78c2e4e1f1 | refs/heads/main | 2023-07-25T06:10:25.715691 | 2021-09-03T11:19:18 | 2021-09-03T11:19:18 | 399,922,700 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,228 | h | /*
===============================
Author: Rayyan Ahmed
Date: 28/8/2021
Module: Users
Project: tic-tac-toe
===============================
*/
#ifndef USERS_H
#define USERS_H
#include <occi.h>
using oracle::occi::Environment;
using oracle::occi::Connection;
using namespace oracle::occi;
template <typename type>
void removeDynamicElement(type* array[], int index, int& size)
{
delete array[index];
for (int j = index; j < size - 1; j++)
{
array[j] = array[j + 1];
array[j]->setID(j + 1);
}
size--;
}
class Users
{
int id;
char* username{ nullptr };
char* pass{ nullptr };
int win = 0;
int loss = 0;
int draws = 0;
public:
//constructors
Users(int id, const char* name, const char* password);
Users(const char* name, const char* password, int w, int l, int d, int idNumber);
Users();
~Users();
//modifiers
void setPassword(const char* password);
void setName(const char* name);
void updateScore(char winloss);
void setID(int idNum);
//queries
char* name()const;
char* password()const;
int score(char winloss)const;
void displayScore() const;
void updateDatabase(Connection* conn)const;
Users& operator = (const Users&) = delete;
Users(const Users&) = delete;
};
#endif // !USERS_H | [
"rayyanahmed021@hotmail.com"
] | rayyanahmed021@hotmail.com |
f894f6ff2592b2b8c3a5ea73b0017128e6e3b91c | c670ed99cb700fe3fa389026601efbb1c51b4278 | /IntegerSetTest.cpp | 69e01dff0609b249814bd1bc9c1c1a5ff3586845 | [] | no_license | davidbethke/integerSet | 714e53aaf719cd91158ee14d883e93dcdf17602b | 6bc087cd790d2ef6e08fc64e112542aac70e2b13 | refs/heads/master | 2020-05-16T20:52:01.839932 | 2012-02-08T07:57:42 | 2012-02-08T07:57:42 | 3,384,398 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,230 | cpp | #include "StdAfx.h"
#include "IntegerSetTest.h"
#include <string>
#include <iostream>
#include <sstream>
using namespace std;
IntegerSetTest::IntegerSetTest(void)
{
}
IntegerSetTest::~IntegerSetTest(void)
{
}
void IntegerSetTest::even(IntegerSet & evenSet)
{
//set even to evens
for(int i=0; i<evenSet.SIZE;++i)
{
if(!(i%2))
evenSet.v[i]=true;
}
// set 0 to FALSE
evenSet.v[0]=true;
}
void IntegerSetTest::odd(IntegerSet & oddSet)
{
//set even to evens
for(int i=0; i<oddSet.SIZE;++i)
{
if((i%2))
oddSet.v[i]=true;
}
// set 0 to FALSE
oddSet.v[0]=true;
}
void IntegerSetTest::oString(string& oS)
{
oS="0 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 ";
}
void IntegerSetTest::eString(string& eS)
{
eS="0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 ";
}
TEST_F(IntegerSetTest, testEmpty)
{
for (int i=0; i<101; ++i)
EXPECT_FALSE(v.v[i])<< "Element:"<<i<<" Fail";
}
TEST_F(IntegerSetTest,testOneVal)
{
int iR=rand()%100;
v.v[iR]=true;
for (int i=0; i<101; ++i)
if(i==iR)
EXPECT_TRUE(v.v[i])<<"Element:"<<i<<" Fail";
else
EXPECT_FALSE(v.v[i])<< "Element:"<<i<<" Fail";
}
TEST_F(IntegerSetTest,testMultVal)
{
v.v[0]=v.v[1]=v.v[20]=v.v[44]=v.v[56]=v.v[100]=true;
for (int i=0; i<101; ++i)
if(i==0 || i==1 || i==20 || i==44 || i==56 || i==100)
EXPECT_TRUE(v.v[i])<< "Element:"<<i<<" Fail";
else
EXPECT_FALSE(v.v[i])<< "Element:"<<i<<" Fail";
}
TEST_F(IntegerSetTest,testPrintOneVal)
{
std::ostringstream oss;
std::streambuf* p_cout_streambuf = std::cout.rdbuf();
std::cout.rdbuf(oss.rdbuf());
v.v[0]=true;
v.printSet();
std::cout.rdbuf(p_cout_streambuf); // restore
EXPECT_EQ("0 \n",oss.str());
}
TEST_F(IntegerSetTest,testPrintMultVal)
{
std::ostringstream oss;
std::streambuf* p_cout_streambuf = std::cout.rdbuf();
std::cout.rdbuf(oss.rdbuf());
v.v[0]=v.v[1]=v.v[20]=v.v[44]=v.v[56]=v.v[100]=true;
v.printSet();
std::cout.rdbuf(p_cout_streambuf); // restore
EXPECT_EQ("0 1 20 44 56 100 \n",oss.str());
}
TEST_F(IntegerSetTest,insertOneElement)
{
v.insertElement(0);
EXPECT_TRUE(v.v[0])<< "Element 0 Not set";
}
TEST_F(IntegerSetTest,insertElementAgain)
{
v.insertElement(0);
EXPECT_TRUE(v.v[0])<< "Element 0 Not set";
v.insertElement(0);
EXPECT_TRUE(v.v[0])<< "Not inserted a Second Time";
}
TEST_F(IntegerSetTest,insertElement100)
{
v.insertElement(100);
EXPECT_TRUE(v.v[100])<< "Not inserted at element 100";
}
TEST_F(IntegerSetTest,insertOutOfBounds)
{
v.insertElement(-1);
v.insertElement(101);
std::cout.rdbuf(oss.rdbuf());
v.printSet();
EXPECT_EQ("\n",oss.str());
}
TEST_F(IntegerSetTest,unionTest1)
{
IntegerSet unionSet;
//set v to evens
for(int i=0; i<v.SIZE;++i)
{
if(!(i%2))
v.v[i]=true;
}
// set 0 to FALSE
v.v[0]=true;
//set v2 to odds
for(int i=0; i<v2.SIZE;++i)
{
if(i%2)
v2.v[i]=true;
}
// set 0 to FALSE
v2.v[0]=false;
unionSet=v.unionOfSets(v2);
std::cout.rdbuf(oss.rdbuf());
v.printSet();
EXPECT_EQ(evenString + "\n",oss.str())<< "Expected All Even Vals";
v2.printSet();
//EXPECT_EQ(evenString+"\n"+ oddString + "\n",oss.str())<< "Expected All Odd Vals"; //hack, need to figure out how to clear the buffer DISABLE
//inspect vals of unionSet as a doubleCheck
for(int i=0; i<unionSet.SIZE;++i)
EXPECT_TRUE(unionSet.v[i])<< "Element:"<<i<<" Fail, Should be TRUE";
}
TEST_F(IntegerSetTest,evenTestManual)
{
for(int i=0; i<v.SIZE;++i)
{
if(!(i%2))
v.v[i]=true;
}
// set 0 to FALSE
v.v[0]=true;
for(int i=0; i<v.SIZE;++i)
{
if(!(i%2))
EXPECT_TRUE(v.v[i])<< "Element:"<<i<<" Fail, Should be TRUE";
else
EXPECT_FALSE(v.v[i])<< "Element:"<<i<<" Fail, Should be FALSE";
}
}
TEST_F(IntegerSetTest,evenTest)
{
for(int i=0; i<evenSet.SIZE;++i)
{
if(!(i%2))
EXPECT_TRUE(evenSet.v[i])<< "Element:"<<i<<" Fail, Should be TRUE";
else
EXPECT_FALSE(evenSet.v[i])<< "Element:"<<i<<" Fail, Should be FALSE";
}
}
//UnionTest2
TEST_F(IntegerSetTest,unionTest2)
{
IntegerSet unionSet;
IntegerSet emptySet;
unionSet=evenSet.unionOfSets(emptySet);
for(int i=0; i<unionSet.SIZE;++i)
{
if(!(i%2))//even
EXPECT_TRUE(unionSet.v[i])<<"Element:"<<i<<" Fail, Should be TRUE";
else
EXPECT_FALSE(unionSet.v[i])<< "Element:"<<i<<" Fail, Should be FALSE";
}
}
TEST_F(IntegerSetTest,intersectionTest1)
{
IntegerSet intersectionSet;
intersectionSet=evenSet.intersectionOfSets(oddSet);
EXPECT_TRUE(intersectionSet.v[0])<<"Element: 0 should be TRUE";
for(int i=1; i<intersectionSet.SIZE;++i)
{
EXPECT_FALSE(intersectionSet.v[i])<<"Element:"<<i<<" should be FALSE";
}
}
TEST_F(IntegerSetTest,intersectionTest2)
{
IntegerSet intersectionSet;
intersectionSet=evenSet.intersectionOfSets(evenSet2);
for(int i=0;i<intersectionSet.SIZE;++i)
{
if(!(i%2))
EXPECT_TRUE(intersectionSet.v[i])<<"Element:"<<i<<" should be TRUE";
else
EXPECT_FALSE(intersectionSet.v[i])<<"Element:"<<i<<"should be FALSE";
}
}
TEST_F(IntegerSetTest,intersectionTest3)
{
IntegerSet intersectionSet;
IntegerSet emptySet;
intersectionSet=oddSet.intersectionOfSets(emptySet);
for(int i=0; i<intersectionSet.SIZE;++i)
{
EXPECT_FALSE(intersectionSet.v[i])<<"Element:"<<i<<" should be FALSE";
}
}
TEST_F(IntegerSetTest,deleteSingleElement)
{
IntegerSet mySet;
int i=rand()%100;
mySet.insertElement(i);
EXPECT_TRUE(mySet.v[i])<<"Element:"<<i<<" should be TRUE";
mySet.deleteElement(i);
EXPECT_FALSE(mySet.v[i])<<"Element:"<<i<<" should be FALSE";
}
TEST_F(IntegerSetTest,deleteMultElement)
{
//verify evenSET
for(int i=0; i<evenSet.SIZE;++i)
{
if(!(i%2))
EXPECT_TRUE(evenSet.v[i])<<"Element:"<<i<<" should be TRUE";
else
EXPECT_FALSE(evenSet.v[i])<<"Element:"<<i<<" should be FALSE";
}
for(int i=0; i<evenSet.SIZE;++i)
evenSet.deleteElement(i);
for(int i=0;i<evenSet.SIZE;++i)
EXPECT_FALSE(evenSet.v[i])<<"Element:"<<i<<" should be FALSE (deleted)";
}
TEST_F(IntegerSetTest,opOS)
{
std::cout.rdbuf(oss.rdbuf());
std::cout << evenSet;
EXPECT_EQ(evenString+"\n",oss.str())<<"Expect even vals";
}
TEST_F(IntegerSetTest,opPipe)
{
IntegerSet unionSet;
unionSet=evenSet | oddSet;
for(int i=0; i< unionSet.SIZE;++i)
EXPECT_TRUE(unionSet.v[i])<<"Element:"<<i<<" should be TRUE";
}
TEST_F(IntegerSetTest,opAmpersand)
{
IntegerSet unionSet;
IntegerSet emptySet;
unionSet=evenSet & emptySet;
for(int i=0; i< unionSet.SIZE;++i)
EXPECT_FALSE(unionSet.v[i])<<"Element:"<<i<<" should be FALSE";
}
TEST_F(IntegerSetTest,opEqual)
{
EXPECT_TRUE(evenSet==evenSet)<<"Expect TRUE, evenSet";
EXPECT_TRUE(evenSet==evenSet2)<<"Expect TRUE, evenSet";
EXPECT_FALSE(evenSet==oddSet)<<"Expect FALSE, evenSet/oddSet";
}
TEST_F(IntegerSetTest,opIns)
{
EXPECT_FALSE(evenSet.v[99])<<"Expect FALSE, insertElement op += at 99, precondition";
evenSet+=99;
EXPECT_TRUE(evenSet.v[99])<<"Expect TRUE, insertElement op += at 99";
}
TEST_F(IntegerSetTest,opDel)
{
EXPECT_TRUE(evenSet.v[98])<<"Expect TRUE, insertElement op -= at 98, precondition";
evenSet-=98;
EXPECT_FALSE(evenSet.v[98])<<"Expect FALSE, insertElement op -= at 98";
}
| [
"david.bethke@gmail.com"
] | david.bethke@gmail.com |
053e0c2de9659454ae0d50c09dc1265675918531 | 0008a76e151837b35645296649ccdbca772b464b | /ImClient/ImClient/NormaMsgCollection.h | f93aac87ce4adfafb470207610f22f3d33320809 | [] | no_license | yuechuanbingzhi163/IMClient | 952add8364132f707dc3b413e780142c86926401 | 06197a859ca02fd01ba8429365be86f12dc0a879 | refs/heads/master | 2020-12-03T04:10:10.153459 | 2014-12-14T04:16:25 | 2014-12-14T04:16:25 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 693 | h | #pragma once
#include "NormalMsg.h"
//将一个Vectore或者Map写在类中便于指针的管理
//
class NormaMsgCollection
{
public:
NormaMsgCollection(void);
~NormaMsgCollection(void);
vector <NormalMsg*>& GetMessageCollection();
vector <NormalMsg*> m_vcNormalMsg ;
};
typedef std::map<std::string , NormaMsgCollection*> MAP_STRING_PNORMALMSGCOLLECTION ;
class NormaMsgCollectionBase
{
public:
NormaMsgCollectionBase();
virtual ~NormaMsgCollectionBase();
MAP_STRING_PNORMALMSGCOLLECTION& GetMesageCollectionMap();
public:
virtual void Insert(NormalMsg* p);
void EraseAndRelease(MAP_STRING_PNORMALMSGCOLLECTION::iterator it);
MAP_STRING_PNORMALMSGCOLLECTION m_normalmsgMap;
};
| [
"z-jming@163.com"
] | z-jming@163.com |
1c29f0e7f3c65b8a790c955c56719ca9399279ad | 86b1e4f77f29d5903c5761203de963c43e5d896a | /functions/keygen/keygen_main.cpp | 643a37a948baf1231fd7534aa6f6f8614ab86101 | [] | no_license | diorcety/akt | 3bbe8c1240d498e7dbd8963aa763a6ea999b4eeb | 27693ef227a37d5888e8191298b1af0bf003b4cb | refs/heads/master | 2021-01-22T06:54:52.154158 | 2017-02-13T07:24:12 | 2017-02-13T07:24:44 | 81,795,586 | 0 | 0 | null | 2017-02-13T07:09:33 | 2017-02-13T07:09:33 | null | UTF-8 | C++ | false | false | 33,338 | cpp | #include "keygen_main.h"
const int primeoffsetcount = 9, primeoffsets[] = { 15, 15, 21, 81, 3103, 3643, 2191, 9691, 2887 };
/*
---------
CreateKey
---------
This is the only function that needs to be externally visible for unsigned
keys. The "regname" parameter is the name of the person to make the key for;
it's used as the encryption key for the other information.
The "keytext" parameter is the "encryption template" for the appropriate
security certificate -- see the Armadillo documentation for details.
The "otherinfo" parameter can specify the number of days and/or uses this
key permits, or the expiration date of the key (in days since 01Jan1999),
or the version number to expire on, or the number of copies to allow. The
meaning depends on the certificate. In most cases, the certificate itself
will specify values for these parameters, and you can leave this at zero.
If the certificate specifies values for these parameters, the "otherinfo"
is ignored.
hardwareID is used only for hardware-locked certificates, and can be set to
zero for anything else.
The only cautions for this function... it expects both "regname" and
"keytext" to be less than 256 bytes, in the calls to CookText(). You may
wish to confirm that before calling CreateKey().
To confirm it: CreateKey("Chad Nelson", "Testing", 14, 0) should return a
key of F806-3E6F-0A27-D091 on 20Jan1999.
*/
const char* CreateKey(unsigned int symmetric_key, unsigned int sym_xor, const char* regname, unsigned short otherinfo, unsigned long hardwareID, short today, HWND log)
{
static char returntext[25];
CipherKey* cipherkey;
unsigned long k[2];
char cooked[2048] = "";
bool first_log = true;
char log_msg[1024] = "";
if(*regname == 0)
{
AddLogMessage(log, "This level does not support nameless keys...", true);
return "";
}
k[0] = symmetric_key;
if(sym_xor)
{
AddLogMessage(log, "Symmetric key changes:", true);
sprintf(log_msg, "%.8X^%.8X=%.8X (sym^xorval=newsym)", (unsigned int)k[0], (unsigned int)sym_xor, (unsigned int)(k[0]^sym_xor));
AddLogMessage(log, log_msg, false);
k[0] ^= sym_xor;
first_log = false;
}
if(hardwareID)
{
if(first_log)
AddLogMessage(log, "Symmetric key changes:", true);
sprintf(log_msg, "%.8X^%.8X=%.8X (sym^hwid=newsym)", (unsigned int)k[0], (unsigned int)hardwareID, (unsigned int)(k[0]^hardwareID));
AddLogMessage(log, log_msg, false);
k[0] ^= hardwareID;
first_log = false;
}
k[1] = (today << 16) | otherinfo;
ByteArray2String((unsigned char*)k, cooked, 2 * sizeof(unsigned long), 2048);
sprintf(log_msg, "KeyBytes: (Len: 8)\r\n%s", cooked);
AddLogMessage(log, log_msg, first_log);
cooked[0] = 0;
/* Encrypt the key information */
CookText(cooked, regname);
sprintf(log_msg, "Cooked name (Len: %d, 0x%X):\r\n%s", strlen(cooked), strlen(cooked), cooked);
AddLogMessage(log, log_msg, false);
cipherkey = CreateCipherKey(cooked, strlen(cooked));
Encipher(cipherkey, (char*)k, 2 * sizeof(unsigned long));
ReleaseCipherKey(cipherkey);
ByteArray2String((unsigned char*)k, cooked, 2 * sizeof(unsigned long), 2048);
sprintf(log_msg, "Enciphered KeyBytes:\r\n%s", cooked);
AddLogMessage(log, log_msg, false);
cooked[0] = 0; //TODO: remove?
/* Format and return it! */
wsprintfA(returntext, "%04X-%04X-%04X-%04X", k[0] >> 16, k[0] & 0xFFFF, k[1] >> 16, k[1] & 0xFFFF);
return returntext;
}
unsigned char* AddByte(unsigned char* c, unsigned char n)
{
*c++ = n;
return c;
}
unsigned char* AddShort(unsigned char* c, unsigned short n)
{
*c++ = (unsigned char)(n >> 8);
*c++ = (unsigned char)(n & 0xFF);
return c;
}
unsigned char* AddLong(unsigned char* c, unsigned long n)
{
*c++ = (unsigned char)(n >> 24);
*c++ = (unsigned char)(n >> 16);
*c++ = (unsigned char)(n >> 8);
*c++ = (unsigned char)(n & 0xFF);
return c;
}
void mystrrev(char* str)
{
/*
** strrev() apparently isn't part of the standard C library, or at least
** isn't supported on all platforms, because I've had reports that it
** isn't available on some. So I wrote this function to replace it.
*/
char tmp, *s1, *s2;
s1 = str;
s2 = strchr(str, 0) - 1;
while(s1 < s2)
{
tmp = *s1;
*s1 = *s2;
*s2 = tmp;
++s1;
--s2;
}
}
CRC32 GetKeyCRC(char* keytext, int period)
{
char cooked[2048], temp[2048], *s, *t;
int x, y, len;
CookText(cooked, keytext);
if(period == 1)
{
/* Just reverse the string. strrev() is apparently not supported on
some CGI systems, so I've written my own version here. */
strcpy(temp, cooked);
t = cooked;
s = strchr(temp, 0) - 1;
while(s >= temp) *t++ = *s--;
*t = 0;
}
else if(period > 1)
{
/* Start at the beginning and split the keytext into groups of 'period'
letters. Reverse each group. */
strcpy(temp, cooked);
t = cooked;
len = strlen(cooked);
for(x = 0; x < (len / period); ++x)
{
s = temp + (x * period);
for(y = period - 1; y >= 0; --y) *t++ = *(s + y);
}
/* Now reverse the last group, if there are any characters that haven't
been handled yet. */
if((len % period) != 0)
{
s = temp + len - 1;
for(y = 0; y < len % period; ++y) *t++ = *(s - y);
}
*t = 0;
}
return crc32(cooked, strlen(cooked), NewCRC32);
}
void GetKeyMD5(unsigned long* i, const char* keytext, int period)
{
char cooked[2048];
int len, x, y;
CookText(cooked, keytext);
if(period == 1)
{
mystrrev(cooked);
}
else if(period > 1)
{
/*
** Start at the beginning and split the keytext into groups of 'period'
** letters. Reverse each group.
*/
char temp[2048], *s, *t;
strcpy(temp, cooked);
t = cooked;
len = strlen(cooked);
for(x = 0; x < (len / period); ++x)
{
s = temp + (x * period);
for(y = period - 1; y >= 0; --y) *t++ = *(s + y);
}
/*
** Now reverse the last group, if there are any characters that haven't
** been handled yet.
*/
if((len % period) != 0)
{
s = temp + len - 1;
for(y = 0; y < len % period; ++y) *t++ = *(s - y);
}
*t = 0;
}
md5(i, cooked, strlen(cooked));
}
void GenerateKeyNumberFromString(char* string, BigInt p, BigInt* keynumber, int keysystem, int v3level)
{
unsigned long i[4], current[4] = {0, 0, 0, 0};
BigInt n, n2, n3, exp;
int x, y;
n = BigInt_Create();
if(keysystem == KS_SHORTV3)
{
/* The ShortV3 key system uses shorter numbers than the standard v3
system, but longer ones than the v2 system. ShortV3 numbers are also
generated using MD5 instead of CRC32. */
for(x = 0; x < 4; ++x)
{
GetKeyMD5(i, string, x + 2);
for(y = 0; y < 4; ++y) current[y] ^= i[y];
}
n2 = BigInt_Create();
n3 = BigInt_Create();
for(x = 0; x < 4; ++x)
{
BigInt_Shift(n, 32, n2);
BigInt_SetU(n3, current[x]);
BigInt_Add(n2, n3, n);
}
BigInt_Modulus(n, p, *keynumber);
BigInt_Destroy(n3);
BigInt_Destroy(n2);
}
else if(keysystem == KS_V3)
{
/* v2 keys are based on 32 bit numbers; v3 keys use much larger ones,
32 additional bits per level. */
n2 = BigInt_Create();
n3 = BigInt_Create();
exp = BigInt_Create();
BigInt_SetU(n, GetKeyCRC(string, 1));
BigInt_Copy(exp, n);
for(x = 0; x < v3level; ++x)
{
BigInt_Shift(n, 32, n2);
BigInt_SetU(n3, GetKeyCRC(string, x + 2));
BigInt_Add(n2, n3, n);
}
BigInt_PowerModulus(n, exp, p, *keynumber);
BigInt_Destroy(exp);
BigInt_Destroy(n3);
BigInt_Destroy(n2);
}
else
{
/* V2 keys */
BigInt_SetU(n, GetKeyCRC(string, 1));
BigInt_PowerModulus(n, n, p, *keynumber);
}
BigInt_Destroy(n);
}
int MakeEccSignature(unsigned char* keybytes, int* keylength, char* name_to_make_key_for, int level, char* prvt_text, char* public_text, bool baboon, HWND log)
{
EC_PARAMETER Base;
EC_KEYPAIR Signer;
SIGNATURE signature;
char tmp[2048], tmp2[2048], encryption_template[2048], log_msg[1024] = "";
unsigned long x, basepointinit;
unsigned char* c;
BigInt stemp = BigInt_Create();
BigInt stemp2 = BigInt_Create();
BigInt stemp3 = BigInt_Create();
BigInt stemp4 = BigInt_Create();
/* Level 29 (ShortV3 Level 10) is the only level that uses this format. */
if(level != 29)
return 0;
/* Create the message to be signed. That will be the current contents of
'keybytes' plus the name we're making the key for, not including the
terminating 0. */
CookText(tmp, name_to_make_key_for);
sprintf(log_msg, "Cooked Name (Len: %d, 0x%X):\r\n%s", strlen(tmp), strlen(tmp), tmp);
AddLogMessage(log, log_msg, false);
memcpy(tmp2, keybytes, *keylength);
memcpy(tmp2 + (*keylength), tmp, strlen(tmp));
int msg_len = *keylength + strlen(tmp);
sprintf(log_msg, "Message (Len: %d, 0x%X):", msg_len, msg_len);
AddLogMessage(log, log_msg, false);
ByteArray2String((unsigned char*)tmp2, log_msg, msg_len, 1024);
AddLogMessage(log, log_msg, false);
int old_keylen = *keylength;
if(!baboon)
{
/* Initialize the ECC system with the base-point and cooked encryption
template. */
char basepoint_text[10] = "";
char pubx[100] = "", puby[100] = "";
char* pubs = public_text;
while(*pubs != ',')
{
sprintf(basepoint_text, "%s%c", basepoint_text, *pubs);
pubs++;
}
pubs++;
while(*pubs != ',')
{
sprintf(pubx, "%s%c", pubx, *pubs);
pubs++;
}
pubs++;
strcpy(puby, pubs);
sscanf(basepoint_text, "%lu", &basepointinit);
ECC_Initialize(&Base, &Signer, basepointinit, encryption_template, prvt_text, pubx, puby);
/* Create the signature. */
BigInt_Set(stemp, 1);
BigInt_Shift(stemp, 112, stemp4);
while(1)
{
ECC_MakeSignature(tmp2, msg_len, &Base, &Signer.prvt_key, &signature, log);
/* The signature is now in two FIELDs. Convert them to a single
BigNumber and write it into the key. I'm reserving 112 bits for each,
the exact amount that should be needed... we should probably allow for
113, to be on the safe side, but 112 comes out to an even 28 bytes of
signature. To ensure that everything fits, we'll check the signature
parts after we create them, and try again with a different random point
if either of them are too big. */
FieldToBigInt(&signature.c, stemp3);
if(BigInt_Compare(stemp3, stemp4) > 0)
continue;
BigInt_Shift(stemp3, 112, stemp2);
FieldToBigInt(&signature.d, stemp3);
if(BigInt_Compare(stemp3, stemp4) > 0)
continue;
BigInt_Add(stemp3, stemp2, stemp);
break;
}
c = keybytes + (*keylength);
BigInt_Set(stemp3, 0xFF);
for(x = 0; x < 28; ++x)
{
BigInt_And(stemp, stemp3, stemp2);
c = AddByte(c, (unsigned char)BigInt_GetU(stemp2));
BigInt_Shift(stemp, -8, stemp2);
BigInt_Copy(stemp, stemp2);
}
*keylength = (c - keybytes);
}
else
{
String2ByteArray("73EA6DAF91BFFDFFFFFFFFFFFFFF192B24A1DC800400000000000000", keybytes + old_keylen, 28);
*keylength += 28;
}
AddLogMessage(log, "Signature (Len: 28, 0x1C):", false);
ByteArray2String(keybytes + old_keylen, log_msg, 28, 1024);
AddLogMessage(log, log_msg, false);
BigInt_Destroy(stemp4);
BigInt_Destroy(stemp3);
BigInt_Destroy(stemp2);
BigInt_Destroy(stemp);
return 1;
}
int MakeSignature(unsigned char* keybytes, int* keylength, char* name_encryptkey, int level, char* pvt_kg_txt, char* y_kg_txt, bool baboon, HWND log)
{
BigInt message, p, p1, pub, pvt, y, temp, temp2, temp3, a, b, k, c1, c2;
char tmp[2048], tmp2[2048];
int size, x, keysystem;
unsigned long i[4], ksource = 0;
unsigned char* c;
CRC32 crc;
char log_msg[1024] = "";
/* What kind of key is it? */
if(level == 29)
{
/* If the signature level is 29, it's ShortV3 Level 10. That level is
different from other signed keys; it uses ECC-DSA for the signature,
rather than standard Elgamal. */
return MakeEccSignature(keybytes, keylength, name_encryptkey, level, pvt_kg_txt, y_kg_txt, baboon, log);
}
else if(level >= 20)
{
keysystem = KS_SHORTV3;
level = level - 20;
/* Standard ShortV3 keys can have signature levels 1 through 9 (or
rather, 0..8) */
if(level > 8)
return 0;
}
else if(level >= 10)
{
keysystem = KS_V3;
level = level - 10;
/* V3 keys can now have signature levels 1 through 9 (or rather, 0..8) */
if(level > 8)
return 0;
}
else
{
/* V2 keys can only have signature levels 1 through 4 (or rather, 0..3) */
keysystem = KS_V2;
if(level < 0 || level > 3)
return 0;
}
size = level + 4;
message = BigInt_Create();
p = BigInt_Create();
p1 = BigInt_Create();
pub = BigInt_Create();
pvt = BigInt_Create();
y = BigInt_Create();
temp = BigInt_Create();
temp2 = BigInt_Create();
temp3 = BigInt_Create();
a = BigInt_Create();
b = BigInt_Create();
k = BigInt_Create();
c1 = BigInt_Create();
c2 = BigInt_Create();
/*
** First we make the "message" that we're going to use. This is much larger
** for v3 keys than it was previously. ShortV3 keys sign the MD5 of the
** message instead of the message itself -- more efficient that way.
*/
CookText(tmp, name_encryptkey);
sprintf(log_msg, "Cooked Name (Len: %d, 0x%X):\r\n%s", strlen(tmp), strlen(tmp), tmp);
AddLogMessage(log, log_msg, false);
if(keysystem == KS_SHORTV3)
{
memcpy(tmp2, keybytes, *keylength);
memcpy(tmp2 + (*keylength), tmp, strlen(tmp));
md5(i, tmp2, (*keylength) + strlen(tmp));
for(x = 0; x < 4; ++x)
{
BigInt_Shift(message, 32, temp2);
BigInt_SetU(temp3, i[x]);
BigInt_Add(temp2, temp3, message);
}
}
else if(keysystem == KS_V3)
{
BigInt_SetU(message, crc32((char*)keybytes, *keylength, NewCRC32));
for(x = 0; x < level + 1; ++x)
{
BigInt_Shift(message, 32, temp2);
BigInt_SetU(temp3, GetKeyCRC(tmp, x));
BigInt_Add(temp2, temp3, message);
}
}
else
{
crc = crc32(tmp, strlen(tmp), NewCRC32);
crc = crc32((char*)keybytes, *keylength, crc);
BigInt_SetU(message, crc);
}
AddLogMessage(log, "Signature message:", false);
BigInt_ToString(message, 16, log_msg);
AddLogMessage(log, log_msg, false);
/* Now we grab a large prime number. Armadillo uses several precalculated
primes, based on the level (size). */
BigInt_Set(temp, 1);
BigInt_Shift(temp, size * 8, p);
BigInt_Set(temp, primeoffsets[level]);
BigInt_Add(p, temp, temp2);
BigInt_Copy(p, temp2);
BigInt_Subtract(p, BigInt_One(), p1);
/*BigNumber(2).Power((level+4)*8)+primeoffsets[level];*/
AddLogMessage(log, "Large prime number:", false);
BigInt_ToString(p, 16, log_msg);
AddLogMessage(log, log_msg, false);
/* Generate the public and private keys, and the 'y' value */
sprintf(tmp, "%u Level Public Key", level);
GenerateKeyNumberFromString(tmp, p, &pub, keysystem, ((keysystem == KS_V3 || keysystem == KS_SHORTV3) ? level + 1 : 0));
AddLogMessage(log, "Public Key:", false);
BigInt_ToString(pub, 16, log_msg);
AddLogMessage(log, log_msg, false);
GenerateKeyNumberFromString(tmp, p, &pvt, keysystem, ((keysystem == KS_V3 || keysystem == KS_SHORTV3) ? level + 1 : 0));
BigInt_FromString(pvt_kg_txt, 16, pvt);
BigInt_PowerModulus(pub, pvt, p, y);
BigInt_FromString(y_kg_txt, 16, y);
/* Get random value for k -- must remain secret! Prepare to repeat if necessary. */
if(!ksource)
ksource = GetRandomSeed();
sprintf(tmp, "%.8X", (unsigned int)ksource);
sprintf(log_msg, "Random Seed:\r\n%s", tmp);
AddLogMessage(log, log_msg, false);
while(1)
{
BigInt_Set(temp, 0);
for(x = 0; x < 5; ++x)
{
BigInt_Shift(temp, 4, temp2);
BigInt_SetU(temp3, GetKeyCRC(tmp, x + 2));
BigInt_Add(temp2, temp3, temp);
};
BigInt_Modulus(temp, p, k); /* Make sure it's less than 'p' */
/* If k and p1 have a common factor, it won't work. Check for it. */
while(1)
{
BigInt_GCD(k, p1, temp);
if(BigInt_Compare(temp, BigInt_One()) == 0)
break;
BigInt_Add(k, BigInt_One(), temp);
BigInt_Copy(k, temp);
if(BigInt_Compare(k, p) >= 0)
BigInt_Set(k, 3);
}
/* Make signature, 'a' and 'b' parts. */
BigInt_PowerModulus(pub, k, p, a);
BigInt_Multiply(pvt, a, temp);
BigInt_Subtract(message, temp, temp2); /*temp2=(message-(pvt*a))*/
BigInt_ModularInverse(k, p1, b); /*b=ModularInverse(k, p-1)*/
/* Check it! We shouldn't have to, but there used to be a rare bug in
the BigInt_ModularInverse function... about one out of every 224 times,
it would return an inverse that wasn't right. Should be fixed now, so
this code shouldn't be necessary, but it doesn't impact the speed very
much, so we've left it in here as a "belt and suspenders" fix. */
BigInt_Multiply(k, b, temp);
BigInt_Modulus(temp, p1, temp3);
if(!BigInt_Compare(temp3, BigInt_One()) == 0)
{
#ifdef DEBUG
printf("ModularInverse returned the wrong answer!\n");
BigInt_Dump(k, "k");
BigInt_Dump(p1, "p1");
#endif
continue;
}
BigInt_Multiply(b, temp2, temp); /*temp=b*temp2*/
BigInt_Modulus(temp, p1, b); /*b=temp%(p-1)*/
/*b=((message-(pvt*a))*BigNumber::ModularInverse(k, p-1)).Mod(p-1);*/
/* Check the size of the parts. */
BigInt_Set(temp, 256);
BigInt_Shift(BigInt_One(), size * 8, temp2);
if(BigInt_Compare(a, temp) >= 0 && BigInt_Compare(a, temp2) < 0 && BigInt_Compare(b, temp) >= 0 && BigInt_Compare(b, temp2) < 0)
{
/* Check the signature, to ensure it's okay. Not needed, it's just
here for debugging purposes. */
/*
BigInt_PowerModulus(y, a, p, c1);
BigInt_PowerModulus(a, b, p, temp);
BigInt_Multiply(temp, c1, temp2);
BigInt_Modulus(temp2, p, c1);
BigInt_PowerModulus(pub, message, p, c2);
if (BigInt_Compare(c1, c2)==0) {
printf("Signature good!\n");
break;
} else printf("Signature error!\n");
*/
break;
}
}
int oldkeylen = *keylength;
/* Write the signature into the key */
c = keybytes + (*keylength);
BigInt_Set(temp2, 0xFF);
for(x = 0; x < size; x++)
{
BigInt_And(a, temp2, temp);
c = AddByte(c, (unsigned char)BigInt_GetU(temp));
BigInt_Shift(a, -8, temp);
BigInt_Copy(a, temp);
BigInt_And(b, temp2, temp);
c = AddByte(c, (unsigned char)BigInt_GetU(temp));
BigInt_Shift(b, -8, temp);
BigInt_Copy(b, temp);
}
*keylength = (c - keybytes);
int siglen = *keylength - oldkeylen;
sprintf(log_msg, "Signature (Len: %d, 0x%X):", siglen, siglen);
AddLogMessage(log, log_msg, false);
ByteArray2String(keybytes + oldkeylen, log_msg, siglen, 1024);
AddLogMessage(log, log_msg, false);
BigInt_Destroy(c2);
BigInt_Destroy(c1);
BigInt_Destroy(k);
BigInt_Destroy(b);
BigInt_Destroy(a);
BigInt_Destroy(temp3);
BigInt_Destroy(temp2);
BigInt_Destroy(temp);
BigInt_Destroy(y);
BigInt_Destroy(pvt);
BigInt_Destroy(pub);
BigInt_Destroy(p1);
BigInt_Destroy(p);
BigInt_Destroy(message);
return 1;
}
void EncryptSignedKey(unsigned char* keybytes, int keylength, char* encryptkey, HWND log)
{
char tmp[2048] = "";
char log_msg[1024] = "";
CookText(tmp, encryptkey);
unsigned int seed = crc32(tmp, strlen(tmp), NewCRC32);
InitRandomGenerator(seed);
tmp[0] = 0;
for(int x = 0; x < keylength; x++)
{
int nextran = NextRandomRange(256);
keybytes[x] ^= nextran;
if(log)
sprintf(tmp, "%s%.2X", tmp, nextran);
}
if(log)
{
sprintf(log_msg, "NextRandomRange Array (Seed=%.8X)\r\n%s", seed, tmp);
AddLogMessage(log, log_msg, false);
}
}
const char* CreateSignedKey(int level, unsigned int symmetric_key, unsigned int sym_xor, char* pvt_kg_txt, char* y_kg_txt, char* keystring, short today, char* _name_to_make_key_for, unsigned long hardwareID, unsigned short otherinfo1, unsigned short otherinfo2, unsigned short otherinfo3, unsigned short otherinfo4, unsigned short otherinfo5, bool baboon, HWND log)
{
static char retval[1024] = "";
char name_to_make_key_for[1024] = "", *cc, *cc2, *shortv3digits = (char*)"0123456789ABCDEFGHJKMNPQRTUVWXYZ";
int otherinfocount, x, nn, dcount, keylength = 0, nameless = 0, retval_add = 0;
unsigned long symmetrickey;
unsigned char* c, keybytes[512] = {0};
BigInt n, t1, t2;
bool useskeystring = false;
bool first_log = true;
char log_msg[1024] = "";
char keystr[256] = "";
char temp[1024] = "";
/* Make a copy of the name -- might not be safe to change the original. */
if(_name_to_make_key_for)
strcpy(name_to_make_key_for, _name_to_make_key_for);
else
strcpy(name_to_make_key_for, "");
/* If the signature level is less than zero, he wants to make a v1
(unsigned) key. Route the call to that function instead, and ignore the
parameters that aren't used in that type. */
if(level < 0)
return CreateKey(symmetric_key, sym_xor, name_to_make_key_for, otherinfo1, hardwareID, today, log);
//CookText(temp, encryption_template);
if(level >= 20)
{
//ShortV3 format
//GetKeyMD5(i, temp, 0);
///Inject Symmetric Key here...
symmetrickey = symmetric_key;
//Is this a "nameless" key? If so, make up a name for it.
if(*name_to_make_key_for == 0)
{
nameless = 1;
nn = strlen(shortv3digits);
cc = name_to_make_key_for;
*cc++ = '2';
for(x = 0; x < 5; ++x)
*cc++ = shortv3digits[NextRandomRange(nn)];
*cc++ = 0;
}
}
else
{
/* V2 or conventional V3 format */
///Inject Symmetric Key here...
symmetrickey = symmetric_key;
if(*name_to_make_key_for == 0)
{
/* Can't make nameless keys for any other format. */
AddLogMessage(log, "This level does not support nameless keys...", true);
return "";
}
}
//Symmetric key mod
if(sym_xor)
{
AddLogMessage(log, "Symmetric key changes:", true);
sprintf(log_msg, "%.8X^%.8X=%.8X (sym^xorval=newsym)", (unsigned int)symmetrickey, (unsigned int)sym_xor, (unsigned int)(symmetrickey ^ sym_xor));
AddLogMessage(log, log_msg, false);
symmetrickey ^= sym_xor;
first_log = false;
}
if(hardwareID)
{
if(first_log)
AddLogMessage(log, "Symmetric key changes:", true);
sprintf(log_msg, "%.8X^%.8X=%.8X (sym^hwid=newsym)", (unsigned int)symmetrickey, (unsigned int)hardwareID, (unsigned int)(symmetrickey ^ hardwareID));
AddLogMessage(log, log_msg, false);
symmetrickey ^= hardwareID;
first_log = false;
}
/* How many otherinfo values are we going to use? */
if(otherinfo5)
otherinfocount = 5;
else if(otherinfo4)
otherinfocount = 4;
else if(otherinfo3)
otherinfocount = 3;
else if(otherinfo2)
otherinfocount = 2;
else if(otherinfo1)
otherinfocount = 1;
else
otherinfocount = 0;
/* Put the unsigned key together */
c = keybytes;
if(otherinfocount >= 5)
c = AddShort(c, otherinfo5);
if(otherinfocount >= 4)
c = AddShort(c, otherinfo4);
if(otherinfocount >= 3)
c = AddShort(c, otherinfo3);
if(otherinfocount >= 2)
c = AddShort(c, otherinfo2);
if(otherinfocount >= 1)
c = AddShort(c, otherinfo1);
c = AddShort(c, today);
c = AddLong(c, symmetrickey);
keylength = c - keybytes;
//Append keystring
if(keystring && keystring[0])
{
strcpy(keystr, keystring);
//keystr[85]=0; //maximum 85 characters...
int len = strlen(keystr);
_strrev(keystr); //reverse bytes
memcpy(&keystr[len], &len, 1); //safe conversion
//keystr[len]=len; //set length byte
len++;
memcpy(keybytes + keylength, keystr, len); //append to the keybytes
keylength += len; //update the length
useskeystring = true;
ByteArray2String((unsigned char*)keystr, temp, len, 1024);
sprintf(log_msg, "KeyString Bytes (Len: %d, 0x%X)\r\n%s", len, len, temp);
AddLogMessage(log, log_msg, first_log);
first_log = false;
}
ByteArray2String(keybytes, temp, keylength, 1024);
sprintf(log_msg, "KeyBytes (Len: %d, 0x%X):\r\n%s", keylength, keylength, temp);
AddLogMessage(log, log_msg, first_log);
/* Encrypt the key */
EncryptSignedKey(keybytes, keylength, name_to_make_key_for, log);
ByteArray2String(keybytes, temp, keylength, 1024);
sprintf(log_msg, "Encrypted KeyBytes:\r\n%s", temp);
AddLogMessage(log, log_msg, false);
/* Now add the signature of this key. */
if(MakeSignature(keybytes, &keylength, name_to_make_key_for, level, pvt_kg_txt, y_kg_txt, baboon, log))
{
sprintf(log_msg, "Signed KeyBytes (Len: %d, 0x%X):", keylength, keylength);
AddLogMessage(log, log_msg, false);
ByteArray2String(keybytes, log_msg, keylength, 1024);
AddLogMessage(log, log_msg, false);
/* Make it into a string */
strcpy(retval, "");
if(level >= 20)
{
/* ShortV3 format */
n = BigInt_Create();
t1 = BigInt_Create();
t2 = BigInt_Create();
/* When I created the ShortV3 keysystem, I didn't take into account
that some keys would have zero-bytes at the beginning, so I had to
change Armadillo later to deal with that case, which made it slower
to recognize keys than it should have been. For the new level 10
ShortV3 keys, I've learned my lesson: I'm setting the first bit on
the key, which we'll strip off when we interpret it. */
if(level == 29)
BigInt_Set(n, 1);
for(x = 0; x < keylength; ++x)
{
BigInt_Shift(n, 8, t1);
BigInt_SetU(t2, keybytes[x]);
BigInt_Add(t1, t2, n);
}
cc = retval;
dcount = 6;
while(BigInt_Compare(n, BigInt_Zero()) != 0)
{
BigInt_SetU(t2, 32);
BigInt_Modulus(n, t2, t1);
nn = BigInt_Get(t1);
BigInt_Shift(n, -5, t2);
BigInt_Copy(n, t2);
if(level == 29)
{
/* For the new ShortV3 Level 10 keys, I'm just going to
insist that all of them start with the digit '1'. That way,
when we're taking them apart, we'll always know which level
to use for it immediately, we don't have to try different
combinations of levels and extra-info like we did with the
earlier ones. */
*cc++ = shortv3digits[nn];
if(--dcount == 0)
{
dcount = 6;
*cc++ = '-';
}
}
else
{
/*
** Ensure that the first digit is outside the range of 0..9
** and A..F. To do this, we'll either add 16 to the first
** digit (if it's less than 16), or add an extra digit.
*/
if(BigInt_Compare(n, BigInt_Zero()) == 0)
{
if(nn < 16)
{
*cc++ = shortv3digits[nn + 16];
--dcount;
}
else
{
*cc++ = shortv3digits[nn];
if(--dcount == 0)
{
dcount = 6;
*cc++ = '-';
}
*cc++ = shortv3digits[16];
--dcount;
}
}
else
{
*cc++ = shortv3digits[nn];
if(--dcount == 0)
{
dcount = 6;
*cc++ = '-';
}
}
}
}
if(level == 29)
{
if(dcount == 0)
{
dcount = 6;
*cc++ = '-';
}
*cc++ = '1';
--dcount;
}
if(useskeystring)
{
if(dcount == 0)
{
dcount = 6;
*cc++ = '-';
}
*cc++ = '3';
--dcount;
}
if(nameless)
{
if(dcount == 0)
{
dcount = 6;
*cc++ = '-';
}
cc2 = name_to_make_key_for + strlen(name_to_make_key_for) - 1;
while(cc2 >= name_to_make_key_for)
{
*cc++ = *cc2--;
if(--dcount == 0)
{
dcount = 6;
*cc++ = '-';
}
}
}
while(dcount-- > 0)
*cc++ = '0';
*cc = 0;
mystrrev(retval);
if(!memcmp(retval, "000000-", 7))
retval_add = 7;
BigInt_Destroy(t2);
BigInt_Destroy(t1);
BigInt_Destroy(n);
}
else
{
/* V2 or conventional V3 format */
for(x = 0; x < keylength; x += 2)
{
if(x > 0)
strcat(retval, "-");
sprintf(strchr(retval, 0), "%02X%02X", (unsigned char)keybytes[x], (unsigned char)keybytes[x + 1]);
}
}
}
else
{
AddLogMessage(log, "Signature error!", true);
return "";
}
return retval + retval_add;
}
/*
--------
MakeDate
--------
Most implimentations can ignore this function. It creates an Armadillo-
formatted date, for use in the "otherinfo" parameter of CreateKey for
expire-by-date keys. The year should be the four-digit year, the month
should be 1 to 12, and the day should be 1 to 31. It returns 0xFFFF on
error (bad date or date before 01Jan99). The maximum year is 2037.
*/
unsigned short MakeDate(unsigned int year, unsigned int month, unsigned int day)
{
const unsigned long secondsperday = (24 * 60 * 60);
const int dateoffset = 10592;
struct tm tm = {0};
tm.tm_year = year - 1900;
tm.tm_mon = month - 1;
tm.tm_mday = day + 1;
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
unsigned long seconds = (unsigned long)mktime(&tm);
if(seconds == (unsigned long)(-1))
return (unsigned short)(-1);
long days = (seconds / secondsperday);
if(days < dateoffset)
return (unsigned short)(-1);
return (unsigned short)(days - dateoffset);
}
| [
"mr.exodia.tpodt@gmail.com"
] | mr.exodia.tpodt@gmail.com |
52ed62f6295427d70ff028ccea01831ee53300de | 835934c3035770bd2fb0cea752bbe5c93b8ddc83 | /VTKHeaders/vtkLight.h | 8e4bb072e5d0e0c21ff11a6879951779d5bebc78 | [
"MIT"
] | permissive | jmah/OsiriX-Quad-Buffered-Stereo | d257c9fc1e9be01340fe652f5bf9d63f5c84cde1 | 096491358a5d4d8a0928dc03d7183ec129720c56 | refs/heads/master | 2016-09-05T11:08:48.274221 | 2007-05-02T15:06:45 | 2007-05-02T15:06:45 | 3,008,660 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,999 | h | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkLight.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkLight - a virtual light for 3D rendering
// .SECTION Description
// vtkLight is a virtual light for 3D rendering. It provides methods to locate
// and point the light, turn it on and off, and set its brightness and color.
// In addition to the basic infinite distance point light source attributes,
// you also can specify the light attenuation values and cone angle.
// These attributes are only used if the light is a positional light.
// The default is a directional light (e.g. infinite point light source).
//
// Lights have a type that describes how the light should move with respect
// to the camera. A Headlight is always located at the current camera position
// and shines on the camera's focal point. A CameraLight also moves with
// the camera, but may not be coincident to it. CameraLights are defined
// in a normalized coordinate space where the camera is located at (0, 0, 1),
// the camera is looking at (0, 0, 0), and up is (0, 1, 0). Finally, a
// SceneLight is part of the scene itself and does not move with the camera.
// (Renderers are responsible for moving the light based on its type.)
//
// Lights have a transformation matrix that describes the space in which
// they are positioned. A light's world space position and focal point
// are defined by their local position and focal point, transformed by
// their transformation matrix (if it exists).
#ifndef __vtkLight_h
#define __vtkLight_h
#include "vtkObject.h"
/* need for virtual function */
class vtkRenderer;
class vtkMatrix4x4;
#define VTK_LIGHT_TYPE_HEADLIGHT 1
#define VTK_LIGHT_TYPE_CAMERA_LIGHT 2
#define VTK_LIGHT_TYPE_SCENE_LIGHT 3
class VTK_RENDERING_EXPORT vtkLight : public vtkObject
{
public:
vtkTypeRevisionMacro(vtkLight,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Create a light with the focal point at the origin and its position
// set to (0,0,1). The light is a SceneLight, its color is white,
// intensity=1, and the light is turned on.
static vtkLight *New();
// Description:
// Abstract interface to renderer. Each concrete subclass of vtkLight
// will load its data into the graphics system in response to this method
// invocation. The actual loading is performed by a vtkLightDevice
// subclass, which will get created automatically.
virtual void Render(vtkRenderer *, int) {};
// Description:
// Set/Get the color of the light. It is possible to set the ambient,
// diffuse and specular colors separately. The SetColor() method sets
// the diffuse and specular colors to the same color (this is a feature
// to preserve backward compatbility.)
vtkSetVector3Macro(AmbientColor,double);
vtkGetVectorMacro(AmbientColor,double,3);
vtkSetVector3Macro(DiffuseColor,double);
vtkGetVectorMacro(DiffuseColor,double,3);
vtkSetVector3Macro(SpecularColor,double);
vtkGetVectorMacro(SpecularColor,double,3);
void SetColor(double, double, double);
void SetColor(double a[3]) { this->SetColor(a[0], a[1], a[2]); }
void GetColor(double rgb[3]);
double *GetColor();
// Description:
// Set/Get the position of the light.
// Note: The position of the light is defined in the coordinate
// space indicated by its transformation matrix (if it exists).
// Thus, to get the light's world space position, use
// vtkGetTransformedPosition() instead of vtkGetPosition().
vtkSetVector3Macro(Position,double);
vtkGetVectorMacro(Position,double,3);
void SetPosition(float *a) {this->SetPosition(a[0],a[1],a[2]);};
// Description:
// Set/Get the point at which the light is shining.
// Note: The focal point of the light is defined in the coordinate
// space indicated by its transformation matrix (if it exists).
// Thus, to get the light's world space focal point, use
// vtkGetTransformedFocalPoint() instead of vtkGetFocalPoint().
vtkSetVector3Macro(FocalPoint,double);
vtkGetVectorMacro(FocalPoint,double,3);
void SetFocalPoint(float *a) {this->SetFocalPoint(a[0],a[1],a[2]);};
// Description:
// Set/Get the brightness of the light (from one to zero).
vtkSetMacro(Intensity,double);
vtkGetMacro(Intensity,double);
// Description:
// Turn the light on or off.
vtkSetMacro(Switch,int);
vtkGetMacro(Switch,int);
vtkBooleanMacro(Switch,int);
// Description:
// Turn positional lighting on or off.
vtkSetMacro(Positional,int);
vtkGetMacro(Positional,int);
vtkBooleanMacro(Positional,int);
// Description:
// Set/Get the exponent of the cosine used in positional lighting.
vtkSetMacro(Exponent,double);
vtkGetMacro(Exponent,double);
// Description:
// Set/Get the lighting cone angle of a positional light in degrees.
// A value of 180 indicates that you want no spot lighting effects
// just a positional light.
vtkSetMacro(ConeAngle,double);
vtkGetMacro(ConeAngle,double);
// Description:
// Set/Get the quadratic attenuation constants. They are specified as
// constant, linear, and quadratic, in that order.
vtkSetVector3Macro(AttenuationValues,double);
vtkGetVectorMacro(AttenuationValues,double,3);
// Description:
// Set/Get the light's transformation matrix. If a matrix is set for
// a light, the light's parameters (position and focal point) are
// transformed by the matrix before being rendered.
virtual void SetTransformMatrix(vtkMatrix4x4*);
vtkGetObjectMacro(TransformMatrix,vtkMatrix4x4);
// Description:
// Get the position of the light, modified by the transformation matrix
// (if it exists).
void GetTransformedPosition(double &a0, double &a1, double &a2);
void GetTransformedPosition(double a[3]);
double *GetTransformedPosition();
// Description:
// Get the focal point of the light, modified by the transformation matrix
// (if it exists).
void GetTransformedFocalPoint(double &a0, double &a1, double &a2);
void GetTransformedFocalPoint(double a[3]);
double *GetTransformedFocalPoint();
// Description:
// Set the position and focal point of a light based on elevation and
// azimuth. The light is moved so it is shining from the given angle.
// Angles are given in degrees. If the light is a
// positional light, it is made directional instead.
void SetDirectionAngle(double elevation, double azimuth);
void SetDirectionAngle(double ang[2]) {
this->SetDirectionAngle(ang[0], ang[1]); };
// Description:
// Perform deep copy of this light.
void DeepCopy(vtkLight *light);
// Description:
// Set/Get the type of the light.
// A SceneLight is a light located in the world coordinate space. A light
// is initially created as a scene light.
//
// A Headlight is always located at the camera and is pointed at the
// camera's focal point. The renderer is free to modify the position and
// focal point of the camera at any time.
//
// A CameraLight is also attached to the camera, but is not necessarily
// located at the camera's position. CameraLights are defined in a
// coordinate space where the camera is located at (0, 0, 1), looking
// towards (0, 0, 0) at a distance of 1, with up being (0, 1, 0).
//
// Note: Use SetLightTypeToSceneLight, rather than SetLightType(3), since
// the former clears the light's transform matrix.
vtkSetMacro(LightType, int);
vtkGetMacro(LightType, int);
void SetLightTypeToHeadlight()
{this->SetLightType(VTK_LIGHT_TYPE_HEADLIGHT);}
void SetLightTypeToSceneLight()
{
this->SetTransformMatrix(NULL);
this->SetLightType(VTK_LIGHT_TYPE_SCENE_LIGHT);
}
void SetLightTypeToCameraLight()
{this->SetLightType(VTK_LIGHT_TYPE_CAMERA_LIGHT);}
// Description:
// Query the type of the light.
int LightTypeIsHeadlight();
int LightTypeIsSceneLight();
int LightTypeIsCameraLight();
void ReadSelf(istream& is);
void WriteSelf(ostream& os);
protected:
vtkLight();
~vtkLight();
double FocalPoint[3];
double Position[3];
double Intensity;
double AmbientColor[3];
double DiffuseColor[3];
double SpecularColor[3];
int Switch;
int Positional;
double Exponent;
double ConeAngle;
double AttenuationValues[3];
vtkMatrix4x4 *TransformMatrix;
double TransformedFocalPointReturn[3];
double TransformedPositionReturn[3];
int LightType;
private:
vtkLight(const vtkLight&); // Not implemented.
void operator=(const vtkLight&); // Not implemented.
};
#endif
| [
"me@JonathonMah.com"
] | me@JonathonMah.com |
1aefe015fe108b5b71215b0c3c7cb77108a3c9ce | f7efc2e6cbcfaf2c3b1bbd0397ebd99f51eddf7b | /acmp.ru/acmp0294.cpp | 2cf3660973f827d482ed1e792316327c38a53212 | [] | no_license | Sysreqx/Cpp | 5b4d26ebfc9aefd732a9d8ffb82ca453b76077d7 | 2aad24c03004e28d0bb1f1e8dd9d010a59542125 | refs/heads/master | 2023-05-11T02:33:22.656539 | 2023-05-07T13:53:20 | 2023-05-07T13:53:20 | 120,492,173 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 627 | cpp | #include <iostream>
#include <string>
int main()
{
int k1, m1, l1, k2, m2, l2;
std::cin >> k1 >> m1 >> l1 >> k2 >> m2 >> l2;
int num_bolts, num_nuts, shortage, bolts_value, nuts_value;
num_bolts = k1 * m1 / 100;
num_nuts = k2 * m2 / 100;
bolts_value = k1 - num_bolts;
nuts_value = k2 - num_nuts;
if (bolts_value > nuts_value)
{
shortage = (bolts_value - nuts_value) * l1;
}
else
{
shortage = (nuts_value - bolts_value) * l2;
}
//std::cout << shortage << std::endl;
num_bolts *= l1;
num_nuts *= l2;
shortage += num_bolts + num_nuts;
std::cout << shortage << std::endl;
//system("pause");
return 0;
}
| [
"sysreqx@gmail.com"
] | sysreqx@gmail.com |
1a16babacf15eb356e336730dcc766140c4491c5 | daf5ef7c58b0b0ba52e7427b4299082eb6556152 | /387.first-unique-character-in-a-string.cpp | b203eb5b92440c6fa890a81a90eaa7b0f5c73e0e | [] | no_license | xijiao/leetcode_practice | ee370fbd070fb7818edbe1afc63f81094877952e | 26924bd99c45484d6eff0057a6902ba932f7c4a2 | refs/heads/master | 2022-11-08T18:02:21.847759 | 2022-10-29T03:00:25 | 2022-10-29T03:00:25 | 228,111,673 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 362 | cpp | /*
* @lc app=leetcode id=387 lang=cpp
*
* [387] First Unique Character in a String
*/
// @lc code=start
class Solution {
public:
int firstUniqChar(string s) {
vector<int> count(26);
for (char c : s) count[c - 'a']++;
for (int i = 0; i < s.size(); i++) {
if (count[s[i] - 'a'] == 1) return i;
}
return -1;
}
};
// @lc code=end
| [
"xijiaosdq@gmail.com"
] | xijiaosdq@gmail.com |
07c5494c339b9bfd15d8b72215a65933bdf0383a | 8a95833a2bd2fc4f465aac7b917ce0de215e3361 | /include/breathalock/BreathalockConfig.hpp | 8cba505156d99f13704b6dd6d37edf3506360a3e | [] | no_license | BreathaLock/Breathalock-Hardware | e31ac63b4f1bedc8fbf8b4285861b26222f47a27 | db049d2bf8008af794536a2e820e8a4e1b34024a | refs/heads/master | 2021-01-19T11:32:57.847113 | 2017-04-26T01:59:54 | 2017-04-26T01:59:54 | 87,974,497 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,007 | hpp | // COMMON SETTINGS
//GAS SENSOR SETTINGS
#define DELTA_TOLERANCE 30
#define V_LOAD_RESISTOR 10
#define WARMUP_TIME_MS 5000
// NAME HERE SETTINGS
// ----------------------------------------------------------------------------------------------
// Description here
// ----------------------------------------------------------------------------------------------
#define GATE_POWER_PIN 4
#define GAS_SENSOR_PIN A0
// RGB STATUS LIGHTS
#define RED_RGB_PIN_STATUS 3
#define BLUE_RGB_PIN_STATUS 6
#define GREEN_RGB_PIN_STATUS 5
//FINGERPRINT
#define FINGER_SOFTWARE_SERIAL_TX 2 //White
#define FINGER_SOFTWARE_SERIAL_RX 7 //Green
//Status Light
#define STATUS_LIGHT_YELLOW 13
#define MOSFET_GAS_HEATER A2 // tx
#define MOSFET_FINGERPRINT A1 // rx
// SOFTWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the pins that will be used for 'SW' serial.
// You should use this option if you are connecting the UART Friend to an UNO
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_SWUART_RXD_PIN 9 // Required for softwa`re serial!
#define BLUEFRUIT_SWUART_TXD_PIN 10 // Required for software serial!
#define BLUEFRUIT_UART_CTS_PIN 11 // Required for software serial!
#define BLUEFRUIT_UART_RTS_PIN 8 // Optional, set to -1 if unused
// ----------------------------------------------------------------------------------------------
// These settings are used in both SW UART, HW UART and SPI mode
// ----------------------------------------------------------------------------------------------
#define BUFSIZE 128 // Size of the read buffer for incoming data
#define VERBOSE_MODE false // If set to 'true' enables debug output
#define DEVICE_NAME "Breathalock"
// HARDWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the HW serial port you are using. Uncomment
// this line if you are connecting the BLE to Leonardo/Micro or Flora
// ----------------------------------------------------------------------------------------------
#ifdef Serial // this makes it not complain on compilation if there's no Serial1
#define BLUEFRUIT_HWSERIAL_NAME Serial
#endif
// SHARED UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following sets the optional Mode pin, its recommended but not required
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_UART_MODE_PIN -1 // Set to -1 if unused
| [
"charlesataylor.p@gmail.com"
] | charlesataylor.p@gmail.com |
f15be542d5f0321e870eedd4fd3229ef766de042 | 68d791fa68841b888e4e46efa3eaac40db21c78e | /USACO/theme.cpp | 1af5ddc1ab089663f6e808128bee5bac4002e046 | [] | no_license | jimgao1/competitive-programming | 14d5b69169249224887c6cf9649a3b325710fa14 | a83ed6fc03293359cafed7524be22a437438fc7b | refs/heads/master | 2020-04-03T14:15:09.400440 | 2019-05-17T01:06:10 | 2019-05-17T01:06:10 | 26,778,076 | 36 | 29 | null | 2017-12-29T20:13:16 | 2014-11-17T21:27:36 | C++ | UTF-8 | C++ | false | false | 869 | cpp | /*
ID: jim_yub1
LANG: C++11
TASK: theme
*/
#include <bits/stdc++.h>
#define MAXN 5001
using namespace std;
int N, A[MAXN], B[MAXN];
int main() {
freopen("theme.in", "r", stdin);
freopen("theme.out", "w", stdout);
cin >> N;
for (int i = 0; i < N; i++) cin >> A[i];
for (int i = 0; i < N - 1; i++) B[i] = A[i + 1] - A[i];
N--;
int ans = 0;
for (int i = 0; i + ans < N; i++) {
for (int j = i + ans; j + ans < N; j++) {
for (int k = 0; j + k < N && i + k < j; k++) {
if (B[i + k] == B[j + k]) {
if (i + k < j - 1)
ans = max(ans, k + 1);
else
ans = max(ans, k);
} else {
break;
}
}
}
}
cout << (ans < 4 ? 0 : ans + 1) << endl;
}
| [
"jim@jimgao.tk"
] | jim@jimgao.tk |
240f7e4aea5c49c7a64ea34d51818e72d8072984 | ad273708d98b1f73b3855cc4317bca2e56456d15 | /aws-cpp-sdk-schemas/source/model/SearchSchemaSummary.cpp | 38d96df1d5adb672c0390690cf2dd22f6bf2a39f | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | novaquark/aws-sdk-cpp | b390f2e29f86f629f9efcf41c4990169b91f4f47 | a0969508545bec9ae2864c9e1e2bb9aff109f90c | refs/heads/master | 2022-08-28T18:28:12.742810 | 2020-05-27T15:46:18 | 2020-05-27T15:46:18 | 267,351,721 | 1 | 0 | Apache-2.0 | 2020-05-27T15:08:16 | 2020-05-27T15:08:15 | null | UTF-8 | C++ | false | false | 3,021 | cpp | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 <aws/schemas/model/SearchSchemaSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Schemas
{
namespace Model
{
SearchSchemaSummary::SearchSchemaSummary() :
m_registryNameHasBeenSet(false),
m_schemaArnHasBeenSet(false),
m_schemaNameHasBeenSet(false),
m_schemaVersionsHasBeenSet(false)
{
}
SearchSchemaSummary::SearchSchemaSummary(JsonView jsonValue) :
m_registryNameHasBeenSet(false),
m_schemaArnHasBeenSet(false),
m_schemaNameHasBeenSet(false),
m_schemaVersionsHasBeenSet(false)
{
*this = jsonValue;
}
SearchSchemaSummary& SearchSchemaSummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("RegistryName"))
{
m_registryName = jsonValue.GetString("RegistryName");
m_registryNameHasBeenSet = true;
}
if(jsonValue.ValueExists("SchemaArn"))
{
m_schemaArn = jsonValue.GetString("SchemaArn");
m_schemaArnHasBeenSet = true;
}
if(jsonValue.ValueExists("SchemaName"))
{
m_schemaName = jsonValue.GetString("SchemaName");
m_schemaNameHasBeenSet = true;
}
if(jsonValue.ValueExists("SchemaVersions"))
{
Array<JsonView> schemaVersionsJsonList = jsonValue.GetArray("SchemaVersions");
for(unsigned schemaVersionsIndex = 0; schemaVersionsIndex < schemaVersionsJsonList.GetLength(); ++schemaVersionsIndex)
{
m_schemaVersions.push_back(schemaVersionsJsonList[schemaVersionsIndex].AsObject());
}
m_schemaVersionsHasBeenSet = true;
}
return *this;
}
JsonValue SearchSchemaSummary::Jsonize() const
{
JsonValue payload;
if(m_registryNameHasBeenSet)
{
payload.WithString("RegistryName", m_registryName);
}
if(m_schemaArnHasBeenSet)
{
payload.WithString("SchemaArn", m_schemaArn);
}
if(m_schemaNameHasBeenSet)
{
payload.WithString("SchemaName", m_schemaName);
}
if(m_schemaVersionsHasBeenSet)
{
Array<JsonValue> schemaVersionsJsonList(m_schemaVersions.size());
for(unsigned schemaVersionsIndex = 0; schemaVersionsIndex < schemaVersionsJsonList.GetLength(); ++schemaVersionsIndex)
{
schemaVersionsJsonList[schemaVersionsIndex].AsObject(m_schemaVersions[schemaVersionsIndex].Jsonize());
}
payload.WithArray("SchemaVersions", std::move(schemaVersionsJsonList));
}
return payload;
}
} // namespace Model
} // namespace Schemas
} // namespace Aws
| [
"aws-sdk-cpp-automation@github.com"
] | aws-sdk-cpp-automation@github.com |
22842b3f579a403220011a20014bcc3ad0309f28 | c220f55c8b671a7b51f0d10837270dab65c6f8ea | /Source/Library.Shared/GamePlay/WorldState.h | 2b9c3ade4046b7f59ae13954a304e90fdd9315cf | [] | no_license | PlatoManchi/NoobEngine | 6fd4a95f4985f2722a6216be7aa2e35ee7d073cc | b6211fa46fe0ce89c76b970d719ca4f517e37d4f | refs/heads/master | 2021-01-11T17:28:35.961322 | 2017-08-22T20:45:18 | 2017-08-22T20:45:18 | 79,780,136 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,049 | h | #pragma once
#include "GamePlay/GameClock.h"
#include "GamePlay/GameTime.h"
namespace NoobEngine
{
namespace GamePlay
{
/**
Forward declaring
*/
class World;
class Sector;
class Entity;
class Action;
class WorldState final
{
public:
/**
Pointer to current world that is being processed.
*/
World* mCurrentWorld;
/**
Pointer to current sector that is being processed.
*/
Sector* mCurrentSector;
/**
Pointer to current entity that is being processed.
*/
Entity* mCurrentEntity;
/**
Pointer to current action that is being processed.
*/
Action* mCurrentAction;
/**
The timer that calculate time elapsed and time since game started.
*/
GameTime mGameTime;
/**
@brief Default constructor.
*/
WorldState();
/**
@brief Default destructor.
*/
~WorldState();
/**
Update the time states
*/
void Update();
private:
/**
The game clock used by world state to keep track of time.
*/
GameClock mGameClock;
};
}
} | [
"plato.manchi@gmail.com"
] | plato.manchi@gmail.com |
ba2f1126171913f87f2ae82048df457f228fd433 | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /external/chromium_org/net/websockets/websocket_handshake_stream_create_helper.h | 31be2313ff7630465e6f1e6139e96c62f7ccb072 | [
"BSD-3-Clause",
"MIT"
] | permissive | karunmatharu/Android-4.4-Pay-by-Data | 466f4e169ede13c5835424c78e8c30ce58f885c1 | fcb778e92d4aad525ef7a995660580f948d40bc9 | refs/heads/master | 2021-03-24T13:33:01.721868 | 2017-02-18T17:48:49 | 2017-02-18T17:48:49 | 81,847,777 | 0 | 2 | MIT | 2020-03-09T00:02:12 | 2017-02-13T16:47:00 | null | UTF-8 | C++ | false | false | 2,250 | h | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_
#define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_
#include <string>
#include <vector>
#include "net/base/net_export.h"
#include "net/websockets/websocket_handshake_stream_base.h"
namespace net {
// Implementation of WebSocketHandshakeStreamBase::CreateHelper. This class is
// used in the implementation of WebSocketStream::CreateAndConnectStream() and
// is not intended to be used by itself.
//
// Holds the information needed to construct a
// WebSocketBasicHandshakeStreamBase.
class NET_EXPORT_PRIVATE WebSocketHandshakeStreamCreateHelper
: public WebSocketHandshakeStreamBase::CreateHelper {
public:
explicit WebSocketHandshakeStreamCreateHelper(
const std::vector<std::string>& requested_subprotocols);
virtual ~WebSocketHandshakeStreamCreateHelper();
// WebSocketHandshakeStreamBase::CreateHelper methods
// Create a WebSocketBasicHandshakeStream.
virtual WebSocketHandshakeStreamBase* CreateBasicStream(
scoped_ptr<ClientSocketHandle> connection,
bool using_proxy) OVERRIDE;
// Unimplemented as of November 2013.
virtual WebSocketHandshakeStreamBase* CreateSpdyStream(
const base::WeakPtr<SpdySession>& session,
bool use_relative_url) OVERRIDE;
// Return the WebSocketHandshakeStreamBase object that we created. In the case
// where CreateBasicStream() was called more than once, returns the most
// recent stream, which will be the one on which the handshake succeeded.
WebSocketHandshakeStreamBase* stream() { return stream_; }
private:
const std::vector<std::string> requested_subprotocols_;
// This is owned by the caller of CreateBaseStream() or
// CreateSpdyStream(). Both the stream and this object will be destroyed
// during the destruction of the URLRequest object associated with the
// handshake.
WebSocketHandshakeStreamBase* stream_;
DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeStreamCreateHelper);
};
} // namespace net
#endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_CREATE_HELPER_H_
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
9b86373edc193315a7dc072a07e00dfe484afbbf | f69ad70bf1a8857301980f986e1b4c31c94d731e | /TP3/EndScreen.cpp | 36d5c4e6698afa3f9c64c759ba7a43b5044d0cb8 | [] | no_license | deboxta/IMAGWZIT | 3fd5d3df3622849dd1106d96659125f4b2ca818e | a24764a00f77bcb31910b4d2136f729c4fae08e7 | refs/heads/master | 2023-02-01T12:56:42.447719 | 2020-12-16T07:37:19 | 2020-12-16T07:37:19 | 264,275,370 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 2,768 | cpp | #include "EndScreen.h"
using namespace TP3Prog;
EndScreen::EndScreen(int* score) : score(*score)
{
}
EndScreen::~EndScreen()
{
}
Scene::scenes EndScreen::run()
{
while (isRunning)
{
getInputs();
update();
draw();
}
return transitionToScene;
}
bool EndScreen::init(RenderWindow * const window)
{
if (!ScreenImageT.loadFromFile("Sprites\\tp3_end.png"))
{
return false;
}
if (!font.loadFromFile("Fonts\\Lady Radical 2.ttf"))
{
return false;
}
ScreenImage.setTexture(ScreenImageT);
scoreLebel.initializeFloatingTextLabel(font, Vector2f(1920 / 2, 500), true, 0, "", 60, Color::White);
newGameButton.initializeStandardCustomButton(font, Vector2f(1920 / 2, 700), true, 200, "new game", 8);
titleButton.initializeStandardCustomButton(font, Vector2f(1920 / 2, 800), true, 200, "return to menu", 14);;
quitButton.initializeStandardCustomButton(font, Vector2f(1920 / 2, 900), true, 200, "quit", 4);
scoreLebel.setText("Score : " +std::to_string(score));
this->mainWin = window;
isRunning = true;
return true;
}
//Puisqu'il ne s'agit pas vraiment d'une scene de jeu et que la manipulation des label et textbox est très fortement
//liée aux événements claviers et souris, tout sera codé dans le getInputs pour leur manipulations
void EndScreen::getInputs()
{
while (mainWin->pollEvent(event))
{
//x sur la fenêtre
if (event.type == Event::Closed)
{
//Attention, ici simplement fermer la fenêtre ne mettrait pas nécessairement
//fin corrctement à l'application
transition(EXIT);
}
//-------------------SELECTION DE TEXTBOX ACTIVE------------------------------------//
//Si on a un événement de click de souris
if (event.type == Event::MouseButtonPressed)
{
if (event.mouseButton.button == sf::Mouse::Left)
{
//Valider si on a appuyé ou non sur un bouton
newGameButton.pressed(Mouse::getPosition(*mainWin));
titleButton.pressed(Mouse::getPosition(*mainWin));
quitButton.pressed(Mouse::getPosition(*mainWin));
}
}
if (event.type == Event::MouseButtonReleased)
{
if (event.mouseButton.button == sf::Mouse::Left)
{
if (newGameButton.released(Mouse::getPosition(*mainWin)))
{
transition(GAME);
}
if (titleButton.released(Mouse::getPosition(*mainWin)))
{
transition(TITLE);
}
if (quitButton.released(Mouse::getPosition(*mainWin)))
{
transition(EXIT);
}
}
}
}
}
void EndScreen::update()
{
}
void EndScreen::draw()
{
mainWin->clear();
mainWin->draw(ScreenImage);
scoreLebel.draw(mainWin);
newGameButton.draw(mainWin);
titleButton.draw(mainWin);
quitButton.draw(mainWin);
mainWin->display();
}
void EndScreen::transition(const Scene::scenes & scene)
{
isRunning = false;
transitionToScene = scene;
}
| [
"yannick.c.pro.a@gmail.com"
] | yannick.c.pro.a@gmail.com |
deae35e262495469aae3b0cea7e74e63c24ea16d | 7fcff8928aa898ec99747cf92212d8d0476e11cb | /Longest Valid Parentheses.cpp | 5242e41ebd3f3b1b50ac7c1e47babac599d5b8a6 | [] | no_license | PoeLoren/Leetcode | c3a23ed8bd7e1d212f0f1eb0e4bdb6c6bd421f60 | 2850215ea337a5dd8b5c552841de860b9e058de1 | refs/heads/master | 2021-01-10T18:06:55.429402 | 2016-05-16T12:23:55 | 2016-05-16T12:23:55 | 25,291,596 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 983 | cpp | class Solution {
public:
int longestValidParentheses(string s) {
stack<int> cStack;
int len = 0;
int last = -1;//last ')' is the point between groups
for(int i = 0;i < s.size();i++)
{
if(s[i] == '(')
{
cStack.push(i);
}
else
{
if(cStack.empty())//no '(' match
last = i;
else
{
cStack.pop();
if(cStack.empty())//there are two kind of situation
{
len = max(len,i-last);//")","()))()()", maxlen is between last ')' of group and current ')'
}
else
{
len = max(len,i-cStack.top());//"((()()())", maxlen is between peer '(' and current ')'
}
}
}
}
return len;
}
}; | [
"yxluozengbo@gmail.com"
] | yxluozengbo@gmail.com |
df68c9f6eaa6d06c07ad95454a8d084612d54393 | e48abae6e62ae89c430b8fd5921b25a1fadc3013 | /QtSimpleChatClient/chatclient.cpp | 2442df0fb78fdb0164202b3885624a8617264133 | [
"Unlicense"
] | permissive | denizcanturk/ChatExample | 613ec97f1a7920c2d5078a5edcb9aa28d8eeff84 | 12452e1ffa1591bdba3aed068999c280a3be5a93 | refs/heads/master | 2020-05-16T00:23:08.897146 | 2019-07-14T10:10:39 | 2019-07-14T10:10:39 | 182,578,552 | 0 | 0 | Unlicense | 2019-04-21T20:19:51 | 2019-04-21T20:19:51 | null | UTF-8 | C++ | false | false | 7,398 | cpp | #include "chatclient.h"
#include <QTcpSocket>
#include <QDataStream>
#include <QJsonParseError>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
ChatClient::ChatClient(QObject *parent)
: QObject(parent)
, m_clientSocket(new QTcpSocket(this))
, m_loggedIn(false)
{
// Forward the connected and disconnected signals
connect(m_clientSocket, &QTcpSocket::connected, this, &ChatClient::connected);
connect(m_clientSocket, &QTcpSocket::disconnected, this, &ChatClient::disconnected);
// connect readyRead() to the slot that will take care of reading the data in
connect(m_clientSocket, &QTcpSocket::readyRead, this, &ChatClient::onReadyRead);
// Forward the error signal, QOverload is necessary as error() is overloaded, see the Qt docs
connect(m_clientSocket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &ChatClient::error);
// Reset the m_loggedIn variable when we disconnec. Since the operation is trivial we use a lambda instead of creating another slot
connect(m_clientSocket, &QTcpSocket::disconnected, this, [this]()->void{m_loggedIn = false;});
}
void ChatClient::login(const QString &userName)
{
if (m_clientSocket->state() == QAbstractSocket::ConnectedState) { // if the client is connected
// create a QDataStream operating on the socket
QDataStream clientStream(m_clientSocket);
// set the version so that programs compiled with different versions of Qt can agree on how to serialise
clientStream.setVersion(QDataStream::Qt_5_7);
// Create the JSON we want to send
QJsonObject message;
message["type"] = QStringLiteral("login");
message["username"] = userName;
// send the JSON using QDataStream
clientStream << QJsonDocument(message).toJson(QJsonDocument::Compact);
}
}
void ChatClient::sendMessage(const QString &text)
{
if (text.isEmpty())
return; // We don't send empty messages
// create a QDataStream operating on the socket
QDataStream clientStream(m_clientSocket);
// set the version so that programs compiled with different versions of Qt can agree on how to serialise
clientStream.setVersion(QDataStream::Qt_5_7);
// Create the JSON we want to send
QJsonObject message;
message["type"] = QStringLiteral("message");
message["text"] = text;
// send the JSON using QDataStream
clientStream << QJsonDocument(message).toJson();
}
void ChatClient::disconnectFromHost()
{
m_clientSocket->disconnectFromHost();
}
void ChatClient::jsonReceived(const QJsonObject &docObj)
{
// actions depend on the type of message
const QJsonValue typeVal = docObj.value(QLatin1String("type"));
if (typeVal.isNull() || !typeVal.isString())
return; // a message with no type was received so we just ignore it
if (typeVal.toString().compare(QLatin1String("login"), Qt::CaseInsensitive) == 0) { //It's a login message
if (m_loggedIn)
return; // if we are already logged in we ignore
// the success field will contain the result of our attempt to login
const QJsonValue resultVal = docObj.value(QLatin1String("success"));
if (resultVal.isNull() || !resultVal.isBool())
return; // the message had no success field so we ignore
const bool loginSuccess = resultVal.toBool();
if (loginSuccess) {
// we logged in succesfully and we notify it via the loggedIn signal
emit loggedIn();
return;
}
// the login attempt failed, we extract the reason of the failure from the JSON
// and notify it via the loginError signal
const QJsonValue reasonVal = docObj.value(QLatin1String("reason"));
emit loginError(reasonVal.toString());
} else if (typeVal.toString().compare(QLatin1String("message"), Qt::CaseInsensitive) == 0) { //It's a chat message
// we extract the text field containing the chat text
const QJsonValue textVal = docObj.value(QLatin1String("text"));
// we extract the sender field containing the username of the sender
const QJsonValue senderVal = docObj.value(QLatin1String("sender"));
if (textVal.isNull() || !textVal.isString())
return; // the text field was invalid so we ignore
if (senderVal.isNull() || !senderVal.isString())
return; // the sender field was invalid so we ignore
// we notify a new message was received via the messageReceived signal
emit messageReceived(senderVal.toString(), textVal.toString());
} else if (typeVal.toString().compare(QLatin1String("newuser"), Qt::CaseInsensitive) == 0) { // A user joined the chat
// we extract the username of the new user
const QJsonValue usernameVal = docObj.value(QLatin1String("username"));
if (usernameVal.isNull() || !usernameVal.isString())
return; // the username was invalid so we ignore
// we notify of the new user via the userJoined signal
emit userJoined(usernameVal.toString());
} else if (typeVal.toString().compare(QLatin1String("userdisconnected"), Qt::CaseInsensitive) == 0) { // A user left the chat
// we extract the username of the new user
const QJsonValue usernameVal = docObj.value(QLatin1String("username"));
if (usernameVal.isNull() || !usernameVal.isString())
return; // the username was invalid so we ignore
// we notify of the user disconnection the userLeft signal
emit userLeft(usernameVal.toString());
}
}
void ChatClient::connectToServer(const QHostAddress &address, quint16 port)
{
m_clientSocket->connectToHost(address, port);
}
void ChatClient::onReadyRead()
{
// prepare a container to hold the UTF-8 encoded JSON we receive from the socket
QByteArray jsonData;
// create a QDataStream operating on the socket
QDataStream socketStream(m_clientSocket);
// set the version so that programs compiled with different versions of Qt can agree on how to serialise
socketStream.setVersion(QDataStream::Qt_5_7);
// start an infinite loop
for (;;) {
// we start a transaction so we can revert to the previous state in case we try to read more data than is available on the socket
socketStream.startTransaction();
// we try to read the JSON data
socketStream >> jsonData;
if (socketStream.commitTransaction()) {
// we successfully read some data
// we now need to make sure it's in fact a valid JSON
QJsonParseError parseError;
// we try to create a json document with the data we received
const QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData, &parseError);
if (parseError.error == QJsonParseError::NoError) {
// if the data was indeed valid JSON
if (jsonDoc.isObject()) // and is a JSON object
jsonReceived(jsonDoc.object()); // parse the JSON
}
// loop and try to read more JSONs if they are available
} else {
// the read failed, the socket goes automatically back to the state it was in before the transaction started
// we just exit the loop and wait for more data to become available
break;
}
}
}
| [
"v.ronin@yahoo.it"
] | v.ronin@yahoo.it |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.