blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
264
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
85
| license_type
stringclasses 2
values | repo_name
stringlengths 5
140
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 905
values | visit_date
timestamp[us]date 2015-08-09 11:21:18
2023-09-06 10:45:07
| revision_date
timestamp[us]date 1997-09-14 05:04:47
2023-09-17 19:19:19
| committer_date
timestamp[us]date 1997-09-14 05:04:47
2023-09-06 06:22:19
| github_id
int64 3.89k
681M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us]date 2012-06-07 00:51:45
2023-09-14 21:58:39
⌀ | gha_created_at
timestamp[us]date 2008-03-27 23:40:48
2023-08-21 23:17:38
⌀ | gha_language
stringclasses 141
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
10.4M
| extension
stringclasses 115
values | content
stringlengths 3
10.4M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
158
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19d42d384753aad72055f6f71afddb5fbde49186 | 6df307b049156f719a3aefaa11197fa8ebddbf33 | /for_test/test_template_more_args.cpp | ba633e0215b8e72c8ea9abdc151945eaff0eb83c | [] | no_license | feifa168/libtins_parser | b1eeac2e81eeea25804d157010d2e77241bdd0f8 | a2850ea89e23472dbe8c658a47446f9f488eb1b7 | refs/heads/master | 2020-03-28T20:30:13.008938 | 2018-09-19T07:34:26 | 2018-09-19T07:34:26 | 149,076,751 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,643 | cpp | #include<iostream>
#include<string.h>
#include<bitset>
#include<boost/any.hpp>
#include<boost/utility.hpp>
#include<typeinfo>
using namespace std;
class InParam
{
public:
template<typename... Arg>
InParam(Arg... args)
{
PutArg(args...);
// m_veParamValue.push_back( head );
// cout << typeid( head ).name() << " : " << head << " | ";
// InParam( last... ); // 这个必须实现一个另外一个一样的构造函数
}
template<typename T>
void PutArg(T value) {
cout << typeid(value).name() << "|" << value << endl;
m_veParamValue.push_back(value);
}
template<typename Head, typename... Rail>
void PutArg(Head head, Rail... last) {
const char *pname = typeid(head).name();
cout << pname << "|" << head << endl;
m_veParamValue.push_back(head);
PutArg(last...);
}
~InParam() {
cout << "~~~~ " << m_veParamValue.size() << endl;
}
private:
vector<boost::any> m_veParamValue;
};
struct X {
int a;
X() :a(5) { cout << "X" << endl; }
~X() { cout << "~X" << endl; }
};
void inner(const X&) { cout << "inner(const X&)" << endl; }
void inner(X&&) { cout << "inner(X&&)" << endl; }
template<typename T>
void outer(T&& t) { inner(forward<T>(t)); }
void test_class_construct() {
X a;
{
X *pa = &a;
}
{
X &ra = a;
}
}
void test_forward()
{
{
X a;
// outer(a);
// outer(X());
// inner(forward<X>(X()));
// inner(forward<X>(a));
{
X &a1 = forward<X>(X());
}
{
X &a2 = forward<X>(a);
}
}
}
void test_template_moree_args()
{
test_class_construct();
test_forward();
InParam ip("aaa", 5, 9.5555, 9999L);
cout << "001" << endl;
} | [
"[email protected]"
] | |
49d46421d3b8ae483ec17386b7349257759ba559 | 6ced41da926682548df646099662e79d7a6022c5 | /aws-cpp-sdk-appflow/include/aws/appflow/model/ConnectorMetadata.h | d89f93ee7d20feb8dc3f1efff9151eed69332870 | [
"Apache-2.0",
"MIT",
"JSON"
] | permissive | irods/aws-sdk-cpp | 139104843de529f615defa4f6b8e20bc95a6be05 | 2c7fb1a048c96713a28b730e1f48096bd231e932 | refs/heads/main | 2023-07-25T12:12:04.363757 | 2022-08-26T15:33:31 | 2022-08-26T15:33:31 | 141,315,346 | 0 | 1 | Apache-2.0 | 2022-08-26T17:45:09 | 2018-07-17T16:24:06 | C++ | UTF-8 | C++ | false | false | 26,390 | h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/appflow/Appflow_EXPORTS.h>
#include <aws/appflow/model/AmplitudeMetadata.h>
#include <aws/appflow/model/DatadogMetadata.h>
#include <aws/appflow/model/DynatraceMetadata.h>
#include <aws/appflow/model/GoogleAnalyticsMetadata.h>
#include <aws/appflow/model/InforNexusMetadata.h>
#include <aws/appflow/model/MarketoMetadata.h>
#include <aws/appflow/model/RedshiftMetadata.h>
#include <aws/appflow/model/S3Metadata.h>
#include <aws/appflow/model/SalesforceMetadata.h>
#include <aws/appflow/model/ServiceNowMetadata.h>
#include <aws/appflow/model/SingularMetadata.h>
#include <aws/appflow/model/SlackMetadata.h>
#include <aws/appflow/model/SnowflakeMetadata.h>
#include <aws/appflow/model/TrendmicroMetadata.h>
#include <aws/appflow/model/VeevaMetadata.h>
#include <aws/appflow/model/ZendeskMetadata.h>
#include <aws/appflow/model/EventBridgeMetadata.h>
#include <aws/appflow/model/UpsolverMetadata.h>
#include <aws/appflow/model/CustomerProfilesMetadata.h>
#include <aws/appflow/model/HoneycodeMetadata.h>
#include <aws/appflow/model/SAPODataMetadata.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Appflow
{
namespace Model
{
/**
* <p> A structure to specify connector-specific metadata such as
* <code>oAuthScopes</code>, <code>supportedRegions</code>,
* <code>privateLinkServiceUrl</code>, and so on. </p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/appflow-2020-08-23/ConnectorMetadata">AWS
* API Reference</a></p>
*/
class AWS_APPFLOW_API ConnectorMetadata
{
public:
ConnectorMetadata();
ConnectorMetadata(Aws::Utils::Json::JsonView jsonValue);
ConnectorMetadata& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p> The connector metadata specific to Amplitude. </p>
*/
inline const AmplitudeMetadata& GetAmplitude() const{ return m_amplitude; }
/**
* <p> The connector metadata specific to Amplitude. </p>
*/
inline bool AmplitudeHasBeenSet() const { return m_amplitudeHasBeenSet; }
/**
* <p> The connector metadata specific to Amplitude. </p>
*/
inline void SetAmplitude(const AmplitudeMetadata& value) { m_amplitudeHasBeenSet = true; m_amplitude = value; }
/**
* <p> The connector metadata specific to Amplitude. </p>
*/
inline void SetAmplitude(AmplitudeMetadata&& value) { m_amplitudeHasBeenSet = true; m_amplitude = std::move(value); }
/**
* <p> The connector metadata specific to Amplitude. </p>
*/
inline ConnectorMetadata& WithAmplitude(const AmplitudeMetadata& value) { SetAmplitude(value); return *this;}
/**
* <p> The connector metadata specific to Amplitude. </p>
*/
inline ConnectorMetadata& WithAmplitude(AmplitudeMetadata&& value) { SetAmplitude(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Datadog. </p>
*/
inline const DatadogMetadata& GetDatadog() const{ return m_datadog; }
/**
* <p> The connector metadata specific to Datadog. </p>
*/
inline bool DatadogHasBeenSet() const { return m_datadogHasBeenSet; }
/**
* <p> The connector metadata specific to Datadog. </p>
*/
inline void SetDatadog(const DatadogMetadata& value) { m_datadogHasBeenSet = true; m_datadog = value; }
/**
* <p> The connector metadata specific to Datadog. </p>
*/
inline void SetDatadog(DatadogMetadata&& value) { m_datadogHasBeenSet = true; m_datadog = std::move(value); }
/**
* <p> The connector metadata specific to Datadog. </p>
*/
inline ConnectorMetadata& WithDatadog(const DatadogMetadata& value) { SetDatadog(value); return *this;}
/**
* <p> The connector metadata specific to Datadog. </p>
*/
inline ConnectorMetadata& WithDatadog(DatadogMetadata&& value) { SetDatadog(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Dynatrace. </p>
*/
inline const DynatraceMetadata& GetDynatrace() const{ return m_dynatrace; }
/**
* <p> The connector metadata specific to Dynatrace. </p>
*/
inline bool DynatraceHasBeenSet() const { return m_dynatraceHasBeenSet; }
/**
* <p> The connector metadata specific to Dynatrace. </p>
*/
inline void SetDynatrace(const DynatraceMetadata& value) { m_dynatraceHasBeenSet = true; m_dynatrace = value; }
/**
* <p> The connector metadata specific to Dynatrace. </p>
*/
inline void SetDynatrace(DynatraceMetadata&& value) { m_dynatraceHasBeenSet = true; m_dynatrace = std::move(value); }
/**
* <p> The connector metadata specific to Dynatrace. </p>
*/
inline ConnectorMetadata& WithDynatrace(const DynatraceMetadata& value) { SetDynatrace(value); return *this;}
/**
* <p> The connector metadata specific to Dynatrace. </p>
*/
inline ConnectorMetadata& WithDynatrace(DynatraceMetadata&& value) { SetDynatrace(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Google Analytics. </p>
*/
inline const GoogleAnalyticsMetadata& GetGoogleAnalytics() const{ return m_googleAnalytics; }
/**
* <p> The connector metadata specific to Google Analytics. </p>
*/
inline bool GoogleAnalyticsHasBeenSet() const { return m_googleAnalyticsHasBeenSet; }
/**
* <p> The connector metadata specific to Google Analytics. </p>
*/
inline void SetGoogleAnalytics(const GoogleAnalyticsMetadata& value) { m_googleAnalyticsHasBeenSet = true; m_googleAnalytics = value; }
/**
* <p> The connector metadata specific to Google Analytics. </p>
*/
inline void SetGoogleAnalytics(GoogleAnalyticsMetadata&& value) { m_googleAnalyticsHasBeenSet = true; m_googleAnalytics = std::move(value); }
/**
* <p> The connector metadata specific to Google Analytics. </p>
*/
inline ConnectorMetadata& WithGoogleAnalytics(const GoogleAnalyticsMetadata& value) { SetGoogleAnalytics(value); return *this;}
/**
* <p> The connector metadata specific to Google Analytics. </p>
*/
inline ConnectorMetadata& WithGoogleAnalytics(GoogleAnalyticsMetadata&& value) { SetGoogleAnalytics(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Infor Nexus. </p>
*/
inline const InforNexusMetadata& GetInforNexus() const{ return m_inforNexus; }
/**
* <p> The connector metadata specific to Infor Nexus. </p>
*/
inline bool InforNexusHasBeenSet() const { return m_inforNexusHasBeenSet; }
/**
* <p> The connector metadata specific to Infor Nexus. </p>
*/
inline void SetInforNexus(const InforNexusMetadata& value) { m_inforNexusHasBeenSet = true; m_inforNexus = value; }
/**
* <p> The connector metadata specific to Infor Nexus. </p>
*/
inline void SetInforNexus(InforNexusMetadata&& value) { m_inforNexusHasBeenSet = true; m_inforNexus = std::move(value); }
/**
* <p> The connector metadata specific to Infor Nexus. </p>
*/
inline ConnectorMetadata& WithInforNexus(const InforNexusMetadata& value) { SetInforNexus(value); return *this;}
/**
* <p> The connector metadata specific to Infor Nexus. </p>
*/
inline ConnectorMetadata& WithInforNexus(InforNexusMetadata&& value) { SetInforNexus(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Marketo. </p>
*/
inline const MarketoMetadata& GetMarketo() const{ return m_marketo; }
/**
* <p> The connector metadata specific to Marketo. </p>
*/
inline bool MarketoHasBeenSet() const { return m_marketoHasBeenSet; }
/**
* <p> The connector metadata specific to Marketo. </p>
*/
inline void SetMarketo(const MarketoMetadata& value) { m_marketoHasBeenSet = true; m_marketo = value; }
/**
* <p> The connector metadata specific to Marketo. </p>
*/
inline void SetMarketo(MarketoMetadata&& value) { m_marketoHasBeenSet = true; m_marketo = std::move(value); }
/**
* <p> The connector metadata specific to Marketo. </p>
*/
inline ConnectorMetadata& WithMarketo(const MarketoMetadata& value) { SetMarketo(value); return *this;}
/**
* <p> The connector metadata specific to Marketo. </p>
*/
inline ConnectorMetadata& WithMarketo(MarketoMetadata&& value) { SetMarketo(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Amazon Redshift. </p>
*/
inline const RedshiftMetadata& GetRedshift() const{ return m_redshift; }
/**
* <p> The connector metadata specific to Amazon Redshift. </p>
*/
inline bool RedshiftHasBeenSet() const { return m_redshiftHasBeenSet; }
/**
* <p> The connector metadata specific to Amazon Redshift. </p>
*/
inline void SetRedshift(const RedshiftMetadata& value) { m_redshiftHasBeenSet = true; m_redshift = value; }
/**
* <p> The connector metadata specific to Amazon Redshift. </p>
*/
inline void SetRedshift(RedshiftMetadata&& value) { m_redshiftHasBeenSet = true; m_redshift = std::move(value); }
/**
* <p> The connector metadata specific to Amazon Redshift. </p>
*/
inline ConnectorMetadata& WithRedshift(const RedshiftMetadata& value) { SetRedshift(value); return *this;}
/**
* <p> The connector metadata specific to Amazon Redshift. </p>
*/
inline ConnectorMetadata& WithRedshift(RedshiftMetadata&& value) { SetRedshift(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Amazon S3. </p>
*/
inline const S3Metadata& GetS3() const{ return m_s3; }
/**
* <p> The connector metadata specific to Amazon S3. </p>
*/
inline bool S3HasBeenSet() const { return m_s3HasBeenSet; }
/**
* <p> The connector metadata specific to Amazon S3. </p>
*/
inline void SetS3(const S3Metadata& value) { m_s3HasBeenSet = true; m_s3 = value; }
/**
* <p> The connector metadata specific to Amazon S3. </p>
*/
inline void SetS3(S3Metadata&& value) { m_s3HasBeenSet = true; m_s3 = std::move(value); }
/**
* <p> The connector metadata specific to Amazon S3. </p>
*/
inline ConnectorMetadata& WithS3(const S3Metadata& value) { SetS3(value); return *this;}
/**
* <p> The connector metadata specific to Amazon S3. </p>
*/
inline ConnectorMetadata& WithS3(S3Metadata&& value) { SetS3(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Salesforce. </p>
*/
inline const SalesforceMetadata& GetSalesforce() const{ return m_salesforce; }
/**
* <p> The connector metadata specific to Salesforce. </p>
*/
inline bool SalesforceHasBeenSet() const { return m_salesforceHasBeenSet; }
/**
* <p> The connector metadata specific to Salesforce. </p>
*/
inline void SetSalesforce(const SalesforceMetadata& value) { m_salesforceHasBeenSet = true; m_salesforce = value; }
/**
* <p> The connector metadata specific to Salesforce. </p>
*/
inline void SetSalesforce(SalesforceMetadata&& value) { m_salesforceHasBeenSet = true; m_salesforce = std::move(value); }
/**
* <p> The connector metadata specific to Salesforce. </p>
*/
inline ConnectorMetadata& WithSalesforce(const SalesforceMetadata& value) { SetSalesforce(value); return *this;}
/**
* <p> The connector metadata specific to Salesforce. </p>
*/
inline ConnectorMetadata& WithSalesforce(SalesforceMetadata&& value) { SetSalesforce(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to ServiceNow. </p>
*/
inline const ServiceNowMetadata& GetServiceNow() const{ return m_serviceNow; }
/**
* <p> The connector metadata specific to ServiceNow. </p>
*/
inline bool ServiceNowHasBeenSet() const { return m_serviceNowHasBeenSet; }
/**
* <p> The connector metadata specific to ServiceNow. </p>
*/
inline void SetServiceNow(const ServiceNowMetadata& value) { m_serviceNowHasBeenSet = true; m_serviceNow = value; }
/**
* <p> The connector metadata specific to ServiceNow. </p>
*/
inline void SetServiceNow(ServiceNowMetadata&& value) { m_serviceNowHasBeenSet = true; m_serviceNow = std::move(value); }
/**
* <p> The connector metadata specific to ServiceNow. </p>
*/
inline ConnectorMetadata& WithServiceNow(const ServiceNowMetadata& value) { SetServiceNow(value); return *this;}
/**
* <p> The connector metadata specific to ServiceNow. </p>
*/
inline ConnectorMetadata& WithServiceNow(ServiceNowMetadata&& value) { SetServiceNow(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Singular. </p>
*/
inline const SingularMetadata& GetSingular() const{ return m_singular; }
/**
* <p> The connector metadata specific to Singular. </p>
*/
inline bool SingularHasBeenSet() const { return m_singularHasBeenSet; }
/**
* <p> The connector metadata specific to Singular. </p>
*/
inline void SetSingular(const SingularMetadata& value) { m_singularHasBeenSet = true; m_singular = value; }
/**
* <p> The connector metadata specific to Singular. </p>
*/
inline void SetSingular(SingularMetadata&& value) { m_singularHasBeenSet = true; m_singular = std::move(value); }
/**
* <p> The connector metadata specific to Singular. </p>
*/
inline ConnectorMetadata& WithSingular(const SingularMetadata& value) { SetSingular(value); return *this;}
/**
* <p> The connector metadata specific to Singular. </p>
*/
inline ConnectorMetadata& WithSingular(SingularMetadata&& value) { SetSingular(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Slack. </p>
*/
inline const SlackMetadata& GetSlack() const{ return m_slack; }
/**
* <p> The connector metadata specific to Slack. </p>
*/
inline bool SlackHasBeenSet() const { return m_slackHasBeenSet; }
/**
* <p> The connector metadata specific to Slack. </p>
*/
inline void SetSlack(const SlackMetadata& value) { m_slackHasBeenSet = true; m_slack = value; }
/**
* <p> The connector metadata specific to Slack. </p>
*/
inline void SetSlack(SlackMetadata&& value) { m_slackHasBeenSet = true; m_slack = std::move(value); }
/**
* <p> The connector metadata specific to Slack. </p>
*/
inline ConnectorMetadata& WithSlack(const SlackMetadata& value) { SetSlack(value); return *this;}
/**
* <p> The connector metadata specific to Slack. </p>
*/
inline ConnectorMetadata& WithSlack(SlackMetadata&& value) { SetSlack(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Snowflake. </p>
*/
inline const SnowflakeMetadata& GetSnowflake() const{ return m_snowflake; }
/**
* <p> The connector metadata specific to Snowflake. </p>
*/
inline bool SnowflakeHasBeenSet() const { return m_snowflakeHasBeenSet; }
/**
* <p> The connector metadata specific to Snowflake. </p>
*/
inline void SetSnowflake(const SnowflakeMetadata& value) { m_snowflakeHasBeenSet = true; m_snowflake = value; }
/**
* <p> The connector metadata specific to Snowflake. </p>
*/
inline void SetSnowflake(SnowflakeMetadata&& value) { m_snowflakeHasBeenSet = true; m_snowflake = std::move(value); }
/**
* <p> The connector metadata specific to Snowflake. </p>
*/
inline ConnectorMetadata& WithSnowflake(const SnowflakeMetadata& value) { SetSnowflake(value); return *this;}
/**
* <p> The connector metadata specific to Snowflake. </p>
*/
inline ConnectorMetadata& WithSnowflake(SnowflakeMetadata&& value) { SetSnowflake(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Trend Micro. </p>
*/
inline const TrendmicroMetadata& GetTrendmicro() const{ return m_trendmicro; }
/**
* <p> The connector metadata specific to Trend Micro. </p>
*/
inline bool TrendmicroHasBeenSet() const { return m_trendmicroHasBeenSet; }
/**
* <p> The connector metadata specific to Trend Micro. </p>
*/
inline void SetTrendmicro(const TrendmicroMetadata& value) { m_trendmicroHasBeenSet = true; m_trendmicro = value; }
/**
* <p> The connector metadata specific to Trend Micro. </p>
*/
inline void SetTrendmicro(TrendmicroMetadata&& value) { m_trendmicroHasBeenSet = true; m_trendmicro = std::move(value); }
/**
* <p> The connector metadata specific to Trend Micro. </p>
*/
inline ConnectorMetadata& WithTrendmicro(const TrendmicroMetadata& value) { SetTrendmicro(value); return *this;}
/**
* <p> The connector metadata specific to Trend Micro. </p>
*/
inline ConnectorMetadata& WithTrendmicro(TrendmicroMetadata&& value) { SetTrendmicro(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Veeva. </p>
*/
inline const VeevaMetadata& GetVeeva() const{ return m_veeva; }
/**
* <p> The connector metadata specific to Veeva. </p>
*/
inline bool VeevaHasBeenSet() const { return m_veevaHasBeenSet; }
/**
* <p> The connector metadata specific to Veeva. </p>
*/
inline void SetVeeva(const VeevaMetadata& value) { m_veevaHasBeenSet = true; m_veeva = value; }
/**
* <p> The connector metadata specific to Veeva. </p>
*/
inline void SetVeeva(VeevaMetadata&& value) { m_veevaHasBeenSet = true; m_veeva = std::move(value); }
/**
* <p> The connector metadata specific to Veeva. </p>
*/
inline ConnectorMetadata& WithVeeva(const VeevaMetadata& value) { SetVeeva(value); return *this;}
/**
* <p> The connector metadata specific to Veeva. </p>
*/
inline ConnectorMetadata& WithVeeva(VeevaMetadata&& value) { SetVeeva(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Zendesk. </p>
*/
inline const ZendeskMetadata& GetZendesk() const{ return m_zendesk; }
/**
* <p> The connector metadata specific to Zendesk. </p>
*/
inline bool ZendeskHasBeenSet() const { return m_zendeskHasBeenSet; }
/**
* <p> The connector metadata specific to Zendesk. </p>
*/
inline void SetZendesk(const ZendeskMetadata& value) { m_zendeskHasBeenSet = true; m_zendesk = value; }
/**
* <p> The connector metadata specific to Zendesk. </p>
*/
inline void SetZendesk(ZendeskMetadata&& value) { m_zendeskHasBeenSet = true; m_zendesk = std::move(value); }
/**
* <p> The connector metadata specific to Zendesk. </p>
*/
inline ConnectorMetadata& WithZendesk(const ZendeskMetadata& value) { SetZendesk(value); return *this;}
/**
* <p> The connector metadata specific to Zendesk. </p>
*/
inline ConnectorMetadata& WithZendesk(ZendeskMetadata&& value) { SetZendesk(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Amazon EventBridge. </p>
*/
inline const EventBridgeMetadata& GetEventBridge() const{ return m_eventBridge; }
/**
* <p> The connector metadata specific to Amazon EventBridge. </p>
*/
inline bool EventBridgeHasBeenSet() const { return m_eventBridgeHasBeenSet; }
/**
* <p> The connector metadata specific to Amazon EventBridge. </p>
*/
inline void SetEventBridge(const EventBridgeMetadata& value) { m_eventBridgeHasBeenSet = true; m_eventBridge = value; }
/**
* <p> The connector metadata specific to Amazon EventBridge. </p>
*/
inline void SetEventBridge(EventBridgeMetadata&& value) { m_eventBridgeHasBeenSet = true; m_eventBridge = std::move(value); }
/**
* <p> The connector metadata specific to Amazon EventBridge. </p>
*/
inline ConnectorMetadata& WithEventBridge(const EventBridgeMetadata& value) { SetEventBridge(value); return *this;}
/**
* <p> The connector metadata specific to Amazon EventBridge. </p>
*/
inline ConnectorMetadata& WithEventBridge(EventBridgeMetadata&& value) { SetEventBridge(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Upsolver. </p>
*/
inline const UpsolverMetadata& GetUpsolver() const{ return m_upsolver; }
/**
* <p> The connector metadata specific to Upsolver. </p>
*/
inline bool UpsolverHasBeenSet() const { return m_upsolverHasBeenSet; }
/**
* <p> The connector metadata specific to Upsolver. </p>
*/
inline void SetUpsolver(const UpsolverMetadata& value) { m_upsolverHasBeenSet = true; m_upsolver = value; }
/**
* <p> The connector metadata specific to Upsolver. </p>
*/
inline void SetUpsolver(UpsolverMetadata&& value) { m_upsolverHasBeenSet = true; m_upsolver = std::move(value); }
/**
* <p> The connector metadata specific to Upsolver. </p>
*/
inline ConnectorMetadata& WithUpsolver(const UpsolverMetadata& value) { SetUpsolver(value); return *this;}
/**
* <p> The connector metadata specific to Upsolver. </p>
*/
inline ConnectorMetadata& WithUpsolver(UpsolverMetadata&& value) { SetUpsolver(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Amazon Connect Customer Profiles. </p>
*/
inline const CustomerProfilesMetadata& GetCustomerProfiles() const{ return m_customerProfiles; }
/**
* <p> The connector metadata specific to Amazon Connect Customer Profiles. </p>
*/
inline bool CustomerProfilesHasBeenSet() const { return m_customerProfilesHasBeenSet; }
/**
* <p> The connector metadata specific to Amazon Connect Customer Profiles. </p>
*/
inline void SetCustomerProfiles(const CustomerProfilesMetadata& value) { m_customerProfilesHasBeenSet = true; m_customerProfiles = value; }
/**
* <p> The connector metadata specific to Amazon Connect Customer Profiles. </p>
*/
inline void SetCustomerProfiles(CustomerProfilesMetadata&& value) { m_customerProfilesHasBeenSet = true; m_customerProfiles = std::move(value); }
/**
* <p> The connector metadata specific to Amazon Connect Customer Profiles. </p>
*/
inline ConnectorMetadata& WithCustomerProfiles(const CustomerProfilesMetadata& value) { SetCustomerProfiles(value); return *this;}
/**
* <p> The connector metadata specific to Amazon Connect Customer Profiles. </p>
*/
inline ConnectorMetadata& WithCustomerProfiles(CustomerProfilesMetadata&& value) { SetCustomerProfiles(std::move(value)); return *this;}
/**
* <p> The connector metadata specific to Amazon Honeycode. </p>
*/
inline const HoneycodeMetadata& GetHoneycode() const{ return m_honeycode; }
/**
* <p> The connector metadata specific to Amazon Honeycode. </p>
*/
inline bool HoneycodeHasBeenSet() const { return m_honeycodeHasBeenSet; }
/**
* <p> The connector metadata specific to Amazon Honeycode. </p>
*/
inline void SetHoneycode(const HoneycodeMetadata& value) { m_honeycodeHasBeenSet = true; m_honeycode = value; }
/**
* <p> The connector metadata specific to Amazon Honeycode. </p>
*/
inline void SetHoneycode(HoneycodeMetadata&& value) { m_honeycodeHasBeenSet = true; m_honeycode = std::move(value); }
/**
* <p> The connector metadata specific to Amazon Honeycode. </p>
*/
inline ConnectorMetadata& WithHoneycode(const HoneycodeMetadata& value) { SetHoneycode(value); return *this;}
/**
* <p> The connector metadata specific to Amazon Honeycode. </p>
*/
inline ConnectorMetadata& WithHoneycode(HoneycodeMetadata&& value) { SetHoneycode(std::move(value)); return *this;}
inline const SAPODataMetadata& GetSAPOData() const{ return m_sAPOData; }
inline bool SAPODataHasBeenSet() const { return m_sAPODataHasBeenSet; }
inline void SetSAPOData(const SAPODataMetadata& value) { m_sAPODataHasBeenSet = true; m_sAPOData = value; }
inline void SetSAPOData(SAPODataMetadata&& value) { m_sAPODataHasBeenSet = true; m_sAPOData = std::move(value); }
inline ConnectorMetadata& WithSAPOData(const SAPODataMetadata& value) { SetSAPOData(value); return *this;}
inline ConnectorMetadata& WithSAPOData(SAPODataMetadata&& value) { SetSAPOData(std::move(value)); return *this;}
private:
AmplitudeMetadata m_amplitude;
bool m_amplitudeHasBeenSet;
DatadogMetadata m_datadog;
bool m_datadogHasBeenSet;
DynatraceMetadata m_dynatrace;
bool m_dynatraceHasBeenSet;
GoogleAnalyticsMetadata m_googleAnalytics;
bool m_googleAnalyticsHasBeenSet;
InforNexusMetadata m_inforNexus;
bool m_inforNexusHasBeenSet;
MarketoMetadata m_marketo;
bool m_marketoHasBeenSet;
RedshiftMetadata m_redshift;
bool m_redshiftHasBeenSet;
S3Metadata m_s3;
bool m_s3HasBeenSet;
SalesforceMetadata m_salesforce;
bool m_salesforceHasBeenSet;
ServiceNowMetadata m_serviceNow;
bool m_serviceNowHasBeenSet;
SingularMetadata m_singular;
bool m_singularHasBeenSet;
SlackMetadata m_slack;
bool m_slackHasBeenSet;
SnowflakeMetadata m_snowflake;
bool m_snowflakeHasBeenSet;
TrendmicroMetadata m_trendmicro;
bool m_trendmicroHasBeenSet;
VeevaMetadata m_veeva;
bool m_veevaHasBeenSet;
ZendeskMetadata m_zendesk;
bool m_zendeskHasBeenSet;
EventBridgeMetadata m_eventBridge;
bool m_eventBridgeHasBeenSet;
UpsolverMetadata m_upsolver;
bool m_upsolverHasBeenSet;
CustomerProfilesMetadata m_customerProfiles;
bool m_customerProfilesHasBeenSet;
HoneycodeMetadata m_honeycode;
bool m_honeycodeHasBeenSet;
SAPODataMetadata m_sAPOData;
bool m_sAPODataHasBeenSet;
};
} // namespace Model
} // namespace Appflow
} // namespace Aws
| [
"[email protected]"
] | |
5a513ee229c405dea2704c2a323ed32c5995022d | 2f00b1f9c227cb30c8658585940d572be524998c | /src/src/lib/geneial/utility/mixins/Buildable.h | 094e2bec7c2f900c4845ce87888beae678c3416b | [
"MIT"
] | permissive | whentze/geneial | b6a92967a68551463368120b7107b1a07193ba5c | 1c03e802f0ec3eb34de134f3eb3fbe5ab62fcfe7 | refs/heads/master | 2020-05-26T01:42:57.455742 | 2019-05-22T15:26:08 | 2019-05-22T15:26:08 | 188,064,093 | 0 | 0 | null | 2019-05-22T15:17:38 | 2019-05-22T15:17:37 | null | UTF-8 | C++ | false | false | 547 | h | #pragma once
#include <memory>
#include <geneial/namespaces.h>
geneial_private_namespace(geneial)
{
geneial_private_namespace(utility)
{
geneial_export_namespace
{
template<typename C>
class Buildable
{
public:
using ptr = std::shared_ptr<C>;
using const_ptr = std::shared_ptr<const C>;
class Builder
{
public:
Builder()
{
}
virtual ~Builder()
{
}
virtual ptr create() = 0;
};
};
} /* export namespace */
} /* namespace utility */
} /* namespace geneial */
| [
"[email protected]"
] | |
b69bd75ffa43e19c3c661d85bef65e55e66ea848 | 9ae445462609dc53af297e98c428e5f297cb53c3 | /PZ1/Model2/Пчела.cpp | 8f74aa9c1651b01be949223797e799f737d8cf92 | [] | no_license | bairdob/MaximovArchitectureIS | b147e500a380b5c3110770e3f057c8ac1d1888c3 | c17e79460a697e0a5e36dc6ed67613217f8a3e0c | refs/heads/main | 2023-04-17T08:48:20.546524 | 2021-05-05T19:00:21 | 2021-05-05T19:00:21 | 339,832,774 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 92 | cpp | /**
* Project Untitled
*/
#include "Пчела.h"
/**
* Пчела implementation
*/
| [
"[email protected]"
] | |
540999c4eb9cf8ce07573070ed689809663d2f70 | d998bb0bd1182e504df724549eaf6f08aa7247fb | /Labs12/g/main.cpp | 98ed9412c4a685771e0d7fc5a0d15c1699f74c5d | [] | no_license | y0f0/ITMO-algorithms-and-data-structure | e410c17bddf6f1605800f10a4bbbee15d1511fba | 8d377c9255cb2236e0ad9cc985529fcc4612890a | refs/heads/master | 2023-06-21T07:52:45.200771 | 2021-07-27T07:52:52 | 2021-07-27T07:52:52 | 294,503,891 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 716 | cpp | #include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
using namespace std;
int main() {
ifstream in("knapsack.in");
ofstream out("knapsack.out");
int s, n, x;
vector<int> w;
in >> s >> n;
for (int i = 0; i < n; i++) {
in >> x;
w.push_back(x);
}
vector<vector<int>> answer(n+1, vector<int>(s+1));
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= s; j++) {
if (i == 0 || j == 0)
answer[i][j] = 0;
else if (w[i - 1] <= j)
answer[i][j] = max(answer[i - 1][j], answer[i - 1][j - w[i - 1]] + w[i - 1]);
else
answer[i][j] = answer[i - 1][j];
}
}
out << answer[n][s];
in.close();
out.close();
return 0;
} | [
"[email protected]"
] | |
fa2944791d077b4fe285aaadaf5e679a09169c21 | 210b894bafc50e46b04b13d1aab2fe8efee18805 | /Nouse5/StateCalibration.cpp | be673fab5670fd788d7a3cbf43cb01f7b551067f | [
"BSD-3-Clause"
] | permissive | gorodnichy/IVI-Nouse | b2c40a6fddf2a89e87551fe94ea74321c6e82cef | 347d40d7d7bb2baed65415441b7967d5f1e1c144 | refs/heads/master | 2021-07-08T07:29:11.148579 | 2017-10-04T01:46:30 | 2017-10-04T01:46:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,804 | cpp | #include "StdAfx.h"
#include "StateCalibration.h"
CStateCalibration::CStateCalibration(void) :
m_nCountConfirm(3),
m_bQuickCalibrate(false),
m_nClickBoxSize(1),
m_nCountCalibrateSelect(5)
{
m_eWhoAmI = STATE_CALIBRATION;
}
CStateCalibration::~CStateCalibration(void)
{
}
void CStateCalibration::onEntrance(CPVS* pPVS) {
m_timeTimerStart = time(0);
m_bInConfirmingStage = false;
m_nCountdown = 0;
m_pNouseControl->m_refImageData.m_pRangeMotion = &m_pNouseControl->m_rangeMotion;
if(*m_pbEnableSounds)
PlaySound(_T("sound/nouseShowNose.wav"), NULL, SND_ASYNC);
}
EState CStateCalibration::processData(CPVS* pPVS) {
int nTimerSeconds = int(difftime(time(0), m_timeTimerStart));
if(m_bQuickCalibrate) {
if(pPVS->m_fd.detectNose(&pPVS->m_imcIn)) {
PVI_POINT ptNose = *pPVS->m_fd.m_bufPtNose0.getLast();//m_pNouseControl->m_rangeMotion.ptZero;
PVI_RECT rectFace = *pPVS->m_fd.m_bufRectFace0.getLast();
m_pNouseTracker->learn(ptNose, rectFace, pPVS, NULL);
return STATE_CURSOR;
}
} else if(m_bInConfirmingStage) {
//TRACE("CONFIRMING\n");
PVI_BUFFER<PVI_3DPOINT>* bufPts = m_pNouseControl->m_refImageData.m_bufPtAbs;
m_nCountdown = m_nCountConfirm - nTimerSeconds;
PVI_RECT rectSearch = m_pNouseControl->m_refImageData.m_pRangeMotion->getRect(m_pNouseControl->m_nMotionRangeHorizontal, m_pNouseControl->m_nMotionRangeVertical);
m_pNouseTracker->track(pPVS, NULL, &rectSearch);
m_pNouseControl->m_refImageData.putAbs(*m_pNouseTracker->m_bufPtNose.getLast(), m_pNouseControl->m_nMotionRangeHorizontal, m_pNouseControl->m_nMotionRangeVertical);
//Elan09
bool bEnoughPointsInBuffer = bufPts->m_nNumElements > 5;
if(!m_nCountConfirm)
return bEnoughPointsInBuffer ? STATE_CURSOR : m_eWhoAmI;
//Elan09
m_rectConfirm.c = PVI_POINT(160/2, 120/2);
m_rectConfirm.s = PVI_POINT(160 * m_nClickBoxSize / 10.0, 120 * m_nClickBoxSize / 10.0);
EPointRectComparison ePointRectComparison = m_rectConfirm.comparePointToMe(*bufPts->getLast());
//Elan09: Put in 2nd half of and so it will work correctly when the buffer starts empty
if(ePointRectComparison != INSIDE_RECT && bEnoughPointsInBuffer)
return STATE_CURSOR;
if(m_nCountdown <= 0)
return STATE_READY;
} else {
//TRACE("COUNTDOWN\n");
m_nCountdown = m_nCountCalibrateSelect - nTimerSeconds;
/*
// Elan09
if (m_bQuickCalibrate) {
m_nCountdown = 0;
}
*/
if(m_nCountdown <= 0) {
PVI_POINT ptNose = m_pNouseControl->m_rangeMotion.ptZero;
PVI_RECT rectFace = *pPVS->m_fd.m_bufRectFace0.getLast();
m_pNouseTracker->learn(ptNose, rectFace, pPVS, NULL);
m_timeTimerStart = time(0);
m_bInConfirmingStage = true;
if(*m_pbEnableSounds)
PlaySound(_T("sound/nouseConfirm.wav"), NULL, SND_ASYNC);
}
}
return m_eWhoAmI;
} | [
"[email protected]"
] | |
760f1bd18868bcd8033ca281ee3b81baf78cee2f | 6c21e958bc79c22aaeef6ada093872add6b7167a | /src/core/timer/jobs/autoattack.cpp | ebc1a1db59cf668b6e4f3d16f69570f015849771 | [] | no_license | Ockin/trogdor-pp | 609acc27478947241f79963400c267f5a6499413 | d8899d64542ed42597511de4e5b0e51a44737e96 | refs/heads/master | 2020-12-11T07:59:34.459591 | 2015-04-02T17:51:59 | 2015-04-02T17:51:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 560 | cpp | #include "../../include/timer/jobs/autoattack.h"
using namespace std;
namespace core {
void AutoAttackTimerJob::execute(TimerJob &job) {
if (!aggressor->isAlive() || !defender->isAlive()) {
job.setExecutions(0);
return;
}
else if (!defender->isAttackable()) {
job.setExecutions(0);
return;
}
else if (aggressor->getLocation() != defender->getLocation()) {
job.setExecutions(0);
return;
}
aggressor->attack(defender, aggressor->selectWeapon());
}
}
| [
"[email protected]"
] | |
a8acd0d65148615b90770f452ce93003793dce69 | d0c7ec22315c9366af69f6ef77d9adf47f16b7f0 | /DeductionServer/DeductionServer/Net/GamePhaseUpdate.h | cdf82d26b415e3436c560cdf849fd0e405ab6b20 | [] | no_license | Muguai/Deduction | 1079f88fe149d38c8922719d649ffe2148a39341 | 8b19f79a9a2963294f92a242efa5bce4e19e1a60 | refs/heads/main | 2023-03-16T19:46:32.554912 | 2021-01-17T23:28:14 | 2021-01-17T23:28:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 324 | h | #pragma once
// WARNING : Auto-generated file, changes made will disappear when re-generated.
#include <iostream>
#pragma pack(push, 1)
class GamePhaseUpdate
{
public:
uint64_t phase;
int64_t timer;
uint64_t previous;
void serialize(std::ostream& os) const;
void deserialize(std::istream& is);
};
#pragma pack(pop)
| [
"[email protected]"
] | |
22b711d3d3043b63c97e7ab7a7e34dd2a9d9c1dd | 1923a18e2b45c3d7011ea4172975cef806e571ce | /framework/sdk/vec3.hpp | c584fde298772606bb7af92aa48d64babf61dafa | [] | no_license | sestain/hawk_sdk | 9a06f286cd59812a8973ed770198cd1d32e19ce3 | f24cd0bd1ebd7a225b849476b9f51fda8f642cae | refs/heads/main | 2023-02-26T00:06:21.037287 | 2021-01-28T09:24:12 | 2021-01-28T09:24:12 | 316,706,269 | 0 | 0 | null | 2020-11-28T10:14:56 | 2020-11-28T10:14:55 | null | UTF-8 | C++ | false | false | 6,794 | hpp | #pragma once
#include <cmath>
#include <algorithm>
#include "angles.hpp"
#define CHECK_VALID( _v ) 0
class vec2_t {
public:
vec2_t() = default;
vec2_t(float x, float y) {
this->x = x;
this->y = y;
}
float x, y;
};
class vec3_t {
public:
float x, y, z;
vec3_t() {
init();
}
vec3_t(float x, float y, float z = 0.0f) {
this->x = x;
this->y = y;
this->z = z;
}
float vLength() const
{
return sqrt(x * x + y * y + z * z);
}
void init() {
this->x = this->y = this->z = 0.0f;
}
void init(float x, float y, float z) {
this->x = x;
this->y = y;
this->z = z;
}
inline float VectorNormalize(vec3_t& v)
{
Assert(v.IsValid());
float l = v.Length();
if (l != 0.0f)
{
v /= l;
}
else
{
// FIXME:
// Just copying the existing implemenation; shouldn't res.z == 0?
v.x = v.y = 0.0f; v.z = 1.0f;
}
return l;
}
//===============================================
inline float VectorNormalize(float* v)
{
return VectorNormalize(*(reinterpret_cast<vec3_t*>(v)));
}
bool is_valid() {
return std::isfinite(this->x) && std::isfinite(this->y) && std::isfinite(this->z);
}
bool is_zero() {
return vec3_t(this->x, this->y, this->z) == vec3_t(0.0f, 0.0f, 0.0f);
}
constexpr auto not_null() const noexcept
{
return x || y || z;
}
void invalidate() {
this->x = this->y = this->z = std::numeric_limits< float >::infinity();
}
void clear() {
this->x = this->y = this->z = 0.0f;
}
float& operator[](int i) {
return ((float*) this)[i];
}
float operator[](int i) const {
return ((float*) this)[i];
}
void zero() {
this->x = this->y = this->z = 0.0f;
}
bool operator==(const vec3_t& src) const {
return (src.x == this->x) && (src.y == y) && (src.z == z);
}
bool operator!=(const vec3_t& src) const {
return (src.x != this->x) || (src.y != y) || (src.z != z);
}
vec3_t& operator+=(const vec3_t& v) {
this->x += v.x; this->y += v.y; this->z += v.z;
return *this;
}
vec3_t& operator-=(const vec3_t& v) {
this->x -= v.x; this->y -= v.y; this->z -= v.z;
return *this;
}
vec3_t& operator*=(float fl) {
this->x *= fl;
this->y *= fl;
this->z *= fl;
return *this;
}
vec3_t& operator*=(const vec3_t& v) {
this->x *= v.x;
this->y *= v.y;
this->z *= v.z;
return *this;
}
vec3_t& operator/=(const vec3_t& v) {
this->x /= v.x;
this->y /= v.y;
this->z /= v.z;
return *this;
}
vec3_t& operator+=(float fl) {
this->x += fl;
this->y += fl;
this->z += fl;
return *this;
}
vec3_t& operator/=(float fl) {
this->x /= fl;
this->y /= fl;
this->z /= fl;
return *this;
}
vec3_t& operator-=(float fl) {
this->x -= fl;
this->y -= fl;
this->z -= fl;
return *this;
}
void clamp()
{
while (this->x < -89.0f)
this->x += 89.0f;
if (this->x > 89.0f)
this->x = 89.0f;
while (this->y < -180.0f)
this->y += 360.0f;
while (this->y > 180.0f)
this->y -= 360.0f;
this->z = 0.0f;
}
#define RAD2DEG(x) ((x) * 57.29577951308232087721f)
auto to_angle() const noexcept
{
return vec3_t{RAD2DEG(std::atan2(-z, std::hypot(x, y))),
RAD2DEG(std::atan2(y, x)),
0.0f};
}
vec3_t& normalize_vec() noexcept
{
x = std::isfinite(x) ? std::remainder(x, 360.0f) : 0.0f;
y = std::isfinite(y) ? std::remainder(y, 360.0f) : 0.0f;
z = 0.0f;
return *this;
}
void normalize() {
*this = normalized();
}
vec3_t normalized() const {
auto res = *this;
auto l = res.length();
if (l != 0.0f)
res /= l;
else
res.x = res.y = res.z = 0.0f;
return res;
}
float normalize_place()
{
vec3_t vecOut = *this;
float flLength = vecOut.length();
float flRadius = 1.0f / (flLength + std::numeric_limits<float>::epsilon());
vecOut.x *= flRadius;
vecOut.y *= flRadius;
vecOut.z *= flRadius;
return flLength;
}
float dist_to(const vec3_t& vec) const {
vec3_t delta;
delta.x = this->x - vec.x;
delta.y = this->y - vec.y;
delta.z = this->z - vec.z;
return delta.length();
}
float dist_to_sqr(const vec3_t& vec) const {
vec3_t delta;
delta.x = this->x - vec.x;
delta.y = this->y - vec.y;
delta.z = this->z - vec.z;
return delta.length_sqr();
}
float dot_product(const vec3_t& vec) const {
return this->x * vec.x + this->y * vec.y + this->z * vec.z;
}
vec3_t cross_product(const vec3_t& vec) const {
return vec3_t(this->y * vec.z - this->z * vec.y, this->z * vec.x - this->x * vec.z, this->x * vec.y - this->y * vec.x);
}
float length() const {
return std::sqrtf(this->x * this->x + this->y * this->y + this->z * this->z);
}
float length_sqr() const {
return this->x * this->x + this->y * this->y + this->z * this->z;
}
float length_2d_sqr() const {
return this->x * this->x + this->y * this->y;
}
float length_2d() const {
return std::sqrtf(this->x * this->x + this->y * this->y);
}
vec3_t& operator=(const vec3_t& vec) {
this->x = vec.x; this->y = vec.y; this->z = vec.z;
return *this;
}
vec3_t operator-() const {
return vec3_t(-this->x, -this->y, -this->z);
}
vec3_t operator+(const vec3_t& v) const {
return vec3_t(this->x + v.x, this->y + v.y, this->z + v.z);
}
vec3_t operator-(const vec3_t& v) const {
return vec3_t(this->x - v.x, this->y - v.y, this->z - v.z);
}
vec3_t operator*(float fl) const {
return vec3_t(this->x * fl, this->y * fl, this->z * fl);
}
vec3_t operator*(const vec3_t& v) const {
return vec3_t(this->x * v.x, this->y * v.y, this->z * v.z);
}
vec3_t operator/(float fl) const {
return vec3_t(this->x / fl, this->y / fl, this->z / fl);
}
vec3_t operator/(const vec3_t& v) const {
return vec3_t(this->x / v.x, this->y / v.y, this->z / v.z);
}
float Length(void) const;
vec3_t Normalize();
};
__forceinline vec3_t operator*(float lhs, const vec3_t& rhs) {
return rhs * lhs;
}
__forceinline vec3_t operator/(float lhs, const vec3_t& rhs) {
return rhs / lhs;
}
inline float vector_length(const vec3_t& v)
{
return (float) sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
}
inline vec3_t vector_approach(vec3_t target, vec3_t value, float speed)
{
vec3_t diff = (target - value);
float delta = diff.length();
if (delta > speed)
value += diff.normalized() * speed;
else if (delta < -speed)
value -= diff.normalized() * speed;
else
value = target;
return value;
}
class __declspec(align(16)) vec_alligned : public vec3_t
{
public:
inline vec_alligned(void) {};
inline vec_alligned(float x, float y, float z)
{
init(x, y, z);
}
public:
explicit vec_alligned(const vec3_t& other)
{
init(other.x, other.y, other.z);
}
vec_alligned& operator=(const vec3_t& other)
{
init(other.x, other.y, other.z);
return *this;
}
vec_alligned& operator=(const vec_alligned& other)
{
init(other.x, other.y, other.z);
return *this;
}
float w;
};
| [
"[email protected]"
] | |
185dbd6507675635b3fb8882fc1fecea129bbfd6 | 1f9de3f854708161db9dd15f4c8cfbc7e40fd562 | /Source/Aria/AriaCharacter.h | 731d9fd00dccf065a5ebfea24fdfe1f0081f4251 | [] | no_license | chris-hamer/Aria | 2a1c6e058c98d6397a0865caaf852f655353eb7b | e1f3e580dcd1f4bfce8afc99eb4244f28c237281 | refs/heads/master | 2021-04-26T23:29:14.540909 | 2018-07-04T04:22:13 | 2018-07-04T04:22:13 | 124,003,476 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,415 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "AriaMovementComponent.h"
#include "AriaCharacter.generated.h"
UCLASS()
class ARIA_API AAriaCharacter : public APawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
AAriaCharacter();
UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
UAriaMovementComponent* MovementComponent;
UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UCapsuleComponent* CapsuleComponent;
UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
USkeletalMeshComponent* Model;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UFUNCTION(BlueprintCallable, Category = "Aria Character Utilities")
void TurnModel();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "State") FRotator TargetDirection;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Settings") float TurnRate = 720.0f;
};
| [
"[email protected]"
] | |
de99a2f19d03de46c98a45e52272f2cb0ccdd716 | 6eccfc50c73272c9515b91c641d0e3b3b9e7ba3c | /libraries/client/include/ohl/client/api_logger.hpp | 9e81b3775d75b802810a3810ff3943e9c8dbb856 | [] | no_license | CplSafe/CPLWallet | 5d3c380f039464124c58f3802141f15f172413b1 | 02ffa6deb8c3cdfd57a0e22ca19b12b9f348c00e | refs/heads/master | 2021-08-30T07:29:51.192084 | 2017-12-16T18:36:47 | 2017-12-16T18:36:47 | 114,468,764 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 861 | hpp |
#pragma once
#include <ohl/api/global_api_logger.hpp>
#if OHL_GLOBAL_API_LOG
#include <fc/io/iostream.hpp>
#include <fc/thread/mutex.hpp>
#include <fc/variant.hpp>
namespace ohl { namespace client {
class stream_api_logger : public ohl::api::api_logger
{
public:
stream_api_logger(fc::ostream_ptr output);
virtual ~stream_api_logger();
virtual void log_call_started ( uint64_t call_id, const ohl::api::common_api* target, const fc::string& name, const fc::variants& args ) override;
virtual void log_call_finished( uint64_t call_id, const ohl::api::common_api* target, const fc::string& name, const fc::variants& args, const fc::variant& result ) override;
virtual void close();
fc::ostream_ptr output;
fc::mutex output_mutex;
bool is_first_item;
bool is_closed;
};
} } // end namespace ohl::client
#endif
| [
"[email protected]"
] | |
0a0895069d417c7f1a859b092d862f32d62bd5a0 | f048ac073eb2bef649a7eddfc69412a3b34e82ca | /Array/arrayRotations/cyclicRotate.cpp | 9866913f7d1bcb7c9277f5afba3288c967da7ad1 | [] | no_license | tiwason/practice | 85189ce6ab2b6d2a233a54a66d8bc89211c9dde4 | e312cc39024a3d87fc2c8982aa83a2e0b38d9d21 | refs/heads/master | 2023-04-26T23:16:25.065399 | 2021-05-23T08:36:06 | 2021-05-23T08:36:06 | 315,837,804 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 785 | cpp | #include <iostream>
using namespace std;
int gcd(int a, int b)
{
if (b == 0)
return a;
else
return gcd(b, a % b);
}
void printArray(int arr[], int n)
{
int i;
for(i=0;i<n;i++)
cout << arr[i] << " ";
cout <<endl;
}
void reverse(int arr[], int start, int end)
{
while (start < end)
{
int tmp = arr[start];
arr[start] = arr[end];
arr[end] = tmp;
start++;
end--;
}
}
void cyclicRotate(int arr[], int n)
{
reverse(arr, 0, n-1);
reverse(arr, 1, n-1);
}
int main()
{
int arr[] = {1,2,3,4,5,6,7,8,9,10,11,12};
int size = sizeof(arr)/sizeof(arr[0]);
cyclicRotate(arr, size);
cout <<"Rotated array is : " << endl;
printArray(arr, size);
return 0;
} | [
"[email protected]"
] | |
418e11ba82035866b37d1a213346cd5030b25855 | 5885fd1418db54cc4b699c809cd44e625f7e23fc | /kattis/printingcosts.cpp | b7dedb7230f4ead83a9d3565a55c2e834d79f39a | [] | no_license | ehnryx/acm | c5f294a2e287a6d7003c61ee134696b2a11e9f3b | c706120236a3e55ba2aea10fb5c3daa5c1055118 | refs/heads/master | 2023-08-31T13:19:49.707328 | 2023-08-29T01:49:32 | 2023-08-29T01:49:32 | 131,941,068 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,855 | cpp | #include <bits/stdc++.h>
using namespace std;
//%:include "utility/fast_input.h"
//%:include "utility/output.h"
using ll = long long;
using ld = long double;
using pt = complex<ld>;
constexpr char nl = '\n';
constexpr int MOD = 998244353;
constexpr ld EPS = 1e-9L;
random_device _rd; mt19937 rng(_rd());
int main() {
cin.tie(0)->sync_with_stdio(0);
cout << fixed << setprecision(10);
#ifdef USING_FAST_INPUT
fast_input cin;
#endif
string dumb = R"( ! 9 " 6 # 24 $ 29 % 22
& 24 ' 3 ( 12 ) 12 * 17 + 13
, 7 - 7 . 4 / 10 0 22 1 19
2 22 3 23 4 21 5 27 6 26 7 16
8 23 9 26 : 8 ; 11 < 10 = 14
> 10 ? 15 @ 32 A 24 B 29 C 20
D 26 E 26 F 20 G 25 H 25 I 18
J 18 K 21 L 16 M 28 N 25 O 26
P 23 Q 31 R 28 S 25 T 16 U 23
V 19 W 26 X 18 Y 14 Z 22 [ 18
\ 10 ] 18 ^ 7 _ 8 ` 3 a 23
b 25 c 17 d 25 e 23 f 18 g 30
h 21 i 15 j 20 k 21 l 16 m 22
n 18 o 20 p 25 q 25 r 13 s 21
t 17 u 17 v 13 w 19 x 13 y 24
z 19 { 18 | 12 } 18 ~ 9 )";
istringstream in(dumb);
map<char, int> cost;
for(string a, b; in >> a >> b; ) {
cost[a[0]] = stoi(b);
}
for(string s; getline(cin, s); ) {
int ans = 0;
for(char c : s) {
ans += cost[c];
}
cout << ans << nl;
}
return 0;
}
| [
"[email protected]"
] | |
ef06d6d0effb581c180689639271adb9fdf8b7fa | 6bb86693b655f77784ceec252b08cb98ab7832d0 | /spoj/basic/test.cpp | 48a03c606af5b3c0809da400fc52f35af343563b | [] | no_license | rahulroshan96/placement | 52d80fc800608068303096a2f5bee7c7d8a5251c | 8d63f9e68cd510972300bab54e1e2a84d818a2df | refs/heads/master | 2020-04-12T09:37:26.388815 | 2018-11-24T07:10:02 | 2018-11-24T07:10:02 | 43,913,700 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 100 | cpp | #include <iosteam>
#include <vector>
using namespace std;
int main()
{
cout<<"Hello";
return 0;
}
| [
"[email protected]"
] | |
7f6e4a29172230ede89278a95593d99f41cd4f1d | 52ce3c5df1ea64d88f7919116a0a50ef43d5483f | /Qualification/reversort-engineering.cpp | 33a0ec44540b386ba034227eb35c71cdd7059aec | [] | no_license | jnobre/Google-Code-Jam-2021 | 0197e5fbeb485022f8f6400e765d213ac8cdaa7a | d0f5e861c1e7518a6eeec7deeb59b97430a95db3 | refs/heads/main | 2023-07-04T01:44:05.799249 | 2021-08-21T15:03:28 | 2021-08-21T15:03:28 | 394,055,818 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 703 | cpp | #include <algorithm>
#include <cstdio>
#include <numeric>
#define MAXN 100
using namespace std;
int l[MAXN], pcost[MAXN];
int main() {
int t;
scanf("%d\n", &t);
for(int tc = 1; tc <= t; tc++) {
int n, c;
scanf("%d %d\n", &n, &c);
if(c < n - 1 || c > (n - 1) * (n + 2) / 2) {
printf("Case #%d: IMPOSSIBLE\n", tc);
continue;
}
for(int i = 0; i < n - 1; i++) {
c -= pcost[i] = min(c - (n - 2 - i), n - i);
}
iota(l, l + n, 1);
for(int i = n - 2; i >= 0; i--) {
reverse(l + i, l + i + pcost[i]);
}
printf("Case #%d:", tc);
for(int i = 0; i < n; i++) {
printf(" %d", l[i]);
}
printf("\n");
}
return 0;
} | [
"[email protected]"
] | |
6c4c8e9860a6ce47a36f9c00a102f52dc03ef02a | a08e2804372e63e9070f0d8beab52733aec2b364 | /pat/1136.cpp | a9972813e8a9731111e93e9f3e7d4ad058e10a96 | [] | no_license | luer9/C | a27393addbb65944491497d5bdad7f6883605b86 | e6f1aa1cdbc6aca3132455a389cb8f0b5fe0faf1 | refs/heads/master | 2022-12-01T13:07:58.743140 | 2020-08-26T10:04:32 | 2020-08-26T10:04:32 | 290,456,724 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,691 | cpp | #include <bits/stdc++.h>
using namespace std;
int isPal(string num) {
int len = num.length();
for(int i = 0; i < len; i ++) {
if(num[i] != num[len - i - 1]) {
return 0;//不是回文
}
}
return 1;//是回文
}
string s;
int num1[1102]= {0},num2[1102]= {0},num[1102]= {0};
int main() {
#ifdef ONLINE_JUDGE
#else
freopen("in.txt", "r", stdin);
#endif
int cnt = 0;
cin >> s;
//要判断 刚开始的 是不是回文串 否则 中间有两个样例过不去
if(isPal(s)){
cout << s << " is a palindromic number." << endl;
return 0;
}
while(1) {
cnt++;
if(cnt > 10) {
cout << "Not found in 10 iterations." << endl;
return 0;
}
int index = 0;
int len = s.length();
//s 转成 数组
for(int i = 0; i < len; i++) {
num1[index] = (s[i]-'0');
num2[index++] = (s[len - i - 1] - '0');
}
// 数组加
for(int i = 0; i < index; i++) {
num[i] = num1[i] + num2[i];
}
int c = 0;
// for(int i = 0; i < index; i++) {
// cout << num[i] << " ";
// }
// cout << endl;
for(int i = 0; i < index; i++) {
num[i] = num[i] + c;
c = num[i] / 10;
num[i] %= 10;
}
if(c!=0) {
num[index] = c;
index++;
}
// for(int i = 0; i < index; i++) {
// cout << num[i] << " ";
// }
// cout << endl;
for(int i = 0; i < len; i++){
cout << s[i];
}
cout << " + ";
for(int i = 0; i < len; i++){
cout << s[len - i - 1];
}
string ans = "";
for(int i = index-1; i >= 0; i--){
ans += (num[i] + '0');
}
cout << " = " ;
cout << ans << endl;
s = ans;
if(isPal(ans)){
cout << ans << " is a palindromic number." << endl;
return 0;
}
}
return 0;
}
/*
大神精简的代码
#include <iostream>
#include <algorithm>
using namespace std;
string rev(string s) {
reverse(s.begin(), s.end());
return s;
}
string add(string s1, string s2) {
string s = s1;
int carry = 0;
for (int i = s1.size() - 1; i >= 0; i--) {
s[i] = (s1[i] - '0' + s2[i] - '0' + carry) % 10 + '0';
carry = (s1[i] - '0' + s2[i] - '0' + carry) / 10;
}
if (carry > 0) s = "1" + s;
return s;
}
int main() {
string s, sum;
int n = 10;
cin >> s;
if (s == rev(s)) {
cout << s << " is a palindromic number.\n";
return 0;
}
while (n--) {
sum = add(s, rev(s));
cout << s << " + " << rev(s) << " = " << sum << endl;
if (sum == rev(sum)) {
cout << sum << " is a palindromic number.\n";
return 0;
}
s = sum;
}
cout << "Not found in 10 iterations.\n";
return 0;
}
*/
| [
"[email protected]"
] | |
4cfba9c9e6910e9c87b196be1a19c2fc11690163 | 80f4842c6df51199c8ae676578a9e7fd2dc6ed12 | /CONTAIN/PainWall.h | 5ee5e6321be7a340e5adc221091f909a89454643 | [] | no_license | john6/CONTAIN | 79e3677841740b386f5bfb847d790456b4be68b1 | dc90e7073f44df14e6e053ff1ca67d4f682f4b94 | refs/heads/master | 2021-05-19T00:24:34.450893 | 2021-01-04T21:21:49 | 2021-01-04T21:21:49 | 251,491,588 | 1 | 2 | null | 2020-11-03T04:19:04 | 2020-03-31T03:31:34 | C++ | UTF-8 | C++ | false | false | 314 | h | #pragma once
#include "Entity.h"
class PainWall :
public Entity
{
private:
bool colorState;
sf::Color colorA;
sf::Color colorB;
hiRes_time_point lastColorSwitch;
float colorSwitchRate;
public:
void Update(float i_stepSize) override;
PainWall(Vector2f i_startPosition, RigidBody i_rb);
~PainWall();
};
| [
"[email protected]"
] | |
3ea540614f2675ffcf7d6303d661964189b4eca4 | 7391feeb5b8e31f982422bdd74517e954d8c955e | /Net/testsuite/src/HTTPCookieTest.h | adc07e6b2cb6ae07c55502a33bc605c937c941eb | [
"BSL-1.0"
] | permissive | AppAnywhere/agent-sdk | 62d762d0424fc2e8d4a98b79fb150e635adedd4d | c5495c4a1d892f2d3bca5b82a7436db7d8adff71 | refs/heads/master | 2021-01-11T15:22:01.406793 | 2016-09-01T16:36:20 | 2016-09-01T16:36:20 | 80,341,203 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 823 | h | //
// HTTPCookieTest.h
//
// $Id: //poco/1.7/Net/testsuite/src/HTTPCookieTest.h#1 $
//
// Definition of the HTTPCookieTest class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef HTTPCookieTest_INCLUDED
#define HTTPCookieTest_INCLUDED
#include "Poco/Net/Net.h"
#include "Poco/DateTime.h"
#include "CppUnit/TestCase.h"
class HTTPCookieTest: public CppUnit::TestCase
{
public:
HTTPCookieTest(const std::string& name);
~HTTPCookieTest();
void testCookie();
void testEscape();
void testUnescape();
void testExpiryFuture();
void testExpiryPast();
void testCookieExpiry(Poco::DateTime expiryTime);
void setUp();
void tearDown();
static CppUnit::Test* suite();
private:
};
#endif // HTTPCookieTest_INCLUDED
| [
"[email protected]"
] | |
0cf1381e35fb9080c3e6ed1ab8a3c21c2f60d59d | fbc8bbdf2fcafbbcf06ea87aac99aad103dfc773 | /VTK/Rendering/OpenGL2/vtkDepthPeelingPass.h | ad4d3aad03bd9cb0e3577daebc80b278b0aed67f | [
"BSD-3-Clause"
] | permissive | vildenst/In_Silico_Heart_Models | a6d3449479f2ae1226796ca8ae9c8315966c231e | dab84821e678f98cdd702620a3f0952699eace7c | refs/heads/master | 2020-12-02T20:50:19.721226 | 2017-07-24T17:27:45 | 2017-07-24T17:27:45 | 96,219,496 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,639 | h | /*=========================================================================
Program: Visualization Toolkit
Module: vtkDepthPeelingPass.h
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.
=========================================================================*/
/**
* @class vtkDepthPeelingPass
* @brief Implement an Order Independent Transparency
* render pass.
*
*
* Note that this implementation is only used as a fallback for drivers that
* don't support floating point textures. Most renderings will use the subclass
* vtkDualDepthPeelingPass instead.
*
* Render the translucent polygonal geometry of a scene without sorting
* polygons in the view direction.
*
* This pass expects an initialized depth buffer and color buffer.
* Initialized buffers means they have been cleared with farest z-value and
* background color/gradient/transparent color.
* An opaque pass may have been performed right after the initialization.
*
* The depth peeling algorithm works by rendering the translucent polygonal
* geometry multiple times (once for each peel). The actually rendering of
* the translucent polygonal geometry is performed by its delegate
* TranslucentPass. This delegate is therefore used multiple times.
*
* Its delegate is usually set to a vtkTranslucentPass.
*
* @sa
* vtkRenderPass, vtkTranslucentPass
*/
#ifndef vtkDepthPeelingPass_h
#define vtkDepthPeelingPass_h
#include "vtkRenderingOpenGL2Module.h" // For export macro
#include "vtkOpenGLRenderPass.h"
#include <vector> // STL Header
class vtkTextureObject;
class vtkOpenGLRenderWindow;
class vtkOpenGLHelper;
class VTKRENDERINGOPENGL2_EXPORT vtkDepthPeelingPass
: public vtkOpenGLRenderPass
{
public:
static vtkDepthPeelingPass *New();
vtkTypeMacro(vtkDepthPeelingPass,vtkOpenGLRenderPass);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Perform rendering according to a render state \p s.
* \pre s_exists: s!=0
*/
void Render(const vtkRenderState *s) VTK_OVERRIDE;
/**
* Release graphics resources and ask components to release their own
* resources.
* \pre w_exists: w!=0
*/
void ReleaseGraphicsResources(vtkWindow *w) VTK_OVERRIDE;
//@{
/**
* Delegate for rendering the translucent polygonal geometry.
* If it is NULL, nothing will be rendered and a warning will be emitted.
* It is usually set to a vtkTranslucentPass.
* Initial value is a NULL pointer.
*/
vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
//@}
//@{
/**
* In case of use of depth peeling technique for rendering translucent
* material, define the threshold under which the algorithm stops to
* iterate over peel layers. This is the ratio of the number of pixels
* that have been touched by the last layer over the total number of pixels
* of the viewport area.
* Initial value is 0.0, meaning rendering have to be exact. Greater values
* may speed-up the rendering with small impact on the quality.
*/
vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
vtkGetMacro(OcclusionRatio,double);
//@}
//@{
/**
* In case of depth peeling, define the maximum number of peeling layers.
* Initial value is 4. A special value of 0 means no maximum limit.
* It has to be a positive value.
*/
vtkSetMacro(MaximumNumberOfPeels,int);
vtkGetMacro(MaximumNumberOfPeels,int);
//@}
/**
* Is rendering at translucent geometry stage using depth peeling and
* rendering a layer other than the first one? (Boolean value)
* If so, the uniform variables UseTexture and Texture can be set.
* (Used by vtkOpenGLProperty or vtkOpenGLTexture)
* int GetDepthPeelingHigherLayer();
*/
// vtkOpenGLRenderPass virtuals:
bool PostReplaceShaderValues(std::string &vertexShader,
std::string &geometryShader,
std::string &fragmentShader,
vtkAbstractMapper *mapper,
vtkProp *prop) VTK_OVERRIDE;
bool SetShaderParameters(vtkShaderProgram *program,
vtkAbstractMapper *mapper, vtkProp *prop,
vtkOpenGLVertexArrayObject* VAO = NULL) VTK_OVERRIDE;
protected:
/**
* Default constructor. TranslucentPass is set to NULL.
*/
vtkDepthPeelingPass();
/**
* Destructor.
*/
~vtkDepthPeelingPass() VTK_OVERRIDE;
vtkRenderPass *TranslucentPass;
vtkTimeStamp CheckTime;
//@{
/**
* Cache viewport values for depth peeling.
*/
int ViewportX;
int ViewportY;
int ViewportWidth;
int ViewportHeight;
//@}
/**
* In case of use of depth peeling technique for rendering translucent
* material, define the threshold under which the algorithm stops to
* iterate over peel layers. This is the ratio of the number of pixels
* that have been touched by the last layer over the total number of pixels
* of the viewport area.
* Initial value is 0.0, meaning rendering have to be exact. Greater values
* may speed-up the rendering with small impact on the quality.
*/
double OcclusionRatio;
/**
* In case of depth peeling, define the maximum number of peeling layers.
* Initial value is 4. A special value of 0 means no maximum limit.
* It has to be a positive value.
*/
int MaximumNumberOfPeels;
// Is rendering at translucent geometry stage using depth peeling and
// rendering a layer other than the first one? (Boolean value)
// If so, the uniform variables UseTexture and Texture can be set.
// (Used by vtkOpenGLProperty or vtkOpenGLTexture)
int DepthPeelingHigherLayer;
vtkOpenGLHelper *FinalBlendProgram;
vtkOpenGLHelper *IntermediateBlendProgram;
vtkTextureObject *OpaqueZTexture;
vtkTextureObject *OpaqueRGBATexture;
vtkTextureObject *TranslucentRGBATexture;
vtkTextureObject *TranslucentZTexture;
vtkTextureObject *CurrentRGBATexture;
std::vector<float> *DepthZData;
void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin, bool);
void BlendFinalPeel(vtkOpenGLRenderWindow *renWin);
private:
vtkDepthPeelingPass(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
void operator=(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
};
#endif
| [
"vilde@Vildes-MBP"
] | vilde@Vildes-MBP |
5c852cecab856003d2527175d842d1b8ea862605 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_2749486_0/C++/tough/b.cpp | 85106a314630d2e3c0ae25f6d9d23a9c0a660cdf | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 405 | cpp | #include <cmath>
#include <string>
#include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
int x,y;
int ca= 0;
char ew,sn;
while(t--){
string s;
ca ++ ;
cin >> x >> y;
for(int i = 0 ;i < abs(x) ;i++){
if(x>0)
s+="WE";
else
s+="EW";
}
for(int i = 0 ;i < abs(y);i++){
if(y>0)
s+="SN";
else
s+="NS";
}
cout<<"Case #"<<ca<<": "<<s<<endl;
}
}
| [
"[email protected]"
] | |
8f8bf4cb6bbf28b42ec85e5afb907aa8bd39fe39 | 0006f89c8d952bcf14a6150e9c26c94e47fab040 | /src/trace/DXInterceptor/dxplugin/DXIntPluginLoaded.h | 2c0d973f1f4e710267b726ce5f2a1785d9abfd12 | [
"BSD-3-Clause"
] | permissive | cooperyuan/attila | eceb5d34b8c64c53ffcc52cd96b684d4f88b706f | 29a0ceab793b566c09cf81af26263e4855842c7a | refs/heads/master | 2016-09-05T18:55:56.472248 | 2013-06-29T14:42:02 | 2013-06-29T14:42:02 | 10,222,034 | 8 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,446 | h | ////////////////////////////////////////////////////////////////////////////////
#pragma once
////////////////////////////////////////////////////////////////////////////////
#include "DXIntPlugin.h"
////////////////////////////////////////////////////////////////////////////////
namespace dxplugin
{
class DXIntPluginLoaded
{
public:
DXIntPluginLoaded(const std::string& filename, HMODULE dllHandle, unsigned int version, const std::string& name);
DXIntPluginLoaded(const DXIntPluginLoaded& plugin);
virtual ~DXIntPluginLoaded();
DXIntPluginLoaded& operator = (const DXIntPluginLoaded& plugin);
const std::string& GetFileName() const;
HMODULE GetDllHandle() const;
unsigned int GetVersion() const;
const std::string& GetName() const;
unsigned int GetCounterCount() const;
bool GetCounter(unsigned int position, DXINTCOUNTERINFO* counter) const;
unsigned int AddCounter(DXINTCOUNTERINFO counter);
bool CounterExists(DXINTCOUNTERID counterID) const;
bool CounterFind(DXINTCOUNTERID counterID, DXINTCOUNTERINFO* counter) const;
protected:
std::string m_filename;
HMODULE m_dllHandle;
unsigned int m_version;
std::string m_name;
std::vector<DXINTCOUNTERINFO> m_counters;
static void CloneObjects(const DXIntPluginLoaded& orig, DXIntPluginLoaded& dest);
};
}
////////////////////////////////////////////////////////////////////////////////
| [
"[email protected]"
] | |
0fc22b70c5402b1aac2fd67193aa728250bde538 | c69118b46cdc2b7b6560debbeb8f8a67a9693ce9 | /Onyx/src/buffers/VBO.hpp | 5c77b78759c90ce7d03f70d5631a1bee8d9357c5 | [] | no_license | MrShedman/Onyx | 50c9f6fb2cd71ed97ba57e50307d6449483a6ca9 | 7cdab90ecf52eca7d7a528bc5b8e0b9af29825c1 | refs/heads/master | 2021-04-26T23:38:33.653141 | 2018-03-04T21:14:33 | 2018-03-04T21:14:33 | 123,829,588 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 471 | hpp | #pragma once
#include "GL\glew.h"
//#include "ErrorCheck.hpp"
#define check_gl_error
class VBO
{
public:
VBO(GLenum target, GLenum usage);
~VBO();
VBO(const VBO& other) = delete;
VBO operator = (const VBO&) = delete;
VBO(VBO&& other);
VBO& operator=(VBO&& other);
GLuint name() const;
void bind() const;
void unbind() const;
void data(GLsizeiptr data_size, const GLvoid* data_ptr);
private:
GLenum m_target;
GLenum m_usage;
GLuint m_name;
}; | [
"[email protected]"
] | |
7779c62c16ec35c3ad0009d888be6bdfc37c8ff2 | bd3054e3359fdeb6415ed15d76b4b98c037e2484 | /DelFEM/DelFEM_VCStaticLibrary/src/ls/preconditioner.cpp | 773ec65e3480e4bb7dbff6e3ed36bd365688db05 | [] | no_license | ryujimiya/delfem4net | 0af1619e375161b8f2a4c1c59c53f953e4d875b0 | 43ca8198ea9589d8d4b6141be16196b864c2393e | refs/heads/master | 2020-05-16T06:35:13.394134 | 2018-04-30T01:50:16 | 2018-04-30T01:50:16 | 42,876,545 | 0 | 1 | null | null | null | null | SHIFT_JIS | C++ | false | false | 13,201 | cpp | /*
Copyright (C) 2009 Nobuyuki Umetani [email protected]
This library 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 2.1 of the License, or (at your option) any later version.
This library 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 library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if defined(__VISUALC__)
#pragma warning( disable : 4786 ) // C4786なんて表示すんな( ゚Д゚)ゴルァ
#endif
#define for if(0); else for
#include <assert.h>
#include <time.h>
#include <stdio.h>
#include "delfem/matvec/matdia_blkcrs.h"
#include "delfem/matvec/matdiafrac_blkcrs.h"
#include "delfem/matvec/matfrac_blkcrs.h"
#include "delfem/matvec/vector_blk.h"
#include "delfem/matvec/solver_mg.h"
#include "delfem/matvec/ordering_blk.h"
#include "delfem/ls/preconditioner.h"
void LsSol::CPreconditioner_ILU::Clear()
{
for(unsigned int i=0;i<m_Matrix_NonDia.size();i++){
for(unsigned int j=0;j<m_Matrix_NonDia[i].size();j++){
if( m_Matrix_NonDia[i][j] != 0 ) delete m_Matrix_NonDia[i][j];
}
m_Matrix_NonDia[i].clear();
}
m_Matrix_NonDia.clear();
////////////////
for(unsigned int i=0;i<m_Matrix_Dia.size();i++){
if( m_Matrix_Dia[i] != 0 ) delete m_Matrix_Dia[i];
}
m_Matrix_Dia.clear();
////////////////
m_alev_input.clear();
m_is_ordering = false;
}
// symbolic factorization
void LsSol::CPreconditioner_ILU::SetLinearSystem(const CLinearSystem& ls)
{
// std::cout << "0 prec : set linsys " << std::endl;
if( m_is_ordering ){
/*
clock_t start,mid,end;
start = clock();
const unsigned int nlss = ls.GetNLinSysSeg();
assert( nlss == 1 );
assert( m_alev_input.size() == 0 || (m_alev_input.size() == 1 && m_alev_input[0].second == -1 ) );
unsigned int lev = 0;
if( m_alev_input.size() == 1 ){
assert( m_alev_input[0].second == -1 );
lev = m_alev_input[0].first;
}
m_order.MakeOrdering_AMD( ls.GetMatrix(0) );
// m_order.MakeOrdering_RCM2( ls.GetMatrix(0) );
// m_order.MakeOrdering_RCM( ls.GetMatrix(0) );
mid = clock();
end = clock();
printf("Ordering:%.4f Pattern:%.4f\n",(double)(mid-start)/CLOCKS_PER_SEC,(double)(end-mid)/CLOCKS_PER_SEC);
*/
m_Matrix_NonDia.resize(1);
m_Matrix_NonDia[0].push_back(0);
m_Matrix_Dia.push_back( new MatVec::CMatDiaFrac_BlkCrs(0,ls.GetMatrix(0),m_order) );
const unsigned int nblk = ls.GetMatrix(0).NBlkMatCol();
const unsigned int nlen = ls.GetMatrix(0).LenBlkCol();
m_vec.Initialize(nblk,nlen);
// std::cout << ls.GetMatrix(0).NBlkMatCol() << " " << ls.GetMatrix(0).NCrs() << " " << m_Matrix_Dia[0]->NCrs() << std::endl;
return;
}
////////////////
// std::cout << "1 prec : set linsys " << std::endl;
const unsigned int nlss = ls.GetNLinSysSeg();
m_Matrix_NonDia.resize(nlss);
for(unsigned int ilss=0;ilss<nlss;ilss++){
m_Matrix_Dia.push_back( new MatVec::CMatDiaFrac_BlkCrs(0,ls.GetMatrix(ilss)) );
for(unsigned int jlss=0;jlss<nlss;jlss++){
if( ilss == jlss || !ls.IsMatrix(ilss,jlss) ){
m_Matrix_NonDia[ilss].push_back(0);
continue;
}
m_Matrix_NonDia[ilss].push_back( new MatVec::CMatFrac_BlkCrs(ls.GetMatrix(ilss,jlss)) );
}
}
if( m_alev_input.size() == 0 && m_afill_blk.empty() ) return; // 指定が何も無ければ0 レベルのフィルイン
// std::cout << "2 prec : set linsys " << std::endl;
std::vector<int> alev;
alev.resize(nlss*nlss,0);
for(unsigned int iin=0;iin<m_alev_input.size();iin++){
const int lev = m_alev_input[iin].first;
const int ilss = m_alev_input[iin].second;
if( ilss == -1 ){
for(unsigned int i=0;i<nlss*nlss;i++){ alev[i] = lev; }
}
else{
for(unsigned int i=0;i<nlss;i++){
alev[i*nlss+ilss] = lev;
alev[ilss*nlss+i] = lev;
}
}
}
{
bool iflag = false;
for(unsigned int i=0;i<nlss*nlss;i++){
if( alev[i] != 0 ) iflag = true;
}
if( !iflag && m_afill_blk.empty() ) return;
}
// std::cout << "3 prec : set linsys " << std::endl;
for(unsigned int ilss=0;ilss<nlss;ilss++){
for(unsigned int jlss=0;jlss<nlss;jlss++){
// std::cout << "add frac ptn" << ilss << " " << jlss << std::endl;
const int lev_ij = alev[ilss*nlss+jlss];
if( ilss == jlss ){
assert( m_Matrix_Dia[ilss] != 0 );
for(unsigned int klss=0;klss<ilss;klss++){
assert( klss < ilss );
if( m_Matrix_NonDia[ilss][klss] == 0 || m_Matrix_NonDia[klss][jlss] == 0) continue;
// std::cout << " add frac ptn low up " << ilss << " " << klss << " " << jlss << std::endl;
m_Matrix_Dia[ilss]->AddFracPtnLowUp(lev_ij,
*m_Matrix_NonDia[ilss][klss], *m_Matrix_NonDia[klss][jlss] );
}
std::cout << " add frac ptn dia " << ilss << " " << ilss << " " << jlss << std::endl;
if( ilss == 0 && m_afill_blk.size() > 0 ){
m_Matrix_Dia[ilss]->AddFracPtn(lev_ij,m_afill_blk);
}
else{
m_Matrix_Dia[ilss]->AddFracPtn(lev_ij);
}
}
else{
const unsigned int kmax = ( ilss < jlss ) ? ilss : jlss;
for(unsigned int klss=0;klss<kmax+1;klss++){
if( klss == ilss && klss < jlss ){
if( m_Matrix_NonDia[ilss][jlss] == 0 ) continue;
// std::cout << " add frac ptn up " << ilss << " " << klss << " " << jlss << std::endl;
m_Matrix_NonDia[ilss][jlss]->AddFracPtnUp( *m_Matrix_Dia[klss], lev_ij);
continue;
}
if( klss == jlss && klss < ilss ){
if( m_Matrix_NonDia[ilss][jlss] == 0 ) continue;
// std::cout << " add frac ptn low " << ilss << " " << klss << " " << jlss << std::endl;
m_Matrix_NonDia[ilss][jlss]->AddFracPtnLow(*m_Matrix_Dia[klss], lev_ij);
continue;
}
if( m_Matrix_NonDia[ilss][klss] == 0 || m_Matrix_NonDia[klss][jlss] == 0 ){ continue; }
if( m_Matrix_NonDia[ilss][jlss] == 0 ){
const MatVec::CVector_Blk& res_i = ls.GetVector(-1,ilss);
const MatVec::CVector_Blk& res_j = ls.GetVector(-1,jlss);
const unsigned int nblk_i = res_i.NBlk();
const unsigned int nblk_j = res_j.NBlk();
if( res_i.Len() >= 0 && res_i.Len() >= 0 ){
// std::cout << "add matrix " << ilss << " " << jlss << std::endl;
m_Matrix_NonDia[ilss][jlss]
= new MatVec::CMatFrac_BlkCrs(nblk_i,res_i.Len(), nblk_j, res_j.Len() );
}
else{
std::cout << "Error!-->Not Implemented" << std::endl;
assert(0);
}
}
// std::cout << " add frac ptn low up" << ilss << " " << klss << " " << jlss << std::endl;
m_Matrix_NonDia[ilss][jlss]
->AddFracPtnLowUp(*m_Matrix_NonDia[ilss][klss], *m_Matrix_NonDia[klss][jlss], lev_ij);
}
}
}
}
// std::cout << "4 prec : set linsys " << std::endl;
for(unsigned int ilss=0;ilss<nlss;ilss++){
assert( m_Matrix_Dia[ilss] != 0 );
m_Matrix_Dia[ilss]->MakePatternFinalize();
for(unsigned int jlss=0;jlss<nlss;jlss++){
if( ilss == jlss ){ continue; }
if( m_Matrix_NonDia[ilss][jlss] == 0 ) continue;
// std::cout << "Pattern finalize " << ilss << " " << jlss << std::endl;
m_Matrix_NonDia[ilss][jlss]->MakePatternFinalize();
}
}
// std::cout << "5 prec : set linsys " << std::endl;
// std::cout << "End Finalize Pattern " << std::endl;
}
// numerical factorization
// 値を設定してILU分解を行う関数
// ILU分解が成功しているかどうかはもっと詳細なデータを返したい
bool LsSol::CPreconditioner_ILU::SetValue(const LsSol::CLinearSystem& ls)
{
// std::cout << "0 prec : set linsys " << std::endl;
// std::cout << "SetValue and LU decompose " << std::endl;
const unsigned int nlss = ls.GetNLinSysSeg();
if( m_is_ordering ){
assert( nlss == 1 );
m_Matrix_Dia[0]->SetValue_Initialize( ls.GetMatrix(0), m_order );
if( !m_Matrix_Dia[0]->DoILUDecomp() ){ return false; }
return true;
}
////////////////
// 値をコピー
for(unsigned int ilss=0;ilss<nlss;ilss++){
// std::cout << " 0SetValue Dia : " << ilss << std::endl;
assert( m_Matrix_Dia[ilss] != 0 );
m_Matrix_Dia[ilss]->SetValue_Initialize( ls.GetMatrix(ilss) );
// std::cout << " 1SetValue Dia : " << ilss << std::endl;
for(unsigned int jlss=0;jlss<nlss;jlss++){
if( ilss == jlss ){ continue; }
if( !ls.IsMatrix(ilss,jlss) && m_Matrix_NonDia[ilss][jlss] != 0 ){
m_Matrix_NonDia[ilss][jlss] -> SetZero();
continue;
}
if( !ls.IsMatrix(ilss,jlss) ) continue;
// std::cout << " 0Set Value : " << ilss << " " << jlss << std::endl;
m_Matrix_NonDia[ilss][jlss]->SetValue_Initialize( ls.GetMatrix(ilss,jlss) );
// std::cout << " 1Set Value : " << ilss << " " << jlss << std::endl;
}
}
// std::cout << "1 prec : set linsys " << std::endl;
////////////////
// ILU分解
for(unsigned int ilss=0;ilss<nlss;ilss++){
for(unsigned int jlss=0;jlss<nlss;jlss++){
if( ilss == jlss ){
for(unsigned int klss=0;klss<ilss;klss++){
if( m_Matrix_NonDia[ilss][klss] && m_Matrix_NonDia[klss][ilss] ){
// std::cout << "ILU Frac Dia LowUp:" << ilss << " " << klss << " " << ilss << std::endl;
if( !m_Matrix_Dia[ilss]->DoILUDecompLowUp(
*m_Matrix_NonDia[ilss][klss],
*m_Matrix_NonDia[klss][ilss] ) ){ return false; }
}
}
// std::cout << "ILU Frac Dia:" << ilss << std::endl;
if( !m_Matrix_Dia[ilss]->DoILUDecomp() ){
std::cout << "ilu frac false 33 matrix non-ordered" << std::endl;
return false;
}
}
else{
if( m_Matrix_NonDia[ilss][jlss] == 0 ) continue;
const unsigned int kmax = ( ilss < jlss ) ? ilss : jlss;
for(unsigned int klss=0;klss<kmax+1;klss++){
if( klss == ilss && klss < jlss ){
// std::cout << "ILU Frac Up:" << ilss << " " << klss << " " << jlss << std::endl;
if( !m_Matrix_NonDia[ilss][jlss]->DoILUDecompUp( *m_Matrix_Dia[ilss] ) ){ return false; }
continue;
}
if( klss == jlss && klss < ilss ){
// std::cout << "ILU Frac Low:" << ilss << " " << klss << " " << jlss << std::endl;
if( !m_Matrix_NonDia[ilss][jlss]->DoILUDecompLow( *m_Matrix_Dia[jlss] ) ){ return false; }
continue;
}
if( m_Matrix_NonDia[ilss][klss] == 0 || m_Matrix_NonDia[klss][jlss] == 0 ){ continue; }
assert( klss < ilss );
assert( klss < jlss );
// std::cout << "ILU Frac LowUp:" << ilss << " " << klss << " " << jlss << std::endl;
if( !m_Matrix_NonDia[ilss][jlss]->DoILUDecompLowUp(
*m_Matrix_NonDia[ilss][klss],
*m_Matrix_NonDia[klss][jlss] ) ){ return false; }
}
}
}
}
return true;
}
// Solve Preconditioning System
bool LsSol::CPreconditioner_ILU::SolvePrecond(LsSol::CLinearSystem& ls, unsigned int iv)
{
const unsigned int nlss = ls.GetNLinSysSeg();
if( m_is_ordering ){
assert( nlss == 1 );
m_order.OrderingVector_OldToNew(m_vec,ls.GetVector(iv,0));
m_Matrix_Dia[0]->ForwardSubstitution( m_vec);
m_Matrix_Dia[0]->BackwardSubstitution(m_vec);
m_order.OrderingVector_NewToOld(ls.GetVector(iv,0),m_vec);
return true;
}
////////////////
// Forward Substitution
for(unsigned int ilss=0;ilss<nlss;ilss++){
for(unsigned int jlss=0;jlss<ilss;jlss++){
if( !m_Matrix_NonDia[ilss][jlss] ){ continue; }
m_Matrix_NonDia[ilss][jlss]->MatVec(
-1.0,ls.GetVector(iv,jlss),1.0,ls.GetVector(iv,ilss),true);
}
m_Matrix_Dia[ilss]->ForwardSubstitution(ls.GetVector(iv,ilss));
}
// Backward Substitution
for(int ilss=(int)nlss-1;ilss>=0;ilss--){
for(unsigned int jlss=ilss+1;jlss<nlss;jlss++){
if( !m_Matrix_NonDia[ilss][jlss] ){ continue; }
m_Matrix_NonDia[ilss][jlss]->MatVec(
-1.0,ls.GetVector(iv,jlss),1.0,ls.GetVector(iv,ilss),true);
}
m_Matrix_Dia[ilss]->BackwardSubstitution(ls.GetVector(iv,ilss));
}
return true;
}
| [
"[email protected]"
] | |
3148d9ed4e0b589de89a72eff05055b44939c5c7 | 2cb7ef795d2a12cabc9c97d47bc8b868ee844b88 | /includes/mach-o_reloc.hpp | f7536a2dcaea8f68a35cced51d85b23c8909767a | [
"MIT"
] | permissive | paulhuggett/machowriter | b0a9f207761add304dfc8b544af7f99163add2d2 | 0a2cf64c55984687faa6009ad785a14a562198e5 | refs/heads/master | 2021-07-15T17:02:34.695855 | 2021-06-19T08:45:07 | 2021-06-19T08:45:07 | 187,329,540 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,310 | hpp | #ifndef MACH_O_RELOC_HPP
#define MACH_O_RELOC_HPP
#include <cstdint>
#ifdef __APPLE__
# include <mach-o/reloc.h>
# define CHECK 1
#endif
namespace mach_o {
// Format of a relocation entry of a Mach-O file. Modified from the 4.3BSD format. The
// modifications from the original format were changing the value of the r_symbolnum field for
// "local" (r_extern == 0) relocation entries. This modification is required to support symbols
// in an arbitrary number of sections not just the three sections (text, data and bss) in
// a 4.3BSD file. Also the last 4 bits have had the r_type tag added to them.
struct relocation_info {
std::int32_t r_address; ///< offset in the section to what is being relocated
std::uint32_t
r_symbolnum : 24, ///< Symbol index if r_extern == 1 or section ordinal if r_extern == 0
r_pcrel : 1, ///< Was relocated pc relative already?
r_length : 2, ///< 0=byte, 1=word, 2=long, 3=quad
r_extern : 1, ///< Does not include value of sym referenced
r_type : 4; ///< If not 0, machine specific relocation type
};
constexpr std::uint32_t r_abs = 0; /// Absolute relocation type for Mach-O files
} // end namespace mach_o
#endif // MACH_O_RELOC_HPP
| [
"[email protected]"
] | |
0954a957f916ab64a28632559f3096170b157a6e | 8bc6efba41eb3562b52a6998ade337f18b538826 | /classes/Cat.h | 55c2642c371846f7f8a965b9003fb7d63fd0b66b | [] | no_license | KaterynaDudko/cpp_course | a49ae7616d528c00d390b9b4b8b2ae8635690109 | d797a1bff3e31eb2e6e42e01a50afe2728540326 | refs/heads/master | 2022-04-15T15:02:49.777979 | 2020-03-31T13:23:30 | 2020-03-31T13:23:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 129 | h | #ifndef CAT_H_
#define CAT_H_
class Cat {
private:
bool happy;
public:
void speak();
Cat();
~Cat();
};
#endif
| [
"[email protected]"
] | |
333a10a96287986499fe9e47f7b5113083936650 | 9a646821b5a9cda524de716caf4225a733527876 | /Artem/Task 2 Matrix/Task 2 Matrix/TestMatrix.cpp | 5b7ca55317a3be765a16dc6350a10e714a9fea15 | [] | no_license | SemyonBevzuk/Programming_practice_381908-1-2 | 5cc584508de1ef2871cffad20b293d33b7a41609 | d09de61f3ea11cbc792ba117e0e3ca0171e32310 | refs/heads/master | 2021-01-01T14:47:13.137338 | 2020-06-02T12:36:11 | 2020-06-02T12:36:11 | 239,323,892 | 0 | 19 | null | 2020-06-02T12:36:12 | 2020-02-09T15:08:11 | C++ | UTF-8 | C++ | false | false | 959 | cpp | #include"Matrix.h"
using namespace std;
int main()
{
Matrix matr1, matr2(2, 1), matr3(matr2), matr4(3), matr5(3, 1), matr6(3, 3);
ifstream fin;
ofstream fout;
fin.open("MatrIn.txt");
fout.open("MatrixResult.txt");
matr3 = matr1 + matr2;
fout << "The result of adding two matrixes together:" << endl;
fout << matr3;
fout << "The fourth matrix:" << endl;
fin >> matr4;
fin.close();
fout << matr4;
matr4 = matr4.Transpose();
fout << "The transposed matrix" << endl;
fout << matr4;
matr4 = matr4 * matr5;
fout << "The result of multiplication of two matrixes:" << endl;
fout << matr4;
matr5 = matr6;
fout << "The fifth matrix:" << endl;
fout << matr5;
if (matr3.IsDagonalDominance())
fout << "The matrix has diagonal dominance" << endl;
else
fout << "The matrix does not have diagonal domination" << endl;
fout << "The result of multiplication by a number:" << endl;
matr4 = matr4 * 2;
fout << matr4;
fout.close();
return 0;
} | [
"[email protected]"
] | |
77d83dd7e681e34449845f4f98cffc244eb94d49 | 7f6d2df4f97ee88d8614881b5fa0e30d51617e61 | /孙宝泉/第5次作业/student.h | 68fec5b82002a501491ad17086f7eebabde7a8ec | [] | no_license | tsingke/Homework_Turing | 79d36b18692ec48b1b65cfb83fc21abf87fd53b0 | aa077a2ca830cdf14f4a0fd55e61822a4f99f01d | refs/heads/master | 2021-10-10T02:03:53.951212 | 2019-01-06T07:44:20 | 2019-01-06T07:44:20 | 148,451,853 | 15 | 25 | null | 2018-10-17T15:20:24 | 2018-09-12T09:01:50 | C++ | UTF-8 | C++ | false | false | 505 | h | #define _CRT_SECURE_NO_WARNINGS
#ifndef _STUDENT
#define _STUDENT
#include<iostream>
#include<string>
using namespace std;
#define SIZE 80
class Student
{
public:
Student();
Student(char* na, char* id, char* num, char* spec, int ag);
Student(const Student &per);
~Student();
char* getName();
char* getID();
char* getNumber();
char* getSpec();
int getAge();
void display();
void input();
private:
char* name;
char ID[19];
char number[10];
char speciality[20];
int age;
};
#endif
| [
"[email protected]"
] | |
94623f262d4a25fe050b06dda20515972e23294b | 59a4648976391959a2a88e43d58828920f3bfb8c | /VarioSW_as/VarioSW/src/lib/CircleFit/data.cpp | 23e4a24730457c7f9d229e3b0fe162079c504ba3 | [] | no_license | Jenatko/VariYO | 871dbcc0eda744daab0bcc484250e5c2ab2d9258 | e68f7e871c2ddfe5746fa28013cbc0fd370e1569 | refs/heads/master | 2022-09-16T14:29:45.241730 | 2022-09-03T22:28:50 | 2022-09-03T22:28:50 | 191,448,893 | 3 | 3 | null | 2021-03-17T22:39:24 | 2019-06-11T21:03:24 | C | UTF-8 | C++ | false | false | 1,952 | cpp | #include "data.h"
//
/************************************************************************
BODY OF THE MEMBER ROUTINES
************************************************************************/
// Default constructor
Data::Data()
{
write_index = 0;
n=0;
X = new reals[n];
Y = new reals[n];
for (int i=0; i<n; i++)
{
X[i]=0.;
Y[i]=0.;
}
}
// Constructor with assignment of the field N
Data::Data(int N)
{
write_index = 0;
n=N;
X = new reals[n];
Y = new reals[n];
for (int i=0; i<n; i++)
{
X[i]=0.;
Y[i]=0.;
}
}
// Constructor with assignment of each field
Data::Data(int N, reals dataX[], reals dataY[])
{
write_index = 0;
n=N;
X = new reals[n];
Y = new reals[n];
for (int i=0; i<n; i++)
{
X[i]=dataX[i];
Y[i]=dataY[i];
}
}
// Routine that computes the x- and y- sample means (the coordinates of the centeroid)
void Data::means(void)
{
meanX=0.; meanY=0.;
for (int i=0; i<n; i++)
{
meanX += X[i];
meanY += Y[i];
}
meanX /= n;
meanY /= n;
}
// Routine that centers the data set (shifts the coordinates to the centeroid)
void Data::center(void)
{
reals sX=0.,sY=0.;
int i;
for (i=0; i<n; i++)
{
sX += X[i];
sY += Y[i];
}
sX /= n;
sY /= n;
for (i=0; i<n; i++)
{
X[i] -= sX;
Y[i] -= sY;
}
meanX = 0.;
meanY = 0.;
}
// Routine that scales the coordinates (makes them of order one)
void Data::scale(void)
{
reals sXX=0.,sYY=0.,scaling;
int i;
for (i=0; i<n; i++)
{
sXX += X[i]*X[i];
sYY += Y[i]*Y[i];
}
scaling = sqrt((sXX+sYY)/n/2.0);
for (i=0; i<n; i++)
{
X[i] /= scaling;
Y[i] /= scaling;
}
}
// Printing routine
void Data::print(void)
{
//cout << endl << "The data set has " << n << " points with coordinates :"<< endl;
//for (int i=0; i<n-1; i++) cout << setprecision(7) << "(" << X[i] << ","<< Y[i] << "), ";
// cout << "(" << X[n-1] << ","<< Y[n-1] << ")\n";
}
// Destructor
Data::~Data()
{
delete[] X;
delete[] Y;
}
| [
"[email protected]"
] | |
64d78dc57eccd0aec4b67c4ba3f124a9981b91c7 | 898aba0ba23c7bfb1af1c0857ad56c814a6d32ba | /CppExamples/Pointers/PointersAndArrays/main.cpp | bab9b340c612d1b0fa011b663ab2ca6f87d95b0a | [] | no_license | andrewbolster/cppqubmarch2013 | 735d4bdefc4e2413969a5bb7a3480969549281fe | cb033fc22f5262daba9f542062d2d0ac40b38f4a | refs/heads/master | 2016-09-05T19:03:32.343921 | 2013-03-22T13:41:27 | 2013-03-22T13:41:27 | 8,875,864 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 832 | cpp |
#include<iostream>
using namespace std;
void printArrayUsingPointerArithmetic(int *);
void printArrayUsingBrackets(int *);
int main() {
int iarray[] = {101,202,303,404,505};
cout << "--- EX 1 ---" << endl;
printArrayUsingPointerArithmetic(iarray);
cout << "--- EX 2 ---" << endl;
printArrayUsingBrackets(iarray);
}
void printArrayUsingPointerArithmetic(int * i_ptr1) {
cout << *i_ptr1 << endl; //101
i_ptr1++;
cout << *i_ptr1 << endl; //202
i_ptr1++;
cout << *i_ptr1 << endl; //303
i_ptr1++;
cout << *i_ptr1 << endl; //404
i_ptr1++;
cout << *i_ptr1 << endl; //505
}
void printArrayUsingBrackets(int * i_ptr2) {
cout << i_ptr2[0] << endl; //101
cout << i_ptr2[1] << endl; //202
cout << i_ptr2[2] << endl; //303
cout << i_ptr2[3] << endl; //404
cout << i_ptr2[4] << endl; //505
} | [
"bolster@localhost.(none)"
] | bolster@localhost.(none) |
fd48062b7f64ed45b145aa67e6f02c5d5f34479f | 3cb01b55220a367f1a941599f34ad3c413ddd734 | /Project 1/Debug/DirectXTK/Inc/Audio.h | 4a02af43577b968bd09f5748d5d935b4bf587e42 | [
"MIT"
] | permissive | FreeButter/Team-Project-GP | 81d222136490b0f9c9ce76b0d2b6f5fae462d1ac | 86a603fdf936f7e7a95e26286fe321e27931fc6d | refs/heads/master | 2020-04-10T21:03:02.391126 | 2016-10-24T11:32:58 | 2016-10-24T11:32:58 | 68,062,626 | 0 | 0 | null | 2016-10-08T09:01:40 | 2016-09-13T01:30:03 | C++ | UTF-8 | C++ | false | false | 22,252 | h | //--------------------------------------------------------------------------------------
// File: Audio.h
//
// DirectXTK for Audio header
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include <objbase.h>
#include <mmreg.h>
#include <audioclient.h>
#if defined(_XBOX_ONE) && defined(_TITLE)
#include <xma2defs.h>
#pragma comment(lib,"acphal.lib")
#endif
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#pragma comment(lib,"PhoneAudioSes.lib")
#endif
#ifndef XAUDIO2_HELPER_FUNCTIONS
#define XAUDIO2_HELPER_FUNCTIONS
#endif
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
#if defined(_MSC_VER) && (_MSC_VER < 1700)
#error DirectX Tool Kit for Audio does not support VS 2010 without the DirectX SDK
#endif
#include <xaudio2.h>
#include <xaudio2fx.h>
#include <x3daudio.h>
#include <xapofx.h>
#pragma comment(lib,"xaudio2.lib")
#else
// Using XAudio 2.7 requires the DirectX SDK
#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\comdecl.h>
#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xaudio2.h>
#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xaudio2fx.h>
#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xapofx.h>
#pragma warning(push)
#pragma warning( disable : 4005 )
#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\x3daudio.h>
#pragma warning(pop)
#pragma comment(lib,"x3daudio.lib")
#pragma comment(lib,"xapofx.lib")
#endif
#include <DirectXMath.h>
#include <stdint.h>
#include <functional>
#include <memory>
#include <string>
#include <vector>
namespace DirectX
{
class SoundEffectInstance;
//----------------------------------------------------------------------------------
struct AudioStatistics
{
size_t playingOneShots; // Number of one-shot sounds currently playing
size_t playingInstances; // Number of sound effect instances currently playing
size_t allocatedInstances; // Number of SoundEffectInstance allocated
size_t allocatedVoices; // Number of XAudio2 voices allocated (standard, 3D, one-shots, and idle one-shots)
size_t allocatedVoices3d; // Number of XAudio2 voices allocated for 3D
size_t allocatedVoicesOneShot; // Number of XAudio2 voices allocated for one-shot sounds
size_t allocatedVoicesIdle; // Number of XAudio2 voices allocated for one-shot sounds but not currently in use
size_t audioBytes; // Total wave data (in bytes) in SoundEffects and in-memory WaveBanks
#if defined(_XBOX_ONE) && defined(_TITLE)
size_t xmaAudioBytes; // Total wave data (in bytes) in SoundEffects and in-memory WaveBanks allocated with ApuAlloc
#endif
};
//----------------------------------------------------------------------------------
class IVoiceNotify
{
public:
virtual void __cdecl OnBufferEnd() = 0;
// Notfication that a voice buffer has finished
// Note this is called from XAudio2's worker thread, so it should perform very minimal and thread-safe operations
virtual void __cdecl OnCriticalError() = 0;
// Notification that the audio engine encountered a critical error
virtual void __cdecl OnReset() = 0;
// Notification of an audio engine reset
virtual void __cdecl OnUpdate() = 0;
// Notification of an audio engine per-frame update (opt-in)
virtual void __cdecl OnDestroyEngine() = 0;
// Notification that the audio engine is being destroyed
virtual void __cdecl OnTrim() = 0;
// Notification of a request to trim the voice pool
virtual void __cdecl GatherStatistics(AudioStatistics& stats) const = 0;
// Contribute to statistics request
};
//----------------------------------------------------------------------------------
enum AUDIO_ENGINE_FLAGS
{
AudioEngine_Default = 0x0,
AudioEngine_EnvironmentalReverb = 0x1,
AudioEngine_ReverbUseFilters = 0x2,
AudioEngine_UseMasteringLimiter = 0x4,
AudioEngine_Debug = 0x10000,
AudioEngine_ThrowOnNoAudioHW = 0x20000,
AudioEngine_DisableVoiceReuse = 0x40000,
};
inline AUDIO_ENGINE_FLAGS operator|(AUDIO_ENGINE_FLAGS a, AUDIO_ENGINE_FLAGS b) { return static_cast<AUDIO_ENGINE_FLAGS>(static_cast<int>(a) | static_cast<int>(b)); }
enum SOUND_EFFECT_INSTANCE_FLAGS
{
SoundEffectInstance_Default = 0x0,
SoundEffectInstance_Use3D = 0x1,
SoundEffectInstance_ReverbUseFilters = 0x2,
SoundEffectInstance_NoSetPitch = 0x4,
SoundEffectInstance_UseRedirectLFE = 0x10000,
};
inline SOUND_EFFECT_INSTANCE_FLAGS operator|(SOUND_EFFECT_INSTANCE_FLAGS a, SOUND_EFFECT_INSTANCE_FLAGS b) { return static_cast<SOUND_EFFECT_INSTANCE_FLAGS>(static_cast<int>(a) | static_cast<int>(b)); }
enum AUDIO_ENGINE_REVERB
{
Reverb_Off,
Reverb_Default,
Reverb_Generic,
Reverb_Forest,
Reverb_PaddedCell,
Reverb_Room,
Reverb_Bathroom,
Reverb_LivingRoom,
Reverb_StoneRoom,
Reverb_Auditorium,
Reverb_ConcertHall,
Reverb_Cave,
Reverb_Arena,
Reverb_Hangar,
Reverb_CarpetedHallway,
Reverb_Hallway,
Reverb_StoneCorridor,
Reverb_Alley,
Reverb_City,
Reverb_Mountains,
Reverb_Quarry,
Reverb_Plain,
Reverb_ParkingLot,
Reverb_SewerPipe,
Reverb_Underwater,
Reverb_SmallRoom,
Reverb_MediumRoom,
Reverb_LargeRoom,
Reverb_MediumHall,
Reverb_LargeHall,
Reverb_Plate,
Reverb_MAX
};
enum SoundState
{
STOPPED = 0,
PLAYING,
PAUSED
};
//----------------------------------------------------------------------------------
class AudioEngine
{
public:
explicit AudioEngine(AUDIO_ENGINE_FLAGS flags = AudioEngine_Default, _In_opt_ const WAVEFORMATEX* wfx = nullptr, _In_opt_z_ const wchar_t* deviceId = nullptr,
AUDIO_STREAM_CATEGORY category = AudioCategory_GameEffects);
AudioEngine(AudioEngine&& moveFrom);
AudioEngine& operator= (AudioEngine&& moveFrom);
AudioEngine(AudioEngine const&) = delete;
AudioEngine& operator= (AudioEngine const&) = delete;
virtual ~AudioEngine();
bool __cdecl Update();
// Performs per-frame processing for the audio engine, returns false if in 'silent mode'
bool __cdecl Reset(_In_opt_ const WAVEFORMATEX* wfx = nullptr, _In_opt_z_ const wchar_t* deviceId = nullptr);
// Reset audio engine from critical error/silent mode using a new device; can also 'migrate' the graph
// Returns true if succesfully reset, false if in 'silent mode' due to no default device
// Note: One shots are lost, all SoundEffectInstances are in the STOPPED state after successful reset
void __cdecl Suspend();
void __cdecl Resume();
// Suspend/resumes audio processing (i.e. global pause/resume)
float __cdecl GetMasterVolume() const;
void __cdecl SetMasterVolume(float volume);
// Master volume property for all sounds
void __cdecl SetReverb(AUDIO_ENGINE_REVERB reverb);
void __cdecl SetReverb(_In_opt_ const XAUDIO2FX_REVERB_PARAMETERS* native);
// Sets environmental reverb for 3D positional audio (if active)
void __cdecl SetMasteringLimit(int release, int loudness);
// Sets the mastering volume limiter properties (if active)
AudioStatistics __cdecl GetStatistics() const;
// Gathers audio engine statistics
WAVEFORMATEXTENSIBLE __cdecl GetOutputFormat() const;
// Returns the format consumed by the mastering voice (which is the same as the device output if defaults are used)
uint32_t __cdecl GetChannelMask() const;
// Returns the output channel mask
int __cdecl GetOutputChannels() const;
// Returns the number of output channels
bool __cdecl IsAudioDevicePresent() const;
// Returns true if the audio graph is operating normally, false if in 'silent mode'
bool __cdecl IsCriticalError() const;
// Returns true if the audio graph is halted due to a critical error (which also places the engine into 'silent mode')
// Voice pool management.
void __cdecl SetDefaultSampleRate(int sampleRate);
// Sample rate for voices in the reuse pool (defaults to 44100)
void __cdecl SetMaxVoicePool(size_t maxOneShots, size_t maxInstances);
// Maximum number of voices to allocate for one-shots and instances
// Note: one-shots over this limit are ignored; too many instance voices throws an exception
void __cdecl TrimVoicePool();
// Releases any currently unused voices
// Internal-use functions
void __cdecl AllocateVoice(_In_ const WAVEFORMATEX* wfx, SOUND_EFFECT_INSTANCE_FLAGS flags, bool oneshot, _Outptr_result_maybenull_ IXAudio2SourceVoice** voice);
void __cdecl DestroyVoice(_In_ IXAudio2SourceVoice* voice);
// Should only be called for instance voices, not one-shots
void __cdecl RegisterNotify(_In_ IVoiceNotify* notify, bool usesUpdate);
void __cdecl UnregisterNotify(_In_ IVoiceNotify* notify, bool usesOneShots, bool usesUpdate);
// XAudio2 interface access
IXAudio2* __cdecl GetInterface() const;
IXAudio2MasteringVoice* __cdecl GetMasterVoice() const;
IXAudio2SubmixVoice* __cdecl GetReverbVoice() const;
X3DAUDIO_HANDLE& __cdecl Get3DHandle() const;
// Static functions
struct RendererDetail
{
std::wstring deviceId;
std::wstring description;
};
static std::vector<RendererDetail> __cdecl GetRendererDetails();
// Returns a list of valid audio endpoint devices
private:
// Private implementation.
class Impl;
std::unique_ptr<Impl> pImpl;
};
//----------------------------------------------------------------------------------
class WaveBank
{
public:
WaveBank(_In_ AudioEngine* engine, _In_z_ const wchar_t* wbFileName);
WaveBank(WaveBank&& moveFrom);
WaveBank& operator= (WaveBank&& moveFrom);
WaveBank(WaveBank const&) = delete;
WaveBank& operator= (WaveBank const&) = delete;
virtual ~WaveBank();
void __cdecl Play(int index);
void __cdecl Play(int index, float volume, float pitch, float pan);
void __cdecl Play(_In_z_ const char* name);
void __cdecl Play(_In_z_ const char* name, float volume, float pitch, float pan);
std::unique_ptr<SoundEffectInstance> __cdecl CreateInstance(int index, SOUND_EFFECT_INSTANCE_FLAGS flags = SoundEffectInstance_Default);
std::unique_ptr<SoundEffectInstance> __cdecl CreateInstance(_In_z_ const char* name, SOUND_EFFECT_INSTANCE_FLAGS flags = SoundEffectInstance_Default);
bool __cdecl IsPrepared() const;
bool __cdecl IsInUse() const;
bool __cdecl IsStreamingBank() const;
size_t __cdecl GetSampleSizeInBytes(int index) const;
// Returns size of wave audio data
size_t __cdecl GetSampleDuration(int index) const;
// Returns the duration in samples
size_t __cdecl GetSampleDurationMS(int index) const;
// Returns the duration in milliseconds
const WAVEFORMATEX* __cdecl GetFormat(int index, _Out_writes_bytes_(maxsize) WAVEFORMATEX* wfx, size_t maxsize) const;
int __cdecl Find(_In_z_ const char* name) const;
#if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/ )
bool __cdecl FillSubmitBuffer(int index, _Out_ XAUDIO2_BUFFER& buffer, _Out_ XAUDIO2_BUFFER_WMA& wmaBuffer) const;
#else
void __cdecl FillSubmitBuffer(int index, _Out_ XAUDIO2_BUFFER& buffer) const;
#endif
private:
// Private implementation.
class Impl;
std::unique_ptr<Impl> pImpl;
// Private interface
void __cdecl UnregisterInstance(_In_ SoundEffectInstance* instance);
friend class SoundEffectInstance;
};
//----------------------------------------------------------------------------------
class SoundEffect
{
public:
SoundEffect(_In_ AudioEngine* engine, _In_z_ const wchar_t* waveFileName);
SoundEffect(_In_ AudioEngine* engine, _Inout_ std::unique_ptr<uint8_t[]>& wavData,
_In_ const WAVEFORMATEX* wfx, _In_reads_bytes_(audioBytes) const uint8_t* startAudio, size_t audioBytes);
SoundEffect(_In_ AudioEngine* engine, _Inout_ std::unique_ptr<uint8_t[]>& wavData,
_In_ const WAVEFORMATEX* wfx, _In_reads_bytes_(audioBytes) const uint8_t* startAudio, size_t audioBytes,
uint32_t loopStart, uint32_t loopLength);
#if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)
SoundEffect(_In_ AudioEngine* engine, _Inout_ std::unique_ptr<uint8_t[]>& wavData,
_In_ const WAVEFORMATEX* wfx, _In_reads_bytes_(audioBytes) const uint8_t* startAudio, size_t audioBytes,
_In_reads_(seekCount) const uint32_t* seekTable, size_t seekCount);
#endif
SoundEffect(SoundEffect&& moveFrom);
SoundEffect& operator= (SoundEffect&& moveFrom);
SoundEffect(SoundEffect const&) = delete;
SoundEffect& operator= (SoundEffect const&) = delete;
virtual ~SoundEffect();
void __cdecl Play();
void __cdecl Play(float volume, float pitch, float pan);
std::unique_ptr<SoundEffectInstance> __cdecl CreateInstance(SOUND_EFFECT_INSTANCE_FLAGS flags = SoundEffectInstance_Default);
bool __cdecl IsInUse() const;
size_t __cdecl GetSampleSizeInBytes() const;
// Returns size of wave audio data
size_t __cdecl GetSampleDuration() const;
// Returns the duration in samples
size_t __cdecl GetSampleDurationMS() const;
// Returns the duration in milliseconds
const WAVEFORMATEX* __cdecl GetFormat() const;
#if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)
bool __cdecl FillSubmitBuffer(_Out_ XAUDIO2_BUFFER& buffer, _Out_ XAUDIO2_BUFFER_WMA& wmaBuffer) const;
#else
void __cdecl FillSubmitBuffer(_Out_ XAUDIO2_BUFFER& buffer) const;
#endif
private:
// Private implementation.
class Impl;
std::unique_ptr<Impl> pImpl;
// Private interface
void __cdecl UnregisterInstance(_In_ SoundEffectInstance* instance);
friend class SoundEffectInstance;
};
//----------------------------------------------------------------------------------
struct AudioListener : public X3DAUDIO_LISTENER
{
AudioListener()
{
memset(this, 0, sizeof(X3DAUDIO_LISTENER));
OrientFront.z = -1.f;
OrientTop.y = 1.f;
}
void XM_CALLCONV SetPosition(FXMVECTOR v)
{
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Position), v);
}
void __cdecl SetPosition(const XMFLOAT3& pos)
{
Position.x = pos.x;
Position.y = pos.y;
Position.z = pos.z;
}
void XM_CALLCONV SetVelocity(FXMVECTOR v)
{
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Velocity), v);
}
void __cdecl SetVelocity(const XMFLOAT3& vel)
{
Velocity.x = vel.x;
Velocity.y = vel.y;
Velocity.z = vel.z;
}
void XM_CALLCONV SetOrientation(FXMVECTOR forward, FXMVECTOR up)
{
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientFront), forward);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientTop), up);
}
void __cdecl SetOrientation(const XMFLOAT3& forward, const XMFLOAT3& up)
{
OrientFront.x = forward.x; OrientTop.x = up.x;
OrientFront.y = forward.y; OrientTop.y = up.y;
OrientFront.z = forward.z; OrientTop.z = up.z;
}
void XM_CALLCONV SetOrientationFromQuaternion(FXMVECTOR quat)
{
XMVECTOR forward = XMVector3Rotate(g_XMIdentityR2, quat);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientFront), forward);
XMVECTOR up = XMVector3Rotate(g_XMIdentityR1, quat);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientTop), up);
}
void XM_CALLCONV Update(FXMVECTOR newPos, XMVECTOR upDir, float dt)
// Updates velocity and orientation by tracking changes in position over time...
{
if (dt > 0.f)
{
XMVECTOR lastPos = XMLoadFloat3(reinterpret_cast<const XMFLOAT3*>(&Position));
XMVECTOR vDelta = (newPos - lastPos);
XMVECTOR v = vDelta / dt;
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Velocity), v);
vDelta = XMVector3Normalize(vDelta);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientFront), vDelta);
v = XMVector3Cross(upDir, vDelta);
v = XMVector3Normalize(v);
v = XMVector3Cross(vDelta, v);
v = XMVector3Normalize(v);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientTop), v);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Position), newPos);
}
}
};
//----------------------------------------------------------------------------------
struct AudioEmitter : public X3DAUDIO_EMITTER
{
float EmitterAzimuths[XAUDIO2_MAX_AUDIO_CHANNELS];
AudioEmitter()
{
memset(this, 0, sizeof(X3DAUDIO_EMITTER));
memset(EmitterAzimuths, 0, sizeof(EmitterAzimuths));
OrientFront.z = -1.f;
OrientTop.y =
ChannelRadius =
CurveDistanceScaler =
DopplerScaler = 1.f;
ChannelCount = 1;
pChannelAzimuths = EmitterAzimuths;
InnerRadiusAngle = X3DAUDIO_PI / 4.0f;
}
void XM_CALLCONV SetPosition(FXMVECTOR v)
{
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Position), v);
}
void __cdecl SetPosition(const XMFLOAT3& pos)
{
Position.x = pos.x;
Position.y = pos.y;
Position.z = pos.z;
}
void XM_CALLCONV SetVelocity(FXMVECTOR v)
{
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Velocity), v);
}
void __cdecl SetVelocity(const XMFLOAT3& vel)
{
Velocity.x = vel.x;
Velocity.y = vel.y;
Velocity.z = vel.z;
}
void XM_CALLCONV SetOrientation(FXMVECTOR forward, FXMVECTOR up)
{
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientFront), forward);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientTop), up);
}
void __cdecl SetOrientation(const XMFLOAT3& forward, const XMFLOAT3& up)
{
OrientFront.x = forward.x; OrientTop.x = up.x;
OrientFront.y = forward.y; OrientTop.y = up.y;
OrientFront.z = forward.z; OrientTop.z = up.z;
}
void XM_CALLCONV SetOrientationFromQuaternion(FXMVECTOR quat)
{
XMVECTOR forward = XMVector3Rotate(g_XMIdentityR2, quat);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientFront), forward);
XMVECTOR up = XMVector3Rotate(g_XMIdentityR1, quat);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientTop), up);
}
void XM_CALLCONV Update(FXMVECTOR newPos, XMVECTOR upDir, float dt)
// Updates velocity and orientation by tracking changes in position over time...
{
if (dt > 0.f)
{
XMVECTOR lastPos = XMLoadFloat3(reinterpret_cast<const XMFLOAT3*>(&Position));
XMVECTOR vDelta = (newPos - lastPos);
XMVECTOR v = vDelta / dt;
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Velocity), v);
vDelta = XMVector3Normalize(vDelta);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientFront), vDelta);
v = XMVector3Cross(upDir, vDelta);
v = XMVector3Normalize(v);
v = XMVector3Cross(vDelta, v);
v = XMVector3Normalize(v);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&OrientTop), v);
XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(&Position), newPos);
}
}
};
//----------------------------------------------------------------------------------
class SoundEffectInstance
{
public:
SoundEffectInstance(SoundEffectInstance&& moveFrom);
SoundEffectInstance& operator= (SoundEffectInstance&& moveFrom);
SoundEffectInstance(SoundEffectInstance const&) = delete;
SoundEffectInstance& operator= (SoundEffectInstance const&) = delete;
virtual ~SoundEffectInstance();
void __cdecl Play(bool loop = false);
void __cdecl Stop(bool immediate = true);
void __cdecl Pause();
void __cdecl Resume();
void __cdecl SetVolume(float volume);
void __cdecl SetPitch(float pitch);
void __cdecl SetPan(float pan);
void __cdecl Apply3D(const AudioListener& listener, const AudioEmitter& emitter, bool rhcoords = true);
bool __cdecl IsLooped() const;
SoundState __cdecl GetState();
// Notifications.
void __cdecl OnDestroyParent();
private:
// Private implementation.
class Impl;
std::unique_ptr<Impl> pImpl;
// Private constructors
SoundEffectInstance(_In_ AudioEngine* engine, _In_ SoundEffect* effect, SOUND_EFFECT_INSTANCE_FLAGS flags);
SoundEffectInstance(_In_ AudioEngine* engine, _In_ WaveBank* effect, int index, SOUND_EFFECT_INSTANCE_FLAGS flags);
friend std::unique_ptr<SoundEffectInstance> __cdecl SoundEffect::CreateInstance(SOUND_EFFECT_INSTANCE_FLAGS);
friend std::unique_ptr<SoundEffectInstance> __cdecl WaveBank::CreateInstance(int, SOUND_EFFECT_INSTANCE_FLAGS);
};
//----------------------------------------------------------------------------------
class DynamicSoundEffectInstance
{
public:
DynamicSoundEffectInstance(_In_ AudioEngine* engine,
_In_opt_ std::function<void __cdecl(DynamicSoundEffectInstance*)> bufferNeeded,
int sampleRate, int channels, int sampleBits = 16,
SOUND_EFFECT_INSTANCE_FLAGS flags = SoundEffectInstance_Default);
DynamicSoundEffectInstance(DynamicSoundEffectInstance&& moveFrom);
DynamicSoundEffectInstance& operator= (DynamicSoundEffectInstance&& moveFrom);
DynamicSoundEffectInstance(DynamicSoundEffectInstance const&) = delete;
DynamicSoundEffectInstance& operator= (DynamicSoundEffectInstance const&) = delete;
virtual ~DynamicSoundEffectInstance();
void __cdecl Play();
void __cdecl Stop(bool immediate = true);
void __cdecl Pause();
void __cdecl Resume();
void __cdecl SetVolume(float volume);
void __cdecl SetPitch(float pitch);
void __cdecl SetPan(float pan);
void __cdecl Apply3D(const AudioListener& listener, const AudioEmitter& emitter, bool rhcoords = true);
void __cdecl SubmitBuffer(_In_reads_bytes_(audioBytes) const uint8_t* pAudioData, size_t audioBytes);
void __cdecl SubmitBuffer(_In_reads_bytes_(audioBytes) const uint8_t* pAudioData, uint32_t offset, size_t audioBytes);
SoundState __cdecl GetState();
size_t __cdecl GetSampleDuration(size_t bytes) const;
// Returns duration in samples of a buffer of a given size
size_t __cdecl GetSampleDurationMS(size_t bytes) const;
// Returns duration in milliseconds of a buffer of a given size
size_t __cdecl GetSampleSizeInBytes(uint64_t duration) const;
// Returns size of a buffer for a duration given in milliseconds
int __cdecl GetPendingBufferCount() const;
const WAVEFORMATEX* __cdecl GetFormat() const;
private:
// Private implementation.
class Impl;
std::unique_ptr<Impl> pImpl;
};
}
| [
"[email protected]"
] | |
beae20661601c010791818772d41198b85b4df66 | 9bf8a225016e45d6ffaf76a626577c1ae60f303c | /apps/common/ospray_testing/builders/Interpolation.cpp | ba5997998b279740007564833dbb47da1362351b | [
"Apache-2.0"
] | permissive | CIBC-Internal/ospray | cccd1c7f85462486b947efa26d79c1de19022b04 | 08111292f4671ed8822e7e0374080d75c15538a2 | refs/heads/master | 2023-07-05T23:21:58.895336 | 2023-06-17T15:16:25 | 2023-06-17T15:16:25 | 130,269,553 | 0 | 1 | Apache-2.0 | 2023-06-23T23:38:17 | 2018-04-19T20:33:05 | C++ | UTF-8 | C++ | false | false | 5,343 | cpp | // Copyright 2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
// stl
#include <random>
using namespace rkcommon::math;
namespace ospray {
namespace testing {
struct Interpolation : public detail::Builder
{
Interpolation(
bool subd = false, unsigned int attrib = 0, unsigned int interp = 0)
: useSubd(subd), attribute(attrib), interpolation(interp)
{}
~Interpolation() override = default;
void commit() override;
cpp::Group buildGroup() const override;
cpp::World buildWorld() const override;
// TODO: support triangles
bool useSubd{false}; // otherwise Mesh
unsigned int attribute; // color, texcoord, normal
unsigned int interpolation; // face varying, vertex varying, uniform, constant
};
// quad mesh data
static std::vector<vec3f> vertices = {
// Left
{0.f, 0.f, 0.f},
{1.f, 0.f, 0.f},
{1.f, 1.f, 0.f},
{0.f, 1.f, 0.f},
// Right
{2.f, 0.f, 0.f},
{2.f, 1.f, 0.f}};
static std::vector<vec4ui> quad_indices = {
{0, 1, 2, 3}, // Left
{1, 4, 5, 2} // Right
};
static std::vector<unsigned int> subd_indices = {0, 1, 2, 3, 1, 4, 5, 2};
static std::vector<vec2f> texcoords = {{0.0f, 0.0f},
{0.1f, 0.0f},
{0.2f, 0.0f},
{0.3f, 0.0f},
{0.4f, 0.0f},
{0.5f, 0.0f},
{0.6f, 0.0f},
{0.7f, 0.0f}};
static std::vector<vec4f> colors = {{1.f, 0.f, 0.f, 1.f},
{0.f, 1.f, 0.f, 1.f},
{0.f, 0.f, 1.f, 1.f},
{1.f, 1.f, 0.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f}};
static std::vector<vec4f> colors_fv = {{1.f, 0.f, 0.f, 1.f},
{0.f, 1.f, 0.f, 1.f},
{0.f, 0.f, 1.f, 1.f},
{1.f, 1.f, 0.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f}};
static std::vector<vec3f> normals = {{1.f, 0.f, 0.f},
{0.f, 1.f, 0.f},
{0.f, 0.f, 1.f},
{1.f, 1.f, 0.f},
{1.f, 0.f, 1.f},
{1.f, 0.f, 1.f},
{1.f, 0.f, 1.f},
{1.f, 0.f, 1.f}};
// number of vertex indices per face
static std::vector<unsigned int> faces = {4, 4};
// Inlined definitions ////////////////////////////////////////////////////
void Interpolation::commit()
{
Builder::commit();
useSubd = getParam<bool>("useSubd", useSubd);
attribute = getParam<unsigned int>("attribute", attribute);
interpolation = getParam<unsigned int>("interpolation", interpolation);
addPlane = false;
}
cpp::Group Interpolation::buildGroup() const
{
cpp::Geometry mesh;
std::vector<vec4f> colors_mod = colors;
if (interpolation == 0)
colors_mod = colors_fv;
else if (interpolation == 2)
colors_mod.resize(2);
else if (interpolation == 3)
colors_mod.resize(1);
cpp::Texture tex("texture2d");
tex.setParam("format", OSP_TEXTURE_RGBA32F);
tex.setParam(
"data", cpp::CopiedData(colors_mod.data(), vec2ul(colors_mod.size(), 1)));
tex.commit();
cpp::Material mat(rendererType, "obj");
if (attribute == 1) // texture
mat.setParam("map_kd", tex);
mat.commit();
if (useSubd) {
mesh = cpp::Geometry("subdivision");
mesh.setParam("vertex.position", cpp::CopiedData(vertices));
mesh.setParam("face", cpp::CopiedData(faces));
mesh.setParam("level", 1.0f); // global level
mesh.setParam("index", cpp::CopiedData(subd_indices));
mesh.setParam("mode", OSP_SUBDIVISION_PIN_CORNERS);
} else {
mesh = cpp::Geometry("mesh");
mesh.setParam("vertex.position", cpp::CopiedData(vertices));
mesh.setParam("index", cpp::CopiedData(quad_indices));
}
if (interpolation == 0) {
if (attribute == 1)
mesh.setParam("texcoord", cpp::CopiedData(texcoords));
else if (attribute == 2)
mesh.setParam("normal", cpp::CopiedData(normals));
else
mesh.setParam("color", cpp::CopiedData(colors_mod));
} else if (interpolation == 1) {
if (attribute == 1)
mesh.setParam("vertex.texcoord", cpp::CopiedData(texcoords));
else if (attribute == 2)
mesh.setParam("vertex.normal", cpp::CopiedData(normals));
else
mesh.setParam("vertex.color", cpp::CopiedData(colors_mod));
}
mesh.commit();
cpp::GeometricModel model(mesh);
// create and setup a material
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
model.setParam("material", mat);
}
if ((attribute == 0) && interpolation == 2)
model.setParam("color", cpp::CopiedData(colors_mod));
else if ((attribute == 0) && interpolation == 3)
model.setParam("color", colors_mod[0]);
// Put the mesh and material into a model
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
}
cpp::World Interpolation::buildWorld() const
{
auto world = Builder::buildWorld();
cpp::Light light("distant");
light.setParam("color", vec3f(0.78f, 0.551f, 0.183f));
light.setParam("intensity", 3.14f);
light.setParam("direction", vec3f(-0.8f, -0.6f, 0.3f));
light.commit();
cpp::Light ambient("ambient");
ambient.setParam("intensity", 0.35f);
ambient.setParam("visible", false);
ambient.commit();
std::vector<cpp::Light> lights{light, ambient};
world.setParam("light", cpp::CopiedData(lights));
return world;
}
OSP_REGISTER_TESTING_BUILDER(Interpolation, interpolation);
} // namespace testing
} // namespace ospray
| [
"[email protected]"
] | |
84868f7b84102b3efe341df82cb378e3cdcd4f11 | 7c0aceac410a978a31a572d8416ea08ba50bde71 | /Shooting01/Shooting/Score.cpp | 87b8aae84c85cc3bc3af4e71b5c06d9fe19a5824 | [] | no_license | ha-k-pg-okada/SubmissionAssignments | 238dd76cc288692db6372bb2441062bc19f9b478 | 085f9ad8977dabb685060208df04671c8d0a24e4 | refs/heads/master | 2022-12-19T19:23:10.703562 | 2020-10-01T07:44:27 | 2020-10-01T07:44:27 | 293,471,279 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 2,003 | cpp | #include "Score.h"
#include "Src/Engine/Engine.h"
void Score::Update()
{
}
void Score::Iintialize(Vec2 init_pos)
{
//メンバ変数初期化
Position = Vec2(0.0f, 0.0f);
Scale = Vec2(1.0f, 1.0f);
Angle = 0.0f;
Alpha = 255;
//unsigned char Alpha;
}
void Release()
{
}
void Score::Draw()
{
int g_Score = 354;
const char* number_keys[] =
{
"Score00",
"Score01",
"Score02",
"Score03",
"Score04",
"Score05",
"Score06",
"Score07",
"Score08",
"Score09",
};
float offset = 120.0f; //数値画像のサイズ
int digit_count = 0; //行チェックの回数
int score = g_Score; //チェック用のスコア
int numbers[6] =
{
0, 2, 0, 3, 0, 0
};
//名桁の値を割り出すための処理
//do
//{
// int digit = g_Score % 10;
// g_Score /= 10;
//Engine::DrawTexture(300.0f - (offset * digit_count), 200.0f, number_keys[digit]);
// numbers[digit_count] = digit;
// digit_count++;
//} while (g_Score != 0);
for (int i = 0; i < 6; i++)
{
int key_id = numbers[i];
Engine::DrawTexture(i * 100.0, 200.0f, number_keys[key_id]);
}
//Engine::DrawTexture(Position.X, Position.Y, "Score00", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score01", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score02", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score03", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score04", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score05", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score06", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score07", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score08", Alpha, Angle, Scale.X, Scale.Y);
//Engine::DrawTexture(Position.X, Position.Y, "Score09", Alpha, Angle, Scale.X, Scale.Y);
}
| [
"[email protected]"
] | |
7c23227d2594413f58b2b3a3b8b66deb52bf0500 | 44a35c2b86a42b2b593089fd334f8e8f20b14a81 | /Phonebook/PersonsView.cpp | 0f1391f424432e7fa0f94d5e200c10e8e0f8a007 | [] | no_license | mironikolov/Phonebook | ea15d0f97af5cb2a370f89573b1f4a61f201e2a6 | d71c8f0a542a7cff831999dffe30c1abd7c373a7 | refs/heads/master | 2020-08-13T00:35:54.804724 | 2020-02-13T14:04:23 | 2020-02-13T14:04:23 | 214,875,301 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,194 | cpp | // PersonsView.cpp : implementation of the CPersonsView class
//
#include "stdafx.h"
// SHARED_HANDLERS can be defined in an ATL project implementing preview, thumbnail
// and search filter handlers and allows sharing of document code with that project.
#ifndef SHARED_HANDLERS
#include "Phonebook.h"
#endif
#include "PersonsView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#define PERSONS_NAME _T( "Име" )
#define PERSONS_SURNAME _T( "Презиме" )
#define PERSONS_LAST_NAME _T( "Фамилия" )
#define PERSONS_UCN _T( "ЕГН" )
#define PERSONS_CITY _T( "Град" )
#define PERSONS_ADDRESS _T( "Адрес" )
#define LIST_COLUMN_WIDTH 300
// CCitiesView
IMPLEMENT_DYNCREATE(CPersonsView, CListView)
BEGIN_MESSAGE_MAP( CPersonsView, CListView )
// Standard printing commands
ON_COMMAND( ID_FILE_PRINT, &CListView::OnFilePrint )
ON_COMMAND( ID_FILE_PRINT_DIRECT, &CListView::OnFilePrint )
ON_COMMAND( ID_FILE_PRINT_PREVIEW, &CListView::OnFilePrintPreview )
ON_COMMAND( ID_MENU_MODIFY, &CPersonsView::OnMenuModify )
ON_COMMAND( ID_MENU_INSERT, &CPersonsView::OnMenuInsert )
ON_COMMAND( ID_MENU_DELETE, &CPersonsView::OnMenuDelete )
ON_COMMAND( ID_MENU_VIEW, &CPersonsView::OpenListCtrlRecord )
ON_WM_CONTEXTMENU()
ON_NOTIFY_REFLECT( LVN_ITEMACTIVATE, &CPersonsView::OnLvnItemActivate )
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, &CPersonsView::OnLvnColumnclick)
END_MESSAGE_MAP()
// CCitiesView construction/destruction
CPersonsView::CPersonsView() noexcept
{
}
CPersonsView::~CPersonsView()
{
}
// Methods
// ----------------
BOOL CPersonsView::PreCreateWindow(CREATESTRUCT& cs)
{
return CListView::PreCreateWindow(cs);
}
void CPersonsView::SetRowText(const PERSONS& recPerson, UpdateViewHint eUpdateViewHint)
{
CListCtrl& oListCtrl = GetListCtrl();
int nItemCount = -1;
if (eUpdateViewHint == ViewInsert)
{
nItemCount = oListCtrl.GetItemCount();
oListCtrl.InsertItem( nItemCount, _T(""), NULL );
oListCtrl.SetItemData( nItemCount, recPerson.lID );
}
else
nItemCount = GetItemIndex( recPerson );
if ( nItemCount == -1 )
return;
oListCtrl.SetItemText( nItemCount, ColumnPersonsName, recPerson.szName );
oListCtrl.SetItemText( nItemCount, ColumnPersonsSurname, recPerson.szSurname );
oListCtrl.SetItemText( nItemCount, ColumnPersonsLastName, recPerson.szLastName );
oListCtrl.SetItemText( nItemCount, ColumnPersonsUCN, recPerson.szUCN );
oListCtrl.SetItemText( nItemCount, ColumnPersonsAddress, recPerson.szAddress );
CITIES* pCity = nullptr;
if(!GetDocument()->GetCitiesMap().Lookup( recPerson.lCityID, pCity ))
return;
if ( pCity == nullptr )
return;
oListCtrl.SetItemText( nItemCount, ColumnPersonsCity, pCity->szName );
}
void CPersonsView::InsertViewColumns()
{
CListCtrl& oListCtrl = GetListCtrl();
oListCtrl.InsertColumn( ColumnPersonsName, PERSONS_NAME, LVCFMT_LEFT, LIST_COLUMN_WIDTH );
oListCtrl.InsertColumn( ColumnPersonsSurname, PERSONS_SURNAME, LVCFMT_LEFT, LIST_COLUMN_WIDTH );
oListCtrl.InsertColumn( ColumnPersonsLastName, PERSONS_LAST_NAME, LVCFMT_LEFT, LIST_COLUMN_WIDTH );
oListCtrl.InsertColumn( ColumnPersonsUCN, PERSONS_UCN, LVCFMT_LEFT, LIST_COLUMN_WIDTH );
oListCtrl.InsertColumn( ColumnPersonsCity, PERSONS_CITY, LVCFMT_LEFT, LIST_COLUMN_WIDTH );
oListCtrl.InsertColumn( ColumnPersonsAddress, PERSONS_ADDRESS, LVCFMT_LEFT, LIST_COLUMN_WIDTH );
}
void CPersonsView::FillListCtrl()
{
const CPersonsArray& oPersonsArray = GetDocument()->GetPersonsArray();
for (int i = 0; i < oPersonsArray.GetCount(); i++)
{
PERSONS* pPerson = oPersonsArray.GetAt(i);
if (!pPerson)
return;
SetRowText(*pPerson, ViewInsert);
}
}
void CPersonsView::OnDraw(CDC* /*pDC*/)
{
CPersonsDocument* pDoc = GetDocument();
ASSERT_VALID(pDoc);
}
void CPersonsView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
ModifyListControlStyles();
InsertViewColumns();
FillListCtrl();
}
// CCitiesView printing
BOOL CPersonsView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CPersonsView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}
void CPersonsView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}
// CCitiesView diagnostics
#ifdef _DEBUG
void CPersonsView::AssertValid() const
{
CListView::AssertValid();
}
void CPersonsView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
CPersonsDocument* CPersonsView::GetDocument() const // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPersonsDocument)));
return (CPersonsDocument*)m_pDocument;
}
#endif //_DEBUG
// CCitiesView message handlers
void CPersonsView::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu oMainMenu;
oMainMenu.LoadMenuW(IDR_CONTEXTMENU);
CMenu* pSubMenu = oMainMenu.GetSubMenu(0);
if (!pSubMenu)
return;
CListCtrl& oListCtrl = GetListCtrl();
int nIndex = GetSelectedItemIndex();
if ( nIndex == -1 )
{
oMainMenu.EnableMenuItem( ID_MENU_MODIFY, MF_GRAYED );
oMainMenu.EnableMenuItem( ID_MENU_VIEW, MF_GRAYED );
oMainMenu.EnableMenuItem( ID_MENU_DELETE, MF_GRAYED );
}
(*pSubMenu).TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
}
void CPersonsView::OpenListCtrlRecord()
{
CListCtrl& oListCtrl = GetListCtrl();
int nIndex = GetSelectedItemIndex();
if (nIndex == -1)
return;
long lID = (long)oListCtrl.GetItemData( nIndex );
CPersonWithNumbers oPersonWithNumbers;
if ( !GetDocument()->SelectWhereID( lID, oPersonWithNumbers ) )
return;
const CPhoneTypesMap& oPhoneTypesMap = GetDocument()->GetPhoneTypesMap();
CPersonsDlg oPersonsDlg( oPersonWithNumbers, GetDocument()->GetCitiesMap(), oPhoneTypesMap, DialogModeView);
oPersonsDlg.DoModal();
}
void CPersonsView::OnMenuModify()
{
CListCtrl& oListCtrl = GetListCtrl();
int nIndex = GetSelectedItemIndex();
if ( nIndex == -1 )
return;
long lID = (long)oListCtrl.GetItemData( nIndex );
CPersonWithNumbers oPersonWithNumbers;
if ( !GetDocument()->SelectWhereID( lID, oPersonWithNumbers ) )
return;
const CCitiesMap& oCitiesMap = GetDocument()->GetCitiesMap();
const CPhoneTypesMap& oPhoneTypesMap = GetDocument()->GetPhoneTypesMap();
CPersonsDlg oPersonsDlg( oPersonWithNumbers, oCitiesMap, oPhoneTypesMap, DialogModeModify);
if (oPersonsDlg .DoModal() != IDOK )
return;
if (!GetDocument()->UpdateWhereID( oPersonWithNumbers.GetPerson().lID, oPersonWithNumbers))
return;
}
void CPersonsView::OnMenuInsert()
{
CPersonWithNumbers oPersonWithNumbers;
const CPhoneTypesMap& oPhoneTypesMap = GetDocument()->GetPhoneTypesMap();
const CCitiesMap& oCitiesMap = GetDocument()->GetCitiesMap();
CPersonsDlg oPersonsDlg( oPersonWithNumbers, oCitiesMap, oPhoneTypesMap, DialogModeInsert);
if ( oPersonsDlg.DoModal() != IDOK )
return;
if (!GetDocument()->Insert( oPersonWithNumbers ))
return;
}
void CPersonsView::OnMenuDelete()
{
int nMessage = MessageBox(_T("Сигурни ли сте, че искате да изтриете този запис?"), NULL, MB_YESNO);
if (nMessage != IDYES)
return;
CListCtrl& oListCtrl = GetListCtrl();
int nIndex = GetSelectedItemIndex();
if ( nIndex == -1 )
return;
long lID = (long)oListCtrl.GetItemData( nIndex );
if (!GetDocument()->DeleteWhereID(lID))
return;
}
int CPersonsView::GetItemIndex(const PERSONS& recPerson)
{
CListCtrl& oListCtrl = GetListCtrl();
for (int i = 0; i < oListCtrl.GetItemCount(); i++)
{
if (recPerson.lID == oListCtrl.GetItemData(i))
{
return i;
}
}
return -1;
}
int CPersonsView::GetSelectedItemIndex()
{
CListCtrl& oListCtrl = GetListCtrl();
POSITION oPos = oListCtrl.GetFirstSelectedItemPosition();
int nIndex = oListCtrl.GetNextSelectedItem(oPos);
return nIndex;
}
void CPersonsView::ModifyListControlStyles()
{
CListCtrl& oListCtrl = GetListCtrl();
oListCtrl.ModifyStyle(0, LVS_REPORT | LVS_SINGLESEL);
oListCtrl.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT );
}
void CPersonsView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CListCtrl& oListCtrl = GetListCtrl();
CPersonWithNumbers* pUpdateHint = static_cast<CPersonWithNumbers*>(pHint);
if (!pUpdateHint)
return;
PERSONS recPerson = pUpdateHint->GetPerson();
switch (lHint)
{
case ViewModify:
SetRowText(recPerson, ViewModify);
break;
case ViewInsert:
SetRowText(recPerson, ViewInsert);
break;
case ViewDelete:
{
int nIndex = GetItemIndex( recPerson );
if ( nIndex == -1 )
return;
oListCtrl.DeleteItem( nIndex );
}
break;
}
}
void CPersonsView::OnLvnItemActivate(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
OpenListCtrlRecord();
*pResult = 0;
}
void CPersonsView::OnLvnColumnclick(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
static int nLastColumn = -1;
static bool bAsc = true;
if (nLastColumn != pNMLV->iSubItem)
{
bAsc = true;
nLastColumn = pNMLV->iSubItem;
}
else
bAsc = !bAsc;
CListCtrl& oListCtrl = GetListCtrl();
CQSortContext oQSortContext(oListCtrl, bAsc, pNMLV->iSubItem);
GetDocument()->SortArray(oQSortContext);
oListCtrl.DeleteAllItems();
FillListCtrl();
*pResult = 0;
}
| [
"[email protected]"
] | |
028a33deea5487aa2d739cfa93321d3d22f9d1ed | 882209d255fe562b73528cc900fb7310646526a1 | /osc_sender/ip/posix/UdpSocket.cpp | 7a6e8d47c18b04d41391bb8d4f4c397719cdeb2d | [
"MIT"
] | permissive | SirDifferential/utilities | d1bec03108ccfea7aeed19f9821495119357ce6e | 39580f37c4248e0d4f1833f72818f2efb06e4a69 | refs/heads/master | 2021-01-02T23:12:46.586082 | 2018-05-04T10:37:19 | 2018-05-04T10:37:19 | 5,548,686 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 18,770 | cpp | /*
oscpack -- Open Sound Control (OSC) packet manipulation library
http://www.rossbencina.com/code/oscpack
Copyright (c) 2004-2013 Ross Bencina <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
The text above constitutes the entire oscpack license; however,
the oscpack developer(s) also make the following non-binding requests:
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version. It is also
requested that these non-binding requests be included whenever the
above license is reproduced.
*/
#include "../UdpSocket.h"
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h> // for sockaddr_in
#include <signal.h>
#include <math.h>
#include <errno.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <cstring> // for memset
#include <stdexcept>
#include <vector>
#include "../PacketListener.h"
#include "../TimerListener.h"
#if defined(__APPLE__) && !defined(_SOCKLEN_T)
// pre system 10.3 didn't have socklen_t
typedef ssize_t socklen_t;
#endif
static void SockaddrFromIpEndpointName( struct sockaddr_in& sockAddr, const IpEndpointName& endpoint )
{
std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) );
sockAddr.sin_family = AF_INET;
sockAddr.sin_addr.s_addr =
(endpoint.address == IpEndpointName::ANY_ADDRESS)
? INADDR_ANY
: htonl( endpoint.address );
sockAddr.sin_port =
(endpoint.port == IpEndpointName::ANY_PORT)
? 0
: htons( endpoint.port );
}
static IpEndpointName IpEndpointNameFromSockaddr( const struct sockaddr_in& sockAddr )
{
return IpEndpointName(
(sockAddr.sin_addr.s_addr == INADDR_ANY)
? IpEndpointName::ANY_ADDRESS
: ntohl( sockAddr.sin_addr.s_addr ),
(sockAddr.sin_port == 0)
? IpEndpointName::ANY_PORT
: ntohs( sockAddr.sin_port )
);
}
class UdpSocket::Implementation{
bool isBound_;
bool isConnected_;
int socket_;
struct sockaddr_in connectedAddr_;
struct sockaddr_in sendToAddr_;
public:
Implementation()
: isBound_( false )
, isConnected_( false )
, socket_( -1 )
{
if( (socket_ = socket( AF_INET, SOCK_DGRAM, 0 )) == -1 ){
throw std::runtime_error("unable to create udp socket\n");
}
std::memset( &sendToAddr_, 0, sizeof(sendToAddr_) );
sendToAddr_.sin_family = AF_INET;
}
~Implementation()
{
if (socket_ != -1) close(socket_);
}
void SetEnableBroadcast( bool enableBroadcast )
{
int broadcast = (enableBroadcast) ? 1 : 0; // int on posix
setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast));
}
void SetAllowReuse( bool allowReuse )
{
int reuseAddr = (allowReuse) ? 1 : 0; // int on posix
setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr));
#ifdef __APPLE__
// needed also for OS X - enable multiple listeners for a single port on same network interface
int reusePort = (allowReuse) ? 1 : 0; // int on posix
setsockopt(socket_, SOL_SOCKET, SO_REUSEPORT, &reusePort, sizeof(reusePort));
#endif
}
IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const
{
assert( isBound_ );
// first connect the socket to the remote server
struct sockaddr_in connectSockAddr;
SockaddrFromIpEndpointName( connectSockAddr, remoteEndpoint );
if (connect(socket_, (struct sockaddr *)&connectSockAddr, sizeof(connectSockAddr)) < 0) {
throw std::runtime_error("unable to connect udp socket\n");
}
// get the address
struct sockaddr_in sockAddr;
std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) );
socklen_t length = sizeof(sockAddr);
if (getsockname(socket_, (struct sockaddr *)&sockAddr, &length) < 0) {
throw std::runtime_error("unable to getsockname\n");
}
if( isConnected_ ){
// reconnect to the connected address
if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) {
throw std::runtime_error("unable to connect udp socket\n");
}
}else{
// unconnect from the remote address
struct sockaddr_in unconnectSockAddr;
std::memset( (char *)&unconnectSockAddr, 0, sizeof(unconnectSockAddr ) );
unconnectSockAddr.sin_family = AF_UNSPEC;
// address fields are zero
int connectResult = connect(socket_, (struct sockaddr *)&unconnectSockAddr, sizeof(unconnectSockAddr));
if ( connectResult < 0 && errno != EAFNOSUPPORT ) {
throw std::runtime_error("unable to un-connect udp socket\n");
}
}
return IpEndpointNameFromSockaddr( sockAddr );
}
void Connect( const IpEndpointName& remoteEndpoint )
{
SockaddrFromIpEndpointName( connectedAddr_, remoteEndpoint );
if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) {
throw std::runtime_error("unable to connect udp socket\n");
}
isConnected_ = true;
}
void Send( const char *data, std::size_t size )
{
assert( isConnected_ );
send( socket_, data, size, 0 );
}
void SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size )
{
sendToAddr_.sin_addr.s_addr = htonl( remoteEndpoint.address );
sendToAddr_.sin_port = htons( remoteEndpoint.port );
sendto( socket_, data, size, 0, (sockaddr*)&sendToAddr_, sizeof(sendToAddr_) );
}
void Bind( const IpEndpointName& localEndpoint )
{
struct sockaddr_in bindSockAddr;
SockaddrFromIpEndpointName( bindSockAddr, localEndpoint );
if (bind(socket_, (struct sockaddr *)&bindSockAddr, sizeof(bindSockAddr)) < 0) {
throw std::runtime_error("unable to bind udp socket\n");
}
isBound_ = true;
}
bool IsBound() const { return isBound_; }
std::size_t ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size )
{
assert( isBound_ );
struct sockaddr_in fromAddr;
socklen_t fromAddrLen = sizeof(fromAddr);
ssize_t result = recvfrom(socket_, data, size, 0,
(struct sockaddr *) &fromAddr, (socklen_t*)&fromAddrLen);
if( result < 0 )
return 0;
remoteEndpoint.address = ntohl(fromAddr.sin_addr.s_addr);
remoteEndpoint.port = ntohs(fromAddr.sin_port);
return (std::size_t)result;
}
int Socket() { return socket_; }
};
UdpSocket::UdpSocket()
{
impl_ = new Implementation();
}
UdpSocket::~UdpSocket()
{
delete impl_;
}
void UdpSocket::SetEnableBroadcast( bool enableBroadcast )
{
impl_->SetEnableBroadcast( enableBroadcast );
}
void UdpSocket::SetAllowReuse( bool allowReuse )
{
impl_->SetAllowReuse( allowReuse );
}
IpEndpointName UdpSocket::LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const
{
return impl_->LocalEndpointFor( remoteEndpoint );
}
void UdpSocket::Connect( const IpEndpointName& remoteEndpoint )
{
impl_->Connect( remoteEndpoint );
}
void UdpSocket::Send( const char *data, std::size_t size )
{
impl_->Send( data, size );
}
void UdpSocket::SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size )
{
impl_->SendTo( remoteEndpoint, data, size );
}
void UdpSocket::Bind( const IpEndpointName& localEndpoint )
{
impl_->Bind( localEndpoint );
}
bool UdpSocket::IsBound() const
{
return impl_->IsBound();
}
std::size_t UdpSocket::ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size )
{
return impl_->ReceiveFrom( remoteEndpoint, data, size );
}
struct AttachedTimerListener{
AttachedTimerListener( int id, int p, TimerListener *tl )
: initialDelayMs( id )
, periodMs( p )
, listener( tl ) {}
int initialDelayMs;
int periodMs;
TimerListener *listener;
};
static bool CompareScheduledTimerCalls(
const std::pair< double, AttachedTimerListener > & lhs, const std::pair< double, AttachedTimerListener > & rhs )
{
return lhs.first < rhs.first;
}
SocketReceiveMultiplexer *multiplexerInstanceToAbortWithSigInt_ = 0;
extern "C" /*static*/ void InterruptSignalHandler( int );
/*static*/ void InterruptSignalHandler( int )
{
multiplexerInstanceToAbortWithSigInt_->AsynchronousBreak();
signal( SIGINT, SIG_DFL );
}
class SocketReceiveMultiplexer::Implementation{
std::vector< std::pair< PacketListener*, UdpSocket* > > socketListeners_;
std::vector< AttachedTimerListener > timerListeners_;
volatile bool break_;
int breakPipe_[2]; // [0] is the reader descriptor and [1] the writer
double GetCurrentTimeMs() const
{
struct timeval t;
gettimeofday( &t, 0 );
return ((double)t.tv_sec*1000.) + ((double)t.tv_usec / 1000.);
}
public:
Implementation()
{
if( pipe(breakPipe_) != 0 )
throw std::runtime_error( "creation of asynchronous break pipes failed\n" );
}
~Implementation()
{
close( breakPipe_[0] );
close( breakPipe_[1] );
}
void AttachSocketListener( UdpSocket *socket, PacketListener *listener )
{
assert( std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ) == socketListeners_.end() );
// we don't check that the same socket has been added multiple times, even though this is an error
socketListeners_.push_back( std::make_pair( listener, socket ) );
}
void DetachSocketListener( UdpSocket *socket, PacketListener *listener )
{
std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i =
std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) );
assert( i != socketListeners_.end() );
socketListeners_.erase( i );
}
void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener )
{
timerListeners_.push_back( AttachedTimerListener( periodMilliseconds, periodMilliseconds, listener ) );
}
void AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener )
{
timerListeners_.push_back( AttachedTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ) );
}
void DetachPeriodicTimerListener( TimerListener *listener )
{
std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin();
while( i != timerListeners_.end() ){
if( i->listener == listener )
break;
++i;
}
assert( i != timerListeners_.end() );
timerListeners_.erase( i );
}
void Run()
{
break_ = false;
char *data = 0;
try{
// configure the master fd_set for select()
fd_set masterfds, tempfds;
FD_ZERO( &masterfds );
FD_ZERO( &tempfds );
// in addition to listening to the inbound sockets we
// also listen to the asynchronous break pipe, so that AsynchronousBreak()
// can break us out of select() from another thread.
FD_SET( breakPipe_[0], &masterfds );
int fdmax = breakPipe_[0];
for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin();
i != socketListeners_.end(); ++i ){
if( fdmax < i->second->impl_->Socket() )
fdmax = i->second->impl_->Socket();
FD_SET( i->second->impl_->Socket(), &masterfds );
}
// configure the timer queue
double currentTimeMs = GetCurrentTimeMs();
// expiry time ms, listener
std::vector< std::pair< double, AttachedTimerListener > > timerQueue_;
for( std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin();
i != timerListeners_.end(); ++i )
timerQueue_.push_back( std::make_pair( currentTimeMs + i->initialDelayMs, *i ) );
std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls );
const int MAX_BUFFER_SIZE = 4098;
data = new char[ MAX_BUFFER_SIZE ];
IpEndpointName remoteEndpoint;
struct timeval timeout;
while( !break_ ){
tempfds = masterfds;
struct timeval *timeoutPtr = 0;
if( !timerQueue_.empty() ){
double timeoutMs = timerQueue_.front().first - GetCurrentTimeMs();
if( timeoutMs < 0 )
timeoutMs = 0;
long timoutSecondsPart = (long)(timeoutMs * .001);
timeout.tv_sec = (time_t)timoutSecondsPart;
// 1000000 microseconds in a second
timeout.tv_usec = (suseconds_t)((timeoutMs - (timoutSecondsPart * 1000)) * 1000);
timeoutPtr = &timeout;
}
if( select( fdmax + 1, &tempfds, 0, 0, timeoutPtr ) < 0 ){
if( break_ ){
break;
}else if( errno == EINTR ){
// on returning an error, select() doesn't clear tempfds.
// so tempfds would remain all set, which would cause read( breakPipe_[0]...
// below to block indefinitely. therefore if select returns EINTR we restart
// the while() loop instead of continuing on to below.
continue;
}else{
throw std::runtime_error("select failed\n");
}
}
if( FD_ISSET( breakPipe_[0], &tempfds ) ){
// clear pending data from the asynchronous break pipe
char c;
read( breakPipe_[0], &c, 1 );
}
if( break_ )
break;
for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin();
i != socketListeners_.end(); ++i ){
if( FD_ISSET( i->second->impl_->Socket(), &tempfds ) ){
std::size_t size = i->second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE );
if( size > 0 ){
i->first->ProcessPacket( data, (int)size, remoteEndpoint );
if( break_ )
break;
}
}
}
// execute any expired timers
currentTimeMs = GetCurrentTimeMs();
bool resort = false;
for( std::vector< std::pair< double, AttachedTimerListener > >::iterator i = timerQueue_.begin();
i != timerQueue_.end() && i->first <= currentTimeMs; ++i ){
i->second.listener->TimerExpired();
if( break_ )
break;
i->first += i->second.periodMs;
resort = true;
}
if( resort )
std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls );
}
delete [] data;
}catch(...){
if( data )
delete [] data;
throw;
}
}
void Break()
{
break_ = true;
}
void AsynchronousBreak()
{
break_ = true;
// Send a termination message to the asynchronous break pipe, so select() will return
write( breakPipe_[1], "!", 1 );
}
};
SocketReceiveMultiplexer::SocketReceiveMultiplexer()
{
impl_ = new Implementation();
}
SocketReceiveMultiplexer::~SocketReceiveMultiplexer()
{
delete impl_;
}
void SocketReceiveMultiplexer::AttachSocketListener( UdpSocket *socket, PacketListener *listener )
{
impl_->AttachSocketListener( socket, listener );
}
void SocketReceiveMultiplexer::DetachSocketListener( UdpSocket *socket, PacketListener *listener )
{
impl_->DetachSocketListener( socket, listener );
}
void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener )
{
impl_->AttachPeriodicTimerListener( periodMilliseconds, listener );
}
void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener )
{
impl_->AttachPeriodicTimerListener( initialDelayMilliseconds, periodMilliseconds, listener );
}
void SocketReceiveMultiplexer::DetachPeriodicTimerListener( TimerListener *listener )
{
impl_->DetachPeriodicTimerListener( listener );
}
void SocketReceiveMultiplexer::Run()
{
impl_->Run();
}
void SocketReceiveMultiplexer::RunUntilSigInt()
{
assert( multiplexerInstanceToAbortWithSigInt_ == 0 ); /* at present we support only one multiplexer instance running until sig int */
multiplexerInstanceToAbortWithSigInt_ = this;
signal( SIGINT, InterruptSignalHandler );
impl_->Run();
signal( SIGINT, SIG_DFL );
multiplexerInstanceToAbortWithSigInt_ = 0;
}
void SocketReceiveMultiplexer::Break()
{
impl_->Break();
}
void SocketReceiveMultiplexer::AsynchronousBreak()
{
impl_->AsynchronousBreak();
}
| [
"[email protected]"
] | |
93fd91bbc920951b77829b6317caa0cdf850cfcf | ef7bf2b4dc47e0f2d91d5c9cd8ba2587e9ec1908 | /client.h | 71ffcddc785a4be74e42cca35b61a18c070d51c7 | [] | no_license | malloc47/term-do | 802960e9f3e2cbb1a370f108d2fcc99f2e23d2b4 | abc03c9e35a34e94e1433d54775dab04674eaf1b | refs/heads/master | 2022-05-11T20:53:01.525472 | 2022-04-26T16:52:28 | 2022-04-26T16:55:02 | 3,126,323 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 852 | h | #include "config.h"
#ifdef DAEMON
#ifndef CLIENT_H_
#define CLIENT_H_
#include <boost/interprocess/ipc/message_queue.hpp>
#include "common.h"
#include "vt100.h"
#include "query.h"
#include "plugins.h"
#include "view.h"
#include "term-do.h"
#include "frontend.h"
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
using namespace boost::interprocess;
class Client : public Frontend {
public:
Client();
~Client();
string loopDo();
void run(string);
void reset();
private:
void init();
void cleanup();
int handleChar(char);
void sendToServer(string);
string getFromServer(string,string);
string getFromServer(string);
string getFromServer();
class View *view;
message_queue *server_send;
message_queue *server_receive;
};
#endif
#endif
| [
"[email protected]"
] | |
782f48276aa5459e2750350e3837d5a971b9d74a | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /c++/TileDB/2018/8/writer.h | a9d2f95fac5fedc5d27cc033258e893b11df0707 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | C++ | false | false | 24,585 | h | /**
* @file writer.h
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2017-2018 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @section DESCRIPTION
*
* This file defines class Writer.
*/
#ifndef TILEDB_WRITER_H
#define TILEDB_WRITER_H
#include "tiledb/sm/array_schema/array_schema.h"
#include "tiledb/sm/filter/filter_pipeline.h"
#include "tiledb/sm/fragment/fragment_metadata.h"
#include "tiledb/sm/misc/status.h"
#include "tiledb/sm/query/dense_cell_range_iter.h"
#include "tiledb/sm/query/types.h"
#include "tiledb/sm/tile/tile.h"
#include <memory>
#include <set>
namespace tiledb {
namespace sm {
class StorageManager;
/** Processes write queries. */
class Writer {
public:
/* ********************************* */
/* TYPE DEFINITIONS */
/* ********************************* */
/**
* State used only in global writes, where the user can "append"
* by successive query submissions until the query is finalized.
*/
struct GlobalWriteState {
/**
* Stores the last tile of each attribute for each write operation.
* For fixed-sized attributes, the second tile is ignored. For
* var-sized attributes, the first tile is the offsets tile, whereas
* the second tile is the values tile.
*/
std::unordered_map<std::string, std::pair<Tile, Tile>> last_tiles_;
/**
* Stores the number of cells written for each attribute across the
* write operations.
*/
std::unordered_map<std::string, uint64_t> cells_written_;
/** The fragment metadata. */
std::shared_ptr<FragmentMetadata> frag_meta_;
};
/** Cell range to be written. */
struct WriteCellRange {
/** The position in the tile where the range will be copied. */
uint64_t pos_;
/** The starting cell in the user buffers. */
uint64_t start_;
/** The ending cell in the user buffers. */
uint64_t end_;
/** Constructor. */
WriteCellRange(uint64_t pos, uint64_t start, uint64_t end)
: pos_(pos)
, start_(start)
, end_(end) {
}
};
/** A vector of write cell ranges. */
typedef std::vector<WriteCellRange> WriteCellRangeVec;
/* ********************************* */
/* CONSTRUCTORS & DESTRUCTORS */
/* ********************************* */
/** Constructor. */
Writer();
/** Destructor. */
~Writer();
/* ********************************* */
/* API */
/* ********************************* */
/** Returns the array schema. */
const ArraySchema* array_schema() const;
/**
* Return list of attribtues for query
* @return vector of attributes for query
*/
std::vector<std::string> attributes() const;
/**
* Fetch AttributeBuffer for attribute
* @param attribute to fetch
* @return AttributeBuffer for attribute
*/
AttributeBuffer buffer(const std::string& attribute) const;
/** Finalizes the reader. */
Status finalize();
/** Initializes the writer. */
Status init();
/** Returns the cell layout. */
Layout layout() const;
/*
* Sets the array schema. If the array is a kv store, then this
* function also sets global order as the default layout.
*/
void set_array_schema(const ArraySchema* array_schema);
/**
* Sets the buffer for a fixed-sized attribute.
*
* @param attribute The attribute to set the buffer for.
* @param buffer The buffer that has the input data to be written.
* @param buffer_size The size of `buffer` in bytes.
* @return Status
*/
Status set_buffer(
const std::string& attribute, void* buffer, uint64_t* buffer_size);
/**
* Sets the buffer for a var-sized attribute.
*
* @param attribute The attribute to set the buffer for.
* @param buffer_off The buffer that has the input data to be written,
* This buffer holds the starting offsets of each cell value in
* `buffer_val`.
* @param buffer_off_size The size of `buffer_off` in bytes.
* @param buffer_val The buffer that has the input data to be written.
* This buffer holds the actual var-sized cell values.
* @param buffer_val_size The size of `buffer_val` in bytes.
* @return Status
*/
Status set_buffer(
const std::string& attribute,
uint64_t* buffer_off,
uint64_t* buffer_off_size,
void* buffer_val,
uint64_t* buffer_val_size);
/** Sets the fragment URI. Applicable only to write queries. */
void set_fragment_uri(const URI& fragment_uri);
/**
* Sets the cell layout of the query. The function will return an error
* if the queried array is a key-value store (because it has its default
* layout for both reads and writes.
*/
Status set_layout(Layout layout);
/** Sets the storage manager. */
void set_storage_manager(StorageManager* storage_manager);
/**
* Sets the query subarray. If it is null, then the subarray will be set to
* the entire domain.
*
* @param subarray The subarray to be set.
* @return Status
*/
Status set_subarray(const void* subarray);
/*
* Return the subarray
* @return subarray
*/
void* subarray() const;
/** Performs a write query using its set members. */
Status write();
private:
/* ********************************* */
/* PRIVATE ATTRIBUTES */
/* ********************************* */
/** The array schema. */
const ArraySchema* array_schema_;
/** The names of the attributes involved in the query. */
std::vector<std::string> attributes_;
/** Maps attribute names to their buffers. */
std::unordered_map<std::string, AttributeBuffer> attr_buffers_;
/**
* Meaningful only when `dedup_coords_` is `false`.
* If `true`, a check for duplicate coordinates will be performed upon
* sparse writes and appropriate errors will be thrown in case
* duplicates are found.
*/
bool check_coord_dups_;
/**
* If `true`, deduplication of coordinates/cells will happen upon
* sparse writes. Ties are broken arbitrarily.
*
*/
bool dedup_coords_;
/** The name of the new fragment to be created. */
URI fragment_uri_;
/** The state associated with global writes. */
std::unique_ptr<GlobalWriteState> global_write_state_;
/** True if the writer has been initialized. */
bool initialized_;
/**
* The layout of the cells in the result of the subarray. Note
* that this may not be the same as what the user set to the
* query, as the Writer may calibrate it to boost performance.
*/
Layout layout_;
/** The storage manager. */
StorageManager* storage_manager_;
/** The subarray the query is constrained on. */
void* subarray_;
/* ********************************* */
/* PRIVATE METHODS */
/* ********************************* */
/** Checks if attributes has been appropriately set for the query. */
Status check_attributes();
/** Correctness checks for buffer sizes. */
Status check_buffer_sizes() const;
/**
* Throws an error if there are coordinate duplicates.
*
* @param cell_pos The sorted positions of the coordinates in the
* `attr_buffers_`.
* @return Status
*/
Status check_coord_dups(const std::vector<uint64_t>& cell_pos) const;
/**
* Throws an error if there are coordinate duplicates. This function
* assumes that the coordinates are written in the global layout,
* which means that they are already sorted in the attribute buffers.
*
* @return Status
*/
Status check_coord_dups() const;
/** Correctness checks for `subarray_`. */
Status check_subarray() const;
/** Correctness checks for `subarray_`. */
template <class T>
Status check_subarray() const;
/** Closes all attribute files, flushing their state to storage. */
Status close_files(FragmentMetadata* meta) const;
/**
* Computes the positions of the coordinate duplicates (if any). Note
* that only the duplicate occurrences are determined, i.e., if the same
* coordinates appear 3 times, only 2 will be marked as duplicates,
* whereas the first occurrence will not be marked as duplicate.
*
* @param cell_pos The sorted positions of the coordinates in the
* `attr_buffers_`.
* @param A set indicating the positions of the duplicates.
* If there are not duplicates, this vector will be **empty** after
* the termination of the function.
* @return Status
*/
Status compute_coord_dups(
const std::vector<uint64_t>& cell_pos,
std::set<uint64_t>* coord_dups) const;
/**
* Computes the positions of the coordinate duplicates (if any). Note
* that only the duplicate occurrences are determined, i.e., if the same
* coordinates appear 3 times, only 2 will be marked as duplicates,
* whereas the first occurrence will not be marked as duplicate.
*
* This functions assumes that the coordinates are laid out in the
* global order and, hence, they are sorted in the attribute buffers.
*
* @param A set indicating the positions of the duplicates.
* If there are not duplicates, this vector will be **empty** after
* the termination of the function.
* @return Status
*/
Status compute_coord_dups(std::set<uint64_t>* coord_dups) const;
/**
* Computes the coordinates metadata (e.g., MBRs).
*
* @tparam T The domain type.
* @param tiles The tiles to calculate the coords metadata from.
* @param meta The fragment metadata that will store the coords metadata.
* @return Status
*/
template <class T>
Status compute_coords_metadata(
const std::vector<Tile>& tiles, FragmentMetadata* meta) const;
/**
* Computes the cell ranges to be written, derived from a
* dense cell range iterator for a specific tile.
*
* @tparam T The domain type.
* @param iter The dense cell range iterator for one
* tile overlapping with the write subarray.
* @param write_cell_ranges The write cell ranges to be created.
* @return Status
*/
template <class T>
Status compute_write_cell_ranges(
DenseCellRangeIter<T>* iters, WriteCellRangeVec* write_cell_ranges) const;
/**
* Creates a new fragment.
*
* @param dense Whether the fragment is dense or not.
* @param frag_meta The fragment metadata to be generated.
* @return Status
*/
Status create_fragment(
bool dense, std::shared_ptr<FragmentMetadata>* frag_meta) const;
/**
* Runs the input tiles for the input attribute through the filter pipeline.
* The tile buffers are modified to contain the output of the pipeline.
*
* @param attribute The attribute the tiles belong to.
* @param tile The tiles to be filtered.
* @return Status
*/
Status filter_tiles(
const std::string& attribute, std::vector<Tile>* tiles) const;
/**
* Runs the input tile for the input attribute through the filter pipeline.
* The tile buffer is modified to contain the output of the pipeline.
*
* @param attribute The attribute the tile belong to.
* @param tile The tile to be filtered.
* @param offsets True if the tile to be filtered contains offsets for a
* var-sized attribute.
* @return Status
*/
Status filter_tile(
const std::string& attribute, Tile* tile, bool offsets) const;
/** Finalizes the global write state. */
Status finalize_global_write_state();
/**
* Finalizes the global write state.
*
* @tparam T The domain type.
* @return Status
*/
template <class T>
Status finalize_global_write_state();
/**
* Writes in the global layout. Applicable to both dense and sparse
* arrays.
*/
Status global_write();
/**
* Writes in the global layout. Applicable to both dense and sparse
* arrays.
*
* @tparam T The domain type.
*/
template <class T>
Status global_write();
/**
* Applicable only to global writes. Writes the last tiles for each
* attribute remaining in the state, and records the metadata for
* the coordinates attribute (if present).
*
* @tparam T The domain type.
* @return Status
*/
template <class T>
Status global_write_handle_last_tile();
/** Returns `true` if the coordinates are included in the attributes. */
bool has_coords() const;
/** Initializes the global write state. */
Status init_global_write_state();
/**
* Initializes a fixed-sized tile.
*
* @param attribute The attribute the tile belongs to.
* @param tile The tile to be initialized.
* @return Status
*/
Status init_tile(const std::string& attribute, Tile* tile) const;
/**
* Initializes a var-sized tile.
*
* @param attribute The attribute the tile belongs to.
* @param tile The offsets tile to be initialized.
* @param tile_var The var-sized data tile to be initialized.
* @return Status
*/
Status init_tile(
const std::string& attribute, Tile* tile, Tile* tile_var) const;
/**
* Initializes dense cell range iterators for the subarray to be writte,
* one per overlapping tile.
*
* @tparam T The domain type.
* @param iters The dense cell range iterators to be created.
* @return Status
*/
template <class T>
Status init_tile_dense_cell_range_iters(
std::vector<DenseCellRangeIter<T>>* iters) const;
/**
* Initializes the tiles for writing for the input attribute.
*
* @param attribute The attribute the tiles belong to.
* @param tile_num The number of tiles.
* @param tiles The tiles to be initialized. Note that the vector
* has been already preallocated.
* @return Status
*/
Status init_tiles(
const std::string& attribute,
uint64_t tile_num,
std::vector<Tile>* tiles) const;
/**
* Generates a new fragment name, which is in the form: <br>
* .__uuid_timestamp. For instance,
* __6ba7b8129dad11d180b400c04fd430c8_1458759561320
*
* Note that this is a temporary name, initiated by a new write process.
* After the new fragmemt is finalized, the array will change its name
* by removing the leading '.' character.
*
* @param frag_uri Will store the new special fragment name
* @return Status
*/
Status new_fragment_name(std::string* frag_uri) const;
/**
* This deletes the global write state and deletes the potentially
* partially written fragment.
*/
void nuke_global_write_state();
/**
* Optimize the layout for 1D arrays. Specifically, if the array
* is 1D and the query layout is not global or unordered, the layout
* should be the same as the cell order of the array. This produces
* equivalent results offering faster processing.
*/
void optimize_layout_for_1D();
/**
* Writes in an ordered layout (col- or row-major order). Applicable only
* to dense arrays.
*/
Status ordered_write();
/**
* Writes in an ordered layout (col- or row-major order). Applicable only
* to dense arrays.
*
* @tparam T The domain type.
*/
template <class T>
Status ordered_write();
/**
* Applicable only to write in global order. It prepares only full
* tiles, storing the last potentially non-full tile in
* `global_write_state->last_tiles_` as part of the state to be used in
* the next write invocation. The last tiles are written to storage
* upon `finalize`. Upon each invocation, the function first
* populates the partially full last tile from the previous
* invocation.
*
* @param attribute The attribute to prepare the tiles for.
* @param coord_dups The positions of the duplicate coordinates.
* @param tiles The **full** tiles to be created.
* @return Status
*/
Status prepare_full_tiles(
const std::string& attribute,
const std::set<uint64_t>& coord_dups,
std::vector<Tile>* tiles) const;
/**
* Applicable only to write in global order. It prepares only full
* tiles, storing the last potentially non-full tile in
* `global_write_state_->last_tiles_` as part of the state to be used in
* the next write invocation. The last tiles are written to storage
* upon `finalize`. Upon each invocation, the function first
* populates the partially full last tile from the previous
* invocation. Applicable only to fixed-sized attributes.
*
* @param attribute The attribute to prepare the tiles for.
* @param coord_dups The positions of the duplicate coordinates.
* @param tiles The **full** tiles to be created.
* @return Status
*/
Status prepare_full_tiles_fixed(
const std::string& attribute,
const std::set<uint64_t>& coord_dups,
std::vector<Tile>* tiles) const;
/**
* Applicable only to write in global order. It prepares only full
* tiles, storing the last potentially non-full tile in
* `global_write_state_->last_tiles_` as part of the state to be used in
* the next write invocation. The last tiles are written to storage
* upon `finalize`. Upon each invocation, the function first
* populates the partially full last tile from the previous
* invocation. Applicable only to var-sized attributes.
*
* @param attribute The attribute to prepare the tiles for.
* @param coord_dups The positions of the duplicate coordinates.
* @param tiles The **full** tiles to be created.
* @return Status
*/
Status prepare_full_tiles_var(
const std::string& attribute,
const std::set<uint64_t>& coord_dups,
std::vector<Tile>* tiles) const;
/**
* It prepares the tiles, copying from the user buffers into the tiles
* the values based on the input write cell ranges, focusing on the
* input attribute.
*
* @param attribute The attribute to prepare the tiles for.
* @param write_cell_ranges The write cell ranges.
* @param tiles The tiles to be created.
* @return Status
*/
Status prepare_tiles(
const std::string& attribute,
const std::vector<WriteCellRangeVec>& write_cell_ranges,
std::vector<Tile>* tiles) const;
/**
* It prepares the tiles, re-organizing the cells from the user
* buffers based on the input sorted positions.
*
* @param attribute The attribute to prepare the tiles for.
* @param cell_pos The positions that resulted from sorting and
* according to which the cells must be re-arranged.
* @param coord_dups The set with the positions
* of duplicate coordinates/cells.
* @param tiles The tiles to be created.
* @return Status
*/
Status prepare_tiles(
const std::string& attribute,
const std::vector<uint64_t>& cell_pos,
const std::set<uint64_t>& coord_dups,
std::vector<Tile>* tiles) const;
/**
* It prepares the tiles, re-organizing the cells from the user
* buffers based on the input sorted positions. Applicable only
* to fixed-sized attributes.
*
* @param attribute The attribute to prepare the tiles for.
* @param cell_pos The positions that resulted from sorting and
* according to which the cells must be re-arranged.
* @param coord_dups The set with the positions
* of duplicate coordinates/cells.
* @param tiles The tiles to be created.
* @return Status
*/
Status prepare_tiles_fixed(
const std::string& attribute,
const std::vector<uint64_t>& cell_pos,
const std::set<uint64_t>& coord_dups,
std::vector<Tile>* tiles) const;
/**
* It prepares the tiles, re-organizing the cells from the user
* buffers based on the input sorted positions. Applicable only
* to var-sized attributes.
*
* @param attribute The attribute to prepare the tiles for.
* @param cell_pos The positions that resulted from sorting and
* according to which the cells must be re-arranged.
* @param coord_dups The set with the positions
* of duplicate coordinates/cells.
* @param tiles The tiles to be created.
* @return Status
*/
Status prepare_tiles_var(
const std::string& attribute,
const std::vector<uint64_t>& cell_pos,
const std::set<uint64_t>& coord_dups,
std::vector<Tile>* tiles) const;
/** Resets the writer object, rendering it incomplete. */
void reset();
/**
* Sorts the coordinates of the user buffers, creating a vector with
* the sorted positions.
*
* @tparam T The domain type.
* @param cell_pos The sorted cell positions to be created.
* @return Status
*/
template <class T>
Status sort_coords(std::vector<uint64_t>* cell_pos) const;
/**
* Writes in unordered layout. Applicable to both dense and sparse arrays.
* Explicit coordinates must be provided for this write.
*/
Status unordered_write();
/**
* Writes in unordered layout. Applicable to both dense and sparse arrays.
* Explicit coordinates must be provided for this write.
*
* @tparam T The domain type.
*/
template <class T>
Status unordered_write();
/**
* Writes an empty cell range to the input tile.
* Applicable to **fixed-sized** attributes.
*
* @param num Number of empty values to write.
* @param tile The tile to write to.
* @return Status
*/
Status write_empty_cell_range_to_tile(uint64_t num, Tile* tile) const;
/**
* Writes an empty cell range to the input tile.
* Applicable to **variable-sized** attributes.
*
* @param num Number of empty values to write.
* @param tile The tile offsets to write to.
* @param tile_var The tile with the var-sized cells to write to.
* @return Status
*/
Status write_empty_cell_range_to_tile_var(
uint64_t num, Tile* tile, Tile* tile_var) const;
/**
* Writes the input cell range to the input tile, for a particular
* buffer. Applicable to **fixed-sized** attributes.
*
* @param buff The write buffer where the cells will be copied from.
* @param start The start element in the write buffer.
* @param end The end element in the write buffer.
* @param tile The tile to write to.
* @return Status
*/
Status write_cell_range_to_tile(
ConstBuffer* buff, uint64_t start, uint64_t end, Tile* tile) const;
/**
* Writes the input cell range to the input tile, for a particular
* buffer. Applicable to **variable-sized** attributes.
*
* @param buff The write buffer where the cell offsets will be copied from.
* @param buff_var The write buffer where the cell values will be copied from.
* @param start The start element in the write buffer.
* @param end The end element in the write buffer.
* @param tile The tile offsets to write to.
* @param tile_var The tile with the var-sized cells to write to.
* @return Status
*/
Status write_cell_range_to_tile_var(
ConstBuffer* buff,
ConstBuffer* buff_var,
uint64_t start,
uint64_t end,
Tile* tile,
Tile* tile_var) const;
/**
* Writes all the input tiles to storage.
*
* @param attribute_tiles Tiles to be written, one element per attribute.
* @return Status
*/
Status write_all_tiles(
FragmentMetadata* frag_meta,
const std::vector<std::vector<Tile>>& attribute_tiles) const;
/**
* Writes the input tiles for the input attribute to storage.
*
* @param attribute The attribute the tiles belong to.
* @param frag_meta The fragment metadata.
* @param tiles The tiles to be written.
* @return Status
*/
Status write_tiles(
const std::string& attribute,
FragmentMetadata* frag_meta,
const std::vector<Tile>& tiles) const;
};
} // namespace sm
} // namespace tiledb
#endif // TILEDB_WRITER_H
| [
"[email protected]"
] | |
3afbcbb1adeb65777029595de165c7532e7d13a6 | e018d8a71360d3a05cba3742b0f21ada405de898 | /Client/Packet/Types/PlayerTypes.h | e480c272e99296df1dc71bf7c7bd807f4cc9fa8a | [] | no_license | opendarkeden/client | 33f2c7e74628a793087a08307e50161ade6f4a51 | 321b680fad81d52baf65ea7eb3beeb91176c15f4 | refs/heads/master | 2022-11-28T08:41:15.782324 | 2022-11-26T13:21:22 | 2022-11-26T13:21:22 | 42,562,963 | 24 | 18 | null | 2022-11-26T13:21:23 | 2015-09-16T03:43:01 | C++ | UHC | C++ | false | false | 4,429 | h | //////////////////////////////////////////////////////////////////////////////
// Filename : PlayerTypes.h
// Written By : Reiot
// Description :
//////////////////////////////////////////////////////////////////////////////
#ifndef __PLAYER_TYPES_H__
#define __PLAYER_TYPES_H__
#include "SystemTypes.h"
//////////////////////////////////////////////////////////////////////////////
// 플레이어 생성 및 변경 관련 에러 ID
//////////////////////////////////////////////////////////////////////////////
enum ErrorID {
INVALID_ID_PASSWORD,
ALREADY_CONNECTED,
ALREADY_REGISTER_ID,
ALREADY_REGISTER_SSN,
EMPTY_ID,
SMALL_ID_LENGTH,
EMPTY_PASSWORD,
SMALL_PASSWORD_LENGTH,
EMPTY_NAME,
EMPTY_SSN,
INVALID_SSN,
NOT_FOUND_PLAYER,
NOT_FOUND_ID,
NOT_PAY_ACCOUNT,
NOT_ALLOW_ACCOUNT,
ETC_ERROR,
IP_DENYED,
CHILDGUARD_DENYED,
CANNOT_AUTHORIZE_BILLING, // 빌링 정보를 찾을 수 없습니다.
CANNOT_CREATE_PC_BILLING, // 유료 사용자가 아니라서 캐릭터를 못 만듭니다.
KEY_EXPIRED, // 키 유효기간이 지났다.
NOT_FOUND_KEY, // 키가 없다.
// add by Coffee
CHECK_VERSION_ERROR,
};
//////////////////////////////////////////////////////////////////////////////
// 플레이어 아이디
//////////////////////////////////////////////////////////////////////////////
const uint minIDLength = 4;
const uint maxIDLength = 10;
//////////////////////////////////////////////////////////////////////////////
// 플레이어 암호
//////////////////////////////////////////////////////////////////////////////
const uint minPasswordLength = 6;
const uint maxPasswordLength = 10;
//////////////////////////////////////////////////////////////////////////////
// 플레이어 이름
//////////////////////////////////////////////////////////////////////////////
const uint maxNameLength = 20;
//////////////////////////////////////////////////////////////////////////////
// 주민등록번호 ( '-' 를 포함해야 한다. )
//////////////////////////////////////////////////////////////////////////////
const uint maxSSNLength = 20;
//////////////////////////////////////////////////////////////////////////////
// 집전화
//////////////////////////////////////////////////////////////////////////////
const uint maxTelephoneLength = 15;
//////////////////////////////////////////////////////////////////////////////
// 휴대폰
//////////////////////////////////////////////////////////////////////////////
const uint maxCellularLength = 15;
//////////////////////////////////////////////////////////////////////////////
// 우편번호
//////////////////////////////////////////////////////////////////////////////
const uint maxZipCodeLength = 7;
//////////////////////////////////////////////////////////////////////////////
// 집주소
//////////////////////////////////////////////////////////////////////////////
const uint maxAddressLength = 100;
//////////////////////////////////////////////////////////////////////////////
// 전자메일
//////////////////////////////////////////////////////////////////////////////
const uint maxEmailLength = 50;
//////////////////////////////////////////////////////////////////////////////
// 홈페이지
//////////////////////////////////////////////////////////////////////////////
const uint maxHomepageLength = 50;
//////////////////////////////////////////////////////////////////////////////
// 자기소개글
//////////////////////////////////////////////////////////////////////////////
const uint maxProfileLength = 200;
//////////////////////////////////////////////////////////////////////////////
// 국적
//////////////////////////////////////////////////////////////////////////////
typedef BYTE Nation_t;
const uint szNation = szBYTE;
enum Nation
{
KOREA,
USA,
JAPAN
};
const std::string Nation2String [] =
{
"KOREA",
"USA",
"JAPAN"
};
//////////////////////////////////////////////////////////////////////////////
// 패널티 타입
//////////////////////////////////////////////////////////////////////////////
enum PenaltyType
{
PENALTY_TYPE_KICKED, // 나가라
PENALTY_TYPE_MUTE, // 닥쳐라
PENALTY_TYPE_FREEZING, // 멈춰라
PENALTY_TYPE_MAX
};
#endif
| [
"[email protected]"
] | |
2f12208ccd9757727299b0a266fce138668b5bb6 | 0c7f6eb2da04fc478cf417b6f6ff7d7ddb3d53be | /src/checkpoints.cpp | cc83d3d2776703ef0a6d2f4b5a326db998556a8e | [
"MIT"
] | permissive | etcdev/EntropyCoins | 425571efe9215eec223df0347e8f9a141fbdda30 | f2d86507ddca3082559531fe4c427b75937569e0 | refs/heads/master | 2016-08-04T18:41:08.491191 | 2014-06-11T01:47:15 | 2014-06-11T01:47:15 | 17,300,445 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,922 | cpp | // Copyright (c) 2009-2012 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 <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
#include "checkpoints.h"
#include "main.h"
#include "uint256.h"
namespace Checkpoints
{
typedef std::map<int, uint256> MapCheckpoints;
// How many times we expect transactions after the last checkpoint to
// be slower. 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 fSigcheckVerificationFactor = 5.0;
struct CCheckpointData {
const MapCheckpoints *mapCheckpoints;
int64 nTimeLastCheckpoint;
int64 nTransactionsLastCheckpoint;
double fTransactionsPerDay;
};
// What makes a good checkpoint block?
// + Is surrounded by blocks with reasonable timestamps
// (no blocks before with a timestamp after, none after with
// timestamp before)
// + Contains no strange transactions
static MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 0, uint256("0x8b7020a5f83d7c90ca2e6a1685a5c21db5afff52916539ccf06feb38e96d0552"))
( 1, uint256("0xa542e0211c11443ce09247c65f30e2a79314b33a0fb992caba5f456689ded041"))
( 49476, uint256("0x9fc075c175271abddf9cc7b8590ea3244e470ae2e0daf2c0f0186c1cb9eed6fb"))
( 51007, uint256("0xa03b2342ef9d5bb5501f6ceaa0a97ecf5fb787ffbe29d776ef78449bb2f92c59"))
( 93528, uint256("0x2115a4dd28cb1b5479949c61f91c05469f21eb3608e347ffe76bcca8e38d6ccc"))
;
static const CCheckpointData data = {
&mapCheckpoints,
1402034580, // * UNIX timestamp of last checkpoint block
106002, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
8000.0 // * estimated number of transactions per day after checkpoint
};
static MapCheckpoints mapCheckpointsTestnet =
boost::assign::map_list_of
( 546, uint256("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70"))
( 35000, uint256("2af959ab4f12111ce947479bfcef16702485f04afd95210aa90fde7d1e4a64ad"))
;
static const CCheckpointData dataTestnet = {
&mapCheckpointsTestnet,
1369685559,
37581,
300
};
const CCheckpointData &Checkpoints() {
if (fTestNet)
return dataTestnet;
else
return data;
}
bool CheckBlock(int nHeight, const uint256& hash)
{
if (fTestNet) return true; // Testnet has no checkpoints
if (!GetBoolArg("-checkpoints", true))
return true;
const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints;
MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
if (i == checkpoints.end()) return true;
//[[REMOVE
return hash == i->second;
//put back to generate genesis block
//return true;
}
// Guess how far we are in the verification process at the given block index
double GuessVerificationProgress(CBlockIndex *pindex) {
if (pindex==NULL)
return 0.0;
int64 nNow = time(NULL);
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 checkoint, and
// fSigcheckVerificationFactor per transaction after.
const CCheckpointData &data = Checkpoints();
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->nTime)/86400.0*data.fTransactionsPerDay;
fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor;
fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor;
}
return fWorkBefore / (fWorkBefore + fWorkAfter);
}
int GetTotalBlocksEstimate()
{
if (fTestNet) return 0; // Testnet has no checkpoints
if (!GetBoolArg("-checkpoints", true))
return 0;
const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints;
//[[[REMOVE
return checkpoints.rbegin()->first;
// put back to generate genesis block
//return 0;
}
CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
{
if (fTestNet) return NULL; // Testnet has no checkpoints
if (!GetBoolArg("-checkpoints", true))
return NULL;
const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints;
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints)
{
const uint256& hash = i.second;
std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash);
if (t != mapBlockIndex.end())
//[[[REMOVE
return t->second;
//put back to generate genesis block
//return NULL;
}
return NULL;
}
}
| [
"[email protected]"
] | |
060cdfc2dd8c58b392b4b097417ccd945dc0ee3a | 74fc7c5d39baa6c30aa929e629ff60bf40500c61 | /test/unit-tests/mbr/mbr_util_mock.h | 1aa861ae66c4fc7cba6a099ae8c649726df493f9 | [
"BSD-3-Clause"
] | permissive | jhyunleehi/poseidonos | e472be680d0e85dc62f0e2c0d7356dbee74a3bd6 | 1d90e4320855d61742ff37af8c0148da579d95d4 | refs/heads/develop | 2023-07-13T03:37:29.754509 | 2021-08-23T15:26:08 | 2021-08-23T15:26:08 | 393,203,347 | 0 | 0 | BSD-3-Clause | 2021-08-20T00:04:14 | 2021-08-06T00:30:35 | C | UTF-8 | C++ | false | false | 109 | h | #include <gmock/gmock.h>
#include <list>
#include <string>
#include <vector>
#include "src/mbr/mbr_util.h"
| [
"[email protected]"
] | |
a4e9cd31d5ac0ef0eb191b05bf0a2369aa6d2c7b | 35500e33d552292dcf2982ac89bb4d3c2ebff952 | /codels/MonteCarloPrintFunctions.cc | a2ba2789da0417acafbb1a4b336b1741f28cd705 | [] | no_license | newbdez33/rfidPositioner | dae07db02b68ff4ed024fc05b3620649abc3fd81 | 7c14ee151b711ceed3f2636217f0e3b2dcd51208 | refs/heads/master | 2021-01-18T05:18:12.054527 | 2010-02-02T19:40:09 | 2010-02-02T19:40:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,639 | cc | /*
* MonteCarloPrintFunctions.cc
*
* Created on: Nov 23, 2009
* Author: acodas
*/
#include "MonteCarloPrintFunctions.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//@tested
//prints a mc_Point
void mc_printPoint(const mc_Point p) {
printf("{x=%g, y=%g, theta=%g}", p.x, p.y, p.theta);
}
//@tested
//prints the matrix A
void mc_printMatrix(const double A[3][3]) {
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
printf("%g ", A[i][j]);
}
printf("\n");
}
}
int mc_printSamples(const char OUTPUT_FILE_NAME[],const mc_Points *currentPoints){
int numberPrinting = MAXMCNSAMPLES;
char * pHome;
char location[128];
pHome = getenv("HOME");
strcpy(location,pHome);
strcat(location,"/simulation/results/");
strcat(location,OUTPUT_FILE_NAME);
FILE* outputFile = fopen(location, "w");
if(outputFile == NULL){
printf("Invalid File to write results. File 'path' == %s \n",location);
return 1;
}
if (numberPrinting > mc_nSamples) {
numberPrinting = mc_nSamples;
}
fprintf(outputFile, "m = [");
int i;
for (i = 0; i < numberPrinting - 1; ++i) {
fprintf(outputFile, "\n\t%lf,\t%lf,\t%lf,\t%.20lf;",
currentPoints->points[i].x, currentPoints->points[i].y,
currentPoints->points[i].theta, currentPoints->weights[i]);
}
fprintf(outputFile, "\n\t%lf,\t%lf,\t%lf,\t%.20lf];",
currentPoints->points[i].x, currentPoints->points[i].y,
currentPoints->points[i].theta, currentPoints->weights[i]);
fprintf(outputFile, "\nparticules = struct('pos',m);\n");
fprintf(outputFile, "simulations = [simulations particules];\n");
fclose(outputFile);
return 0;
}
//prints the current samples with an introduction text
//prints tag detections
void mc_printTagDetections(const TagDetection* tagDetections) {
const TagDetection* aux = tagDetections;
int tagNum = -2;
while (aux != 0) {
if (tagNum == tagNumber(aux->tagid)) {
printf(" %d", aux->antenna);
} else {
tagNum = tagNumber(aux->tagid);
printf("\nTagDetection %d %s - antennas %d", tagNum, aux->tagid,
aux->antenna);
}
aux = aux->next;
}
printf("\n");
}
void mc_printTagsExpected(const TagExpectation* tagsExpected) {
const TagExpectation* aux = tagsExpected;
int tagNum;
while (aux != 0) {
if (tagNum == tagNumber(aux->tagid)) {
printf("\n%s antenna %d - probability %lf ", aux->tagid,
aux->antenna, aux->probability);
} else {
tagNum = tagNumber(aux->tagid);
printf("\nTagExpectation %d %s\n", tagNum, aux->tagid);
printf("\n%s antenna %d - probability %lf ", aux->tagid,
aux->antenna, aux->probability);
}
aux = aux->next;
}
printf("\n");
}
| [
"[email protected]"
] | |
45ce884f9ee229350a5c4529111fb74ec19ccbdb | 51a2d2dfbeef5db71abb77f3fc23e2f86c422f6f | /src/core/indicator/DoubleMatrixLightIndicator.h | 5b045e3b4a9485a2ea2d95018663123a3a08a8df | [] | no_license | bidule21/arduino-etarget | a20e8b6ef2fbaa36c39e50b4ed7ea131609b3faf | 92cb507cb68921a7d28566a8635e60dcc20f01ed | refs/heads/master | 2020-04-28T19:26:34.813396 | 2017-08-13T18:44:52 | 2017-08-13T18:44:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 442 | h | #include <LedControlMS.h>
#include "LightIndicatorInterface.h"
#ifndef DoubleMatrixLightIndicator_h
#define DoubleMatrixLightIndicator_h
class DoubleMatrixLightIndicator: public LightIndicatorInterface {
public:
DoubleMatrixLightIndicator(bool doInit = false);
void init();
void green();
void red();
void off();
void setBrightness(int brightness);
String getName();
private:
LedControl *lc;
};
#endif
| [
"[email protected]"
] | |
683ce4db96fb32ecd2df9755970ae7603110de7a | 2d6fe63c5688f0555f7f51d866e0c00e3771fb0f | /C/switch_blinking_led/switch_blinking_led.ino | 3cabde74471f010cc39ac2ff60af03d1e672a7b7 | [] | no_license | supa96/C-ProjectX | 800e4d105a463e667f47100c5e9f0246843f1199 | c601a0880767bb137449056ee09436379a410ecd | refs/heads/master | 2021-01-19T09:31:50.959304 | 2017-02-16T01:04:28 | 2017-02-16T01:04:28 | 82,122,947 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 487 | ino | const int buttonPin = 2;
const int ledPinR = 13;
const int ledPinG = 12;
int buttonState;
void setup() {
pinMode(ledPinR, OUTPUT);
pinMode(ledPinG, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(ledPinG, HIGH);
digitalWrite(ledPinR, LOW );
} else {
digitalWrite(ledPinG, LOW);
digitalWrite(ledPinR, HIGH);
}
}
| [
"Supachai"
] | Supachai |
3293ebcc9798437f1a0af19667f165c2e709238e | 17021f288a57ec5af71ac038b3de9de45f10f353 | /BitManipulation/LC751IPToCIDR.cpp | cf1a0c6478715592f1051d5b4368d19eab615804 | [] | no_license | CSStudySession/AlgoInCpp | 17895441df545cf6a177e84f85a1c4bcf13ea88e | 44dcea21406a37d6ed015850d12542184f7b52d9 | refs/heads/master | 2022-09-30T15:58:47.283730 | 2022-08-27T09:08:30 | 2022-08-27T09:08:30 | 223,360,180 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,886 | cpp | //
// Created by Aaron Liu on 9/12/20.
//
#include <vector>
#include <string>
#include <cmath>
#include <iostream>
using namespace std;
class LC751 {
public:
vector<string> ipToCIDR(string ip, int n) {
vector<string> ret;
long ipNum = 0;
string buffer;
// convert ip from string to long type
for (int i = 0 ; i <= ip.size(); i++) {
if (i == ip.size() || ip[i] == '.') {
cout << "buffer: " << buffer << " ";
ipNum |= stoi(buffer);
cout << "ipNum :" << ipNum << endl;
if (i != ip.size()) ipNum <<= 8;
buffer.clear();
} else {
buffer.append(1, ip[i]);
}
}
// edage cases: ip: "0.0.0.0"
if (ipNum == 0) {
for (int i = 0; i < n; i++) {
string tmp = "0.0.0.";
tmp += to_string(i);
tmp += "/32";
ret.push_back(tmp);
}
return ret;
}
while (n > 0) {
long delta = ipNum & -ipNum;
cout << "delta: " << delta << " ";
while (delta > n) delta /= 2;
string tmp = convert(ipNum, delta);
ret.push_back(tmp);
ipNum += delta;
n -= delta;
}
return ret;
}
string convert(long ipNum, int delta) {
return to_string((ipNum >> 24) & 255) + "." +
to_string((ipNum >> 16) & 255) + "." +
to_string((ipNum >> 8) & 255) + "." +
to_string(ipNum & 255) + "/" +
to_string(32 - (int)log2(delta));
}
};
/*
int main() {
LC751 inst;
string myip = "0.0.0.0";
int n = 2;
vector<string> ret = inst.ipToCIDR(myip, n);
for (auto &item : ret) {
cout << item << endl;
}
return 0;
}
*/
| [
"[email protected]"
] | |
2eb98eaff6de144034947252517f5af34eb62c6e | 2dbea73b8d331e2370341a45168e1ccf105d53a2 | /Rune/Client.h | ad3ec5027d4a850961dfe361713021dc58a890e6 | [] | no_license | BSkin/Rune | e032521e3b2e64baa048ba8f2b22e9a79f162139 | 7ddb326a97abba5a9f8bd01fb80198bc8ed5d5eb | refs/heads/master | 2016-09-01T07:52:45.232857 | 2016-02-09T04:45:22 | 2016-02-09T04:45:22 | 51,332,888 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,593 | h | #ifndef CLIENT_H
#define CLIENT_H
#include "Packet.h"
#include "DataBuffer.h"
#include "NetworkFunctions.h"
#include <string>
using std::string;
class Client
{
public:
Client();
~Client();
DataBuffer * popSendData();
void pushSendData(const char * c, int size);
void pushSendData(char * c, int size) { pushSendData((const char *)c, size); }
DataBuffer * popReceiveData();
void pushReceiveData(const char * c, int size);
void pushReceiveData(char * c, int size) { pushReceiveData((const char *)c, size); }
Packet * getPacketAddress() { return &packetData; }
unsigned long getIPAddress() { return ipAddress; }
unsigned long getPortTCP() { return portTCP; }
unsigned long getPortUDP() { return portUDP; }
unsigned long getFrameCount() { return frameCount; }
void setConnected(string name = "Peasant");
void setDisconnected();
bool isConnected() { return connected; }
void setName(string x) { name = x; }
string getName() { return name; }
void setPing(int x) { ping = x; }
void setID(int x) { clientID = x; }
void setIPAddress(unsigned long x) { ipAddress = x; }
void setPortTCP(unsigned long x) { portTCP = x; }
void setPortUDP(unsigned long x) { portUDP = x; }
void setFrameCount(unsigned long x) { frameCount = x; }
void setSynch(bool x) { synch = x; }
bool requiresSynch() { return synch; }
int aquireMutex();
int releaseMutex();
private:
void init();
Packet packetData;
bool connected;
string name;
int ping;
int clientID;
unsigned long ipAddress, portTCP, portUDP;
unsigned long frameCount;
bool synch;
HANDLE clientMutex;
};
#endif CLIENT_H | [
"[email protected]"
] | |
2eacf10341d5bd10baf6117a634c81e0ffee7ad0 | 36631dcd4211c9896f978b042b50ae06e7428902 | /project/functions/addCredit/addCredit.h | 9ac052b4fd08d85f9614ca4465d55eb79264726b | [] | no_license | JosephRob/csci3060u-project | 16fb5bcf3eceb4f22e8c34ca88f93cafcef5907d | 831efcd36d35b4561b026f179149fc8e507523ac | refs/heads/master | 2021-03-19T10:54:13.384545 | 2018-03-08T20:49:07 | 2018-03-08T20:49:07 | 117,279,085 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 486 | h | #ifndef __ADDCREDIT_H_INCLUDED__
#define __ADDCREDIT_H_INCLUDED__
#include <string>
using namespace std;
/*
This is the class for add credit function.
In this function, there are 2 functions, the constructor
and the addCredit function itself
*/
class addCreditClass{
public:
double credit;
string targetUserName;
addCreditClass();
bool addCredit(string userType, double maxAddBalanceThisSession);
bool isNumber(const string& s);
bool checkTarget(string userName);
};
#endif
| [
"[email protected]"
] | |
acd4f7ea406fd9279c5c4ed3b92547e02b3391f8 | bd8da89a17e0056bed98aefcec38dac80fd8dd5d | /sqldata/sqldb.cpp | cd9d50acde5157cb49c9ff152eb163a614d9c718 | [
"Apache-2.0"
] | permissive | ChrisYuan/sqlines | cf89b9d171288d608d3c6ea5ad733034eb1e3505 | f82176f154a158105f655d71fb7934dd0ee1c82f | refs/heads/master | 2022-01-22T04:04:01.198352 | 2021-12-19T09:06:37 | 2021-12-19T09:06:37 | 211,207,186 | 1 | 0 | Apache-2.0 | 2019-09-27T00:56:29 | 2019-09-27T00:56:29 | null | UTF-8 | C++ | false | false | 104,260 | cpp | /**
* Copyright (c) 2016 SQLines
*
* 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.
*/
// SqlDb Database Access
#if defined(WIN32) || defined(WIN64)
#include <windows.h>
#include <process.h>
#endif
#include <stdio.h>
#include <string>
#include <list>
#include "sqldb.h"
#include "sqlociapi.h"
#include "sqlsncapi.h"
#include "sqlmysqlapi.h"
#include "sqlpgapi.h"
#include "sqlctapi.h"
#include "sqlasaapi.h"
#include "sqlifmxapi.h"
#include "sqldb2api.h"
#include "sqlodbcapi.h"
#include "sqlstdapi.h"
#include "str.h"
#include "os.h"
// Constructor
SqlDb::SqlDb()
{
source_type = 0;
target_type = 0;
source_subtype = 0;
target_subtype = 0;
_callback = NULL;
_callback_object = NULL;
_callback_rate = 3100;
_metaSqlDb = this;
_parameters = NULL;
_log = NULL;
_column_map = NULL;
_datatype_map = NULL;
_tsel_exp_map = NULL;
_tsel_exp_all = NULL;
_twhere_cond_map = NULL;
_session_id = 0;
_trace_diff_data = false;
_validation_not_equal_max_rows = -1;
_validation_datetime_fraction = -1;
_mysql_validation_collate = NULL;
}
// Destructor
SqlDb::~SqlDb()
{
delete _source_ca.db_api;
delete _target_ca.db_api;
}
// Set database configuration
int SqlDb::Init(int db_types, const char *source_conn, const char *target_conn, int *s_rc_inout, int *t_rc_inout)
{
SqlApiBase *s_db_api = NULL, *t_db_api = NULL;
int s_rc = 0;
int t_rc = 0;
// Set static initialization results
if(s_rc_inout != NULL)
s_rc = *s_rc_inout;
if(t_rc_inout != NULL)
t_rc = *t_rc_inout;
// Create database API object for source database
if(s_rc == 0)
s_db_api = CreateDatabaseApi(source_conn, &source_type);
// Create database API object for target database
if(t_rc == 0 && db_types != SQLDB_SOURCE_ONLY)
t_db_api = CreateDatabaseApi(target_conn, &target_type);
// Initialize the source database API (do not exit in case of error, allow initializing the target API)
if(s_db_api != NULL)
{
s_db_api->SetTargetApiProvider(t_db_api);
s_rc = InitCa(&_source_ca, s_db_api);
if(s_rc_inout != NULL)
*s_rc_inout = s_rc;
}
else
{
if(s_rc == 0)
strcpy(_source_ca.native_error_text, "Source database type is unknown");
s_rc = -1;
if(s_rc_inout != NULL)
*s_rc_inout = -1;
}
// Initialize the source database API
if(t_db_api != NULL)
{
t_db_api->SetSourceApiProvider(s_db_api);
t_rc = InitCa(&_target_ca, t_db_api);
if(t_rc_inout != NULL)
*t_rc_inout = t_rc;
}
else
{
if(t_rc == 0)
strcpy(_target_ca.native_error_text, "Target database type is unknown");
t_rc = -1;
if(t_rc_inout != NULL)
*t_rc_inout = -1;
}
if(s_rc == -1 || t_rc == -1)
return -1;
return 0;
}
// Perform static initialization of the API libraries
int SqlDb::InitStatic(int db_types, const char *source_conn, const char *target_conn, int *s_rc_out, int *t_rc_out)
{
std::string error_text;
int s_rc = InitStaticApi(source_conn, error_text);
if(s_rc == -1)
{
_source_ca.cmd_rc = (short)s_rc;
strcpy(_source_ca.native_error_text, error_text.c_str());
}
if(s_rc_out != NULL)
*s_rc_out = s_rc;
// Source database is only initialized
if(db_types == SQLDB_SOURCE_ONLY)
return s_rc;
error_text.clear();
int t_rc = InitStaticApi(target_conn, error_text);
if(t_rc == -1)
{
_target_ca.cmd_rc = (short)t_rc;
strcpy(_target_ca.native_error_text, error_text.c_str());
}
if(t_rc_out != NULL)
*t_rc_out = t_rc;
if(s_rc == -1 || t_rc == -1)
return -1;
return 0;
}
// Initialize database API once per process
int SqlDb::InitStaticApi(const char *conn, std::string &error)
{
if(conn == NULL)
return -1;
int rc = 0;
const char *cur = Str::SkipSpaces(conn);
// Initialize MySQL C API
if(_strnicmp(cur, "mysql", 5) == 0 || _strnicmp(cur, "mariadb", 7) == 0)
{
SqlMysqlApi mysqlApi;
mysqlApi.SetParameters(_parameters);
mysqlApi.SetAppLog(_log);
const char *conn = strchr(cur, ',');
if(conn != NULL)
{
conn = Str::SkipSpaces(conn + 1);
mysqlApi.SetConnectionString(conn);
}
if(_strnicmp(cur, "mariadb", 7) == 0)
mysqlApi.SetSubType(SQLDATA_SUBTYPE_MARIADB);
rc = mysqlApi.InitStatic();
if(rc == -1)
error = mysqlApi.GetNativeErrorText();
}
// If API does not support static initialization 0 must be returned
return rc;
}
// Create database API object for source database
SqlApiBase* SqlDb::CreateDatabaseApi(const char *conn, short *type)
{
if(conn == NULL)
return NULL;
SqlApiBase *db_api = NULL;
const char *cur = Str::SkipSpaces(conn);
// Check for Oracle OCI
if(_strnicmp(cur, "oracle", 6) == 0)
{
db_api = new SqlOciApi();
cur += 6;
if(type != NULL)
*type = SQLDATA_ORACLE;
}
else
// Check for SQL Server Native Client
if(_strnicmp(cur, "sql", 3) == 0)
{
db_api = new SqlSncApi();
cur += 3;
if(type != NULL)
*type = SQLDATA_SQL_SERVER;
}
else
// Check for MySQL C API
if(_strnicmp(cur, "mysql", 5) == 0)
{
db_api = new SqlMysqlApi();
cur += 5;
if(type != NULL)
*type = SQLDATA_MYSQL;
}
else
// Check for MariaDB C API
if(_strnicmp(cur, "mariadb", 7) == 0)
{
db_api = new SqlMysqlApi();
db_api->SetSubType(SQLDATA_SUBTYPE_MARIADB);
cur += 7;
if(type != NULL)
*type = SQLDATA_MYSQL;
}
else
// Check for PostgreSQL libpq C library
if(_strnicmp(cur, "pg", 2) == 0)
{
db_api = new SqlPgApi();
cur += 2;
if(type != NULL)
*type = SQLDATA_POSTGRESQL;
}
else
// Check for Sybase Client library
if(_strnicmp(cur, "sybase", 6) == 0)
{
db_api = new SqlCtApi();
cur += 6;
if(type != NULL)
*type = SQLDATA_SYBASE;
}
#if defined(WIN32) || defined(_WIN64)
else
// Sybase SQL Anywhere ODBC driver
if(_strnicmp(cur, "asa", 3) == 0)
{
db_api = new SqlAsaApi();
cur += 3;
if(type != NULL)
*type = SQLDATA_ASA;
}
#endif
else
// Check for Informix library
if(_strnicmp(cur, "informix", 8) == 0)
{
db_api = new SqlIfmxApi();
cur += 8;
if(type != NULL)
*type = SQLDATA_INFORMIX;
}
else
// Check for DB2 library
if(_strnicmp(cur, "db2", 3) == 0)
{
db_api = new SqlDb2Api();
cur += 3;
if(type != NULL)
*type = SQLDATA_DB2;
}
#if defined(WIN32) || defined(_WIN64)
else
// Check for ODBC
if(_strnicmp(cur, "odbc", 4) == 0)
{
db_api = new SqlOdbcApi();
cur += 4;
if(type != NULL)
*type = SQLDATA_ODBC;
}
#endif
else
// Check for Standard Output
if(_strnicmp(cur, "stdout", 6) == 0)
{
db_api = new SqlStdApi();
cur += 6;
if(type != NULL)
*type = SQLDATA_STDOUT;
}
cur = Str::SkipSpaces(cur);
// Check driver type information
if(*cur == ':')
{
cur++;
db_api->SetDriverType(cur);
cur = Str::SkipUntil(cur, ',');
}
cur = Str::SkipSpaces(cur);
// Skip comma after database type
if(*cur == ',')
cur++;
cur = Str::SkipSpaces(cur);
// Set the connection string and parameters in the API object
if(db_api != NULL)
{
db_api->SetConnectionString(cur);
db_api->SetParameters(_parameters);
db_api->SetAppLog(_log);
}
return db_api;
}
// Initialize database API
int SqlDb::InitCa(SqlDbThreadCa *ca, SqlApiBase *db_api)
{
if(db_api == NULL)
return -1;
ca->sqlDb = this;
ca->db_api = db_api;
// Initialize the database API library
int rc = ca->db_api->Init();
if(rc == -1)
{
ca->cmd_rc = (short)rc;
strcpy(ca->native_error_text, ca->db_api->GetNativeErrorText());
return rc;
}
// Create synchronization objects
#if defined(WIN32) || defined(_WIN64)
ca->_wait_event = CreateEvent(NULL, FALSE, FALSE, NULL);
ca->_completed_event = CreateEvent(NULL, FALSE, FALSE, NULL);
#else
Os::CreateEvent(&ca->_wait_event);
Os::CreateEvent(&ca->_completed_event);
#endif
// Start a thread to handle requests for the database
#if defined(WIN32) || defined(_WIN64)
_beginthreadex(NULL, 0, &SqlDb::StartWorkerS, ca, 0, NULL);
#else
pthread_t thread;
pthread_create(&thread, NULL, &SqlDb::StartWorkerS, ca);
#endif
return 0;
}
// Connect to databases
int SqlDb::Connect(int db_types, SqlDataReply &reply, int *s_rc_in, int *t_rc_in)
{
size_t start = Os::GetTickCount();
int rc = 0;
int s_rc = 0;
int t_rc = 0;
// Set initialization results
if(s_rc_in != NULL)
s_rc = *s_rc_in;
if(t_rc_in != NULL)
t_rc = *t_rc_in;
// Connect to both databases (both were initialized successfully)
if(db_types == SQLDB_BOTH && s_rc == 0 && t_rc == 0)
{
rc = Execute(SQLDATA_CMD_CONNECT);
}
else
// Connect to source only
if(db_types == SQLDB_SOURCE_ONLY || (db_types == SQLDB_BOTH && s_rc == 0))
{
if(_source_ca.db_api != NULL)
{
s_rc = _source_ca.db_api->Connect(&_source_ca._time_spent);
if(s_rc == -1)
_source_ca.error = _source_ca.db_api->GetError();
}
}
else
// Connect to target only
if(db_types == SQLDB_SOURCE_ONLY || (db_types == SQLDB_BOTH && t_rc == 0))
{
if(_target_ca.db_api != NULL)
{
t_rc = _target_ca.db_api->Connect(&_target_ca._time_spent);
if(t_rc == -1)
_target_ca.error = _target_ca.db_api->GetError();
}
}
if(s_rc == -1 || t_rc == -1)
rc = -1;
source_subtype = GetSubType(SQLDB_SOURCE_ONLY);
target_subtype = GetSubType(SQLDB_TARGET_ONLY);
// Set results
reply._cmd_subtype = SQLDATA_CMD_CONNECT;
reply.rc = rc;
reply._s_rc = _source_ca.cmd_rc;
reply._t_rc = _target_ca.cmd_rc;
// Versions
if(_source_ca.db_api != NULL)
strcpy(reply._s_name, _source_ca.db_api->GetVersion().c_str());
if(_target_ca.db_api != NULL)
strcpy(reply._t_name, _target_ca.db_api->GetVersion().c_str());
reply.s_error = _source_ca.error;
reply.t_error = _target_ca.error;
reply._time_spent = GetTickCount() - start;
reply._s_time_spent = _source_ca._time_spent;
reply._t_time_spent = _target_ca._time_spent;
if(reply.s_error == -1 && _source_ca.db_api != NULL)
strcpy(reply.s_native_error_text, _source_ca.db_api->GetNativeErrorText());
if(reply.t_error == -1 && _target_ca.db_api != NULL)
strcpy(reply.t_native_error_text, _target_ca.db_api->GetNativeErrorText());
return rc;
}
// Test connection
int SqlDb::TestConnection(std::string &conn, std::string &error, std::string &loaded_path,
std::list<std::string> &search_paths, size_t *time_spent)
{
size_t start = Os::GetTickCount();
// Create database API
SqlApiBase *api = CreateDatabaseApi(conn.c_str(), NULL);
if(api == NULL)
{
error = "Unknown database API";
return -1;
}
// Initialize the database API library for process
int rc = InitStaticApi(conn.c_str(), error);
if(rc == 0)
{
// Initialize the database API library
rc = api->Init();
api->GetDriverPaths(search_paths);
loaded_path = api->GetLoadedDriver();
if(rc == -1)
{
error = api->GetNativeErrorText();
delete api;
if(time_spent != NULL)
*time_spent = Os::GetTickCount() - start;
return -1;
}
}
// Try to connect
if(rc == 0)
{
rc = api->Connect(NULL);
if(rc == -1)
error = api->GetNativeErrorText();
api->Disconnect();
api->Deallocate();
}
delete api;
if(time_spent != NULL)
*time_spent = Os::GetTickCount() - start;
return rc;
}
// Get the list of available tables
int SqlDb::GetAvailableTables(int db_types, std::string &table_template, std::string &exclude,
std::list<std::string> &tables)
{
if(_source_ca.db_api == NULL)
return -1;
int rc = 0;
if(db_types == SQLDB_SOURCE_ONLY)
rc = _source_ca.db_api->GetAvailableTables(table_template, exclude, tables);
return rc;
}
// Read schema information
int SqlDb::ReadSchema(int db_types, std::string &select, std::string &exclude, bool read_cns, bool read_idx)
{
int rc = 0;
// Read source and target schemas
if(db_types == SQLDB_BOTH && _source_ca.db_api != NULL && _target_ca.db_api != NULL)
{
if(target_type == SQLDATA_ORACLE)
{
_source_ca._void1 = (void*)select.c_str();
_target_ca._void1 = (void*)select.c_str();
_source_ca._void2 = (void*)exclude.c_str();
_target_ca._void2 = (void*)exclude.c_str();
rc = Execute(SQLDATA_CMD_READ_SCHEMA, SQLDATA_CMD_READ_SCHEMA_FOR_TRANSFER_TO);
}
else
rc = _source_ca.db_api->ReadSchema(select.c_str(), exclude.c_str(), read_cns, read_idx);
}
else
// Read the source schema only
if(db_types == SQLDB_SOURCE_ONLY && _source_ca.db_api != NULL)
rc = _source_ca.db_api->ReadSchema(select.c_str(), exclude.c_str(), read_cns, read_idx);
return rc;
}
// Read non-table objects
int SqlDb::ReadObjects(int db_types, std::string &select, std::string &exclude)
{
int rc = 0;
// Read the source schema only
if(db_types == SQLDB_SOURCE_ONLY && _source_ca.db_api != NULL)
rc = _source_ca.db_api->ReadObjects(select.c_str(), exclude.c_str());
return rc;
}
// Read table name by constraint name
int SqlDb::ReadConstraintTable(int /*db_types*/, const char *schema, const char *constraint, std::string &table)
{
if(_source_ca.db_api == NULL)
return -1;
int rc = _source_ca.db_api->ReadConstraintTable(schema, constraint, table);
return rc;
}
// Read columns of the specified constraint name
int SqlDb::ReadConstraintColumns(int /*db_types*/, const char *schema, const char *table, const char *constraint, std::string &cols)
{
if(_source_ca.db_api == NULL)
return -1;
int rc = _source_ca.db_api->ReadConstraintColumns(schema, table, constraint, cols);
return rc;
}
// Check if identity column defined for the table
bool SqlDb::IsIdentityDefined(int /*db_types*/, std::string &schema, std::string &table)
{
if(_source_ca.db_api == NULL)
return false;
return _source_ca.db_api->IsIdentityDefined(schema, table);
}
// Read columns for the specified PRIMARY and UNIQUE key constraint
int SqlDb::GetKeyConstraintColumns(int /*db_types*/, SqlConstraints &cns, std::list<std::string> &key_cols)
{
if(_source_ca.db_api == NULL)
return -1;
int rc = _source_ca.db_api->GetKeyConstraintColumns(cns, key_cols);
return rc;
}
// Get columns for the specified FOREIGN key constraint
int SqlDb::GetForeignKeyConstraintColumns(int /*db_types*/, SqlConstraints &cns, std::list<std::string> &fcols,
std::list<std::string> &pcols, std::string &ptable)
{
if(_source_ca.db_api == NULL)
return -1;
int rc = _source_ca.db_api->GetForeignKeyConstraintColumns(cns, fcols, pcols, ptable);
return rc;
}
// Get column list for the specified index
int SqlDb::GetIndexColumns(int /*db_types*/, SqlIndexes &idx, std::list<std::string> &idx_cols, std::list<std::string> &idx_sorts)
{
if(_source_ca.db_api == NULL)
return -1;
return _source_ca.db_api->GetIndexColumns(idx, idx_cols, idx_sorts);
}
// Get information on table columns
std::list<SqlColMeta>* SqlDb::GetTableColumns(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetTableColumns();
}
// Get information on table constraints
std::list<SqlConstraints>* SqlDb::GetTableConstraints(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetTableConstraints();
}
// Get information about constraint columns
std::list<SqlConsColumns>* SqlDb::GetConstraintColumns(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetConstraintColumns();
}
std::list<SqlComments>* SqlDb::GetTableComments(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetTableComments();
}
std::list<SqlIndexes>* SqlDb::GetTableIndexes(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetTableIndexes();
}
std::list<SqlIndColumns>* SqlDb::GetIndexColumns(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetIndexColumns();
}
std::list<SqlIndExp>* SqlDb::GetIndexExpressions(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetIndexExpressions();
}
// Get sequences
std::list<SqlSequences>* SqlDb::GetSequences(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetSequences();
}
// Get stored procedures
std::list<SqlObjMeta>* SqlDb::GetProcedures(int /*db_type*/)
{
if(_source_ca.db_api == NULL)
return NULL;
return _source_ca.db_api->GetProcedures();
}
// Transfer table rows
int SqlDb::TransferRows(SqlDataReply &reply, int options, bool create_tables, bool data)
{
if(_source_ca.db_api == NULL || _target_ca.db_api == NULL)
return -1;
// Notify that a table was selected for processing
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_STARTED;
_callback(_callback_object, &reply);
}
size_t start = GetTickCount(), now = start, prev_update = start;
std::string select, t_select;
// SELECT query
if(reply.s_sql_l.empty())
{
if(_metaSqlDb != NULL)
_metaSqlDb->BuildQuery(select, t_select, reply._s_name, reply._t_name, true);
}
else
select = reply.s_sql_l;
size_t col_count = 0, allocated_array_rows = 0;
int rows_fetched = 0, rows_written = 0;
int all_rows_read = 0, all_rows_written = 0;
size_t bytes_written = 0;
__int64 all_bytes_written = 0;
size_t time_read = 0, all_time_read = 0;
size_t time_write = 0, all_time_write = 0;
SqlCol *s_cols = NULL, *s_cols_copy = NULL, *cur_cols = NULL, *t_cols = NULL;
bool no_more_data = false;
size_t buffer_rows = 0;
// Fetch only one row to get cursor definition when no data transferred
if(!data)
buffer_rows = 1;
// Open cursor allocating 10M buffer
int rc = _source_ca.db_api->OpenCursor(select.c_str(), buffer_rows, 1024*1024*32, &col_count, &allocated_array_rows,
&rows_fetched, &s_cols, &time_read, false, _datatype_map);
if(rc != -1)
{
all_rows_read += rows_fetched;
all_time_read += time_read;
}
// Notify on opening cursor
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_OPEN_CURSOR;
reply.rc = rc;
reply._s_int1 = all_rows_read;
reply._s_int2 = (int)time_read;
// There can be warnings (rc = 1) such as truncation error, get exact message
if(rc != 0)
{
reply.s_error = _source_ca.db_api->GetError();
strcpy(reply.s_native_error_text, _source_ca.db_api->GetNativeErrorText());
}
// In case of error, callback will be called on completion
if(rc != -1)
_callback(_callback_object, &reply);
}
if(rc == -1)
return -1;
// Check if we can read and write in parallel for this table
bool parallel_read_write = _source_ca.db_api->CanParallelReadWrite();
// Check whether target bound the source buffers, so the same buffers must be passed to TransferRows
bool data_bound = _target_ca.db_api->IsDataBufferBound();
// Oracle OCI returns 100, ODBC 0 when rows are less than allocated array
if(rc == 100 || rows_fetched < allocated_array_rows)
no_more_data = true;
cur_cols = s_cols;
// Allocate a copy of column buffer if data were not fetched in one iteration
if(no_more_data == false && parallel_read_write == true)
{
CopyColumns(s_cols, &s_cols_copy, col_count, allocated_array_rows);
cur_cols = s_cols_copy;
}
bool ddl_error = false;
// Check whether we need to drop, create or truncate the table
if(create_tables && options != 0)
{
rc = PrepareTransfer(s_cols, reply._s_name, reply._t_name, col_count, options, reply);
if(rc == -1)
{
reply._cmd_subtype = SQLDATA_CMD_DUMP_DDL;
reply.rc = rc;
reply.data = s_cols;
reply._int1 = (int)col_count;
if(_callback != NULL)
_callback(_callback_object, &reply);
reply.data = NULL;
reply._int1 = 0;
// Notify on transfer completion with DDL error (call back will be called in the caller)
reply._cmd_subtype = SQLDATA_CMD_COMPLETE_WITH_DDL_ERROR;
reply.rc = rc;
ddl_error = true;
}
}
bool bulk_init = false;
// Initialize the bulk insert in the target database
if(data && rc != -1 && rows_fetched != 0)
{
rc = _target_ca.db_api->InitBulkTransfer(reply._t_name, col_count, allocated_array_rows, cur_cols, &t_cols);
bulk_init = true;
}
while(data && rc != -1)
{
// Only one fetch, or the last fetch
if(no_more_data == true)
{
// Sybase CT-lib and ODBC return NO DATA after all rows fetched so check for number of rows
if(rows_fetched != 0)
{
// Copy buffer if it is non-single fetch and source data buffer is bound
if(s_cols_copy != NULL && data_bound == true)
CopyColumnData(s_cols, s_cols_copy, col_count, rows_fetched);
// Do not copy, use source buffers
else
cur_cols = s_cols;
// Insert last portion of rows
rc = _target_ca.db_api->TransferRows(cur_cols, rows_fetched, &rows_written, &bytes_written,
&time_write);
if(rc == 0)
{
all_rows_written += rows_written;
all_bytes_written += bytes_written;
all_time_write += time_write;
}
}
break;
}
else
// Parallel read/write is not allowed
if(parallel_read_write == false)
{
// Insert the current row
rc = _target_ca.db_api->TransferRows(cur_cols, rows_fetched, &rows_written, &bytes_written,
&time_write);
if(rc == -1)
break;
// Get next row
rc = _source_ca.db_api->Fetch(&rows_fetched, &time_read);
}
// Use concurrent threads
else
{
// Copy data
CopyColumnData(s_cols, s_cols_copy, col_count, rows_fetched);
cur_cols = s_cols_copy;
// Prepare insert command
_target_ca._int2 = rows_fetched;
_target_ca._void1 = cur_cols;
// Fetch the next set of data, and insert the current set in 2 concurrent threads
rc = Execute(SQLDATA_CMD_FETCH_NEXT, SQLDATA_CMD_INSERT_NEXT);
if(rc == -1)
break;
rows_fetched = _source_ca._int1;
time_read = (size_t)_source_ca._int4;
rows_written = _target_ca._int1;
bytes_written = (size_t)_target_ca._int3;
time_write = (size_t)_target_ca._int4;
}
all_rows_read += rows_fetched;
all_time_read += time_read;
all_rows_written += rows_written;
all_bytes_written += bytes_written;
all_time_write += time_write;
now = GetTickCount();
// Notify on transfer in progress every callback_rate milliseconds
if(_callback != NULL && (now - prev_update >= _callback_rate))
{
reply._cmd_subtype = SQLDATA_CMD_IN_PROGRESS;
reply.rc = 0;
reply._int1 = (int)(now - start);
reply._s_int1 = all_rows_read;
reply._s_int2 = (int)all_time_read;
reply._t_int1 = (int)all_rows_written;
reply._t_int2 = (int)all_time_write;
reply._t_bigint1 = all_bytes_written;
_callback(_callback_object, &reply);
prev_update = now;
}
// it was the last fetch
if(rc == 100 || rows_fetched < allocated_array_rows)
no_more_data = true;
}
// Complete transfer
if(bulk_init == true)
{
int close_rc = _target_ca.db_api->CloseBulkTransfer();
if(close_rc == -1)
{
rc = -1;
reply._t_rc = -1;
}
}
// Close the source database cursor
_source_ca.db_api->CloseCursor();
// Delete the copy buffer
if(s_cols_copy != NULL)
{
for(int i = 0; i < col_count; i++)
{
delete [] s_cols_copy[i]._data;
delete [] s_cols_copy[i]._ind2;
delete [] s_cols_copy[i]._len_ind2;
}
delete [] s_cols_copy;
}
// Notify on transfer completion (call back will be called in the caller)
if(data && ddl_error == false)
{
reply._cmd_subtype = SQLDATA_CMD_COMPLETE;
reply.rc = rc;
reply._int1 = (int)(GetTickCount() - start);
reply._s_int1 = all_rows_read;
reply._s_int2 = (int)all_time_read;
reply._t_int1 = all_rows_written;
reply._t_int2 = (int)all_time_write;
reply._t_bigint1 = all_bytes_written;
// Set error information in case of a failure
if(rc == -1)
{
reply.s_error = _source_ca.db_api->GetError();
reply.t_error = _target_ca.db_api->GetError();
strcpy(reply.s_native_error_text, _source_ca.db_api->GetNativeErrorText());
strcpy(reply.t_native_error_text, _target_ca.db_api->GetNativeErrorText());
}
}
// Notify that the data transfer was skipped
if(!data)
{
reply._cmd_subtype = SQLDATA_CMD_SKIPPED;
reply.rc = 0;
}
return (rc == 100) ? 0 : rc;
}
// Assess table rows
int SqlDb::AssessRows(SqlDataReply &reply)
{
if(_source_ca.db_api == NULL)
return -1;
// Notify that a table was selected for processing
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_STARTED;
_callback(_callback_object, &reply);
}
size_t start = GetTickCount(), now = start, prev_update = start;
std::string select, t_select;
// SELECT query
if(_metaSqlDb != NULL)
_metaSqlDb->BuildQuery(select, t_select, reply._s_name, reply._t_name, true);
//select = "select well_te from afmss.well_remarks where well_rmks_id=100827";
size_t col_count = 0, allocated_array_rows = 0;
int rows_fetched = 0;
int all_rows_read = 0;
__int64 all_bytes_read = 0;
size_t time_read = 0, all_time_read = 0;
SqlCol *s_cols = NULL;
bool no_more_data = false;
// Open cursor allocating 10M buffer
int rc = _source_ca.db_api->OpenCursor(select.c_str(), 0, 1024*1024*10, &col_count, &allocated_array_rows,
&rows_fetched, &s_cols, &time_read);
if(rc != -1)
{
all_rows_read += rows_fetched;
all_time_read += time_read;
}
// Notify on opening cursor
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_OPEN_CURSOR;
reply.rc = rc;
reply._s_int1 = all_rows_read;
reply._s_int2 = (int)time_read;
// There can be warnings (rc = 1) such as truncation error, get exact message
if(rc != 0)
{
reply.s_error = _source_ca.db_api->GetError();
strcpy(reply.s_native_error_text, _source_ca.db_api->GetNativeErrorText());
}
// In case of error, callback will be called on completion
if(rc != -1)
_callback(_callback_object, &reply);
}
if(rc == -1)
return -1;
// Oracle OCI returns 100, ODBC 0 when rows are less than allocated array
if(rc == 100 || rows_fetched < allocated_array_rows)
no_more_data = true;
while(rc != -1)
{
// Prepare buffers and calculate data size
for(int i = 0; i < rows_fetched; i++)
{
for(int k = 0; k < col_count; k++)
{
if(source_type == SQLDATA_DB2 || source_type == SQLDATA_SQL_SERVER ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_MYSQL ||
source_type == SQLDATA_ASA)
{
if(s_cols[k].ind != NULL && s_cols[k].ind[i] != -1)
{
// Source indicator can contain value larger than fetch size in case if data truncated
// warning risen (Informix when LOB fecthed as VARCHAR)
if(s_cols[k].ind[i] > s_cols[k]._fetch_len)
all_bytes_read += s_cols[k]._fetch_len;
else
all_bytes_read += s_cols[k].ind[i];
}
}
}
}
if(no_more_data == true)
break;
// Get next rows
rc = _source_ca.db_api->Fetch(&rows_fetched, &time_read);
all_rows_read += rows_fetched;
all_time_read += time_read;
now = GetTickCount();
// Notify on assessment in progress every callback_rate milliseconds
if(_callback != NULL && (now - prev_update >= _callback_rate))
{
reply._cmd_subtype = SQLDATA_CMD_IN_PROGRESS;
reply.rc = 0;
reply._int1 = (int)(now - start);
reply._s_int1 = all_rows_read;
reply._s_int2 = (int)all_time_read;
reply._s_bigint1 = all_bytes_read;
_callback(_callback_object, &reply);
prev_update = now;
}
// Last fetch in ODBC-like interface, no new data in buffer
if(rc == 100 && rows_fetched == 0)
break;
// it was the last fetch
if(rc == 100 || rows_fetched < allocated_array_rows)
no_more_data = true;
}
// Close the source database cursor
_source_ca.db_api->CloseCursor();
reply._cmd_subtype = SQLDATA_CMD_COMPLETE;
reply.rc = rc;
reply._int1 = (int)(GetTickCount() - start);
reply._s_int1 = all_rows_read;
reply._s_int2 = (int)all_time_read;
reply._s_bigint1 = all_bytes_read;
// Set error information in case of a failure
if(rc == -1)
{
reply.s_error = _source_ca.db_api->GetError();
strcpy(reply.s_native_error_text, _source_ca.db_api->GetNativeErrorText());
}
return (rc == 100) ? 0 : rc;
}
// Check whether we need to drop, create or truncate the table
int SqlDb::PrepareTransfer(SqlCol *s_cols, const char *s_table, const char *t_table, size_t col_count, int options, SqlDataReply &reply)
{
if(s_table == NULL || t_table == NULL || _target_ca.db_api == NULL || s_cols == NULL)
return -1;
int rc = 0;
size_t time_spent = 0;
// Check for necessity to DROP existing table
if(options & SQLDATA_OPT_DROP)
{
std::string drop_stmt;
rc = _target_ca.db_api->DropTable(t_table, &time_spent, drop_stmt);
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_DROP;
reply.rc = rc;
reply._int1 = (int)time_spent;
reply.t_sql = drop_stmt.c_str();
if(rc != 0)
{
reply.t_error = _target_ca.db_api->GetError();
strcpy(reply.t_native_error_text, _target_ca.db_api->GetNativeErrorText());
}
_callback(_callback_object, &reply);
}
// If failed with the error other than table does not exist, then exit
if(rc == -1 && reply.t_error != SQL_DBAPI_NOT_EXISTS_ERROR)
return rc;
}
// Check truncate command
if(options & SQLDATA_OPT_TRUNCATE)
{
std::string command = "TRUNCATE TABLE ";
command += t_table;
rc = _target_ca.db_api->ExecuteNonQuery(command.c_str(), &time_spent);
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_TRUNCATE;
reply.rc = rc;
reply._int1 = (int)time_spent;
reply.t_sql = command.c_str();
if(rc != 0)
{
reply.t_error = _target_ca.db_api->GetError();
strcpy(reply.t_native_error_text, _target_ca.db_api->GetNativeErrorText());
}
_callback(_callback_object, &reply);
}
}
// Check for necessity to create table
if(options & SQLDATA_OPT_CREATE)
{
std::string command;
// Generate SQL CREATE TABLE statement
GenerateCreateTable(s_cols, s_table, t_table, (int)col_count, command);
rc = _target_ca.db_api->ExecuteNonQuery(command.c_str(), &time_spent);
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_CREATE;
reply.rc = rc;
reply._int1 = (int)time_spent;
reply.t_sql = command.c_str();
if(rc != 0)
{
reply.t_error = _target_ca.db_api->GetError();
strcpy(reply.t_native_error_text, _target_ca.db_api->GetNativeErrorText());
}
_callback(_callback_object, &reply);
}
}
return rc;
}
// Generate SQL CREATE TABLE statement
int SqlDb::GenerateCreateTable(SqlCol *s_cols, const char *s_table, const char *t_table, int col_count, std::string &sql)
{
if(s_table == NULL || t_table == NULL || s_cols == NULL)
return -1;
sql = "CREATE TABLE ";
sql += t_table;
sql += "\n(\n ";
char int1[12], int2[12];
for(int i = 0; i < col_count; i++)
{
if(i > 0)
sql += ",\n ";
std::string colname;
std::string coltype;
// Get the target column name
MapColumn(s_table, s_cols[i]._name, colname, coltype);
sql += colname;
sql += ' ';
strcpy(s_cols[i]._t_name, colname.c_str());
// Set data type from global data type mapping
if(coltype.empty() == true && s_cols[i]._t_datatype_name.empty() == false)
coltype = s_cols[i]._t_datatype_name;
std::string identity_clause;
// Get IDENTITY clause to be added to column definition, it may affect the target data type conversion
GetInlineIdentityClause(s_table, s_cols[i]._name, identity_clause);
// Data type is set by the column name mapping
if(coltype.empty() == false)
sql += coltype;
else
// Oracle VARCHAR2 (SQLT_CHR) ODBC SQL_VARCHAR
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_CHR) ||
// Sybase ASE CHAR and VARCHAR (CS_CHAR_TYPE for VARCHAR <= 255, and CS_LONGCHAR_TYPE for VARCHAR < 32K)
(source_type == SQLDATA_SYBASE && (s_cols[i]._native_dt == CS_CHAR_TYPE || s_cols[i]._native_dt == CS_LONGCHAR_TYPE)) ||
// MySQL VARCHAR
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_VAR_STRING) ||
// SQL Server, DB2, Informix, Sybase ASA VARCHAR
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA || source_type == SQLDATA_ODBC)
&& s_cols[i]._native_dt == SQL_VARCHAR))
{
Str::IntToString((int)s_cols[i]._len, int1);
// VARCHAR2 or CLOB in Oracle
if(target_type == SQLDATA_SQL_SERVER)
{
if(s_cols[i]._len <= 8000)
{
sql += "VARCHAR(";
sql += int1;
sql += ")";
}
else
sql += "VARCHAR(max)";
}
else
// VARCHAR2 or CLOB in Oracle
if(target_type == SQLDATA_ORACLE)
{
if(s_cols[i]._len <= 4000)
{
sql += "VARCHAR2(";
sql += int1;
sql += " CHAR)";
}
else
sql += "CLOB";
}
else
if(target_type == SQLDATA_MYSQL)
{
// Can be SQL Server VARCHAR(max), so check the length
if(s_cols[i]._len <= 8000)
{
sql += "VARCHAR(";
sql += int1;
sql += ")";
}
else
sql += "LONGTEXT";
}
else
if(target_type == SQLDATA_POSTGRESQL)
{
sql += "TEXT";
}
else
{
sql += "VARCHAR(";
sql += int1;
sql += ")";
}
}
else
// Oracle CHAR
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_AFC) ||
// SQL Server CHAR
(source_type == SQLDATA_SQL_SERVER && s_cols[i]._native_dt == SQL_CHAR) ||
// Informix CHAR
(source_type == SQLDATA_INFORMIX && s_cols[i]._native_dt == SQL_CHAR) ||
// DB2 CHAR
(source_type == SQLDATA_DB2 && s_cols[i]._native_dt == SQL_CHAR) ||
// ODBC CHAR
(source_type == SQLDATA_ODBC && s_cols[i]._native_dt == SQL_CHAR) ||
// MySQL CHAR
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_STRING))
{
int len = (int)s_cols[i]._len;
Str::IntToString(len, int1);
// MySQL allows zero length for CHAR columns
if(len == 0 && target_type != SQLDATA_MYSQL)
len = 1;
// MySQL allows max size 255 for CHAR
if(target_type == SQLDATA_MYSQL)
{
if(s_cols[i]._len <= 255)
{
sql += "CHAR(";
sql += int1;
sql += ")";
}
else
sql += "TEXT";
}
else
// SQL Server allows max size 8000 for CHAR (while Informix allows 32,767)
if(target_type == SQLDATA_SQL_SERVER)
{
if(s_cols[i]._len <= 8000)
{
sql += "CHAR(";
sql += int1;
sql += ")";
}
else
sql += "VARCHAR(max)";
}
else
{
sql += "CHAR(";
sql += int1;
// Add CHAR length semantic for Oracle as many databases specify size in characters,
// while BYTE is default in Oracle
if(target_type == SQLDATA_ORACLE)
sql += " CHAR";
sql += ")";
}
}
else
// SQL Server, Sybase ASA NCHAR
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_WCHAR) ||
// DB2 GRAPHIC with code -95
(source_type == SQLDATA_DB2 && s_cols[i]._native_dt == -95))
{
// Length in characters for source Sybase ASA
int len = (int)s_cols[i]._len;
Str::IntToString((int)s_cols[i]._len, int1);
// NCHAR in SQL Server
if(target_type == SQLDATA_SQL_SERVER)
{
if(len <= 4000)
{
sql += "NCHAR(";
sql += int1;
sql += ")";
}
else
sql += "NVARCHAR(max)";
}
else
// MySQL allows max size 255 for NCHAR
if(target_type == SQLDATA_MYSQL)
{
if(s_cols[i]._len <= 255)
{
sql += "NCHAR(";
sql += int1;
sql += ")";
}
else
sql += "TEXT";
}
else
if(target_type == SQLDATA_POSTGRESQL)
{
sql += "TEXT";
}
else
{
sql += "NCHAR(";
sql += int1;
sql += ")";
}
}
else
// SQL Server, Sybase ASA NVARCHAR
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_WVARCHAR) ||
// DB2 VARGRAPHIC with code -96
(source_type == SQLDATA_DB2 && s_cols[i]._native_dt == -96))
{
// Length in characters for source Sybase ASA
int len = (int)s_cols[i]._len;
Str::IntToString((int)s_cols[i]._len, int1);
if(target_type == SQLDATA_ORACLE)
{
sql += "NVARCHAR2(";
sql += int1;
sql += ")";
}
else
// NVARCHAR in SQL Server
if(target_type == SQLDATA_SQL_SERVER)
{
if(len <= 4000)
{
sql += "NVARCHAR(";
sql += int1;
sql += ")";
}
else
sql += "NVARCHAR(max)";
}
else
if(target_type == SQLDATA_MYSQL)
{
// Can be SQL Server NVARCHAR(max), so check the length
if(s_cols[i]._len <= 4000)
{
sql += "NVARCHAR(";
sql += int1;
sql += ")";
}
else
sql += "LONGTEXT";
}
else
if(target_type == SQLDATA_POSTGRESQL)
{
sql += "TEXT";
}
else
{
sql += "NVARCHAR(";
sql += int1;
sql += ")";
}
}
else
// Oracle NUMBER as INTEGER
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_NUM && s_cols[i]._precision != 0 &&
s_cols[i]._precision < 10 && s_cols[i]._scale == 0) ||
// Oracle NUMBER as INTEGER through ODBC
(source_type == SQLDATA_ODBC && source_subtype == SQLDATA_ORACLE && s_cols[i]._native_dt == SQL_DECIMAL &&
s_cols[i]._precision < 10 && s_cols[i]._scale == 0) ||
// SQL Server, DB2, Informix, Sybase ASA INTEGER
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA)
&& s_cols[i]._native_dt == SQL_INTEGER) ||
// Sybase ASE INT
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_INT_TYPE) ||
// MySQL INT
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_LONG))
{
if(target_type != SQLDATA_ORACLE)
sql += "INTEGER";
else
sql += "NUMBER(10)";
}
else
// SQL Server, DB2, Informix, Sybase ASA BIGINT (SQL_BIGINT -5)
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_BIGINT) ||
// MySQL BIGINT
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_LONGLONG) ||
// Sybase ASE BIGINT
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_BIGINT_TYPE) ||
// Informix SQL_INFX_BIGINT (-114)
(source_type == SQLDATA_INFORMIX && s_cols[i]._native_dt == -114))
{
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER(19)";
else
sql += "BIGINT";
}
else
// SMALLINT
if((source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_SMALLINT_TYPE) ||
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_SHORT) ||
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA)
&& s_cols[i]._native_dt == SQL_SMALLINT))
{
if(target_type != SQLDATA_ORACLE)
sql += "SMALLINT";
else
sql += "NUMBER(5)";
}
else
// SQL Server, MySQL, Sybase ASA TINYINT
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_TINYINT) ||
// Sybase TINYINT
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_TINYINT_TYPE) ||
// MySQL TINYINT
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_TINY))
{
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER(3)";
else
if(target_type == SQLDATA_SQL_SERVER || target_type == SQLDATA_MYSQL)
sql += "TINYINT";
else
sql += "INTEGER";
}
else
// Oracle NUMBER without parameters
if(source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_NUM &&
((s_cols[i]._precision == 0 && s_cols[i]._scale == 129) || s_cols[i]._precision >= 38))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "FLOAT";
else
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER";
else
if(target_type == SQLDATA_MYSQL)
sql += "DOUBLE";
else
sql += "DOUBLE PRECISION";
}
else
// MySQL DOUBLE
if((source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_DOUBLE) ||
// SQL Server, DB2, ODBC FLOAT
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 || source_type == SQLDATA_ODBC) &&
s_cols[i]._native_dt == SQL_FLOAT))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "FLOAT";
else
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER";
else
if(target_type == SQLDATA_POSTGRESQL)
sql += "DOUBLE PRECISION";
else
sql += "DOUBLE";
}
else
// SQL Server, DB2, ODBC DOUBLE
if((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 || source_type == SQLDATA_ODBC) &&
s_cols[i]._native_dt == SQL_DOUBLE)
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "FLOAT";
else
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER";
else
if(target_type == SQLDATA_POSTGRESQL)
sql += "DOUBLE PRECISION";
else
sql += "DOUBLE";
}
else
// Informix single-precision floating point number SMALLFLOAT, REAL
if((source_type == SQLDATA_INFORMIX && s_cols[i]._native_dt == SQL_REAL) ||
// DB2 FLOAT, SQL Server REAL, Sybase ASA single-precision FLOAT
((source_type == SQLDATA_DB2 || source_type == SQLDATA_SQL_SERVER ||
source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_REAL))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "FLOAT";
else
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER";
else
sql += "FLOAT";
}
else
// Informix double-precision floating point number FLOAT, DOUBLE PRECISION
// Sybase ASA DOUBLE
if((source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_DOUBLE)
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "FLOAT";
else
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER";
else
sql += "DOUBLE PRECISION";
}
else
// MySQL FLOAT (4-byte)
if((source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_FLOAT) ||
// Sybase ASE FLOAT
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_FLOAT_TYPE))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "REAL";
else
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER";
else
sql += "FLOAT";
}
else
// DB2 DECFLOAT(16 | 34)
if(source_type == SQLDATA_DB2 && s_cols[i]._native_dt == -360)
{
sql += "DOUBLE";
}
else
// Oracle NUMBER as DECIMAL
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_NUM ||
source_type == SQLDATA_ODBC && source_subtype == SQLDATA_ORACLE && s_cols[i]._native_dt == SQL_DECIMAL) &&
((s_cols[i]._precision >= 10 && s_cols[i]._precision <= 38) || s_cols[i]._scale != 0) ||
// Sybase ASE NUMERIC and DECIMAL
(source_type == SQLDATA_SYBASE && (s_cols[i]._native_dt == CS_NUMERIC_TYPE || s_cols[i]._native_dt == CS_DECIMAL_TYPE)) ||
// SQL Server, DB2, Informix, Sybase ASA DECIMAL/NUMERIC
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA) &&
(s_cols[i]._native_dt == SQL_DECIMAL || s_cols[i]._native_dt == SQL_NUMERIC)) ||
// MySQL DECIMAL or NUMERIC
(source_type == SQLDATA_MYSQL &&
(s_cols[i]._native_dt == MYSQL_TYPE_NEWDECIMAL || s_cols[i]._native_dt == MYSQL_TYPE_DECIMAL)))
{
// Sybase ASE allows NUMERIC/DECIMAL(x,0) for identity while MySQL/MariaDB allows only integers
if(source_type == SQLDATA_SYBASE && target_type == SQLDATA_MYSQL && s_cols[i]._scale == 0 && !identity_clause.empty())
{
if(s_cols[i]._precision < 9)
sql += "INTEGER";
else
sql += "BIGINTEGER";
}
else
{
if(target_type == SQLDATA_ORACLE)
sql += "NUMBER(";
else
sql += "DECIMAL(";
sql += Str::IntToString(s_cols[i]._precision, int1);
sql += ",";
sql += Str::IntToString(s_cols[i]._scale, int2);
sql += ")";
}
}
else
// Sybase ASE MONEY
if(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_MONEY_TYPE)
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "MONEY";
else
{
sql += "DECIMAL(";
sql += Str::IntToString(s_cols[i]._precision, int1);
sql += ",";
sql += Str::IntToString(s_cols[i]._scale, int2);
sql += ")";
}
}
else
// Sybase ASE SMALLMONEY
if(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_MONEY4_TYPE)
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "SMALLMONEY";
else
{
sql += "DECIMAL(";
sql += Str::IntToString(s_cols[i]._precision, int1);
sql += ",";
sql += Str::IntToString(s_cols[i]._scale, int2);
sql += ")";
}
}
else
// Oracle DATE
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_DAT) ||
// MySQL DATETIME
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_DATETIME))
{
if(target_type == SQLDATA_DB2 || target_type == SQLDATA_POSTGRESQL)
sql += "TIMESTAMP";
else
if(target_type == SQLDATA_ORACLE)
sql += "DATE";
else
sql += "DATETIME";
}
else
// Oracle TIMESTAMP (SQLT_TIMESTAMP)
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_TIMESTAMP) ||
// Sybase ASE DATETIME
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_DATETIME_TYPE) ||
// SQL Server, DB2, Informix, Sybase ASA, ODBC DATETIME
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA ||
source_type == SQLDATA_ODBC) &&
s_cols[i]._native_dt == SQL_TYPE_TIMESTAMP))
{
char fraction[11];
// Define fractional seconds precision
sprintf(fraction, "%d", s_cols[i]._scale);
if(target_type == SQLDATA_SQL_SERVER)
sql += "DATETIME2";
else
if(target_type == SQLDATA_MYSQL)
{
sql += "DATETIME(";
// In DB2 fraction can be up to 12, in some other databases up to 9
// while MySQL and MariaDB support up to 6
if(s_cols[i]._scale <= 6)
sql += fraction;
else
sql += "6";
sql += ')';
}
else
// Oracle TIMESTAMP
if(target_type == SQLDATA_ORACLE)
{
sql += "TIMESTAMP(";
sql += fraction;
sql += ')';
}
else
sql += "TIMESTAMP";
}
else
// Oracle TIMESTAMP WITH TIME ZONE
if(source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_TIMESTAMP_TZ)
{
char fraction[11];
// Define fractional seconds precision
sprintf(fraction, "%d", s_cols[i]._scale);
if(target_type == SQLDATA_SQL_SERVER)
{
sql += "DATETIMEOFFSET(";
sql += fraction;
sql += ')';
}
else
if(target_type == SQLDATA_ORACLE)
{
sql += "TIMESTAMP(";
sql += fraction;
sql += ')';
sql += " WITH TIME ZONE";
}
else
if(target_type == SQLDATA_MYSQL)
sql += "DATETIME";
}
else
// ODBC, SQL Server, DB2, Informix, Sybase ASA TIME
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA ||
source_type == SQLDATA_ODBC) && s_cols[i]._native_dt == SQL_TYPE_TIME) ||
(source_type == SQLDATA_SQL_SERVER && s_cols[i]._native_dt == SQL_SS_TIME2) ||
// Sybase ASE TIME
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_TIME_TYPE))
{
char fraction[11];
// Define fractional seconds precision
sprintf(fraction, "%d", s_cols[i]._scale);
if(target_type == SQLDATA_SQL_SERVER)
{
sql += "TIME(";
sql += fraction;
sql += ')';
}
else
// Oracle TIMESTAMP
if(target_type == SQLDATA_ORACLE)
{
sql += "TIMESTAMP(";
sql += fraction;
sql += ')';
}
else
sql += "TIME";
}
else
// Oracle INTERVAL DAY TO SECOND
if(source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_INTERVAL_DS)
{
char fraction[11];
// Define fractional seconds precision
sprintf(fraction, "%d", s_cols[i]._scale);
if(target_type == SQLDATA_SQL_SERVER || target_type == SQLDATA_MYSQL)
sql += "VARCHAR(30)";
else
if(target_type == SQLDATA_ORACLE)
{
sql += "INTERVAL DAY TO SECOND(";
sql += fraction;
sql += ')';
}
}
else
// SQL Server, DB2, Informix, Sybase ASA DATE
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 ||
source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_TYPE_DATE) ||
// MySQL DATE
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_DATE) ||
// Sybase ASE DATE
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_DATE_TYPE))
{
sql += "DATE";
}
else
// Sybase ASE SMALLDATETIME
if(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_DATETIME4_TYPE)
{
if(target_type == SQLDATA_MYSQL)
sql += "DATETIME";
else
sql += "DATETIME";
}
else
// SQL Server BINARY
if((source_type == SQLDATA_SQL_SERVER && s_cols[i]._native_dt == SQL_BINARY) ||
// Sybase ASE BINARY
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_BINARY_TYPE))
{
if(target_type == SQLDATA_ORACLE)
{
sql += "RAW(";
sql += Str::IntToString((int)s_cols[i]._len, int1);
sql += ")";
}
else
if(target_type == SQLDATA_MYSQL)
{
sql += "BINARY(";
sql += Str::IntToString((int)s_cols[i]._len, int1);
sql += ")";
}
}
else
// Oracle RAW
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_BIN) ||
// SQL Server VARBINARY, DB2 VARCHAR FOR BIT DATA
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2)
&& s_cols[i]._native_dt == SQL_VARBINARY &&
s_cols[i]._lob == false) ||
// Sybase ASA BINARY is variable-length (!) data type
(source_type == SQLDATA_ASA && s_cols[i]._native_dt == SQL_BINARY))
{
int len = (int)s_cols[i]._len;
Str::IntToString(len, int1);
// VARBINARY(n | MAX) in SQL Server
if(target_type == SQLDATA_SQL_SERVER)
{
sql += "VARBINARY(";
if(len <= 8000)
sql += int1;
else
sql += "MAX";
sql += ")";
}
else
if(target_type == SQLDATA_MYSQL)
{
// Can be SQL Server VARBINARY(max) fetched as non-LOB, so check the length
if(s_cols[i]._len <= 8000)
{
sql += "VARBINARY(";
sql += int1;
sql += ")";
}
else
sql += "LONGBLOB";
}
else
if(target_type == SQLDATA_POSTGRESQL)
{
sql += "BYTEA";
}
else
{
sql += "VARBINARY(";
sql += int1;
sql += ")";
}
}
else
// Oracle CLOB, LONG
if((source_type == SQLDATA_ORACLE &&
(s_cols[i]._native_dt == SQLT_CLOB || s_cols[i]._native_dt == SQLT_LNG)) ||
// Sybase ASE TEXT
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_TEXT_TYPE) ||
// Informix TEXT, Sybase ASA LONG VARCHAR
((source_type == SQLDATA_INFORMIX || source_type == SQLDATA_ASA || source_type == SQLDATA_ODBC)
&& s_cols[i]._native_dt == SQL_LONGVARCHAR) ||
// DB2 CLOB with code -99, LONG VARCHAR with code -1
(source_type == SQLDATA_DB2 && (s_cols[i]._native_dt == -99 || s_cols[i]._native_dt == -1)) ||
// Informix CLOB with code -103
(source_type == SQLDATA_INFORMIX && s_cols[i]._native_dt == -103) ||
// MySQL CLOB
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_BLOB && s_cols[i]._binary == false))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "VARCHAR(MAX)";
else
if(target_type == SQLDATA_ORACLE)
sql += "CLOB";
else
if(target_type == SQLDATA_MYSQL)
sql += "LONGTEXT";
else
if(target_type == SQLDATA_POSTGRESQL)
sql += "TEXT";
}
else
// SQL Server NTEXT, Sybase ASA LONG NVARCHAR
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_INFORMIX ||
source_type == SQLDATA_ASA || source_type == SQLDATA_ODBC)
&& s_cols[i]._native_dt == SQL_WLONGVARCHAR) ||
// Sybase ASE UNITEXT
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_UNITEXT_TYPE))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "NVARCHAR(MAX)";
else
if(target_type == SQLDATA_ORACLE)
sql += "NCLOB";
else
if(target_type == SQLDATA_MYSQL)
sql += "LONGTEXT";
else
if(target_type == SQLDATA_POSTGRESQL)
sql += "TEXT";
}
else
// Oracle BLOB, ODBC BLOB
if((source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_BLOB) ||
// SQL Server IMAGE, Informix BYTE, Sybase ASA LONG BINARY
((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_DB2 || source_type == SQLDATA_INFORMIX ||
source_type == SQLDATA_ASA || source_type == SQLDATA_ODBC)
&& s_cols[i]._native_dt == SQL_LONGVARBINARY) ||
// SQL Server VARBINARY(max)
(source_type == SQLDATA_SQL_SERVER && s_cols[i]._native_dt == SQL_VARBINARY &&
s_cols[i]._lob == true) ||
// DB2 BLOB with code -98
(source_type == SQLDATA_DB2 && s_cols[i]._native_dt == -98) ||
// Informix BLOB with code -102
(source_type == SQLDATA_INFORMIX && s_cols[i]._native_dt == -102) ||
// MySQL BLOB
(source_type == SQLDATA_MYSQL && s_cols[i]._native_dt == MYSQL_TYPE_BLOB && s_cols[i]._binary == true))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "VARBINARY(MAX)";
else
if(target_type == SQLDATA_ORACLE)
sql += "BLOB";
else
if(target_type == SQLDATA_MYSQL)
sql += "LONGBLOB";
else
if(target_type == SQLDATA_POSTGRESQL)
sql += "BYTEA";
}
else
// SQL Server XML
if((source_type == SQLDATA_SQL_SERVER && s_cols[i]._native_dt == SQL_SS_XML) ||
// DB2 XML with code -370
(source_type == SQLDATA_DB2 && s_cols[i]._native_dt == -370))
{
if(target_type == SQLDATA_ORACLE)
sql += "XMLTYPE";
else
if(target_type == SQLDATA_SQL_SERVER)
sql += "XML";
else
if(target_type == SQLDATA_MYSQL)
sql += "LONGTEXT";
else
if(target_type == SQLDATA_POSTGRESQL)
sql += "TEXT";
else
sql += "XML";
}
else
// SQL Server, Sybase ASA BIT, Informix BOOLEAN (SQL_BIT -7)
if(((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_INFORMIX ||
source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_BIT) ||
// Sybase ASE BIT
(source_type == SQLDATA_SYBASE && s_cols[i]._native_dt == CS_BIT_TYPE))
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "BIT";
else
sql += "CHAR(1)";
}
else
// Sybase ASA UNIQUEIDENTIFIER (SQL_GUID -11)
if((source_type == SQLDATA_SQL_SERVER || source_type == SQLDATA_ASA) &&
s_cols[i]._native_dt == SQL_GUID)
{
if(target_type == SQLDATA_SQL_SERVER)
sql += "UNIQUEIDENTIFIER";
else
sql += "CHAR(36)";
}
else
// Oracle ROWID
if(source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_RDD)
{
if(target_type != SQLDATA_ORACLE)
sql += "CHAR(18)";
else
sql += "ROWID";
}
else
// Oracle object type
if(source_type == SQLDATA_ORACLE && s_cols[i]._native_dt == SQLT_NTY)
{
Str::IntToString((int)s_cols[i]._len, int1);
sql += "VARCHAR(";
sql += int1;
sql += ")";
}
std::string default_clause;
// Get DEFAULT if it is a literal (MySQL i.e. requires full column specification in ALTER TABLE)
GetDefaultClause(s_table, s_cols[i]._name, default_clause);
if(source_type == SQLDATA_DB2 && target_type == SQLDATA_MYSQL && default_clause.empty() == false)
{
sql += " DEFAULT ";
sql += default_clause;
}
// Check NOT NULL attribute
if(s_cols[i]._nullable == false || IsPrimaryKeyColumn(s_table, s_cols[i]._name))
sql += " NOT NULL";
if(identity_clause.empty() == false)
{
sql += " ";
sql += identity_clause;
}
// For MySQL add column comment as a column property
if(target_type == SQLDATA_MYSQL)
{
std::string comment;
_source_ca.db_api->GetComment(s_table, s_cols[i]._name, comment);
// A comment found
if(comment.empty() == false)
{
std::string quoted_comment;
// Single quotes in comment must be duplicated
Str::Quote(comment, quoted_comment);
sql += " COMMENT ";
sql += quoted_comment;
}
}
}
sql += "\n)";
// For MySQL add table comment, character set etc. as a part of CREATE TABLE statement
if(target_type == SQLDATA_MYSQL)
AddMySQLTableOptions(s_table, sql);
return 0;
}
// Add table options when target is MySQL
void SqlDb::AddMySQLTableOptions(const char *s_table, std::string &sql)
{
// Add table comment as a part of CREATE TABLE statement
std::string comment;
_source_ca.db_api->GetComment(s_table, NULL, comment);
// A comment found
if(comment.empty() == false)
{
std::string quoted_comment;
// Single quotes in comment must be duplicated
Str::Quote(comment, quoted_comment);
sql += "\n COMMENT ";
sql += quoted_comment;
}
// Character set
const char *value = _parameters->Get("-mysql_set_character_set");
if(Str::IsSet(value))
{
sql += "\n CHARACTER SET ";
sql += value;
}
// Collation
value = _parameters->Get("-mysql_set_collation");
if(Str::IsSet(value))
{
sql += "\n COLLATE ";
sql += value;
}
}
// Get DEFAULT if it is a literal (MySQL i.e. requires full column specification in ALTER TABLE)
int SqlDb::GetDefaultClause(const char *s_table, char *column, std::string &default_clause)
{
if(s_table == NULL || column == NULL)
return -1;
if(target_type != SQLDATA_MYSQL)
return 0;
std::string def_clause;
if(_metaSqlDb != NULL)
_metaSqlDb->_source_ca.db_api->GetColumnDefault(s_table, column, def_clause);
// MySQL allows only string literals, numbers and some functions
if(def_clause.empty() == false)
{
const char *d = def_clause.c_str();
if(*d == '\'' || (*d >= '0' && *d <= '9') || !_stricmp(d, "CURRENT_TIMESTAMP"))
default_clause = def_clause;
else
if(!_stricmp(d, "CURRENT TIMESTAMP"))
default_clause = "CURRENT_TIMESTAMP";
}
return 0;
}
// Get IDENTITY clause to be added to column definition
int SqlDb::GetInlineIdentityClause(const char *s_table, char *column, std::string &identity_clause)
{
if(s_table == NULL || column == NULL)
return -1;
if(target_type != SQLDATA_SQL_SERVER && target_type != SQLDATA_MYSQL)
return 0;
std::list<SqlColMeta> *table_columns = _metaSqlDb->GetTableColumns(SQLDB_SOURCE_ONLY);
if(table_columns == NULL)
return 0;
std::string schema;
std::string table;
SqlApiBase::SplitQualifiedName(s_table, schema, table);
// Find mapping record for this table and column
for(std::list<SqlColMeta>::iterator i = table_columns->begin(); i != table_columns->end(); i++)
{
// Not an identity column
if((*i).identity == false)
continue;
char *col = (*i).column;
char *tab = (*i).table;
char *sch = (*i).schema;
if(col == NULL || tab == NULL || sch == NULL)
continue;
if(_stricmp(col, column) == 0 && _stricmp(tab, table.c_str()) == 0 &&
_stricmp(sch, schema.c_str()) == 0)
{
char int1[21];
if(target_type == SQLDATA_SQL_SERVER)
{
identity_clause += "IDENTITY(";
identity_clause += Str::IntToString((*i).id_next, int1);
identity_clause += ",";
identity_clause += Str::IntToString((*i).id_inc, int1);
identity_clause += ")";
}
else
// MySQL and MariaDB require auto_increment to be a key
if(target_type == SQLDATA_MYSQL)
identity_clause += "AUTO_INCREMENT PRIMARY KEY";
break;
}
}
return 0;
}
// Check if a column belongs to primary key
bool SqlDb::IsPrimaryKeyColumn(const char *s_table, const char *column)
{
if(s_table == NULL || column == NULL)
return false;
std::list<SqlColMeta> *table_columns = _metaSqlDb->GetTableColumns(SQLDB_SOURCE_ONLY);
if(table_columns == NULL)
return 0;
std::string schema;
std::string table;
SqlApiBase::SplitQualifiedName(s_table, schema, table);
// Find mapping record for this table and column
for(std::list<SqlColMeta>::iterator i = table_columns->begin(); i != table_columns->end(); i++)
{
// Not a primary key column
if((*i).pk_column == false)
continue;
char *col = (*i).column;
char *tab = (*i).table;
char *sch = (*i).schema;
if(col == NULL || tab == NULL || sch == NULL)
continue;
if(_stricmp(col, column) == 0 && _stricmp(tab, table.c_str()) == 0 &&
_stricmp(sch, schema.c_str()) == 0)
return (*i).pk_column;
}
return false;
}
// Get the target column name and type
void SqlDb::MapColumn(const char *s_table, const char *s_name, std::string &t_name, std::string &t_type)
{
if(s_table == NULL || s_name == NULL)
return;
bool name_mapped = false;
// Check is column name mapping is set
if(_column_map != NULL && _column_map->size() > 0)
{
std::string schema;
std::string table;
SqlApiBase::SplitQualifiedName(s_table, schema, table);
// Find mapping record for this table and column
for(std::list<SqlColMap>::iterator i = _column_map->begin(); i != _column_map->end(); i++)
{
if(_stricmp((*i).schema.c_str(), schema.c_str()) == 0 &&
_stricmp((*i).table.c_str(), table.c_str()) == 0 && _stricmp((*i).name.c_str(), s_name) == 0)
{
// Target column name is optional
if((*i).t_name.empty() == false)
{
t_name = (*i).t_name;
name_mapped = true;
}
// Target data type is optional
t_type = (*i).t_type;
break;
}
}
}
if(name_mapped)
return;
// Enclose column names to prevent reserved word conflicts
if(target_type == SQLDATA_SQL_SERVER)
{
t_name += '[';
t_name += s_name;
t_name += "]";
}
else
if(target_type == SQLDATA_ORACLE)
{
// Check for a reserved word in the target database
bool resword = _target_ca.db_api->IsReservedWord(s_name);
// Check for space (Sybase ASE, ASA i.e. return unqouted identifier when space inside)
bool space = strchr(s_name, ' ') != NULL ? true : false;
if(resword || space)
t_name += '"';
t_name += s_name;
if(resword || space)
t_name += '"';
// The length must not exceed 30 characters
if(resword == false)
{
size_t len = t_name.size();
if(len > 30)
{
std::string trimmed;
Str::TrimToAbbr(t_name, trimmed, 30);
t_name = trimmed;
}
}
}
else
if(target_type == SQLDATA_POSTGRESQL)
{
if(IsSpecialIdentifier(s_name) == true)
{
t_name += '"';
t_name += s_name;
t_name += "\"";
}
else
t_name += s_name;
}
else
if(target_type == SQLDATA_MYSQL)
{
t_name += '`';
t_name += s_name;
t_name += "`";
}
else
t_name += s_name;
}
// Check is the identifier contains a special character such as a space, dot etc.
bool SqlDb::IsSpecialIdentifier(const char *name)
{
if(name == NULL)
return false;
if(strchr(name, ' ') || strchr(name, '.'))
return true;
return false;
}
// Copy column definitions and buffers
int SqlDb::CopyColumns(SqlCol *cols, SqlCol **cols_copy, size_t col_count, size_t allocated_array_rows)
{
if(cols == NULL || cols_copy == NULL || col_count <= 0 || allocated_array_rows <= 0)
return -1;
SqlCol *cols_c = new SqlCol[col_count];
for(int i = 0; i < col_count; i++)
{
// Copy column metadata
cols_c[i] = cols[i];
// Allocate copy buffers
cols_c[i]._data = new char[cols_c[i]._fetch_len * allocated_array_rows];
if(cols[i]._ind2 != NULL)
cols_c[i]._ind2 = new short[allocated_array_rows];
if(cols[i].ind != NULL)
cols_c[i].ind = new size_t[allocated_array_rows];
if(cols[i]._len_ind2 != NULL)
cols_c[i]._len_ind2 = new short[allocated_array_rows];
if(cols[i]._len_ind4 != NULL)
cols_c[i]._len_ind4 = new int[allocated_array_rows];
}
*cols_copy = cols_c;
return 0;
}
// Copy data
int SqlDb::CopyColumnData(SqlCol *s_cols, SqlCol *t_cols, size_t col_count, int rows_fetched)
{
if(s_cols == NULL || t_cols == NULL || col_count <= 0 || rows_fetched <= 0)
return -1;
for(int i = 0; i < col_count; i++)
{
// Copy data
memcpy(t_cols[i]._data, s_cols[i]._data, s_cols[i]._fetch_len * rows_fetched);
if(s_cols[i]._ind2 != NULL)
memcpy(t_cols[i]._ind2, s_cols[i]._ind2, sizeof(short) * rows_fetched);
if(s_cols[i].ind != NULL)
memcpy(t_cols[i].ind, s_cols[i].ind, sizeof(size_t) * rows_fetched);
if(s_cols[i]._len_ind2 != NULL)
memcpy(t_cols[i]._len_ind2, s_cols[i]._len_ind2, sizeof(short) * rows_fetched);
if(s_cols[i]._len_ind4 != NULL)
memcpy(t_cols[i]._len_ind4, s_cols[i]._len_ind4, sizeof(int) * rows_fetched);
}
return 0;
}
// Validate table row count
int SqlDb::ValidateRowCount(SqlDataReply &reply)
{
if(_source_ca.db_api == NULL || _target_ca.db_api == NULL)
return -1;
// Notify that a table was selected for processing
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_STARTED;
_callback(_callback_object, &reply);
}
_source_ca._name = reply._s_name;
_target_ca._name = reply._t_name;
size_t start = GetTickCount();
// Execute the command
int rc = Execute(SQLDATA_CMD_VALIDATE_ROW_COUNT);
// Set results
reply._cmd_subtype = SQLDATA_CMD_COMPLETE;
reply.rc = rc;
reply._s_rc = _source_ca.cmd_rc;
reply._t_rc = _target_ca.cmd_rc;
reply._s_int1 = _source_ca._int1;
reply._t_int1 = _target_ca._int1;
reply._time_spent = GetTickCount() - start;
reply._s_time_spent = _source_ca._time_spent;
reply._t_time_spent = _target_ca._time_spent;
reply.s_error = _source_ca.error;
reply.t_error = _target_ca.error;
return rc;
};
// Validate data in rows
int SqlDb::ValidateRows(SqlDataReply &reply)
{
if(_metaSqlDb == NULL)
return -1;
// Notify that a table was selected for processing
if(_callback != NULL)
{
reply._cmd_subtype = SQLDATA_CMD_STARTED;
_callback(_callback_object, &reply);
}
size_t start = Os::GetTickCount();
std::string s_select, t_select;
// SELECT queries with ORDER BY
_metaSqlDb->BuildQuery(s_select, t_select, reply._s_name, reply._t_name, false);
_source_ca._void1 = (void*)s_select.c_str();
_target_ca._void1 = (void*)t_select.c_str();
// Out SqlCols
_source_ca._void2 = NULL;
_target_ca._void2 = NULL;
// Row and column counts
_source_ca._int1 = 0;
_source_ca._int2 = 0;
_source_ca._int3 = 0;
_target_ca._int1 = 0;
_target_ca._int2 = 0;
_target_ca._int3 = 0;
// The same number of rows must be fetched
_source_ca._int4 = 10000;
_target_ca._int4 = 10000;
int all_not_equal_rows = 0;
int not_equal_rows = 0;
// Open cursors
int rc = Execute(SQLDATA_CMD_OPEN_CURSOR);
SqlCol *s_cols = (SqlCol*)_source_ca._void2;
SqlCol *t_cols = (SqlCol*)_target_ca._void2;
int s_col_count = _source_ca._int1;
int t_col_count = _target_ca._int1;
int s_alloc_rows = _source_ca._int2;
int t_alloc_rows = _target_ca._int2;
int s_fetched_rows = _source_ca._int3;
int t_fetched_rows = _target_ca._int3;
int s_all_fetched_rows = 0;
int t_all_fetched_rows = 0;
__int64 s_all_bytes = 0;
__int64 t_all_bytes = 0;
int s_time_spent = (int)_source_ca._time_spent;
int t_time_spent = (int)_target_ca._time_spent;
bool more = true;
// Set trace file name containing possible differences (it will be created only if any difference found)
if(_trace_diff_data)
_trace_diff.SetLogfile(std::string(reply._s_name).append("_diff.txt").c_str(), NULL);
while(more)
{
if(rc == -1)
{
more = false;
break;
}
int s_bytes = 0, t_bytes = 0;
// Compare content in the buffers
not_equal_rows = ValidateCompareRows(s_cols, t_cols, s_col_count, &s_bytes, t_col_count, s_fetched_rows,
t_fetched_rows, &t_bytes, s_all_fetched_rows, all_not_equal_rows);
s_all_fetched_rows += s_fetched_rows;
t_all_fetched_rows += t_fetched_rows;
s_all_bytes += s_bytes;
t_all_bytes += t_bytes;
if(not_equal_rows != -1)
all_not_equal_rows += not_equal_rows;
// Exit if the number of fetched rows is less than allocated rows, or we reached the number of errors
if((s_fetched_rows < s_alloc_rows || t_fetched_rows < t_alloc_rows) ||
(_validation_not_equal_max_rows != -1 && all_not_equal_rows >= _validation_not_equal_max_rows))
{
more = false;
break;
}
// Fetch the next set of data in 2 concurrent threads
rc = Execute(SQLDATA_CMD_FETCH_NEXT);
s_fetched_rows = _source_ca._int1;
t_fetched_rows = _target_ca._int1;
s_time_spent += _source_ca._int4;
t_time_spent += _target_ca._int4;
// No more row, 0 can be returned if total rows divisible buffer size (10K, 100K, 10M etc.)
if(s_fetched_rows == 0 || t_fetched_rows == 0)
{
more = false;
break;
}
}
int diff_cols = 0;
std::string diff_cols_list;
// Before closing cursors calculate the number of different columns
for(int i = 0; i < s_col_count; i++)
{
if(s_cols != NULL && s_cols[i]._diff_rows > 0)
{
if(diff_cols > 0)
diff_cols_list += ", ";
diff_cols_list += s_cols[i]._name;
diff_cols++;
}
}
// Close cursors
_source_ca.db_api->CloseCursor();
_target_ca.db_api->CloseCursor();
// Set results
reply._cmd_subtype = SQLDATA_CMD_COMPLETE;
reply.rc = rc;
reply._s_rc = _source_ca.cmd_rc;
reply._t_rc = _target_ca.cmd_rc;
reply.s_error = _source_ca.error;
reply.t_error = _target_ca.error;
reply._int1 = all_not_equal_rows;
reply._int2 = diff_cols;
reply._int3 = s_col_count;
reply._s_int1 = s_all_fetched_rows;
reply._t_int1 = t_all_fetched_rows;
if(diff_cols > 0)
{
strncpy(reply.data2, diff_cols_list.c_str(), 1023);
reply.data2[1023] = '\x0';
}
reply.s_sql_l = s_select;
reply.t_sql_l = t_select;
reply._s_bigint1 = s_all_bytes;
reply._t_bigint1 = t_all_bytes;
reply._time_spent = Os::GetTickCount() - start;
reply._s_time_spent = (size_t)s_time_spent;
reply._t_time_spent = (size_t)t_time_spent;
if(reply.s_error == -1)
strcpy(reply.s_native_error_text, _source_ca.db_api->GetNativeErrorText());
if(reply.t_error == -1)
strcpy(reply.t_native_error_text, _target_ca.db_api->GetNativeErrorText());
return rc;
}
// Compare data in rows
int SqlDb::ValidateCompareRows(SqlCol *s_cols, SqlCol *t_cols, int s_col_count, int *s_bytes, int t_col_count,
int s_rows, int t_rows, int *t_bytes, int running_rows, int running_not_equal_rows)
{
if(s_cols == NULL || t_cols == NULL || s_col_count == 0 || t_col_count == 0)
return -1;
int not_equal_rows = 0;
int sb = 0, tb = 0;
char ora_date_str[19];
for(int i = 0; i < s_rows; i++)
{
// No corresponding target row
if(i >= t_rows)
break;
bool equal_row = true;
for(int k = 0; k < s_col_count; k++)
{
// No corresponding target column
if(k >= t_col_count)
break;
// Length/NULL indicators
int s_len = GetColumnDataLen(s_cols, i, k, source_type, _source_ca.db_api);
int t_len = GetColumnDataLen(t_cols, i, k, target_type, _target_ca.db_api);
char *s_string = NULL, *t_string = NULL;
char *s_ora_date = NULL, *t_ora_date = NULL;
bool s_int_set = false, t_int_set = false;
int s_int = 0, t_int = 0;
SQL_TIMESTAMP_STRUCT *s_ts_struct = NULL, *t_ts_struct = NULL;
// Both NULL values
if(s_len == -1 && t_len == -1)
continue;
else
// Oracle NULL and non-Oracle empty string
if((source_type == SQLDATA_ORACLE && s_len == -1 && target_type != SQLDATA_ORACLE && t_len == 0) ||
(source_type != SQLDATA_ORACLE && s_len == 0 && target_type == SQLDATA_ORACLE && t_len == -1))
continue;
else
// One is NULL, another not NULL
if((s_len == -1 && t_len != -1) || (s_len != -1 && t_len == -1))
{
equal_row = false;
s_cols[k]._diff_rows++;
if(_trace_diff_data)
ValidateDiffDump(&s_cols[k], &t_cols[k], i + running_rows, s_len, t_len, s_string, t_string);
continue;
}
// Both are empty (non-NULL) values
if(s_len == 0 && t_len == 0)
continue;
if(s_len != -1)
sb += s_len;
if(t_len != -1)
tb += t_len;
int equal = -1;
// If LOBs perform their comparison first
bool lob = ValidateCompareLobs(&s_cols[k], s_len, &t_cols[k], t_len, &equal);
// Get the source and target values
if(!lob)
{
GetColumnData(s_cols, i, k, source_type, _source_ca.db_api, &s_string, &s_int_set, &s_int, &s_ts_struct, &s_ora_date);
GetColumnData(t_cols, i, k, target_type, _target_ca.db_api, &t_string, &t_int_set, &t_int, &t_ts_struct, &t_ora_date);
}
// Compare 2 string values
if(s_string != NULL && t_string != NULL && !lob)
{
// Compare string representations of numbers .5 and 0.50
bool num = ValidateCompareNumbers(&s_cols[k], s_string, s_len, &t_cols[k], t_string, t_len, &equal);
bool datetime = false;
if(!num)
datetime = ValidateCompareDatetimes(&s_cols[k], s_string, s_len, &t_cols[k], t_string, t_len, &equal);
if(!num && !datetime)
{
if(s_len == t_len)
equal = memcmp(s_string, t_string, (size_t)s_len);
else
ValidateCompareStrings(&s_cols[k], s_string, s_len, &t_cols[k], t_string, t_len, &equal);
}
}
else
// Compare string and integer
if(((s_int_set && t_string != NULL) || (s_string != NULL && t_int_set)) && !lob)
{
char *str = (s_string != NULL) ? s_string : t_string;
int int_v = s_int_set ? s_int : t_int;
int int_v2 = atoi(str);
equal = (int_v == int_v2) ? 0 : -1;
}
else
// Compare ODBC SQL_TIMESTAMP_STRUCT and string
if(((s_ts_struct != NULL && t_string != NULL) || (t_ts_struct != NULL && s_string != NULL)) && !lob)
{
SQL_TIMESTAMP_STRUCT *ts = (s_ts_struct != NULL) ? s_ts_struct : t_ts_struct;
char *str = (s_string != NULL) ? s_string : t_string;
// String can contain date only or date and time
int str_len = (s_string != NULL) ? s_len : t_len;
char ts_str[27];
// Convert SQL_TIMESTAMP_STRUCT to string
Str::SqlTs2Str((short)ts->year, (short)ts->month, (short)ts->day, (short)ts->hour, (short)ts->minute, (short)ts->second, (long)ts->fraction, ts_str);
equal = memcmp(str, ts_str, (size_t)str_len);
}
else
// Compare Oracle DATE and string
if(((s_ora_date != NULL && t_string != NULL) || (t_ora_date != NULL && s_string != NULL)) && !lob)
{
char *ora_date = (s_ora_date != NULL) ? s_ora_date : t_ora_date;
char *str = (s_string != NULL) ? s_string : t_string;
// String can contain date only or date and time
// int str_len = (s_string != NULL) ? s_len : t_len;
// Convert 7-byte packed Oracle DATE to string (non-null terminated, exactly 19 characters)
Str::OraDate2Str((unsigned char*)ora_date, ora_date_str);
// Target SQL Server i.e. may have trailing .000 in string, so let's use Oracle len
equal = memcmp(ora_date_str, str, 19);
}
// Not equal
if(equal != 0)
{
equal_row = false;
s_cols[k]._diff_rows++;
if(_trace_diff_data)
ValidateDiffDump(&s_cols[k], &t_cols[k], i + running_rows, s_len, t_len, s_string, t_string);
}
}
if(equal_row == false)
{
not_equal_rows++;
// Check for not equal rows max limit
if(_validation_not_equal_max_rows != -1 && (not_equal_rows + running_not_equal_rows) >= _validation_not_equal_max_rows)
break;
}
}
if(s_bytes != NULL)
*s_bytes = sb;
if(t_bytes != NULL)
*t_bytes = tb;
return not_equal_rows;
}
// Compare string representations of numbers .5 and 0.50
bool SqlDb::ValidateCompareNumbers(SqlCol *s_col, const char *s_string, int s_len, SqlCol *t_col,
const char *t_string, int t_len, int *equal)
{
if(s_col == NULL || s_string == NULL || t_col == NULL || t_string == NULL)
return false;
bool num = false;
bool comp = false;
// Check is the source data type is a number fetched as string
if((source_type == SQLDATA_ORACLE && s_col->_native_dt == SQLT_NUM && s_col->_scale != 129 /*floating*/) ||
(source_type == SQLDATA_SYBASE && s_col->_native_fetch_dt == CS_CHAR_TYPE &&
(s_col->_native_dt == CS_NUMERIC_TYPE || s_col->_native_dt == CS_DECIMAL_TYPE ||
s_col->_native_dt == CS_MONEY_TYPE || s_col->_native_dt == CS_MONEY4_TYPE)) ||
(source_type == SQLDATA_INFORMIX && s_col->_native_fetch_dt == SQL_C_CHAR &&
(s_col->_native_dt == SQL_DECIMAL || s_col->_native_dt == SQL_NUMERIC ||
s_col->_native_dt == SQL_REAL || s_col->_native_dt == SQL_DOUBLE)))
{
// Compare numbers
comp = Str::CompareNumberAsString(s_string, s_len, t_string, t_len);
num = true;
}
else
// Compare floating point numbers that can be different due to rounding issues
// Sybase ASE can return 6.7000000000000002 for value 6.7
if((source_type == SQLDATA_ORACLE && s_col->_native_dt == SQLT_NUM && s_col->_scale == 129 /*floating*/) ||
(source_type == SQLDATA_SYBASE && s_col->_native_fetch_dt == CS_CHAR_TYPE &&
(s_col->_native_dt == CS_REAL_TYPE || s_col->_native_dt == CS_FLOAT_TYPE)))
{
double d1 = 0.0, d2 = 0.0;
char f1[11], f2[11];
// Get double values
sprintf(f1, "%%%dlf", s_len);
sprintf(f2, "%%%dlf", t_len);
sscanf(s_string, f1, &d1);
sscanf(t_string, f2, &d2);
if(d1 == d2)
{
comp = true;
num = true;
}
}
if(equal != NULL)
*equal = comp ? 0 : -1;
return num;
}
// Compare datetime values featched as strings
bool SqlDb::ValidateCompareDatetimes(SqlCol *s_col, const char *s_string, int s_len, SqlCol *t_col,
const char *t_string, int t_len, int *equal)
{
if(s_col == NULL || s_string == NULL || t_col == NULL || t_string == NULL)
return false;
bool datetime = false;
int comp = -1;
// Oracle TIMESTAMP compared with MySQL DATETIME without fraction
if((source_type == SQLDATA_ORACLE && s_col->_native_dt == SQLT_TIMESTAMP) ||
(source_type == SQLDATA_SYBASE && (s_col->_native_dt == CS_DATETIME_TYPE || s_col->_native_dt == CS_DATETIME4_TYPE || s_col->_native_dt == CS_DATE_TYPE))
&& (target_type == SQLDATA_MYSQL))
{
int s_len_new = s_len;
int t_len_new = t_len;
// All datetime data types are fetched with 26 length from Sybase ASE, so we need to correct the length
if(source_type == SQLDATA_SYBASE)
{
// Sybase ASE DATE that fetched with 00:00:00.000000 time part
if(s_col->_native_dt == CS_DATE_TYPE)
s_len_new = 10;
else
// Sybase ASE SMALLDATETIME contains minutes only, seconds always 00
if(s_col->_native_dt == CS_DATETIME4_TYPE)
s_len_new = 19;
}
// Number of fractional digits to compare
if(_validation_datetime_fraction != -1)
{
if(s_len_new > 20 + _validation_datetime_fraction)
s_len_new = 20 + _validation_datetime_fraction;
if(t_len_new > 19 + _validation_datetime_fraction)
t_len_new = 20 + _validation_datetime_fraction;
}
// If length are not equal allow only difference in number of 0s in fractional part, so consider .0 and .000 equal
if(s_len_new != t_len_new)
{
int l_len = s_len_new;
int m_len = t_len_new;
const char *m_string = t_string;
if(s_len_new > t_len_new)
{
l_len = t_len_new;
m_len = s_len_new;
m_string = s_string;
}
comp = memcmp(s_string, t_string, (size_t)l_len);
// Common part is equal
if(!comp)
{
// Larger part must contain 0s
for(int i = l_len; i < m_len; i++)
{
if(m_string[i] != '0')
{
comp = -1;
break;
}
}
}
}
else
comp = memcmp(s_string, t_string, (size_t)s_len_new);
datetime = true;
}
if(equal != NULL)
*equal = comp;
return datetime;
}
// Compare strings
bool SqlDb::ValidateCompareStrings(SqlCol *s_col, const char *s_string, int s_len, SqlCol *t_col, const char *t_string, int t_len, int *equal)
{
if(s_col == NULL || s_string == NULL || t_col == NULL || t_string == NULL)
return false;
const char *max_s = s_string;
int max_len = s_len;
int min_len = t_len;
if(s_len < t_len)
{
max_s = t_string;
max_len = t_len;
min_len = s_len;
}
// First compare data for matched size
int comp = memcmp(s_string, t_string, (size_t)min_len);
// Common part is equal
if(comp == 0)
{
// Larger part must contain spaces only
for(int i = min_len; i < max_len; i++)
{
if(max_s[i] != ' ')
{
comp = -1;
break;
}
}
}
if(equal != NULL)
*equal = comp;
return true;
}
// Compare LOB values
bool SqlDb::ValidateCompareLobs(SqlCol *s_col, int s_len, SqlCol *t_col, int t_len, int *equal)
{
if(s_col == NULL || t_col == NULL)
return false;
bool lob = false;
int comp = -1;
if(source_type == SQLDATA_ORACLE && (s_col->_native_dt == SQLT_CLOB || s_col->_native_dt == SQLT_BLOB))
{
if(s_len == t_len)
comp = 0;
lob = true;
}
if(lob && equal != NULL)
*equal = comp;
return lob;
}
// Dump differences in column
void SqlDb::ValidateDiffDump(SqlCol *s_col, SqlCol *t_col, int row, int s_len, int t_len, char *s_string, char *t_string)
{
if(s_col == NULL || t_col == NULL)
return;
_trace_diff.LogFile("Row %d, Column %s (src native type code %d, tgt native type code %d)\n", row, s_col->_name, s_col->_native_dt, t_col->_native_dt);
_trace_diff.LogFile("src len: %d; tgt len: %d;\n", s_len, t_len);
_trace_diff.LogFile("src val: ");
ValidateDiffDumpValue(s_len, s_string);
_trace_diff.LogFile("\n");
_trace_diff.LogFile("tgt val: ");
ValidateDiffDumpValue(t_len, t_string);
_trace_diff.LogFile("\n\n");
}
// Dump column value
void SqlDb::ValidateDiffDumpValue(int len, char *str)
{
if(len != -1)
{
if(str != NULL)
_trace_diff.LogFile(str, len);
}
else
_trace_diff.LogFile("NULL");
}
// Get the length of column data in the buffer
int SqlDb::GetColumnDataLen(SqlCol *cols, int row, int column, int db_type, SqlApiBase *db_api)
{
if(cols == NULL || db_api == NULL)
return -1;
size_t len = (size_t)-1;
if(db_type == SQLDATA_ORACLE)
{
if(cols[column]._ind2 == NULL || cols[column]._len_ind2 == NULL)
return -1;
// Check for NULL
if(cols[column]._ind2[row] == -1)
len = (size_t)-1;
else
// Get length for the CLOB or BLOB
if(cols[column]._native_dt == SQLT_CLOB || cols[column]._native_dt == SQLT_BLOB)
{
// LOB contains data
int rc = db_api->GetLobLength((size_t)row, (size_t)column, &len);
if(rc == -1)
return -1;
}
// Get the length for non-NULL non-LOB value
else
len = (size_t)cols[column]._len_ind2[row];
}
else
if(db_type == SQLDATA_SYBASE)
{
if(cols[column]._ind2 == NULL || cols[column]._len_ind4 == NULL)
return -1;
// Check for NULL
if(cols[column]._ind2[row] == -1)
len = (size_t)-1;
else
len = (size_t)cols[column]._len_ind4[row];
}
else
if(db_type == SQLDATA_MYSQL)
{
if(cols[column].ind != NULL && cols[column].ind[row] != -1)
len = cols[column].ind[row];
}
else
if(db_type == SQLDATA_POSTGRESQL)
{
if(cols[column].ind != NULL && cols[column].ind[row] != -1)
len = cols[column].ind[row];
}
else
if(db_type == SQLDATA_SQL_SERVER || db_type == SQLDATA_INFORMIX)
{
if(cols[column].ind != NULL && cols[column].ind[row] != -1)
len = cols[column].ind[row];
}
return (int)len;
}
// Get column data from the buffer
int SqlDb::GetColumnData(SqlCol *cols, int row, int column, int db_type, SqlApiBase *db_api,
char **str, bool *int_set, int *int_value, SQL_TIMESTAMP_STRUCT **ts_struct,
char **ora_date)
{
if(cols == NULL || db_api == NULL)
return -1;
char *s = NULL;
char *ora_d = NULL;
int int_v = 0;
bool int_s = false;
SQL_TIMESTAMP_STRUCT *ts = NULL;
if(db_type == SQLDATA_ORACLE)
{
if(cols[column]._native_fetch_dt == SQLT_STR || cols[column]._native_fetch_dt == SQLT_BIN)
s = cols[column]._data + cols[column]._fetch_len * row;
else
if(cols[column]._native_fetch_dt == SQLT_INT)
{
int_v = *((int*)(cols[column]._data + cols[column]._fetch_len * row));
int_s = true;
}
else
if(cols[column]._native_fetch_dt == SQLT_DAT)
ora_d = cols[column]._data + cols[column]._fetch_len * row;
}
else
if(db_type == SQLDATA_SYBASE)
{
if(cols[column]._native_fetch_dt == CS_CHAR_TYPE)
s = cols[column]._data + cols[column]._fetch_len * row;
}
else
if(db_type == SQLDATA_MYSQL)
{
// All columns are fetched as strings
s = cols[column]._data + cols[column]._fetch_len * row;
}
else
if(db_type == SQLDATA_POSTGRESQL)
{
s = cols[column]._data + cols[column]._fetch_len * row;
}
else
if(db_type == SQLDATA_SQL_SERVER || db_type == SQLDATA_INFORMIX)
{
if(cols[column]._native_fetch_dt == SQL_C_CHAR || cols[column]._native_fetch_dt == SQL_C_BINARY)
s = cols[column]._data + cols[column]._fetch_len * row;
else
if(cols[column]._native_fetch_dt == SQL_C_LONG)
{
int_v = *((int*)(cols[column]._data + cols[column]._fetch_len * row));
int_s = true;
}
else
if(cols[column]._native_fetch_dt == SQL_TYPE_TIMESTAMP)
ts = (SQL_TIMESTAMP_STRUCT*)(cols[column]._data + cols[column]._fetch_len * row);
}
if(str != NULL && s != NULL)
*str = s;
if(int_value != NULL && int_set != NULL && int_s == true)
{
*int_value = int_v;
*int_set = true;
}
if(ts_struct != NULL && ts != NULL)
*ts_struct = ts;
if(ora_date != NULL && ora_d != NULL)
*ora_date = ora_d;
return 0;
}
// Build transfer and data validation query
int SqlDb::BuildQuery(std::string &s_query, std::string &t_query, const char *s_table, const char *t_table,
bool transfer)
{
if(_source_ca.db_api == NULL)
return -1;
s_query = "SELECT ";
t_query = "SELECT ";
bool select_list = false;
// Check if SELECT expression is defined for the table
if(_tsel_exp_map != NULL )
{
std::map<std::string, std::string>::iterator i = _tsel_exp_map->find(s_table);
if(i != _tsel_exp_map->end())
{
if(s_table != NULL)
{
s_query += i->second;
s_query += " FROM ";
s_query += s_table;
}
if(t_table != NULL)
{
t_query += i->second;
t_query += " FROM ";
t_query += t_table;
}
select_list = true;
}
}
// Check if SELECT expression is defined for all tables
if(!select_list && _tsel_exp_all != NULL && !_tsel_exp_all->empty())
{
if(s_table != NULL)
{
s_query += *_tsel_exp_all;
s_query += " FROM ";
s_query += s_table;
}
if(t_table != NULL)
{
t_query += *_tsel_exp_all;
t_query += " FROM ";
t_query += t_table;
}
select_list = true;
}
// Metadata is not supported
if(!select_list && source_type != SQLDATA_ORACLE && source_type != SQLDATA_INFORMIX && source_type != SQLDATA_SYBASE
&& source_type != SQLDATA_ASA)
{
if(s_table != NULL)
{
s_query += "* FROM ";
s_query += s_table;
}
if(t_table != NULL)
{
t_query += "* FROM ";
t_query += t_table;
}
select_list = true;
}
std::string s_schema, t_schema;
std::string s_object, t_object;
if(!select_list)
{
SqlApiBase::SplitQualifiedName(s_table, s_schema, s_object);
SqlApiBase::SplitQualifiedName(t_table, t_schema, t_object);
std::list<SqlColMeta> *table_columns = _source_ca.db_api->GetTableColumns();
if(table_columns == NULL)
return -1;
int num = 0;
// Find table columns (already ordered by column number)
for(std::list<SqlColMeta>::iterator i = table_columns->begin(); i != table_columns->end(); i++)
{
char *s = (*i).schema;
char *t = (*i).table;
char *c = (*i).column;
char *d = (*i).data_type;
// Table found
if(s != NULL && t != NULL && c != NULL && strcmp(s, s_schema.c_str()) == 0 &&
strcmp(t, s_object.c_str()) == 0)
{
if(num > 0)
{
s_query += ", ";
t_query += ", ";
}
bool column_added = false;
if(d != NULL &&
// Oracle CHAR contains trailing spaces on retrieval
((source_type == SQLDATA_ORACLE && !_stricmp(d, "CHAR")) ||
// Sybase ASE CHAR (UDT ID, TID) also contains trailing spaces
(source_type == SQLDATA_SYBASE &&
(!_stricmp(d, "CHAR") || !_stricmp(d, "ID") || !_stricmp(d, "TID")))))
{
// MySQL by default trims spaces in CHAR, but PAD_CHAR_TO_FULL_LENGTH can be set, so trim both
if(transfer == false && target_type == SQLDATA_MYSQL)
{
s_query += "RTRIM(";
if(source_type == SQLDATA_ORACLE)
s_query += '"';
s_query += c;
if(source_type == SQLDATA_ORACLE)
s_query += '"';
s_query += ") AS ";
s_query += c;
t_query += "RTRIM(";
t_query += c;
t_query += ") AS ";
t_query += c;
column_added = true;
}
}
else
// Oracle TIMESTAMP WITH TIME ZONE column
if(source_type == SQLDATA_ORACLE && d != NULL && strstr(d, "WITH TIME ZONE") != NULL)
{
// Convert to UTC time zone for MySQL
if(target_type == SQLDATA_MYSQL)
{
s_query += "SYS_EXTRACT_UTC(\"";
s_query += c;
s_query += "\") AS ";
s_query += c;
t_query += c;
column_added = true;
}
}
else
// Oracle XMLTYPE column that fetched as object type in OCI
if(source_type == SQLDATA_ORACLE && d != NULL && !_stricmp(d, "XMLTYPE"))
{
s_query += "XMLSERIALIZE(CONTENT \"";
s_query += c;
s_query += "\" AS CLOB) AS ";
s_query += c;
t_query += c;
column_added = true;
}
else
// Oracle stores quoted columns without " but in the same case as they specified in CREATE TABLE
if(source_type == SQLDATA_ORACLE)
{
// Double quotes will not be returned when describing column name after open cursor
s_query += "\"";
s_query += c;
s_query += "\"";
if(target_type == SQLDATA_SQL_SERVER)
{
t_query += '[';
t_query += c;
t_query += "]";
}
else
if(target_type == SQLDATA_MYSQL)
{
t_query += '`';
t_query += c;
t_query += "`";
}
else
t_query += c;
column_added = true;
}
else
// Sybase ASE stores columns without [] even if they are reserved words or contain spaces
if(source_type == SQLDATA_SYBASE)
{
s_query += '[';
s_query += c;
s_query += ']';
t_query += c;
column_added = true;
}
else
// Sybase ASA stores columns that are reserved words without any quotes in catalog
if(source_type == SQLDATA_ASA && _source_ca.db_api->IsReservedWord(c))
{
s_query += '"';
s_query += c;
s_query += '"';
t_query += c;
column_added = true;
}
// Add column as is
if(column_added == false)
{
if(source_type == SQLDATA_ORACLE)
s_query += '"';
s_query += c;
if(source_type == SQLDATA_ORACLE)
s_query += '"';
t_query += c;
}
num++;
continue;
}
else
// Another table's columns started
if(num > 0)
break;
}
if(num == 0)
{
s_query += " *";
t_query += " *";
}
s_query += " FROM ";
t_query += " FROM ";
if(s_table != NULL)
s_query += s_table;
if(t_table != NULL)
t_query += t_table;
}
// Check if WHERE condition is defined for the table
if(_twhere_cond_map != NULL )
{
std::map<std::string, std::string>::iterator i = _twhere_cond_map->find(s_table);
if(i != _twhere_cond_map->end())
{
if(s_table != NULL)
{
s_query += " WHERE ";
s_query += i->second;
}
if(t_table != NULL)
{
t_query += " WHERE ";
t_query += i->second;
}
}
}
// Add sort order for validation
if(transfer == false)
BuildQueryAddOrder(s_query, s_schema, s_object, t_query, t_schema, t_object);
return 0;
}
// Add ORDER BY clause to data validation query
int SqlDb::BuildQueryAddOrder(std::string &s_query, std::string &s_schema, std::string &s_object,
std::string &t_query, std::string & /*t_schema*/, std::string & /*t_object*/)
{
if(_metaSqlDb == NULL || _metaSqlDb->_source_ca.db_api == NULL || _metaSqlDb->_target_ca.db_api == NULL)
return -1;
SqlApiBase *db_api = _metaSqlDb->_source_ca.db_api;
SqlApiBase *t_db_api = _metaSqlDb->_target_ca.db_api;
std::list<std::string> s_order, s_order_sorts;
std::list<std::string> s_order_types;
bool pk_exists = false;
std::list<SqlConstraints> *table_cns = db_api->GetTableConstraints();
std::list<SqlConsColumns> *table_cns_cols = db_api->GetConstraintColumns();
if(table_cns != NULL && table_cns_cols != NULL)
{
// Find a primary or unique key
for(std::list<SqlConstraints>::iterator i = table_cns->begin(); i != table_cns->end(); i++)
{
if((*i).type != 'P' && (*i).type != 'U')
continue;
char *s = (*i).schema;
char *t = (*i).table;
char *c = (*i).constraint;
if(s == NULL || t == NULL || c == NULL)
continue;
if(strcmp(t, s_object.c_str()) != 0 || strcmp(s, s_schema.c_str()) != 0)
continue;
// Now find the key columns
db_api->GetKeyConstraintColumns((*i), s_order, &s_order_types);
pk_exists = true;
break;
}
}
bool unique_exists = false;
std::list<SqlIndexes> *idx = db_api->GetTableIndexes();
if(pk_exists == false && idx != NULL)
{
// Find the first unique index
for(std::list<SqlIndexes>::iterator i = idx->begin(); i != idx->end(); i++)
{
if((*i).unique == false)
continue;
char *s = (*i).t_schema;
char *t = (*i).t_name;
if(s == NULL || t == NULL)
continue;
if(strcmp(t, s_object.c_str()) != 0 || strcmp(s, s_schema.c_str()) != 0)
continue;
// Get index columns
db_api->GetIndexColumns((*i), s_order, s_order_sorts);
unique_exists = true;
break;
}
}
std::list<SqlColMeta> *table_cols = db_api->GetTableColumns();
if(pk_exists == false && unique_exists == false && table_cols != NULL)
{
bool found = false;
// Find table columns
for(std::list<SqlColMeta>::iterator i = table_cols->begin(); i != table_cols->end(); i++)
{
char *s = (*i).schema;
char *t = (*i).table;
char *c = (*i).column;
char *d = (*i).data_type;
int dc = (*i).data_type_code;
if(s == NULL || t == NULL || c == NULL)
continue;
if(strcmp(t, s_object.c_str()) != 0 || strcmp(s, s_schema.c_str()) != 0)
{
if(found)
break;
else
continue;
}
// Data type as a string in Oracle, Sybase ASE
if(d != NULL)
{
// A numeric column
if(!_stricmp(d, "NUMBER") || !_stricmp(d, "INT") || !_stricmp(d, "SMALLINT") || !_stricmp(d, "BIGINT") ||
!_stricmp(d, "NUMERIC") || !_stricmp(d, "DECIMAL") || !_stricmp(d, "FLOAT") || !_stricmp(d, "MONEY") || !_stricmp(d, "SMALLMONEY"))
{
s_order.push_back(c);
s_order_types.push_back("Numeric");
}
else
// A string column CHAR, VARCHAR or VARCHAR2
if(!_stricmp(d, "CHAR") || !_stricmp(d, "VARCHAR"))
{
s_order.push_back(c);
s_order_types.push_back("String");
}
else
// A datetime column
if(strstr(d, "TIMESTAMP") != NULL || !_stricmp(d, "DATE") || !_stricmp(d, "DATETIME"))
{
s_order.push_back(c);
s_order_types.push_back("Datetime");
}
found = true;
}
else
// Data type as a code in Informix
if(source_type == SQLDATA_INFORMIX)
{
// A numeric column SMALLINT - 1, INTEGER - 2, FLOAT - 3, SMALLFLOAT - 4, DECIMAL - 5
// SERIAL - 6 (if NOT NULL +256)
if((dc >= 1 && dc <= 6) || (dc >= 257 && dc <= 262))
{
s_order.push_back(c);
s_order_types.push_back("Numeric");
}
else
// A string column CHAR - 0, CHAR NOT NULL - 256, VARCHAR - 13, VARCHAR NOT NULL 269
if(dc == 0 || dc == 13 || dc == 256 || dc == 269)
{
s_order.push_back(c);
s_order_types.push_back("String");
}
else
// A datetime column DATE - 7
if(dc == 7)
{
s_order.push_back(c);
s_order_types.push_back("Datetime");
}
found = true;
}
}
}
if(s_order.empty() == false)
{
int c = 0;
std::list<std::string>::iterator ti = s_order_types.begin();
for(std::list<std::string>::iterator i = s_order.begin(); i != s_order.end(); i++)
{
std::string type;
// Column type - String, Numeric or Datetime
if(ti != s_order_types.end())
{
type = (*ti);
ti++;
}
if(c == 0)
{
s_query += " ORDER BY ";
t_query += " ORDER BY ";
}
else
{
s_query += ", ";
t_query += ", ";
}
s_query += (*i);
t_query += (*i);
// In Oracle NULLs go last in ASC order, in MySQL and Informix first
if(source_type == SQLDATA_ORACLE && target_type == SQLDATA_MYSQL)
s_query += " NULLS FIRST";
else
if((source_type == SQLDATA_MYSQL || source_type == SQLDATA_INFORMIX) && target_type == SQLDATA_ORACLE)
t_query += " NULLS FIRST";
else
// MySQL/MariaDB uses collation defined in the table, for some reason it does not use COLLATION_CONNECTION session value
// so we redefine COLLATE in ORDER BY for strings
if(target_type == SQLDATA_MYSQL)
{
if(_mysql_validation_collate != NULL && type == "String")
t_query.append(" COLLATE ").append(_mysql_validation_collate);
}
else
if(target_type == SQLDATA_SQL_SERVER)
{
if(type == "String")
t_query.append(" COLLATE Latin1_General_bin");
}
else
// Informix and PostgreSQL have differences in string and NULL order
if(source_type == SQLDATA_INFORMIX && target_type == SQLDATA_POSTGRESQL)
{
// Informix sorts strings in ASCII order - space, digit, A,B,a, b;
// while PostgreSQL space, digit, a, A, b, B when collation is not "C"
if(type == "String")
{
// Collate "C" to use ASCII code sorting is available since PostgreSQL 9.1
if(t_db_api->GetMajorVersion() >= 9 && t_db_api->GetMinorVersion() >= 1)
t_query += " COLLATE \"C\" NULLS FIRST";
}
else
t_query += " NULLS FIRST";
}
c++;
}
}
return 0;
}
// Execute the statement that does not return any result
int SqlDb::ExecuteNonQuery(int db_types, SqlDataReply &reply, const char *query)
{
if(db_types == SQLDB_TARGET_ONLY)
{
reply.rc = _target_ca.db_api->ExecuteNonQuery(query, &reply._t_time_spent);
if(reply.rc == -1)
{
reply.t_error = _target_ca.db_api->GetError();
strcpy(reply.t_native_error_text, _target_ca.db_api->GetNativeErrorText());
}
}
return reply.rc;
}
// Create sequence object
int SqlDb::CreateSequence(int db_types, SqlDataReply &reply, const char *query, const char *seq_name)
{
if(seq_name == NULL)
return -1;
SqlDataReply drop_reply;
strcpy(reply.t_o_name, seq_name);
drop_reply = reply;
std::string drop_stmt = "DROP SEQUENCE ";
// IF EXISTS supported by PostgreSQL
if(target_type == SQLDATA_POSTGRESQL)
drop_stmt += "IF EXISTS ";
drop_stmt += seq_name;
// Execute drop sequence
int rc = ExecuteNonQuery(db_types, drop_reply, drop_stmt.c_str());
if(_callback != NULL)
{
drop_reply._cmd_subtype = SQLDATA_CMD_DROP_SEQUENCE;
drop_reply.t_sql = drop_stmt.c_str();
_callback(_callback_object, &drop_reply);
}
// Create the sequence
rc = ExecuteNonQuery(db_types, reply, query);
return rc;
}
// Drop foreign keys to the
int SqlDb::DropReferences(int db_types, const char *table, size_t *time_spent, int *keys)
{
SqlApiBase *api = (db_types == SQLDB_SOURCE_ONLY) ? _source_ca.db_api : _target_ca.db_api;
if(api == NULL)
return -1;
int rc = api->DropReferencesChild(table, time_spent, keys);
return rc;
}
// Get database type for ODBC API
short SqlDb::GetSubType(short db_types)
{
short subtype = 0;
SqlApiBase *api = (db_types == SQLDB_SOURCE_ONLY) ? _source_ca.db_api : _target_ca.db_api;
if(api != NULL)
subtype = api->GetSubType();
return subtype;
}
// Execute a command by database API threads
int SqlDb::Execute(int cmd)
{
return Execute(cmd, cmd);
}
// Execute one command for source, another for target in concurrent threads and wait
int SqlDb::Execute(int cmd1, int cmd2)
{
_source_ca._cmd = (short)cmd1;
_target_ca._cmd = (short)cmd2;
// Release the source and target threads to process the command
#if defined(WIN32) || defined(_WIN64)
SetEvent(_source_ca._wait_event);
SetEvent(_target_ca._wait_event);
#else
Os::SetEvent(&_source_ca._wait_event);
Os::SetEvent(&_target_ca._wait_event);
#endif
// Wait for the commands completion
#if defined(WIN32) || defined(_WIN64)
HANDLE handles[2] = { _source_ca._completed_event, _target_ca._completed_event };
WaitForMultipleObjects(2, handles, TRUE, INFINITE);
#else
Os::WaitForEvent(&_source_ca._completed_event);
Os::WaitForEvent(&_target_ca._completed_event);
#endif
if(_source_ca.cmd_rc == -1 || _target_ca.cmd_rc == -1)
return -1;
return 0;
}
// Start a worker thread
int SqlDb::StartWorker(SqlDbThreadCa *ca)
{
if(ca == NULL)
return -1;
bool more = true;
while(more)
{
size_t time_spent = 0;
// Wait for a new task
#if defined(WIN32) || defined(_WIN64)
WaitForSingleObject(ca->_wait_event, INFINITE);
#else
Os::WaitForEvent(&ca->_wait_event);
#endif
// Execute connection command
if(ca->_cmd == SQLDATA_CMD_CONNECT)
{
ca->cmd_rc = (short)ca->db_api->Connect(&ca->_time_spent);
}
else
// Execute row count command
if(ca->_cmd == SQLDATA_CMD_VALIDATE_ROW_COUNT)
{
ca->cmd_rc = (short)ca->db_api->GetRowCount(ca->_name, &ca->_int1, &ca->_time_spent);
}
else
// Open cursor for data validation
if(ca->_cmd == SQLDATA_CMD_OPEN_CURSOR)
{
size_t col_count;
size_t allocated_rows;
// Exact or less number of rows must be fetched
ca->cmd_rc = (short)ca->db_api->OpenCursor((const char*)ca->_void1, (size_t)ca->_int4, 0, &col_count, &allocated_rows,
&ca->_int3, (SqlCol**)&ca->_void2, &ca->_time_spent);
ca->_int1 = (int)col_count;
ca->_int2 = (int)allocated_rows;
}
else
// Fetch next portion of data
if(ca->_cmd == SQLDATA_CMD_FETCH_NEXT)
{
ca->cmd_rc = (short)ca->db_api->Fetch(&ca->_int1, &time_spent);
ca->_int4 = (int)time_spent;
}
else
// Insert the data from buffer
if(ca->_cmd == SQLDATA_CMD_INSERT_NEXT)
{
size_t bytes_written;
ca->cmd_rc = (short)ca->db_api->TransferRows((SqlCol*)ca->_void1, ca->_int2, &ca->_int1, &bytes_written,
&time_spent);
ca->_int3 = (int)bytes_written;
ca->_int4 = (int)time_spent;
}
else
// Close cursor for data validation
if(ca->_cmd == SQLDATA_CMD_CLOSE_CURSOR)
{
ca->cmd_rc = (short)ca->db_api->CloseCursor();
}
else
// Read the database schema
if(ca->_cmd == SQLDATA_CMD_READ_SCHEMA)
{
ca->cmd_rc = (short)ca->db_api->ReadSchema((const char*)ca->_void1, (const char*)ca->_void2);
}
else
// Read the schema of the database where transfer is performed to
if(ca->_cmd == SQLDATA_CMD_READ_SCHEMA_FOR_TRANSFER_TO)
{
ca->cmd_rc = (short)ca->db_api->ReadSchemaForTransferTo((const char*)ca->_void1, (const char*)ca->_void2);
}
// Get database API error code
if(ca->cmd_rc == -1)
{
ca->error = ca->db_api->GetError();
strcpy(ca->native_error_text, ca->db_api->GetNativeErrorText());
}
// Specify that the task is completed
#if defined(WIN32) || defined(_WIN64)
SetEvent(ca->_completed_event);
#else
Os::SetEvent(&ca->_completed_event);
#endif
}
return 0;
}
// Start a worker thread
#if defined(WIN32) || defined(_WIN64)
unsigned int __stdcall SqlDb::StartWorkerS(void *v_ca)
#else
void* SqlDb::StartWorkerS(void *v_ca)
#endif
{
SqlDbThreadCa *ca = (SqlDbThreadCa*)v_ca;
if(ca == NULL || ca->sqlDb == NULL)
#if defined(WIN32) || defined(_WIN64)
return (unsigned int)-1;
#else
return NULL;
#endif
int rc = ca->sqlDb->StartWorker(ca);
delete ca->db_api;
#if defined(WIN32) || defined(_WIN64)
return (unsigned int)rc;
#else
return NULL;
#endif
}
// Set parameters
void SqlDb::SetParameters(Parameters *p)
{
_parameters = p;
if(_parameters->GetTrue("-trace_diff_data") != NULL)
_trace_diff_data = true;
_validation_not_equal_max_rows = _parameters->GetInt("-validation_not_equal_max_rows", -1);
_validation_datetime_fraction = _parameters->GetInt("-validation_datetime_fraction", -1);
_mysql_validation_collate = _parameters->Get("-mysql_validation_collate");
}
// Get errors on the DB interface
void SqlDb::GetErrors(SqlDataReply &reply)
{
reply.rc = (_source_ca.cmd_rc == -1 || _target_ca.cmd_rc == -1) ? -1 : 0;
reply._s_rc = _source_ca.cmd_rc;
reply._t_rc = _target_ca.cmd_rc;
reply.s_error = _source_ca.error;
reply.t_error = _target_ca.error;
strcpy(reply.s_native_error_text, _source_ca.native_error_text);
strcpy(reply.t_native_error_text, _target_ca.native_error_text);
}
| [
"[email protected]"
] | |
4bbb24821de1836b59303b8e32234c74e3afa442 | 399705334f88e0b88adb86163c988d9e1c24314a | /Practise/Hackerrank/Equal.cpp | ee84f7bbcf17134e25d6e89d20dc571111afd6a1 | [] | no_license | shivangstreak/comp | d4d27b6726291d29d9216b632127399f4c7cf18b | 0ba7f89d6cd6f548449fdbbbff19c2fec42579c6 | refs/heads/master | 2023-08-13T02:53:07.867755 | 2023-08-07T08:01:52 | 2023-08-07T08:01:52 | 380,742,432 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 539 | cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=10005;
int arr[N];
ll ops(ll x){
return x/5+(x%5)/2+((x%5)%2);
}
int main(){
int n,t;scanf("%d",&t);
while(t--){
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&arr[i]);
}
int mn=*min_element(arr,arr+n);
ll mn1=INT_MAX;
ll sum=0;
for(int i=0;i<=5;i++){
sum=0;
for(int j=0;j<n;j++){
sum+=ops((ll)arr[j]-(ll)(mn-i));
}
if(sum<mn1){
mn1=sum;
}
}
printf("%lld\n",mn1);
}
return 0;
}
| [
"[email protected]"
] | |
0733a48cd65be28dd995c9f106b0fd97955bb541 | 8295a6c1cb2a09055fc628b8cbc8f7a8cb1d3723 | /cpp/ex1/src/bench_dijkstra.cpp | 787ef84f63da602a6816b013b7e994a20647b294 | [] | no_license | leochatain/inf5016 | e430c541d1e8b47e1969abf09482587db55a44d9 | 5baed0901821d2181511c3e45741717c2c7cf9c0 | refs/heads/master | 2021-01-20T10:46:56.568704 | 2012-12-29T05:55:52 | 2012-12-29T05:55:52 | 5,690,233 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,248 | cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <fstream>
#include <vector>
#include <ctime>
#include "binary_heap.h"
#include "dijkstra.h"
#include "graph.h"
using namespace std;
using namespace inf5016;
const int ERROR = -1;
const int HELP = 0;
const int PROGRAM = 1;
bool comp(const Edge a, const Edge b) {
return a.cost < b.cost;
}
int parse_args(int argc, char* argv[], int& num_bench, string& graph_path);
vector<pair<int, int> > parse_bench(ifstream& in);
Graph parse_graph(ifstream& in);
void print_help();
int main(int argc, char** argv) {
int num_bench;
string graph_path;
switch (parse_args(argc, argv, num_bench, graph_path)) {
case ERROR:
return ERROR;
case HELP:
print_help();
return HELP;
};
// Parse graph and benchmarks.
ifstream graph_file(graph_path.c_str());
const Graph& graph = parse_graph(graph_file);
Dijkstra dijkstra;
// Run benchmarks.
srand((int)time(0));
double sum = 0;
for (int i = 0; i < num_bench; i++) {
int src = rand() % graph.size();
int dst = rand() % (graph.size() - 1);
if (dst == src) dst = graph.size() -1;
time_t init_time = clock();
int distance = dijkstra.run(graph, src, dst);
time_t end_time = clock();
sum += (end_time - init_time) / (double)CLOCKS_PER_SEC;
}
cout << sum / (double) num_bench << endl;
}
int parse_args(int argc, char* argv[], int& num_bench, string& graph_path) {
if (argc < 3) {
return HELP;
}
for (int i = 1; i < argc; i++) {
if (!(strcmp(argv[i], "-b"))) {
num_bench = atoi(argv[++i]);
} else if (!strcmp(argv[i], "-g")) {
graph_path = argv[++i];
} else {
cout << "Unknown option " << argv[i] << endl;
return ERROR;
}
}
return PROGRAM;
}
Graph parse_graph(ifstream& in) {
Graph g;
string line;
while (getline(in, line)) {
if (line[0] == 'a') {
int u, v, w;
sscanf(line.c_str(), "a %d %d %d", &u, &v, &w);
g.put(u, v, w);
}
}
return g;
}
void print_help() {
cout << "ex1 - By Leo Chatain ([email protected])" << endl << endl;
cout << "-b Specifies the number of benchmarks (they're all random)"
<< endl
<< "-g Specifies the graph file." << endl;
}
| [
"[email protected]"
] | |
c9ee5721678cbb3c999c1d078b4088b27949fd37 | 25b8499e6395bddc3103ec7fcc652a10e781b74e | /test/testTrie2.cpp | 65763afed6542c961bf29f0eee6b072c902a1260 | [] | no_license | Kakarotto9/CxxSearch | 8b1e5c600fe1943a010383a66584acfa93b21bb6 | d50ff5c970972ad68873751f19523a6437d2eabe | refs/heads/master | 2020-05-07T19:27:57.398485 | 2019-04-16T04:36:05 | 2019-04-16T04:36:05 | 180,814,425 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 717 | cpp |
#include<iostream>
#include"Trie2.h"
using namespace std;
int main(){
Trie t;
t.addWord("weixin",1);
t.addWord("weixi",2);
t.addWord("weixn",3);
t.addWord("wexin",4);
t.addWord("weixi",8);
cout<<"getFreq="<<t.getFreq("weixn")<<endl;
t.addWord("ascw",2);
t.addWord("asce",3);
t.addWord("ahce",9);
vector<string> v;
t.printMatch("wei",v);
for(auto i:v){
cout<<"v="<<i<<endl;
}
vector<string> v2;
t.printMatch("as",v2);
for(auto i:v2){
cout<<"v2="<<i<<endl;
}
vector<string> v3;
t.getAllWord(v3);
for(auto i:v3){
cout<<"v3="<<i<<endl;
}
vector<int> v4;
bool b2=t.getLineNum("weixi",v4);
if(b2){
for(auto i:v4){
cout<<"v4="<<i<<endl;
}
}
else{
cout<<"v4没找到"<<endl;
}
}
| [
"[email protected]"
] | |
c2cbd8d2f10b5028feba084c4af42817318dc43a | 7419c3edc2d0f8ecc82be918f1321d985b781a39 | /sources/scene.cpp | 60a2546d0f0e3f09871c6e13e3281ac8bfc432ee | [] | no_license | Nojan/particle | 07b1685f127610b35d222aa305a9114577e6a855 | d3e700a114479c69dfcced52f828c1b253d4fde7 | refs/heads/master | 2021-07-30T00:03:37.947192 | 2018-09-16T15:27:45 | 2018-09-16T15:33:35 | 21,325,548 | 1 | 1 | null | 2021-07-28T09:49:41 | 2014-06-29T15:03:19 | C++ | UTF-8 | C++ | false | false | 1,267 | cpp | #include "scene.hpp"
#include "imgui/imgui_header.hpp"
namespace Constant {
IMGUI_CONST float Direction[] = { 0.f, 0.1f, -0.5f };
IMGUI_CONST float DiffuseColor[] = { 1.f, 1.f, 1.f };
IMGUI_CONST float SpecularColor[] = { 1.f, 1.f, 1.f };
}
#ifdef IMGUI_ENABLE
void Scene::debug_GUI()
{
ImGui::SliderFloat3("Direction", Constant::Direction, -1.f, 1.f);
ImGui::SliderFloat3("Diffuse Color", Constant::DiffuseColor, 0.f, 1.f);
ImGui::SliderFloat3("Specular Color", Constant::SpecularColor, 0.f, 1.f);
SetupDefaultLight();
}
#endif
Scene::Scene()
{
SetupDefaultLight();
}
void Scene::SetupDefaultLight()
{
mDirLight.mDirection = glm::vec3(Constant::Direction[0], Constant::Direction[1], Constant::Direction[2]);
mDirLight.mDirection = glm::normalize(mDirLight.mDirection);
mDirLight.mDiffuseColor.r = Constant::DiffuseColor[0];
mDirLight.mDiffuseColor.g = Constant::DiffuseColor[1];
mDirLight.mDiffuseColor.b = Constant::DiffuseColor[2];
mDirLight.mSpecularColor.r = Constant::SpecularColor[0];
mDirLight.mSpecularColor.g = Constant::SpecularColor[1];
mDirLight.mSpecularColor.b = Constant::SpecularColor[2];
}
const DirectionalLight& Scene::GetDirectionalLight() const
{
return mDirLight;
}
| [
"[email protected]"
] | |
7e362eca6b1e6c250161dfc69f242b09d0707580 | 3aa9a68026ab10ced85dec559b6b4dfcb74ae251 | /love babbar series/Strings/balanced paranthesis.cpp | 3fe754cb39abd13bcbfea05dfc0cbe5a693312b7 | [] | no_license | kushuu/competitive_programming_all | 10eee29c3ca0656a2ffa37b142df680c3a022f1b | 5edaec66d2179a012832698035bdfb0957dbd806 | refs/heads/master | 2023-08-17T15:09:48.492816 | 2021-10-04T20:09:37 | 2021-10-04T20:09:37 | 334,891,360 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,430 | cpp | /****************************************************************
Author: kushuu File: balanced paranthesis.cpp Date: Sun Nov 08 2020
****************************************************************/
#include <bits/stdc++.h>
//shorts
#define ll long long int
#define sll stack<long long int>
#define vll vector<long long int>
#define ld long double
#define pb push_back
#define mp make_pair
#define vpll vector<pair<long long int, long long int>>
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define fo(i,x,y) for(long long i = x; i < y; i++)
#define MOD 1000000007
#define endl "\n"
#define F first
#define S second
#define s(a) a.size()
//program specific shorts (if any)
//
using namespace std;
ll getlcm(ll a, ll b) {
return (a*b)/__gcd(a, b);
}
int main() {
fastIO;
ll t; cin >> t;
while(t--) {
string s; cin >> s;
if(s(s) == 1) {cout << "not balanced\n"; continue;}
map<char, char> close;
close['('] = ')';
close['['] = ']';
close['{'] = '}';
stack<char> check;
check.push(s[0]);
fo(i, 1, s(s)) {
if(s[i] == close[check.top()])
check.pop();
else
check.push(s[i]);
}
if(check.empty()) cout << "balanced\n";
else cout << "not balanced\n";
// while(!check.empty()) {cout << check.top(); check.pop();}
}
return 0;
} | [
"[email protected]"
] | |
3cc986c6835fe2625a6262194248264175c04cea | 691abe5f62df930ae7420d00f48e5b2f7f57faed | /atcoder.jp/abc035/abc035_b/Main.cpp | 81914f83a052e87b5c80dcf03d98fb211644c252 | [] | no_license | Volverman/procon-archive | 2fa9d10d0a655590f2c6342c5e494deff5718c73 | 834adc4a70a275eb28cea6d724ee5cc5d926ffe7 | refs/heads/master | 2022-12-18T23:40:48.494023 | 2020-09-12T07:48:48 | 2020-09-12T07:48:48 | 294,258,109 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,072 | cpp | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
using P = pair<int,int>;
int dx[4]={-1,1,0,0};
int dy[4]={0,0,1,-1};
int main()
{
string S;
int T;
cin >> S >> T;
int x=0,y=0;
int MAX=0,MIN=0;
REP(i,S.size()){
if(S.at(i)=='L'){
x+=dx[0];
y+=dy[0];
}else if(S.at(i)=='R'){
x+=dx[1];
y+=dy[1];
}else if(S.at(i)=='U'){
x+=dx[2];
y+=dy[2];
}else if(S.at(i)=='D'){
x+=dx[3];
y+=dy[3];
}else if(S.at(i)=='?'){
MAX++;
}
}
int maxans = MAX+abs(x)+abs(y);
int minans;
if(abs(x)+abs(y)-MAX>=0){
minans=abs(x)+abs(y)-MAX;
}else{
if(((abs(x)+abs(y))%2==0&&MAX%2==0)||(abs(x)+abs(y))%2==1&&MAX%2==1){
minans = 0;
}else{
minans = 1;
}
}
if(T==1){
cout << maxans << endl;
}else{
cout << minans << endl;
}
} | [
"[email protected]"
] | |
4477bf46d153e01601fd53929cf5e5839ce9830e | f5cf5bd1f9eb40e468dd3fb580f55944ec1ff31c | /src/ActiveDataAPI/ActAPI_IParameter.cpp | 4d5a097171a1337ac81eb109dc7ab3b4deabf8c4 | [] | no_license | CadQuery/active-data | 3977b4fe693e15e791ba919df2f91b08c71de8f5 | df3f043d7d8a050a0695c04851462ff10e1a6730 | refs/heads/master | 2022-12-11T16:22:13.373786 | 2020-07-21T12:53:53 | 2020-07-21T12:53:53 | 291,694,156 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,995 | cpp | //-----------------------------------------------------------------------------
// Created on: March 2012
//-----------------------------------------------------------------------------
// Copyright (c) 2017, OPEN CASCADE SAS
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of OPEN CASCADE SAS nor the
// names of all 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 AUTHORS 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.
//
// Web: http://dev.opencascade.org
//-----------------------------------------------------------------------------
// Own include
#include <ActAPI_IParameter.h>
//! Destructor.
ActAPI_IUserParameter::~ActAPI_IUserParameter()
{
}
| [
"[email protected]"
] | |
b20e86a527421b6a13980907e78092e671073155 | dc7ba2a2eb5f6eb721074e25dbf16b5e15a3b298 | /src/realta/inc/MRealTimeAnalyzer.h | ee4df15ad09356f70ae7d089e19ad6f75dd199e6 | [] | no_license | markbandstra/megalib | 094fc75debe3cff24a79ba8c3485180c92d70858 | 078f4d23813d8185a75414e1cdb2099d73f17a65 | refs/heads/master | 2021-01-17T08:34:07.177308 | 2013-11-15T22:17:10 | 2013-11-15T22:17:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,264 | h | /*
* MRealTimeAnalyzer.h
*
* Copyright (C) by Andreas Zoglauer.
* All rights reserved.
*
* Please see the source-file for the copyright-notice.
*
*/
#ifndef __MRealTimeAnalyzer__
#define __MRealTimeAnalyzer__
////////////////////////////////////////////////////////////////////////////////
// Standard libs:
#include <list>
#include <vector>
using namespace std;
// ROOT libs:
#include "TH1.h"
#include "TThread.h"
#include "TMutex.h"
// MEGAlib libs:
#include "MGlobal.h"
#include "MSettingsRealta.h"
#include "MRealTimeEvent.h"
#include "MTransceiverTcpIp.h"
#include "MImageSpheric.h"
#include "MImagerExternallyManaged.h"
#include "MIsotope.h"
// Forward declarations:
////////////////////////////////////////////////////////////////////////////////
void* StartTransmissionThread(void* Analysis);
void* StartCoincidenceThread(void* Analysis);
void* StartReconstructionThread(void* Analysis);
void* StartImagingThread(void* Analysis);
void* StartHistogrammingThread(void* Analysis);
void* StartIdentificationThread(void* Analysis);
////////////////////////////////////////////////////////////////////////////////
class MRealTimeAnalyzer
{
// public interface:
public:
//! Default constructor for the real-time analyzer
MRealTimeAnalyzer();
//! Default desstructor for the real-time analyzer
virtual ~MRealTimeAnalyzer();
//! Set all the user definable settings
void SetSettings(MSettingsRealta* Settings);
//! Set the accumulation time
void SetAccumulationTime(double AccumulationTime);
//! Start all the analysis
void StartAnalysis();
//! Stop all the analysis
void StopAnalysis();
//! Connect to the other machine
bool Connect();
//! Disconnect from the other machine
bool Disconnect();
//! Reset the analysis
bool Reset();
//! The infinite reading loop
void OneTransmissionLoop();
//! The infinite coincidence loop
void OneCoincidenceLoop();
//! The infinite reconstruction loop
void OneReconstructionLoop();
//! The infinite backprojection loop
void OneImagingLoop();
//! The infinite backprojection loop
void OneHistogrammingLoop();
//! The infinite identification loop
void OneIdentificationLoop();
//! Get count rate historgram
TH1D* GetCountRateHistogram() { return m_CountRate; }
//! Get spectrum historgram
TH1D* GetSpectrumHistogram() { return m_Spectrum; }
//! Get image
MImageSpheric* GetImage() { return m_Image; }
//! Get a COPY of the isotope list
vector<MIsotope> GetIsotopes();
//! Return the connection
bool IsConnected() { return m_IsConnected; }
//! Get the transmission thread CPU usage...
double GetTransmissionThreadCpuUsage() { return m_TransmissionThreadCpuUsage; }
//! Get the coincidence thread CPU usage...
double GetCoincidenceThreadCpuUsage() { return m_CoincidenceThreadCpuUsage; }
//! Get the reconstruction thread CPU usage...
double GetReconstructionThreadCpuUsage() { return m_ReconstructionThreadCpuUsage; }
//! Get the imaging thread CPU usage...
double GetImagingThreadCpuUsage() { return m_ImagingThreadCpuUsage; }
//! Get the imaging thread CPU usage...
double GetHistogrammingThreadCpuUsage() { return m_HistogrammingThreadCpuUsage; }
//! Get the identification thread CPU usage...
double GetIdentificationThreadCpuUsage() { return m_IdentificationThreadCpuUsage; }
//! Get the ID of the last event handled in the transmission thread...
unsigned int GetTransmissionThreadLastEventID() { return m_TransmissionThreadLastEventID; }
//! Get the ID of the last event handled in the coincidence thread...
unsigned int GetCoincidenceThreadLastEventID() { return m_CoincidenceThreadLastEventID; }
//! Get the ID of the last event handled in the reconstruction thread...
unsigned int GetReconstructionThreadLastEventID() { return m_ReconstructionThreadLastEventID; }
//! Get the ID of the last event handled in the imaging thread...
unsigned int GetImagingThreadLastEventID() { return m_ImagingThreadLastEventID; }
//! Get the ID of the last event handled in the histogramming thread...
unsigned int GetHistogrammingThreadLastEventID() { return m_HistogrammingThreadLastEventID; }
//! Get the ID of the last event handled in the identification thread...
unsigned int GetIdentificationThreadLastEventID() { return m_IdentificationThreadLastEventID; }
// protected methods:
protected:
//! initialize an object of MImagerExternallyManaged
MImagerExternallyManaged* InitializeImager();
// private methods:
private:
// protected members:
protected:
// private members:
private:
//! The user settings
MSettingsRealta* m_Settings;
//! The thread where the transmission happens
TThread* m_TransmissionThread;
//! True if the transmission thread is in its execution loop
bool m_IsTransmissionThreadRunning;
//! The CPU usage of the transmission thread
double m_TransmissionThreadCpuUsage;
//! The ID of the last transmitted event
unsigned int m_TransmissionThreadLastEventID;
//! The thread where the coincidence finding happens
TThread* m_CoincidenceThread;
//! True if the coincidence thread is in its execution loop
bool m_IsCoincidenceThreadRunning;
//! The CPU usage of the coincidence thread
double m_CoincidenceThreadCpuUsage;
//! The ID of the last coincident event
unsigned int m_CoincidenceThreadLastEventID;
//! The thread where the event reconstruction happens
TThread* m_ReconstructionThread;
//! True if the reconstruction thread is in its execution loop
bool m_IsReconstructionThreadRunning;
//! The CPU usage of the reconstruction thread
double m_ReconstructionThreadCpuUsage;
//! The ID of the last reconstructed event
unsigned int m_ReconstructionThreadLastEventID;
//! The thread where the backprojection happens
TThread* m_ImagingThread;
//! True if the imaging thread is in its execution loop
bool m_IsImagingThreadRunning;
//! The CPU usage of the imaging thread
double m_ImagingThreadCpuUsage;
//! The ID of the last imaged event
unsigned int m_ImagingThreadLastEventID;
//! The thread where the histogramming happens
TThread* m_HistogrammingThread;
//! True if the histogramming thread is in its execution loop
bool m_IsHistogrammingThreadRunning;
//! The CPU usage of the histogramming thread
double m_HistogrammingThreadCpuUsage;
//! The ID of the last histogrammed event
unsigned int m_HistogrammingThreadLastEventID;
//! The thread where the identification happens
TThread* m_IdentificationThread;
//! True if the identification thread is in its execution loop
bool m_IsIdentificationThreadRunning;
//! The CPU usage of the identification thread
double m_IdentificationThreadCpuUsage;
//! The ID of the last identification event
unsigned int m_IdentificationThreadLastEventID;
//! Unique Id for all the threads...
static int m_ThreadId;
//! True if the threads should be stopped
bool m_StopThreads;
//! True is the analysis is running
bool m_IsAnalysisRunning;
//! True if we are at the thread initialization stage
bool m_IsInitializing;
//! True is the analysis is running
bool m_IsConnected;
//! True if we should disconnect
bool m_DoDisconnect;
//! The transceiver
MTransceiverTcpIp* m_Transceiver;
//! The geometry file name
MString m_GeometryFileName;
//! The accumulation time in seconds
double m_AccumulationTime;
//! And a guarding mutex for the accumulation time
TMutex m_AccumulationTimeMutex;
//! The "list"
list<MRealTimeEvent*> m_Events;
//! Current number of events in the list
unsigned int m_NEvents;
//! Maximum number of events to keep in the list
unsigned int m_MaxNEvents;
//! The current count rate histogram
TH1D* m_CountRate;
//! The current spectrum histogram
TH1D* m_Spectrum;
//! The current image
MImageSpheric* m_Image;
//! A list of isoptopes to identify:
vector<MIsotope> m_Isotopes;
//! And a guarding mutex for the isotope retrieval
TMutex m_IsotopeMutex;
#ifdef ___CINT___
public:
ClassDef(MRealTimeAnalyzer, 0) // no description
#endif
};
#endif
////////////////////////////////////////////////////////////////////////////////
| [
"[email protected]"
] | |
e1afa30e7e19cb1b289e8e0431740e6152961b37 | dc442d8cd539a7db76d47007e20dfe7d2126ed53 | /stack using array.cpp | 198a0ad6939d62cd7389d8ad9ac59c485ccb3771 | [] | no_license | barsha87/snippets | e7177af081123852bff584b414013cb363824407 | fdf0ef70ca335cef127835297a21194e9d7bbc97 | refs/heads/master | 2022-01-09T00:14:33.520985 | 2019-04-30T10:54:49 | 2019-04-30T10:54:49 | 181,631,572 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,633 | cpp | #include <iostream>
using namespace std;
class stack
{
int a[50],n,res;
public:
int top;
void pop();
void push();
void disp();
};
void stack::push()
{
cout<<"\nEnter element: ";
cin>>n;
if(top==49)
res=-1;
else
{
top++;
a[top]=n;
res=0;
}
if (res==-1)
{
cout<<"Overflow!! \n";
}
}
void stack::pop()
{
if(top==-1)
cout<<"Underflow!! \n";
else
{
res=a[top];
top--;
cout<<"\nThe deleted element is: "<<res<<endl;
}
}
void stack::disp()
{
cout<<"\nThe Stack now is: \n";
if(top==-1)
{cout<<"Empty";
return;}
cout<<a[top];
for(int i=top-1;i>=0;i--)
cout<<" "<<a[i];
}
int main()
{
stack s;
s.top=-1;
int c;
char ch='y';
while (ch=='y'||ch=='Y')
{
cout<<"Enter Choice: (1)Push (2)Pop (3)Display : ";
cin>>c;
switch(c)
{
case 1: s.push();
break;
case 2: s.pop();
break;
case 3: s.disp();
break;
default: cout<<"\nInvalid Choice! ";
}
cout<<"\n continue? ";
cin>>ch;
}
return 0;
}
| [
"[email protected]"
] | |
de2cee8ee5603730f6d0f19e6c44a21b5f1e50dd | 9ca0783e78c37c41221d255601bab73ec958b0b9 | /src/util/gl/Buffer.hpp | 159c3f6a1e574ae12ec673e5f3cf7907f6c87670 | [] | no_license | nagalun/worldofpixels-client | c67006bf982cd79fa47d1d173381c39a703bc9c2 | d224a215fa6f33727e6315745b65def7fc4dda97 | refs/heads/master | 2023-07-07T11:11:50.010894 | 2023-06-28T09:02:17 | 2023-06-28T09:02:17 | 210,177,431 | 6 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 490 | hpp | #pragma once
#include <cstdint>
#include <cstddef>
namespace gl {
class Buffer {
std::uint32_t id;
public:
Buffer();
~Buffer();
Buffer(Buffer &&other);
Buffer& operator=(Buffer &&other);
Buffer(const Buffer &other) = delete;
Buffer& operator=(const Buffer &other) = delete;
void use(std::uint32_t type) const;
void data(std::uint32_t type, std::size_t size, const void * data, std::uint32_t usage);
std::uint32_t get() const;
private:
void del();
};
} /* namespace gl */
| [
"[email protected]"
] | |
abf1d8883944292071ef22c8ae2ba8c4ff7e8134 | ac92a9c7251a11048a314d9d452f7a9e8816b258 | /Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_8Table.cpp | 3abadb311f8b0c705f80f659ea54f136c118938d | [] | no_license | vannorman/MappingPrefabs | a411858b792f24e62cf17d80981981cc3779adc7 | 22f3fb8389ec8c0298ac0a863994dcb00fc1ceaa | refs/heads/master | 2020-03-29T07:15:25.468882 | 2019-02-01T17:17:13 | 2019-02-01T17:17:13 | 149,658,755 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 250,928 | 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 "il2cpp-class-internals.h"
#include "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
// Microsoft.Win32.SafeHandles.SafeWaitHandle
struct SafeWaitHandle_t1972936122;
// System.ActivationContext
struct ActivationContext_t976916018;
// System.AppDomainInitializer
struct AppDomainInitializer_t682969308;
// System.AppDomainManager
struct AppDomainManager_t1420869192;
// System.ApplicationIdentity
struct ApplicationIdentity_t1917735356;
// System.AssemblyLoadEventHandler
struct AssemblyLoadEventHandler_t107971893;
// System.AttributeUsageAttribute
struct AttributeUsageAttribute_t290877318;
// System.Boolean[]
struct BooleanU5BU5D_t2897418192;
// System.Byte[]
struct ByteU5BU5D_t4116647657;
// System.Char[]
struct CharU5BU5D_t3528271667;
// System.Collections.ArrayList
struct ArrayList_t2718874744;
// System.Collections.Hashtable
struct Hashtable_t1853889766;
// System.Collections.IDictionary
struct IDictionary_t1363984059;
// System.Collections.SortedList
struct SortedList_t2427694641;
// System.Delegate
struct Delegate_t1188392813;
// System.EventHandler
struct EventHandler_t1348719766;
// System.IO.TextReader
struct TextReader_t283511965;
// System.IO.TextWriter
struct TextWriter_t3478189236;
// System.Int32[]
struct Int32U5BU5D_t385246372;
// System.IntPtr[]
struct IntPtrU5BU5D_t4013366056;
// System.MonoEnumInfo/IntComparer
struct IntComparer_t3812095803;
// System.MonoEnumInfo/LongComparer
struct LongComparer_t1798269597;
// System.MonoEnumInfo/SByteComparer
struct SByteComparer_t2329725001;
// System.MonoEnumInfo/ShortComparer
struct ShortComparer_t2253094562;
// System.MulticastDelegate
struct MulticastDelegate_t;
// System.Object[]
struct ObjectU5BU5D_t2843939325;
// System.OperatingSystem
struct OperatingSystem_t3730783609;
// System.Reflection.Assembly
struct Assembly_t;
// System.Reflection.ConstructorInfo
struct ConstructorInfo_t5769829;
// System.ResolveEventHandler
struct ResolveEventHandler_t2775508208;
// System.Runtime.Hosting.ActivationArguments
struct ActivationArguments_t4219999170;
// System.Runtime.Remoting.ServerIdentity
struct ServerIdentity_t2342208608;
// System.SByte[]
struct SByteU5BU5D_t2651576203;
// System.Security.Cryptography.RandomNumberGenerator
struct RandomNumberGenerator_t386037858;
// System.Security.PermissionSet
struct PermissionSet_t223948603;
// System.Security.Policy.ApplicationTrust
struct ApplicationTrust_t3270368423;
// System.Security.Policy.Evidence
struct Evidence_t2008144148;
// System.Security.Principal.IPrincipal
struct IPrincipal_t2343618843;
// System.Security.SecurityContext
struct SecurityContext_t2435442044;
// System.Security.SecurityElement
struct SecurityElement_t1046076091;
// System.String
struct String_t;
// System.String[]
struct StringU5BU5D_t1281789340;
// System.Text.DecoderFallback
struct DecoderFallback_t3123823036;
// System.Text.DecoderFallbackBuffer
struct DecoderFallbackBuffer_t2402303981;
// System.Text.EncoderFallback
struct EncoderFallback_t1188251036;
// System.Text.Encoding
struct Encoding_t1523322056;
// System.Threading.ExecutionContext
struct ExecutionContext_t1748372627;
// System.Threading.ManualResetEvent
struct ManualResetEvent_t451242010;
// System.Threading.Timer/Scheduler
struct Scheduler_t3215764947;
// System.Threading.TimerCallback
struct TimerCallback_t1438585625;
// System.Threading.WaitHandle
struct WaitHandle_t1743403487;
// System.Threading.WaitOrTimerCallback
struct WaitOrTimerCallback_t1973723282;
// System.Type
struct Type_t;
// System.Type[]
struct TypeU5BU5D_t3940880105;
// System.UnhandledExceptionEventHandler
struct UnhandledExceptionEventHandler_t3101989324;
// System.Void
struct Void_t1185182177;
#ifndef RUNTIMEOBJECT_H
#define RUNTIMEOBJECT_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Object
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RUNTIMEOBJECT_H
#ifndef ACTIVATIONCONTEXT_T976916018_H
#define ACTIVATIONCONTEXT_T976916018_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ActivationContext
struct ActivationContext_t976916018 : public RuntimeObject
{
public:
// System.Boolean System.ActivationContext::_disposed
bool ____disposed_0;
public:
inline static int32_t get_offset_of__disposed_0() { return static_cast<int32_t>(offsetof(ActivationContext_t976916018, ____disposed_0)); }
inline bool get__disposed_0() const { return ____disposed_0; }
inline bool* get_address_of__disposed_0() { return &____disposed_0; }
inline void set__disposed_0(bool value)
{
____disposed_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ACTIVATIONCONTEXT_T976916018_H
#ifndef ACTIVATOR_T1841325713_H
#define ACTIVATOR_T1841325713_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Activator
struct Activator_t1841325713 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ACTIVATOR_T1841325713_H
#ifndef APPLICATIONIDENTITY_T1917735356_H
#define APPLICATIONIDENTITY_T1917735356_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ApplicationIdentity
struct ApplicationIdentity_t1917735356 : public RuntimeObject
{
public:
// System.String System.ApplicationIdentity::_fullName
String_t* ____fullName_0;
public:
inline static int32_t get_offset_of__fullName_0() { return static_cast<int32_t>(offsetof(ApplicationIdentity_t1917735356, ____fullName_0)); }
inline String_t* get__fullName_0() const { return ____fullName_0; }
inline String_t** get_address_of__fullName_0() { return &____fullName_0; }
inline void set__fullName_0(String_t* value)
{
____fullName_0 = value;
Il2CppCodeGenWriteBarrier((&____fullName_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // APPLICATIONIDENTITY_T1917735356_H
#ifndef ATTRIBUTE_T861562559_H
#define ATTRIBUTE_T861562559_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Attribute
struct Attribute_t861562559 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ATTRIBUTE_T861562559_H
#ifndef BITCONVERTER_T3118986983_H
#define BITCONVERTER_T3118986983_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.BitConverter
struct BitConverter_t3118986983 : public RuntimeObject
{
public:
public:
};
struct BitConverter_t3118986983_StaticFields
{
public:
// System.Boolean System.BitConverter::SwappedWordsInDouble
bool ___SwappedWordsInDouble_0;
// System.Boolean System.BitConverter::IsLittleEndian
bool ___IsLittleEndian_1;
public:
inline static int32_t get_offset_of_SwappedWordsInDouble_0() { return static_cast<int32_t>(offsetof(BitConverter_t3118986983_StaticFields, ___SwappedWordsInDouble_0)); }
inline bool get_SwappedWordsInDouble_0() const { return ___SwappedWordsInDouble_0; }
inline bool* get_address_of_SwappedWordsInDouble_0() { return &___SwappedWordsInDouble_0; }
inline void set_SwappedWordsInDouble_0(bool value)
{
___SwappedWordsInDouble_0 = value;
}
inline static int32_t get_offset_of_IsLittleEndian_1() { return static_cast<int32_t>(offsetof(BitConverter_t3118986983_StaticFields, ___IsLittleEndian_1)); }
inline bool get_IsLittleEndian_1() const { return ___IsLittleEndian_1; }
inline bool* get_address_of_IsLittleEndian_1() { return &___IsLittleEndian_1; }
inline void set_IsLittleEndian_1(bool value)
{
___IsLittleEndian_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // BITCONVERTER_T3118986983_H
#ifndef BUFFER_T1599081364_H
#define BUFFER_T1599081364_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Buffer
struct Buffer_t1599081364 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // BUFFER_T1599081364_H
#ifndef CHARENUMERATOR_T1121470421_H
#define CHARENUMERATOR_T1121470421_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.CharEnumerator
struct CharEnumerator_t1121470421 : public RuntimeObject
{
public:
// System.String System.CharEnumerator::str
String_t* ___str_0;
// System.Int32 System.CharEnumerator::index
int32_t ___index_1;
// System.Int32 System.CharEnumerator::length
int32_t ___length_2;
public:
inline static int32_t get_offset_of_str_0() { return static_cast<int32_t>(offsetof(CharEnumerator_t1121470421, ___str_0)); }
inline String_t* get_str_0() const { return ___str_0; }
inline String_t** get_address_of_str_0() { return &___str_0; }
inline void set_str_0(String_t* value)
{
___str_0 = value;
Il2CppCodeGenWriteBarrier((&___str_0), value);
}
inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(CharEnumerator_t1121470421, ___index_1)); }
inline int32_t get_index_1() const { return ___index_1; }
inline int32_t* get_address_of_index_1() { return &___index_1; }
inline void set_index_1(int32_t value)
{
___index_1 = value;
}
inline static int32_t get_offset_of_length_2() { return static_cast<int32_t>(offsetof(CharEnumerator_t1121470421, ___length_2)); }
inline int32_t get_length_2() const { return ___length_2; }
inline int32_t* get_address_of_length_2() { return &___length_2; }
inline void set_length_2(int32_t value)
{
___length_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CHARENUMERATOR_T1121470421_H
#ifndef CONSOLE_T3208230065_H
#define CONSOLE_T3208230065_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Console
struct Console_t3208230065 : public RuntimeObject
{
public:
public:
};
struct Console_t3208230065_StaticFields
{
public:
// System.IO.TextWriter System.Console::stdout
TextWriter_t3478189236 * ___stdout_0;
// System.IO.TextWriter System.Console::stderr
TextWriter_t3478189236 * ___stderr_1;
// System.IO.TextReader System.Console::stdin
TextReader_t283511965 * ___stdin_2;
// System.Text.Encoding System.Console::inputEncoding
Encoding_t1523322056 * ___inputEncoding_3;
// System.Text.Encoding System.Console::outputEncoding
Encoding_t1523322056 * ___outputEncoding_4;
public:
inline static int32_t get_offset_of_stdout_0() { return static_cast<int32_t>(offsetof(Console_t3208230065_StaticFields, ___stdout_0)); }
inline TextWriter_t3478189236 * get_stdout_0() const { return ___stdout_0; }
inline TextWriter_t3478189236 ** get_address_of_stdout_0() { return &___stdout_0; }
inline void set_stdout_0(TextWriter_t3478189236 * value)
{
___stdout_0 = value;
Il2CppCodeGenWriteBarrier((&___stdout_0), value);
}
inline static int32_t get_offset_of_stderr_1() { return static_cast<int32_t>(offsetof(Console_t3208230065_StaticFields, ___stderr_1)); }
inline TextWriter_t3478189236 * get_stderr_1() const { return ___stderr_1; }
inline TextWriter_t3478189236 ** get_address_of_stderr_1() { return &___stderr_1; }
inline void set_stderr_1(TextWriter_t3478189236 * value)
{
___stderr_1 = value;
Il2CppCodeGenWriteBarrier((&___stderr_1), value);
}
inline static int32_t get_offset_of_stdin_2() { return static_cast<int32_t>(offsetof(Console_t3208230065_StaticFields, ___stdin_2)); }
inline TextReader_t283511965 * get_stdin_2() const { return ___stdin_2; }
inline TextReader_t283511965 ** get_address_of_stdin_2() { return &___stdin_2; }
inline void set_stdin_2(TextReader_t283511965 * value)
{
___stdin_2 = value;
Il2CppCodeGenWriteBarrier((&___stdin_2), value);
}
inline static int32_t get_offset_of_inputEncoding_3() { return static_cast<int32_t>(offsetof(Console_t3208230065_StaticFields, ___inputEncoding_3)); }
inline Encoding_t1523322056 * get_inputEncoding_3() const { return ___inputEncoding_3; }
inline Encoding_t1523322056 ** get_address_of_inputEncoding_3() { return &___inputEncoding_3; }
inline void set_inputEncoding_3(Encoding_t1523322056 * value)
{
___inputEncoding_3 = value;
Il2CppCodeGenWriteBarrier((&___inputEncoding_3), value);
}
inline static int32_t get_offset_of_outputEncoding_4() { return static_cast<int32_t>(offsetof(Console_t3208230065_StaticFields, ___outputEncoding_4)); }
inline Encoding_t1523322056 * get_outputEncoding_4() const { return ___outputEncoding_4; }
inline Encoding_t1523322056 ** get_address_of_outputEncoding_4() { return &___outputEncoding_4; }
inline void set_outputEncoding_4(Encoding_t1523322056 * value)
{
___outputEncoding_4 = value;
Il2CppCodeGenWriteBarrier((&___outputEncoding_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONSOLE_T3208230065_H
#ifndef CONVERT_T2465617642_H
#define CONVERT_T2465617642_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Convert
struct Convert_t2465617642 : public RuntimeObject
{
public:
public:
};
struct Convert_t2465617642_StaticFields
{
public:
// System.Object System.Convert::DBNull
RuntimeObject * ___DBNull_0;
// System.Type[] System.Convert::conversionTable
TypeU5BU5D_t3940880105* ___conversionTable_1;
public:
inline static int32_t get_offset_of_DBNull_0() { return static_cast<int32_t>(offsetof(Convert_t2465617642_StaticFields, ___DBNull_0)); }
inline RuntimeObject * get_DBNull_0() const { return ___DBNull_0; }
inline RuntimeObject ** get_address_of_DBNull_0() { return &___DBNull_0; }
inline void set_DBNull_0(RuntimeObject * value)
{
___DBNull_0 = value;
Il2CppCodeGenWriteBarrier((&___DBNull_0), value);
}
inline static int32_t get_offset_of_conversionTable_1() { return static_cast<int32_t>(offsetof(Convert_t2465617642_StaticFields, ___conversionTable_1)); }
inline TypeU5BU5D_t3940880105* get_conversionTable_1() const { return ___conversionTable_1; }
inline TypeU5BU5D_t3940880105** get_address_of_conversionTable_1() { return &___conversionTable_1; }
inline void set_conversionTable_1(TypeU5BU5D_t3940880105* value)
{
___conversionTable_1 = value;
Il2CppCodeGenWriteBarrier((&___conversionTable_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONVERT_T2465617642_H
#ifndef DBNULL_T3725197148_H
#define DBNULL_T3725197148_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DBNull
struct DBNull_t3725197148 : public RuntimeObject
{
public:
public:
};
struct DBNull_t3725197148_StaticFields
{
public:
// System.DBNull System.DBNull::Value
DBNull_t3725197148 * ___Value_0;
public:
inline static int32_t get_offset_of_Value_0() { return static_cast<int32_t>(offsetof(DBNull_t3725197148_StaticFields, ___Value_0)); }
inline DBNull_t3725197148 * get_Value_0() const { return ___Value_0; }
inline DBNull_t3725197148 ** get_address_of_Value_0() { return &___Value_0; }
inline void set_Value_0(DBNull_t3725197148 * value)
{
___Value_0 = value;
Il2CppCodeGenWriteBarrier((&___Value_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DBNULL_T3725197148_H
#ifndef DATETIMEUTILS_T3080864452_H
#define DATETIMEUTILS_T3080864452_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DateTimeUtils
struct DateTimeUtils_t3080864452 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DATETIMEUTILS_T3080864452_H
#ifndef DELEGATEDATA_T1677132599_H
#define DELEGATEDATA_T1677132599_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DelegateData
struct DelegateData_t1677132599 : public RuntimeObject
{
public:
// System.Type System.DelegateData::target_type
Type_t * ___target_type_0;
// System.String System.DelegateData::method_name
String_t* ___method_name_1;
public:
inline static int32_t get_offset_of_target_type_0() { return static_cast<int32_t>(offsetof(DelegateData_t1677132599, ___target_type_0)); }
inline Type_t * get_target_type_0() const { return ___target_type_0; }
inline Type_t ** get_address_of_target_type_0() { return &___target_type_0; }
inline void set_target_type_0(Type_t * value)
{
___target_type_0 = value;
Il2CppCodeGenWriteBarrier((&___target_type_0), value);
}
inline static int32_t get_offset_of_method_name_1() { return static_cast<int32_t>(offsetof(DelegateData_t1677132599, ___method_name_1)); }
inline String_t* get_method_name_1() const { return ___method_name_1; }
inline String_t** get_address_of_method_name_1() { return &___method_name_1; }
inline void set_method_name_1(String_t* value)
{
___method_name_1 = value;
Il2CppCodeGenWriteBarrier((&___method_name_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DELEGATEDATA_T1677132599_H
#ifndef DELEGATESERIALIZATIONHOLDER_T3408600559_H
#define DELEGATESERIALIZATIONHOLDER_T3408600559_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DelegateSerializationHolder
struct DelegateSerializationHolder_t3408600559 : public RuntimeObject
{
public:
// System.Delegate System.DelegateSerializationHolder::_delegate
Delegate_t1188392813 * ____delegate_0;
public:
inline static int32_t get_offset_of__delegate_0() { return static_cast<int32_t>(offsetof(DelegateSerializationHolder_t3408600559, ____delegate_0)); }
inline Delegate_t1188392813 * get__delegate_0() const { return ____delegate_0; }
inline Delegate_t1188392813 ** get_address_of__delegate_0() { return &____delegate_0; }
inline void set__delegate_0(Delegate_t1188392813 * value)
{
____delegate_0 = value;
Il2CppCodeGenWriteBarrier((&____delegate_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DELEGATESERIALIZATIONHOLDER_T3408600559_H
#ifndef DELEGATEENTRY_T1019584161_H
#define DELEGATEENTRY_T1019584161_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DelegateSerializationHolder/DelegateEntry
struct DelegateEntry_t1019584161 : public RuntimeObject
{
public:
// System.String System.DelegateSerializationHolder/DelegateEntry::type
String_t* ___type_0;
// System.String System.DelegateSerializationHolder/DelegateEntry::assembly
String_t* ___assembly_1;
// System.Object System.DelegateSerializationHolder/DelegateEntry::target
RuntimeObject * ___target_2;
// System.String System.DelegateSerializationHolder/DelegateEntry::targetTypeAssembly
String_t* ___targetTypeAssembly_3;
// System.String System.DelegateSerializationHolder/DelegateEntry::targetTypeName
String_t* ___targetTypeName_4;
// System.String System.DelegateSerializationHolder/DelegateEntry::methodName
String_t* ___methodName_5;
// System.DelegateSerializationHolder/DelegateEntry System.DelegateSerializationHolder/DelegateEntry::delegateEntry
DelegateEntry_t1019584161 * ___delegateEntry_6;
public:
inline static int32_t get_offset_of_type_0() { return static_cast<int32_t>(offsetof(DelegateEntry_t1019584161, ___type_0)); }
inline String_t* get_type_0() const { return ___type_0; }
inline String_t** get_address_of_type_0() { return &___type_0; }
inline void set_type_0(String_t* value)
{
___type_0 = value;
Il2CppCodeGenWriteBarrier((&___type_0), value);
}
inline static int32_t get_offset_of_assembly_1() { return static_cast<int32_t>(offsetof(DelegateEntry_t1019584161, ___assembly_1)); }
inline String_t* get_assembly_1() const { return ___assembly_1; }
inline String_t** get_address_of_assembly_1() { return &___assembly_1; }
inline void set_assembly_1(String_t* value)
{
___assembly_1 = value;
Il2CppCodeGenWriteBarrier((&___assembly_1), value);
}
inline static int32_t get_offset_of_target_2() { return static_cast<int32_t>(offsetof(DelegateEntry_t1019584161, ___target_2)); }
inline RuntimeObject * get_target_2() const { return ___target_2; }
inline RuntimeObject ** get_address_of_target_2() { return &___target_2; }
inline void set_target_2(RuntimeObject * value)
{
___target_2 = value;
Il2CppCodeGenWriteBarrier((&___target_2), value);
}
inline static int32_t get_offset_of_targetTypeAssembly_3() { return static_cast<int32_t>(offsetof(DelegateEntry_t1019584161, ___targetTypeAssembly_3)); }
inline String_t* get_targetTypeAssembly_3() const { return ___targetTypeAssembly_3; }
inline String_t** get_address_of_targetTypeAssembly_3() { return &___targetTypeAssembly_3; }
inline void set_targetTypeAssembly_3(String_t* value)
{
___targetTypeAssembly_3 = value;
Il2CppCodeGenWriteBarrier((&___targetTypeAssembly_3), value);
}
inline static int32_t get_offset_of_targetTypeName_4() { return static_cast<int32_t>(offsetof(DelegateEntry_t1019584161, ___targetTypeName_4)); }
inline String_t* get_targetTypeName_4() const { return ___targetTypeName_4; }
inline String_t** get_address_of_targetTypeName_4() { return &___targetTypeName_4; }
inline void set_targetTypeName_4(String_t* value)
{
___targetTypeName_4 = value;
Il2CppCodeGenWriteBarrier((&___targetTypeName_4), value);
}
inline static int32_t get_offset_of_methodName_5() { return static_cast<int32_t>(offsetof(DelegateEntry_t1019584161, ___methodName_5)); }
inline String_t* get_methodName_5() const { return ___methodName_5; }
inline String_t** get_address_of_methodName_5() { return &___methodName_5; }
inline void set_methodName_5(String_t* value)
{
___methodName_5 = value;
Il2CppCodeGenWriteBarrier((&___methodName_5), value);
}
inline static int32_t get_offset_of_delegateEntry_6() { return static_cast<int32_t>(offsetof(DelegateEntry_t1019584161, ___delegateEntry_6)); }
inline DelegateEntry_t1019584161 * get_delegateEntry_6() const { return ___delegateEntry_6; }
inline DelegateEntry_t1019584161 ** get_address_of_delegateEntry_6() { return &___delegateEntry_6; }
inline void set_delegateEntry_6(DelegateEntry_t1019584161 * value)
{
___delegateEntry_6 = value;
Il2CppCodeGenWriteBarrier((&___delegateEntry_6), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DELEGATEENTRY_T1019584161_H
#ifndef ENVIRONMENT_T2712485525_H
#define ENVIRONMENT_T2712485525_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Environment
struct Environment_t2712485525 : public RuntimeObject
{
public:
public:
};
struct Environment_t2712485525_StaticFields
{
public:
// System.OperatingSystem System.Environment::os
OperatingSystem_t3730783609 * ___os_1;
public:
inline static int32_t get_offset_of_os_1() { return static_cast<int32_t>(offsetof(Environment_t2712485525_StaticFields, ___os_1)); }
inline OperatingSystem_t3730783609 * get_os_1() const { return ___os_1; }
inline OperatingSystem_t3730783609 ** get_address_of_os_1() { return &___os_1; }
inline void set_os_1(OperatingSystem_t3730783609 * value)
{
___os_1 = value;
Il2CppCodeGenWriteBarrier((&___os_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ENVIRONMENT_T2712485525_H
#ifndef EVENTARGS_T3591816995_H
#define EVENTARGS_T3591816995_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.EventArgs
struct EventArgs_t3591816995 : public RuntimeObject
{
public:
public:
};
struct EventArgs_t3591816995_StaticFields
{
public:
// System.EventArgs System.EventArgs::Empty
EventArgs_t3591816995 * ___Empty_0;
public:
inline static int32_t get_offset_of_Empty_0() { return static_cast<int32_t>(offsetof(EventArgs_t3591816995_StaticFields, ___Empty_0)); }
inline EventArgs_t3591816995 * get_Empty_0() const { return ___Empty_0; }
inline EventArgs_t3591816995 ** get_address_of_Empty_0() { return &___Empty_0; }
inline void set_Empty_0(EventArgs_t3591816995 * value)
{
___Empty_0 = value;
Il2CppCodeGenWriteBarrier((&___Empty_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EVENTARGS_T3591816995_H
#ifndef EXCEPTION_T_H
#define EXCEPTION_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Exception
struct Exception_t : public RuntimeObject
{
public:
// System.IntPtr[] System.Exception::trace_ips
IntPtrU5BU5D_t4013366056* ___trace_ips_0;
// System.Exception System.Exception::inner_exception
Exception_t * ___inner_exception_1;
// System.String System.Exception::message
String_t* ___message_2;
// System.String System.Exception::help_link
String_t* ___help_link_3;
// System.String System.Exception::class_name
String_t* ___class_name_4;
// System.String System.Exception::stack_trace
String_t* ___stack_trace_5;
// System.String System.Exception::_remoteStackTraceString
String_t* ____remoteStackTraceString_6;
// System.Int32 System.Exception::remote_stack_index
int32_t ___remote_stack_index_7;
// System.Int32 System.Exception::hresult
int32_t ___hresult_8;
// System.String System.Exception::source
String_t* ___source_9;
// System.Collections.IDictionary System.Exception::_data
RuntimeObject* ____data_10;
public:
inline static int32_t get_offset_of_trace_ips_0() { return static_cast<int32_t>(offsetof(Exception_t, ___trace_ips_0)); }
inline IntPtrU5BU5D_t4013366056* get_trace_ips_0() const { return ___trace_ips_0; }
inline IntPtrU5BU5D_t4013366056** get_address_of_trace_ips_0() { return &___trace_ips_0; }
inline void set_trace_ips_0(IntPtrU5BU5D_t4013366056* value)
{
___trace_ips_0 = value;
Il2CppCodeGenWriteBarrier((&___trace_ips_0), value);
}
inline static int32_t get_offset_of_inner_exception_1() { return static_cast<int32_t>(offsetof(Exception_t, ___inner_exception_1)); }
inline Exception_t * get_inner_exception_1() const { return ___inner_exception_1; }
inline Exception_t ** get_address_of_inner_exception_1() { return &___inner_exception_1; }
inline void set_inner_exception_1(Exception_t * value)
{
___inner_exception_1 = value;
Il2CppCodeGenWriteBarrier((&___inner_exception_1), 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((&___message_2), value);
}
inline static int32_t get_offset_of_help_link_3() { return static_cast<int32_t>(offsetof(Exception_t, ___help_link_3)); }
inline String_t* get_help_link_3() const { return ___help_link_3; }
inline String_t** get_address_of_help_link_3() { return &___help_link_3; }
inline void set_help_link_3(String_t* value)
{
___help_link_3 = value;
Il2CppCodeGenWriteBarrier((&___help_link_3), value);
}
inline static int32_t get_offset_of_class_name_4() { return static_cast<int32_t>(offsetof(Exception_t, ___class_name_4)); }
inline String_t* get_class_name_4() const { return ___class_name_4; }
inline String_t** get_address_of_class_name_4() { return &___class_name_4; }
inline void set_class_name_4(String_t* value)
{
___class_name_4 = value;
Il2CppCodeGenWriteBarrier((&___class_name_4), value);
}
inline static int32_t get_offset_of_stack_trace_5() { return static_cast<int32_t>(offsetof(Exception_t, ___stack_trace_5)); }
inline String_t* get_stack_trace_5() const { return ___stack_trace_5; }
inline String_t** get_address_of_stack_trace_5() { return &___stack_trace_5; }
inline void set_stack_trace_5(String_t* value)
{
___stack_trace_5 = value;
Il2CppCodeGenWriteBarrier((&___stack_trace_5), value);
}
inline static int32_t get_offset_of__remoteStackTraceString_6() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_6)); }
inline String_t* get__remoteStackTraceString_6() const { return ____remoteStackTraceString_6; }
inline String_t** get_address_of__remoteStackTraceString_6() { return &____remoteStackTraceString_6; }
inline void set__remoteStackTraceString_6(String_t* value)
{
____remoteStackTraceString_6 = value;
Il2CppCodeGenWriteBarrier((&____remoteStackTraceString_6), value);
}
inline static int32_t get_offset_of_remote_stack_index_7() { return static_cast<int32_t>(offsetof(Exception_t, ___remote_stack_index_7)); }
inline int32_t get_remote_stack_index_7() const { return ___remote_stack_index_7; }
inline int32_t* get_address_of_remote_stack_index_7() { return &___remote_stack_index_7; }
inline void set_remote_stack_index_7(int32_t value)
{
___remote_stack_index_7 = value;
}
inline static int32_t get_offset_of_hresult_8() { return static_cast<int32_t>(offsetof(Exception_t, ___hresult_8)); }
inline int32_t get_hresult_8() const { return ___hresult_8; }
inline int32_t* get_address_of_hresult_8() { return &___hresult_8; }
inline void set_hresult_8(int32_t value)
{
___hresult_8 = value;
}
inline static int32_t get_offset_of_source_9() { return static_cast<int32_t>(offsetof(Exception_t, ___source_9)); }
inline String_t* get_source_9() const { return ___source_9; }
inline String_t** get_address_of_source_9() { return &___source_9; }
inline void set_source_9(String_t* value)
{
___source_9 = value;
Il2CppCodeGenWriteBarrier((&___source_9), value);
}
inline static int32_t get_offset_of__data_10() { return static_cast<int32_t>(offsetof(Exception_t, ____data_10)); }
inline RuntimeObject* get__data_10() const { return ____data_10; }
inline RuntimeObject** get_address_of__data_10() { return &____data_10; }
inline void set__data_10(RuntimeObject* value)
{
____data_10 = value;
Il2CppCodeGenWriteBarrier((&____data_10), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EXCEPTION_T_H
#ifndef GC_T959872083_H
#define GC_T959872083_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.GC
struct GC_t959872083 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // GC_T959872083_H
#ifndef GUIDPARSER_T2761237274_H
#define GUIDPARSER_T2761237274_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Guid/GuidParser
struct GuidParser_t2761237274 : public RuntimeObject
{
public:
// System.String System.Guid/GuidParser::_src
String_t* ____src_0;
// System.Int32 System.Guid/GuidParser::_length
int32_t ____length_1;
// System.Int32 System.Guid/GuidParser::_cur
int32_t ____cur_2;
public:
inline static int32_t get_offset_of__src_0() { return static_cast<int32_t>(offsetof(GuidParser_t2761237274, ____src_0)); }
inline String_t* get__src_0() const { return ____src_0; }
inline String_t** get_address_of__src_0() { return &____src_0; }
inline void set__src_0(String_t* value)
{
____src_0 = value;
Il2CppCodeGenWriteBarrier((&____src_0), value);
}
inline static int32_t get_offset_of__length_1() { return static_cast<int32_t>(offsetof(GuidParser_t2761237274, ____length_1)); }
inline int32_t get__length_1() const { return ____length_1; }
inline int32_t* get_address_of__length_1() { return &____length_1; }
inline void set__length_1(int32_t value)
{
____length_1 = value;
}
inline static int32_t get_offset_of__cur_2() { return static_cast<int32_t>(offsetof(GuidParser_t2761237274, ____cur_2)); }
inline int32_t get__cur_2() const { return ____cur_2; }
inline int32_t* get_address_of__cur_2() { return &____cur_2; }
inline void set__cur_2(int32_t value)
{
____cur_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // GUIDPARSER_T2761237274_H
#ifndef LOCALDATASTORESLOT_T740841968_H
#define LOCALDATASTORESLOT_T740841968_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.LocalDataStoreSlot
struct LocalDataStoreSlot_t740841968 : public RuntimeObject
{
public:
// System.Int32 System.LocalDataStoreSlot::slot
int32_t ___slot_0;
// System.Boolean System.LocalDataStoreSlot::thread_local
bool ___thread_local_1;
public:
inline static int32_t get_offset_of_slot_0() { return static_cast<int32_t>(offsetof(LocalDataStoreSlot_t740841968, ___slot_0)); }
inline int32_t get_slot_0() const { return ___slot_0; }
inline int32_t* get_address_of_slot_0() { return &___slot_0; }
inline void set_slot_0(int32_t value)
{
___slot_0 = value;
}
inline static int32_t get_offset_of_thread_local_1() { return static_cast<int32_t>(offsetof(LocalDataStoreSlot_t740841968, ___thread_local_1)); }
inline bool get_thread_local_1() const { return ___thread_local_1; }
inline bool* get_address_of_thread_local_1() { return &___thread_local_1; }
inline void set_thread_local_1(bool value)
{
___thread_local_1 = value;
}
};
struct LocalDataStoreSlot_t740841968_StaticFields
{
public:
// System.Object System.LocalDataStoreSlot::lock_obj
RuntimeObject * ___lock_obj_2;
// System.Boolean[] System.LocalDataStoreSlot::slot_bitmap_thread
BooleanU5BU5D_t2897418192* ___slot_bitmap_thread_3;
// System.Boolean[] System.LocalDataStoreSlot::slot_bitmap_context
BooleanU5BU5D_t2897418192* ___slot_bitmap_context_4;
public:
inline static int32_t get_offset_of_lock_obj_2() { return static_cast<int32_t>(offsetof(LocalDataStoreSlot_t740841968_StaticFields, ___lock_obj_2)); }
inline RuntimeObject * get_lock_obj_2() const { return ___lock_obj_2; }
inline RuntimeObject ** get_address_of_lock_obj_2() { return &___lock_obj_2; }
inline void set_lock_obj_2(RuntimeObject * value)
{
___lock_obj_2 = value;
Il2CppCodeGenWriteBarrier((&___lock_obj_2), value);
}
inline static int32_t get_offset_of_slot_bitmap_thread_3() { return static_cast<int32_t>(offsetof(LocalDataStoreSlot_t740841968_StaticFields, ___slot_bitmap_thread_3)); }
inline BooleanU5BU5D_t2897418192* get_slot_bitmap_thread_3() const { return ___slot_bitmap_thread_3; }
inline BooleanU5BU5D_t2897418192** get_address_of_slot_bitmap_thread_3() { return &___slot_bitmap_thread_3; }
inline void set_slot_bitmap_thread_3(BooleanU5BU5D_t2897418192* value)
{
___slot_bitmap_thread_3 = value;
Il2CppCodeGenWriteBarrier((&___slot_bitmap_thread_3), value);
}
inline static int32_t get_offset_of_slot_bitmap_context_4() { return static_cast<int32_t>(offsetof(LocalDataStoreSlot_t740841968_StaticFields, ___slot_bitmap_context_4)); }
inline BooleanU5BU5D_t2897418192* get_slot_bitmap_context_4() const { return ___slot_bitmap_context_4; }
inline BooleanU5BU5D_t2897418192** get_address_of_slot_bitmap_context_4() { return &___slot_bitmap_context_4; }
inline void set_slot_bitmap_context_4(BooleanU5BU5D_t2897418192* value)
{
___slot_bitmap_context_4 = value;
Il2CppCodeGenWriteBarrier((&___slot_bitmap_context_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LOCALDATASTORESLOT_T740841968_H
#ifndef MARSHALBYREFOBJECT_T2760389100_H
#define MARSHALBYREFOBJECT_T2760389100_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MarshalByRefObject
struct MarshalByRefObject_t2760389100 : public RuntimeObject
{
public:
// System.Runtime.Remoting.ServerIdentity System.MarshalByRefObject::_identity
ServerIdentity_t2342208608 * ____identity_0;
public:
inline static int32_t get_offset_of__identity_0() { return static_cast<int32_t>(offsetof(MarshalByRefObject_t2760389100, ____identity_0)); }
inline ServerIdentity_t2342208608 * get__identity_0() const { return ____identity_0; }
inline ServerIdentity_t2342208608 ** get_address_of__identity_0() { return &____identity_0; }
inline void set__identity_0(ServerIdentity_t2342208608 * value)
{
____identity_0 = value;
Il2CppCodeGenWriteBarrier((&____identity_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MARSHALBYREFOBJECT_T2760389100_H
#ifndef MATH_T1671470975_H
#define MATH_T1671470975_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Math
struct Math_t1671470975 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MATH_T1671470975_H
#ifndef MONOCUSTOMATTRS_T3634537737_H
#define MONOCUSTOMATTRS_T3634537737_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoCustomAttrs
struct MonoCustomAttrs_t3634537737 : public RuntimeObject
{
public:
public:
};
struct MonoCustomAttrs_t3634537737_StaticFields
{
public:
// System.Reflection.Assembly System.MonoCustomAttrs::corlib
Assembly_t * ___corlib_0;
// System.Type System.MonoCustomAttrs::AttributeUsageType
Type_t * ___AttributeUsageType_1;
// System.AttributeUsageAttribute System.MonoCustomAttrs::DefaultAttributeUsage
AttributeUsageAttribute_t290877318 * ___DefaultAttributeUsage_2;
public:
inline static int32_t get_offset_of_corlib_0() { return static_cast<int32_t>(offsetof(MonoCustomAttrs_t3634537737_StaticFields, ___corlib_0)); }
inline Assembly_t * get_corlib_0() const { return ___corlib_0; }
inline Assembly_t ** get_address_of_corlib_0() { return &___corlib_0; }
inline void set_corlib_0(Assembly_t * value)
{
___corlib_0 = value;
Il2CppCodeGenWriteBarrier((&___corlib_0), value);
}
inline static int32_t get_offset_of_AttributeUsageType_1() { return static_cast<int32_t>(offsetof(MonoCustomAttrs_t3634537737_StaticFields, ___AttributeUsageType_1)); }
inline Type_t * get_AttributeUsageType_1() const { return ___AttributeUsageType_1; }
inline Type_t ** get_address_of_AttributeUsageType_1() { return &___AttributeUsageType_1; }
inline void set_AttributeUsageType_1(Type_t * value)
{
___AttributeUsageType_1 = value;
Il2CppCodeGenWriteBarrier((&___AttributeUsageType_1), value);
}
inline static int32_t get_offset_of_DefaultAttributeUsage_2() { return static_cast<int32_t>(offsetof(MonoCustomAttrs_t3634537737_StaticFields, ___DefaultAttributeUsage_2)); }
inline AttributeUsageAttribute_t290877318 * get_DefaultAttributeUsage_2() const { return ___DefaultAttributeUsage_2; }
inline AttributeUsageAttribute_t290877318 ** get_address_of_DefaultAttributeUsage_2() { return &___DefaultAttributeUsage_2; }
inline void set_DefaultAttributeUsage_2(AttributeUsageAttribute_t290877318 * value)
{
___DefaultAttributeUsage_2 = value;
Il2CppCodeGenWriteBarrier((&___DefaultAttributeUsage_2), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MONOCUSTOMATTRS_T3634537737_H
#ifndef ATTRIBUTEINFO_T2216804170_H
#define ATTRIBUTEINFO_T2216804170_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoCustomAttrs/AttributeInfo
struct AttributeInfo_t2216804170 : public RuntimeObject
{
public:
// System.AttributeUsageAttribute System.MonoCustomAttrs/AttributeInfo::_usage
AttributeUsageAttribute_t290877318 * ____usage_0;
// System.Int32 System.MonoCustomAttrs/AttributeInfo::_inheritanceLevel
int32_t ____inheritanceLevel_1;
public:
inline static int32_t get_offset_of__usage_0() { return static_cast<int32_t>(offsetof(AttributeInfo_t2216804170, ____usage_0)); }
inline AttributeUsageAttribute_t290877318 * get__usage_0() const { return ____usage_0; }
inline AttributeUsageAttribute_t290877318 ** get_address_of__usage_0() { return &____usage_0; }
inline void set__usage_0(AttributeUsageAttribute_t290877318 * value)
{
____usage_0 = value;
Il2CppCodeGenWriteBarrier((&____usage_0), value);
}
inline static int32_t get_offset_of__inheritanceLevel_1() { return static_cast<int32_t>(offsetof(AttributeInfo_t2216804170, ____inheritanceLevel_1)); }
inline int32_t get__inheritanceLevel_1() const { return ____inheritanceLevel_1; }
inline int32_t* get_address_of__inheritanceLevel_1() { return &____inheritanceLevel_1; }
inline void set__inheritanceLevel_1(int32_t value)
{
____inheritanceLevel_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ATTRIBUTEINFO_T2216804170_H
#ifndef INTCOMPARER_T3812095803_H
#define INTCOMPARER_T3812095803_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoEnumInfo/IntComparer
struct IntComparer_t3812095803 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTCOMPARER_T3812095803_H
#ifndef LONGCOMPARER_T1798269597_H
#define LONGCOMPARER_T1798269597_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoEnumInfo/LongComparer
struct LongComparer_t1798269597 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LONGCOMPARER_T1798269597_H
#ifndef SBYTECOMPARER_T2329725001_H
#define SBYTECOMPARER_T2329725001_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoEnumInfo/SByteComparer
struct SByteComparer_t2329725001 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SBYTECOMPARER_T2329725001_H
#ifndef SHORTCOMPARER_T2253094562_H
#define SHORTCOMPARER_T2253094562_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoEnumInfo/ShortComparer
struct ShortComparer_t2253094562 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SHORTCOMPARER_T2253094562_H
#ifndef MONOTOUCHAOTHELPER_T570977590_H
#define MONOTOUCHAOTHELPER_T570977590_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoTouchAOTHelper
struct MonoTouchAOTHelper_t570977590 : public RuntimeObject
{
public:
public:
};
struct MonoTouchAOTHelper_t570977590_StaticFields
{
public:
// System.Boolean System.MonoTouchAOTHelper::FalseFlag
bool ___FalseFlag_0;
public:
inline static int32_t get_offset_of_FalseFlag_0() { return static_cast<int32_t>(offsetof(MonoTouchAOTHelper_t570977590_StaticFields, ___FalseFlag_0)); }
inline bool get_FalseFlag_0() const { return ___FalseFlag_0; }
inline bool* get_address_of_FalseFlag_0() { return &___FalseFlag_0; }
inline void set_FalseFlag_0(bool value)
{
___FalseFlag_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MONOTOUCHAOTHELPER_T570977590_H
#ifndef MONOTYPEINFO_T3366989025_H
#define MONOTYPEINFO_T3366989025_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoTypeInfo
struct MonoTypeInfo_t3366989025 : public RuntimeObject
{
public:
// System.String System.MonoTypeInfo::full_name
String_t* ___full_name_0;
// System.Reflection.ConstructorInfo System.MonoTypeInfo::default_ctor
ConstructorInfo_t5769829 * ___default_ctor_1;
public:
inline static int32_t get_offset_of_full_name_0() { return static_cast<int32_t>(offsetof(MonoTypeInfo_t3366989025, ___full_name_0)); }
inline String_t* get_full_name_0() const { return ___full_name_0; }
inline String_t** get_address_of_full_name_0() { return &___full_name_0; }
inline void set_full_name_0(String_t* value)
{
___full_name_0 = value;
Il2CppCodeGenWriteBarrier((&___full_name_0), value);
}
inline static int32_t get_offset_of_default_ctor_1() { return static_cast<int32_t>(offsetof(MonoTypeInfo_t3366989025, ___default_ctor_1)); }
inline ConstructorInfo_t5769829 * get_default_ctor_1() const { return ___default_ctor_1; }
inline ConstructorInfo_t5769829 ** get_address_of_default_ctor_1() { return &___default_ctor_1; }
inline void set_default_ctor_1(ConstructorInfo_t5769829 * value)
{
___default_ctor_1 = value;
Il2CppCodeGenWriteBarrier((&___default_ctor_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MONOTYPEINFO_T3366989025_H
#ifndef CRITICALFINALIZEROBJECT_T701527852_H
#define CRITICALFINALIZEROBJECT_T701527852_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.ConstrainedExecution.CriticalFinalizerObject
struct CriticalFinalizerObject_t701527852 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CRITICALFINALIZEROBJECT_T701527852_H
#ifndef DECODER_T2204182725_H
#define DECODER_T2204182725_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.Decoder
struct Decoder_t2204182725 : public RuntimeObject
{
public:
// System.Text.DecoderFallback System.Text.Decoder::fallback
DecoderFallback_t3123823036 * ___fallback_0;
// System.Text.DecoderFallbackBuffer System.Text.Decoder::fallback_buffer
DecoderFallbackBuffer_t2402303981 * ___fallback_buffer_1;
public:
inline static int32_t get_offset_of_fallback_0() { return static_cast<int32_t>(offsetof(Decoder_t2204182725, ___fallback_0)); }
inline DecoderFallback_t3123823036 * get_fallback_0() const { return ___fallback_0; }
inline DecoderFallback_t3123823036 ** get_address_of_fallback_0() { return &___fallback_0; }
inline void set_fallback_0(DecoderFallback_t3123823036 * value)
{
___fallback_0 = value;
Il2CppCodeGenWriteBarrier((&___fallback_0), value);
}
inline static int32_t get_offset_of_fallback_buffer_1() { return static_cast<int32_t>(offsetof(Decoder_t2204182725, ___fallback_buffer_1)); }
inline DecoderFallbackBuffer_t2402303981 * get_fallback_buffer_1() const { return ___fallback_buffer_1; }
inline DecoderFallbackBuffer_t2402303981 ** get_address_of_fallback_buffer_1() { return &___fallback_buffer_1; }
inline void set_fallback_buffer_1(DecoderFallbackBuffer_t2402303981 * value)
{
___fallback_buffer_1 = value;
Il2CppCodeGenWriteBarrier((&___fallback_buffer_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DECODER_T2204182725_H
#ifndef ENCODING_T1523322056_H
#define ENCODING_T1523322056_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.Encoding
struct Encoding_t1523322056 : public RuntimeObject
{
public:
// System.Int32 System.Text.Encoding::codePage
int32_t ___codePage_0;
// System.Int32 System.Text.Encoding::windows_code_page
int32_t ___windows_code_page_1;
// System.Boolean System.Text.Encoding::is_readonly
bool ___is_readonly_2;
// System.Text.DecoderFallback System.Text.Encoding::decoder_fallback
DecoderFallback_t3123823036 * ___decoder_fallback_3;
// System.Text.EncoderFallback System.Text.Encoding::encoder_fallback
EncoderFallback_t1188251036 * ___encoder_fallback_4;
// System.String System.Text.Encoding::body_name
String_t* ___body_name_8;
// System.String System.Text.Encoding::encoding_name
String_t* ___encoding_name_9;
// System.String System.Text.Encoding::header_name
String_t* ___header_name_10;
// System.Boolean System.Text.Encoding::is_mail_news_display
bool ___is_mail_news_display_11;
// System.Boolean System.Text.Encoding::is_mail_news_save
bool ___is_mail_news_save_12;
// System.Boolean System.Text.Encoding::is_browser_save
bool ___is_browser_save_13;
// System.Boolean System.Text.Encoding::is_browser_display
bool ___is_browser_display_14;
// System.String System.Text.Encoding::web_name
String_t* ___web_name_15;
public:
inline static int32_t get_offset_of_codePage_0() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___codePage_0)); }
inline int32_t get_codePage_0() const { return ___codePage_0; }
inline int32_t* get_address_of_codePage_0() { return &___codePage_0; }
inline void set_codePage_0(int32_t value)
{
___codePage_0 = value;
}
inline static int32_t get_offset_of_windows_code_page_1() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___windows_code_page_1)); }
inline int32_t get_windows_code_page_1() const { return ___windows_code_page_1; }
inline int32_t* get_address_of_windows_code_page_1() { return &___windows_code_page_1; }
inline void set_windows_code_page_1(int32_t value)
{
___windows_code_page_1 = value;
}
inline static int32_t get_offset_of_is_readonly_2() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___is_readonly_2)); }
inline bool get_is_readonly_2() const { return ___is_readonly_2; }
inline bool* get_address_of_is_readonly_2() { return &___is_readonly_2; }
inline void set_is_readonly_2(bool value)
{
___is_readonly_2 = value;
}
inline static int32_t get_offset_of_decoder_fallback_3() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___decoder_fallback_3)); }
inline DecoderFallback_t3123823036 * get_decoder_fallback_3() const { return ___decoder_fallback_3; }
inline DecoderFallback_t3123823036 ** get_address_of_decoder_fallback_3() { return &___decoder_fallback_3; }
inline void set_decoder_fallback_3(DecoderFallback_t3123823036 * value)
{
___decoder_fallback_3 = value;
Il2CppCodeGenWriteBarrier((&___decoder_fallback_3), value);
}
inline static int32_t get_offset_of_encoder_fallback_4() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___encoder_fallback_4)); }
inline EncoderFallback_t1188251036 * get_encoder_fallback_4() const { return ___encoder_fallback_4; }
inline EncoderFallback_t1188251036 ** get_address_of_encoder_fallback_4() { return &___encoder_fallback_4; }
inline void set_encoder_fallback_4(EncoderFallback_t1188251036 * value)
{
___encoder_fallback_4 = value;
Il2CppCodeGenWriteBarrier((&___encoder_fallback_4), value);
}
inline static int32_t get_offset_of_body_name_8() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___body_name_8)); }
inline String_t* get_body_name_8() const { return ___body_name_8; }
inline String_t** get_address_of_body_name_8() { return &___body_name_8; }
inline void set_body_name_8(String_t* value)
{
___body_name_8 = value;
Il2CppCodeGenWriteBarrier((&___body_name_8), value);
}
inline static int32_t get_offset_of_encoding_name_9() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___encoding_name_9)); }
inline String_t* get_encoding_name_9() const { return ___encoding_name_9; }
inline String_t** get_address_of_encoding_name_9() { return &___encoding_name_9; }
inline void set_encoding_name_9(String_t* value)
{
___encoding_name_9 = value;
Il2CppCodeGenWriteBarrier((&___encoding_name_9), value);
}
inline static int32_t get_offset_of_header_name_10() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___header_name_10)); }
inline String_t* get_header_name_10() const { return ___header_name_10; }
inline String_t** get_address_of_header_name_10() { return &___header_name_10; }
inline void set_header_name_10(String_t* value)
{
___header_name_10 = value;
Il2CppCodeGenWriteBarrier((&___header_name_10), value);
}
inline static int32_t get_offset_of_is_mail_news_display_11() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___is_mail_news_display_11)); }
inline bool get_is_mail_news_display_11() const { return ___is_mail_news_display_11; }
inline bool* get_address_of_is_mail_news_display_11() { return &___is_mail_news_display_11; }
inline void set_is_mail_news_display_11(bool value)
{
___is_mail_news_display_11 = value;
}
inline static int32_t get_offset_of_is_mail_news_save_12() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___is_mail_news_save_12)); }
inline bool get_is_mail_news_save_12() const { return ___is_mail_news_save_12; }
inline bool* get_address_of_is_mail_news_save_12() { return &___is_mail_news_save_12; }
inline void set_is_mail_news_save_12(bool value)
{
___is_mail_news_save_12 = value;
}
inline static int32_t get_offset_of_is_browser_save_13() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___is_browser_save_13)); }
inline bool get_is_browser_save_13() const { return ___is_browser_save_13; }
inline bool* get_address_of_is_browser_save_13() { return &___is_browser_save_13; }
inline void set_is_browser_save_13(bool value)
{
___is_browser_save_13 = value;
}
inline static int32_t get_offset_of_is_browser_display_14() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___is_browser_display_14)); }
inline bool get_is_browser_display_14() const { return ___is_browser_display_14; }
inline bool* get_address_of_is_browser_display_14() { return &___is_browser_display_14; }
inline void set_is_browser_display_14(bool value)
{
___is_browser_display_14 = value;
}
inline static int32_t get_offset_of_web_name_15() { return static_cast<int32_t>(offsetof(Encoding_t1523322056, ___web_name_15)); }
inline String_t* get_web_name_15() const { return ___web_name_15; }
inline String_t** get_address_of_web_name_15() { return &___web_name_15; }
inline void set_web_name_15(String_t* value)
{
___web_name_15 = value;
Il2CppCodeGenWriteBarrier((&___web_name_15), value);
}
};
struct Encoding_t1523322056_StaticFields
{
public:
// System.Reflection.Assembly System.Text.Encoding::i18nAssembly
Assembly_t * ___i18nAssembly_5;
// System.Boolean System.Text.Encoding::i18nDisabled
bool ___i18nDisabled_6;
// System.Object[] System.Text.Encoding::encodings
ObjectU5BU5D_t2843939325* ___encodings_7;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::asciiEncoding
Encoding_t1523322056 * ___asciiEncoding_16;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::bigEndianEncoding
Encoding_t1523322056 * ___bigEndianEncoding_17;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::defaultEncoding
Encoding_t1523322056 * ___defaultEncoding_18;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::utf7Encoding
Encoding_t1523322056 * ___utf7Encoding_19;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::utf8EncodingWithMarkers
Encoding_t1523322056 * ___utf8EncodingWithMarkers_20;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::utf8EncodingWithoutMarkers
Encoding_t1523322056 * ___utf8EncodingWithoutMarkers_21;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::unicodeEncoding
Encoding_t1523322056 * ___unicodeEncoding_22;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::isoLatin1Encoding
Encoding_t1523322056 * ___isoLatin1Encoding_23;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::utf8EncodingUnsafe
Encoding_t1523322056 * ___utf8EncodingUnsafe_24;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::utf32Encoding
Encoding_t1523322056 * ___utf32Encoding_25;
// System.Text.Encoding modreq(System.Runtime.CompilerServices.IsVolatile) System.Text.Encoding::bigEndianUTF32Encoding
Encoding_t1523322056 * ___bigEndianUTF32Encoding_26;
// System.Object System.Text.Encoding::lockobj
RuntimeObject * ___lockobj_27;
public:
inline static int32_t get_offset_of_i18nAssembly_5() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___i18nAssembly_5)); }
inline Assembly_t * get_i18nAssembly_5() const { return ___i18nAssembly_5; }
inline Assembly_t ** get_address_of_i18nAssembly_5() { return &___i18nAssembly_5; }
inline void set_i18nAssembly_5(Assembly_t * value)
{
___i18nAssembly_5 = value;
Il2CppCodeGenWriteBarrier((&___i18nAssembly_5), value);
}
inline static int32_t get_offset_of_i18nDisabled_6() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___i18nDisabled_6)); }
inline bool get_i18nDisabled_6() const { return ___i18nDisabled_6; }
inline bool* get_address_of_i18nDisabled_6() { return &___i18nDisabled_6; }
inline void set_i18nDisabled_6(bool value)
{
___i18nDisabled_6 = value;
}
inline static int32_t get_offset_of_encodings_7() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___encodings_7)); }
inline ObjectU5BU5D_t2843939325* get_encodings_7() const { return ___encodings_7; }
inline ObjectU5BU5D_t2843939325** get_address_of_encodings_7() { return &___encodings_7; }
inline void set_encodings_7(ObjectU5BU5D_t2843939325* value)
{
___encodings_7 = value;
Il2CppCodeGenWriteBarrier((&___encodings_7), value);
}
inline static int32_t get_offset_of_asciiEncoding_16() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___asciiEncoding_16)); }
inline Encoding_t1523322056 * get_asciiEncoding_16() const { return ___asciiEncoding_16; }
inline Encoding_t1523322056 ** get_address_of_asciiEncoding_16() { return &___asciiEncoding_16; }
inline void set_asciiEncoding_16(Encoding_t1523322056 * value)
{
___asciiEncoding_16 = value;
Il2CppCodeGenWriteBarrier((&___asciiEncoding_16), value);
}
inline static int32_t get_offset_of_bigEndianEncoding_17() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___bigEndianEncoding_17)); }
inline Encoding_t1523322056 * get_bigEndianEncoding_17() const { return ___bigEndianEncoding_17; }
inline Encoding_t1523322056 ** get_address_of_bigEndianEncoding_17() { return &___bigEndianEncoding_17; }
inline void set_bigEndianEncoding_17(Encoding_t1523322056 * value)
{
___bigEndianEncoding_17 = value;
Il2CppCodeGenWriteBarrier((&___bigEndianEncoding_17), value);
}
inline static int32_t get_offset_of_defaultEncoding_18() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___defaultEncoding_18)); }
inline Encoding_t1523322056 * get_defaultEncoding_18() const { return ___defaultEncoding_18; }
inline Encoding_t1523322056 ** get_address_of_defaultEncoding_18() { return &___defaultEncoding_18; }
inline void set_defaultEncoding_18(Encoding_t1523322056 * value)
{
___defaultEncoding_18 = value;
Il2CppCodeGenWriteBarrier((&___defaultEncoding_18), value);
}
inline static int32_t get_offset_of_utf7Encoding_19() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___utf7Encoding_19)); }
inline Encoding_t1523322056 * get_utf7Encoding_19() const { return ___utf7Encoding_19; }
inline Encoding_t1523322056 ** get_address_of_utf7Encoding_19() { return &___utf7Encoding_19; }
inline void set_utf7Encoding_19(Encoding_t1523322056 * value)
{
___utf7Encoding_19 = value;
Il2CppCodeGenWriteBarrier((&___utf7Encoding_19), value);
}
inline static int32_t get_offset_of_utf8EncodingWithMarkers_20() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___utf8EncodingWithMarkers_20)); }
inline Encoding_t1523322056 * get_utf8EncodingWithMarkers_20() const { return ___utf8EncodingWithMarkers_20; }
inline Encoding_t1523322056 ** get_address_of_utf8EncodingWithMarkers_20() { return &___utf8EncodingWithMarkers_20; }
inline void set_utf8EncodingWithMarkers_20(Encoding_t1523322056 * value)
{
___utf8EncodingWithMarkers_20 = value;
Il2CppCodeGenWriteBarrier((&___utf8EncodingWithMarkers_20), value);
}
inline static int32_t get_offset_of_utf8EncodingWithoutMarkers_21() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___utf8EncodingWithoutMarkers_21)); }
inline Encoding_t1523322056 * get_utf8EncodingWithoutMarkers_21() const { return ___utf8EncodingWithoutMarkers_21; }
inline Encoding_t1523322056 ** get_address_of_utf8EncodingWithoutMarkers_21() { return &___utf8EncodingWithoutMarkers_21; }
inline void set_utf8EncodingWithoutMarkers_21(Encoding_t1523322056 * value)
{
___utf8EncodingWithoutMarkers_21 = value;
Il2CppCodeGenWriteBarrier((&___utf8EncodingWithoutMarkers_21), value);
}
inline static int32_t get_offset_of_unicodeEncoding_22() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___unicodeEncoding_22)); }
inline Encoding_t1523322056 * get_unicodeEncoding_22() const { return ___unicodeEncoding_22; }
inline Encoding_t1523322056 ** get_address_of_unicodeEncoding_22() { return &___unicodeEncoding_22; }
inline void set_unicodeEncoding_22(Encoding_t1523322056 * value)
{
___unicodeEncoding_22 = value;
Il2CppCodeGenWriteBarrier((&___unicodeEncoding_22), value);
}
inline static int32_t get_offset_of_isoLatin1Encoding_23() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___isoLatin1Encoding_23)); }
inline Encoding_t1523322056 * get_isoLatin1Encoding_23() const { return ___isoLatin1Encoding_23; }
inline Encoding_t1523322056 ** get_address_of_isoLatin1Encoding_23() { return &___isoLatin1Encoding_23; }
inline void set_isoLatin1Encoding_23(Encoding_t1523322056 * value)
{
___isoLatin1Encoding_23 = value;
Il2CppCodeGenWriteBarrier((&___isoLatin1Encoding_23), value);
}
inline static int32_t get_offset_of_utf8EncodingUnsafe_24() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___utf8EncodingUnsafe_24)); }
inline Encoding_t1523322056 * get_utf8EncodingUnsafe_24() const { return ___utf8EncodingUnsafe_24; }
inline Encoding_t1523322056 ** get_address_of_utf8EncodingUnsafe_24() { return &___utf8EncodingUnsafe_24; }
inline void set_utf8EncodingUnsafe_24(Encoding_t1523322056 * value)
{
___utf8EncodingUnsafe_24 = value;
Il2CppCodeGenWriteBarrier((&___utf8EncodingUnsafe_24), value);
}
inline static int32_t get_offset_of_utf32Encoding_25() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___utf32Encoding_25)); }
inline Encoding_t1523322056 * get_utf32Encoding_25() const { return ___utf32Encoding_25; }
inline Encoding_t1523322056 ** get_address_of_utf32Encoding_25() { return &___utf32Encoding_25; }
inline void set_utf32Encoding_25(Encoding_t1523322056 * value)
{
___utf32Encoding_25 = value;
Il2CppCodeGenWriteBarrier((&___utf32Encoding_25), value);
}
inline static int32_t get_offset_of_bigEndianUTF32Encoding_26() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___bigEndianUTF32Encoding_26)); }
inline Encoding_t1523322056 * get_bigEndianUTF32Encoding_26() const { return ___bigEndianUTF32Encoding_26; }
inline Encoding_t1523322056 ** get_address_of_bigEndianUTF32Encoding_26() { return &___bigEndianUTF32Encoding_26; }
inline void set_bigEndianUTF32Encoding_26(Encoding_t1523322056 * value)
{
___bigEndianUTF32Encoding_26 = value;
Il2CppCodeGenWriteBarrier((&___bigEndianUTF32Encoding_26), value);
}
inline static int32_t get_offset_of_lockobj_27() { return static_cast<int32_t>(offsetof(Encoding_t1523322056_StaticFields, ___lockobj_27)); }
inline RuntimeObject * get_lockobj_27() const { return ___lockobj_27; }
inline RuntimeObject ** get_address_of_lockobj_27() { return &___lockobj_27; }
inline void set_lockobj_27(RuntimeObject * value)
{
___lockobj_27 = value;
Il2CppCodeGenWriteBarrier((&___lockobj_27), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ENCODING_T1523322056_H
#ifndef STRINGBUILDER_T_H
#define STRINGBUILDER_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.StringBuilder
struct StringBuilder_t : public RuntimeObject
{
public:
// System.Int32 System.Text.StringBuilder::_length
int32_t ____length_1;
// System.String System.Text.StringBuilder::_str
String_t* ____str_2;
// System.String System.Text.StringBuilder::_cached_str
String_t* ____cached_str_3;
// System.Int32 System.Text.StringBuilder::_maxCapacity
int32_t ____maxCapacity_4;
public:
inline static int32_t get_offset_of__length_1() { return static_cast<int32_t>(offsetof(StringBuilder_t, ____length_1)); }
inline int32_t get__length_1() const { return ____length_1; }
inline int32_t* get_address_of__length_1() { return &____length_1; }
inline void set__length_1(int32_t value)
{
____length_1 = value;
}
inline static int32_t get_offset_of__str_2() { return static_cast<int32_t>(offsetof(StringBuilder_t, ____str_2)); }
inline String_t* get__str_2() const { return ____str_2; }
inline String_t** get_address_of__str_2() { return &____str_2; }
inline void set__str_2(String_t* value)
{
____str_2 = value;
Il2CppCodeGenWriteBarrier((&____str_2), value);
}
inline static int32_t get_offset_of__cached_str_3() { return static_cast<int32_t>(offsetof(StringBuilder_t, ____cached_str_3)); }
inline String_t* get__cached_str_3() const { return ____cached_str_3; }
inline String_t** get_address_of__cached_str_3() { return &____cached_str_3; }
inline void set__cached_str_3(String_t* value)
{
____cached_str_3 = value;
Il2CppCodeGenWriteBarrier((&____cached_str_3), value);
}
inline static int32_t get_offset_of__maxCapacity_4() { return static_cast<int32_t>(offsetof(StringBuilder_t, ____maxCapacity_4)); }
inline int32_t get__maxCapacity_4() const { return ____maxCapacity_4; }
inline int32_t* get_address_of__maxCapacity_4() { return &____maxCapacity_4; }
inline void set__maxCapacity_4(int32_t value)
{
____maxCapacity_4 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // STRINGBUILDER_T_H
#ifndef COMPRESSEDSTACK_T1202932761_H
#define COMPRESSEDSTACK_T1202932761_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.CompressedStack
struct CompressedStack_t1202932761 : public RuntimeObject
{
public:
// System.Collections.ArrayList System.Threading.CompressedStack::_list
ArrayList_t2718874744 * ____list_0;
public:
inline static int32_t get_offset_of__list_0() { return static_cast<int32_t>(offsetof(CompressedStack_t1202932761, ____list_0)); }
inline ArrayList_t2718874744 * get__list_0() const { return ____list_0; }
inline ArrayList_t2718874744 ** get_address_of__list_0() { return &____list_0; }
inline void set__list_0(ArrayList_t2718874744 * value)
{
____list_0 = value;
Il2CppCodeGenWriteBarrier((&____list_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMPRESSEDSTACK_T1202932761_H
#ifndef EXECUTIONCONTEXT_T1748372627_H
#define EXECUTIONCONTEXT_T1748372627_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.ExecutionContext
struct ExecutionContext_t1748372627 : public RuntimeObject
{
public:
// System.Security.SecurityContext System.Threading.ExecutionContext::_sc
SecurityContext_t2435442044 * ____sc_0;
// System.Boolean System.Threading.ExecutionContext::_suppressFlow
bool ____suppressFlow_1;
// System.Boolean System.Threading.ExecutionContext::_capture
bool ____capture_2;
public:
inline static int32_t get_offset_of__sc_0() { return static_cast<int32_t>(offsetof(ExecutionContext_t1748372627, ____sc_0)); }
inline SecurityContext_t2435442044 * get__sc_0() const { return ____sc_0; }
inline SecurityContext_t2435442044 ** get_address_of__sc_0() { return &____sc_0; }
inline void set__sc_0(SecurityContext_t2435442044 * value)
{
____sc_0 = value;
Il2CppCodeGenWriteBarrier((&____sc_0), value);
}
inline static int32_t get_offset_of__suppressFlow_1() { return static_cast<int32_t>(offsetof(ExecutionContext_t1748372627, ____suppressFlow_1)); }
inline bool get__suppressFlow_1() const { return ____suppressFlow_1; }
inline bool* get_address_of__suppressFlow_1() { return &____suppressFlow_1; }
inline void set__suppressFlow_1(bool value)
{
____suppressFlow_1 = value;
}
inline static int32_t get_offset_of__capture_2() { return static_cast<int32_t>(offsetof(ExecutionContext_t1748372627, ____capture_2)); }
inline bool get__capture_2() const { return ____capture_2; }
inline bool* get_address_of__capture_2() { return &____capture_2; }
inline void set__capture_2(bool value)
{
____capture_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EXECUTIONCONTEXT_T1748372627_H
#ifndef INTERLOCKED_T2273387594_H
#define INTERLOCKED_T2273387594_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Interlocked
struct Interlocked_t2273387594 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTERLOCKED_T2273387594_H
#ifndef MONITOR_T2197244473_H
#define MONITOR_T2197244473_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Monitor
struct Monitor_t2197244473 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MONITOR_T2197244473_H
#ifndef NATIVEEVENTCALLS_T570794723_H
#define NATIVEEVENTCALLS_T570794723_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.NativeEventCalls
struct NativeEventCalls_t570794723 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // NATIVEEVENTCALLS_T570794723_H
#ifndef SYNCHRONIZATIONCONTEXT_T2326897723_H
#define SYNCHRONIZATIONCONTEXT_T2326897723_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.SynchronizationContext
struct SynchronizationContext_t2326897723 : public RuntimeObject
{
public:
public:
};
struct SynchronizationContext_t2326897723_ThreadStaticFields
{
public:
// System.Threading.SynchronizationContext System.Threading.SynchronizationContext::currentContext
SynchronizationContext_t2326897723 * ___currentContext_0;
public:
inline static int32_t get_offset_of_currentContext_0() { return static_cast<int32_t>(offsetof(SynchronizationContext_t2326897723_ThreadStaticFields, ___currentContext_0)); }
inline SynchronizationContext_t2326897723 * get_currentContext_0() const { return ___currentContext_0; }
inline SynchronizationContext_t2326897723 ** get_address_of_currentContext_0() { return &___currentContext_0; }
inline void set_currentContext_0(SynchronizationContext_t2326897723 * value)
{
___currentContext_0 = value;
Il2CppCodeGenWriteBarrier((&___currentContext_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SYNCHRONIZATIONCONTEXT_T2326897723_H
#ifndef THREADPOOL_T2177989550_H
#define THREADPOOL_T2177989550_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.ThreadPool
struct ThreadPool_t2177989550 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // THREADPOOL_T2177989550_H
#ifndef SCHEDULER_T3215764947_H
#define SCHEDULER_T3215764947_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Timer/Scheduler
struct Scheduler_t3215764947 : public RuntimeObject
{
public:
// System.Collections.SortedList System.Threading.Timer/Scheduler::list
SortedList_t2427694641 * ___list_1;
public:
inline static int32_t get_offset_of_list_1() { return static_cast<int32_t>(offsetof(Scheduler_t3215764947, ___list_1)); }
inline SortedList_t2427694641 * get_list_1() const { return ___list_1; }
inline SortedList_t2427694641 ** get_address_of_list_1() { return &___list_1; }
inline void set_list_1(SortedList_t2427694641 * value)
{
___list_1 = value;
Il2CppCodeGenWriteBarrier((&___list_1), value);
}
};
struct Scheduler_t3215764947_StaticFields
{
public:
// System.Threading.Timer/Scheduler System.Threading.Timer/Scheduler::instance
Scheduler_t3215764947 * ___instance_0;
public:
inline static int32_t get_offset_of_instance_0() { return static_cast<int32_t>(offsetof(Scheduler_t3215764947_StaticFields, ___instance_0)); }
inline Scheduler_t3215764947 * get_instance_0() const { return ___instance_0; }
inline Scheduler_t3215764947 ** get_address_of_instance_0() { return &___instance_0; }
inline void set_instance_0(Scheduler_t3215764947 * value)
{
___instance_0 = value;
Il2CppCodeGenWriteBarrier((&___instance_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SCHEDULER_T3215764947_H
#ifndef TIMERCOMPARER_T2774265395_H
#define TIMERCOMPARER_T2774265395_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Timer/TimerComparer
struct TimerComparer_t2774265395 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TIMERCOMPARER_T2774265395_H
#ifndef VALUETYPE_T3640485471_H
#define VALUETYPE_T3640485471_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ValueType
struct ValueType_t3640485471 : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t3640485471_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t3640485471_marshaled_com
{
};
#endif // VALUETYPE_T3640485471_H
#ifndef APPDOMAINMANAGER_T1420869192_H
#define APPDOMAINMANAGER_T1420869192_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.AppDomainManager
struct AppDomainManager_t1420869192 : public MarshalByRefObject_t2760389100
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // APPDOMAINMANAGER_T1420869192_H
#ifndef APPLICATIONEXCEPTION_T2339761290_H
#define APPLICATIONEXCEPTION_T2339761290_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ApplicationException
struct ApplicationException_t2339761290 : public Exception_t
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // APPLICATIONEXCEPTION_T2339761290_H
#ifndef ASSEMBLYLOADEVENTARGS_T2792010465_H
#define ASSEMBLYLOADEVENTARGS_T2792010465_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.AssemblyLoadEventArgs
struct AssemblyLoadEventArgs_t2792010465 : public EventArgs_t3591816995
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ASSEMBLYLOADEVENTARGS_T2792010465_H
#ifndef CONTEXTBOUNDOBJECT_T1394786030_H
#define CONTEXTBOUNDOBJECT_T1394786030_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ContextBoundObject
struct ContextBoundObject_t1394786030 : public MarshalByRefObject_t2760389100
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CONTEXTBOUNDOBJECT_T1394786030_H
#ifndef ENUM_T4135868527_H
#define ENUM_T4135868527_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Enum
struct Enum_t4135868527 : public ValueType_t3640485471
{
public:
public:
};
struct Enum_t4135868527_StaticFields
{
public:
// System.Char[] System.Enum::split_char
CharU5BU5D_t3528271667* ___split_char_0;
public:
inline static int32_t get_offset_of_split_char_0() { return static_cast<int32_t>(offsetof(Enum_t4135868527_StaticFields, ___split_char_0)); }
inline CharU5BU5D_t3528271667* get_split_char_0() const { return ___split_char_0; }
inline CharU5BU5D_t3528271667** get_address_of_split_char_0() { return &___split_char_0; }
inline void set_split_char_0(CharU5BU5D_t3528271667* value)
{
___split_char_0 = value;
Il2CppCodeGenWriteBarrier((&___split_char_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t4135868527_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t4135868527_marshaled_com
{
};
#endif // ENUM_T4135868527_H
#ifndef FLAGSATTRIBUTE_T2262502849_H
#define FLAGSATTRIBUTE_T2262502849_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.FlagsAttribute
struct FlagsAttribute_t2262502849 : public Attribute_t861562559
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FLAGSATTRIBUTE_T2262502849_H
#ifndef GUID_T_H
#define GUID_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Guid
struct Guid_t
{
public:
// System.Int32 System.Guid::_a
int32_t ____a_0;
// System.Int16 System.Guid::_b
int16_t ____b_1;
// System.Int16 System.Guid::_c
int16_t ____c_2;
// System.Byte System.Guid::_d
uint8_t ____d_3;
// System.Byte System.Guid::_e
uint8_t ____e_4;
// System.Byte System.Guid::_f
uint8_t ____f_5;
// System.Byte System.Guid::_g
uint8_t ____g_6;
// System.Byte System.Guid::_h
uint8_t ____h_7;
// System.Byte System.Guid::_i
uint8_t ____i_8;
// System.Byte System.Guid::_j
uint8_t ____j_9;
// System.Byte System.Guid::_k
uint8_t ____k_10;
public:
inline static int32_t get_offset_of__a_0() { return static_cast<int32_t>(offsetof(Guid_t, ____a_0)); }
inline int32_t get__a_0() const { return ____a_0; }
inline int32_t* get_address_of__a_0() { return &____a_0; }
inline void set__a_0(int32_t value)
{
____a_0 = value;
}
inline static int32_t get_offset_of__b_1() { return static_cast<int32_t>(offsetof(Guid_t, ____b_1)); }
inline int16_t get__b_1() const { return ____b_1; }
inline int16_t* get_address_of__b_1() { return &____b_1; }
inline void set__b_1(int16_t value)
{
____b_1 = value;
}
inline static int32_t get_offset_of__c_2() { return static_cast<int32_t>(offsetof(Guid_t, ____c_2)); }
inline int16_t get__c_2() const { return ____c_2; }
inline int16_t* get_address_of__c_2() { return &____c_2; }
inline void set__c_2(int16_t value)
{
____c_2 = value;
}
inline static int32_t get_offset_of__d_3() { return static_cast<int32_t>(offsetof(Guid_t, ____d_3)); }
inline uint8_t get__d_3() const { return ____d_3; }
inline uint8_t* get_address_of__d_3() { return &____d_3; }
inline void set__d_3(uint8_t value)
{
____d_3 = value;
}
inline static int32_t get_offset_of__e_4() { return static_cast<int32_t>(offsetof(Guid_t, ____e_4)); }
inline uint8_t get__e_4() const { return ____e_4; }
inline uint8_t* get_address_of__e_4() { return &____e_4; }
inline void set__e_4(uint8_t value)
{
____e_4 = value;
}
inline static int32_t get_offset_of__f_5() { return static_cast<int32_t>(offsetof(Guid_t, ____f_5)); }
inline uint8_t get__f_5() const { return ____f_5; }
inline uint8_t* get_address_of__f_5() { return &____f_5; }
inline void set__f_5(uint8_t value)
{
____f_5 = value;
}
inline static int32_t get_offset_of__g_6() { return static_cast<int32_t>(offsetof(Guid_t, ____g_6)); }
inline uint8_t get__g_6() const { return ____g_6; }
inline uint8_t* get_address_of__g_6() { return &____g_6; }
inline void set__g_6(uint8_t value)
{
____g_6 = value;
}
inline static int32_t get_offset_of__h_7() { return static_cast<int32_t>(offsetof(Guid_t, ____h_7)); }
inline uint8_t get__h_7() const { return ____h_7; }
inline uint8_t* get_address_of__h_7() { return &____h_7; }
inline void set__h_7(uint8_t value)
{
____h_7 = value;
}
inline static int32_t get_offset_of__i_8() { return static_cast<int32_t>(offsetof(Guid_t, ____i_8)); }
inline uint8_t get__i_8() const { return ____i_8; }
inline uint8_t* get_address_of__i_8() { return &____i_8; }
inline void set__i_8(uint8_t value)
{
____i_8 = value;
}
inline static int32_t get_offset_of__j_9() { return static_cast<int32_t>(offsetof(Guid_t, ____j_9)); }
inline uint8_t get__j_9() const { return ____j_9; }
inline uint8_t* get_address_of__j_9() { return &____j_9; }
inline void set__j_9(uint8_t value)
{
____j_9 = value;
}
inline static int32_t get_offset_of__k_10() { return static_cast<int32_t>(offsetof(Guid_t, ____k_10)); }
inline uint8_t get__k_10() const { return ____k_10; }
inline uint8_t* get_address_of__k_10() { return &____k_10; }
inline void set__k_10(uint8_t value)
{
____k_10 = value;
}
};
struct Guid_t_StaticFields
{
public:
// System.Guid System.Guid::Empty
Guid_t ___Empty_11;
// System.Object System.Guid::_rngAccess
RuntimeObject * ____rngAccess_12;
// System.Security.Cryptography.RandomNumberGenerator System.Guid::_rng
RandomNumberGenerator_t386037858 * ____rng_13;
// System.Security.Cryptography.RandomNumberGenerator System.Guid::_fastRng
RandomNumberGenerator_t386037858 * ____fastRng_14;
public:
inline static int32_t get_offset_of_Empty_11() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ___Empty_11)); }
inline Guid_t get_Empty_11() const { return ___Empty_11; }
inline Guid_t * get_address_of_Empty_11() { return &___Empty_11; }
inline void set_Empty_11(Guid_t value)
{
___Empty_11 = value;
}
inline static int32_t get_offset_of__rngAccess_12() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ____rngAccess_12)); }
inline RuntimeObject * get__rngAccess_12() const { return ____rngAccess_12; }
inline RuntimeObject ** get_address_of__rngAccess_12() { return &____rngAccess_12; }
inline void set__rngAccess_12(RuntimeObject * value)
{
____rngAccess_12 = value;
Il2CppCodeGenWriteBarrier((&____rngAccess_12), value);
}
inline static int32_t get_offset_of__rng_13() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ____rng_13)); }
inline RandomNumberGenerator_t386037858 * get__rng_13() const { return ____rng_13; }
inline RandomNumberGenerator_t386037858 ** get_address_of__rng_13() { return &____rng_13; }
inline void set__rng_13(RandomNumberGenerator_t386037858 * value)
{
____rng_13 = value;
Il2CppCodeGenWriteBarrier((&____rng_13), value);
}
inline static int32_t get_offset_of__fastRng_14() { return static_cast<int32_t>(offsetof(Guid_t_StaticFields, ____fastRng_14)); }
inline RandomNumberGenerator_t386037858 * get__fastRng_14() const { return ____fastRng_14; }
inline RandomNumberGenerator_t386037858 ** get_address_of__fastRng_14() { return &____fastRng_14; }
inline void set__fastRng_14(RandomNumberGenerator_t386037858 * value)
{
____fastRng_14 = value;
Il2CppCodeGenWriteBarrier((&____fastRng_14), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // GUID_T_H
#ifndef INT32_T2950945753_H
#define INT32_T2950945753_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Int32
struct Int32_t2950945753
{
public:
// System.Int32 System.Int32::m_value
int32_t ___m_value_2;
public:
inline static int32_t get_offset_of_m_value_2() { return static_cast<int32_t>(offsetof(Int32_t2950945753, ___m_value_2)); }
inline int32_t get_m_value_2() const { return ___m_value_2; }
inline int32_t* get_address_of_m_value_2() { return &___m_value_2; }
inline void set_m_value_2(int32_t value)
{
___m_value_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INT32_T2950945753_H
#ifndef INTPTR_T_H
#define INTPTR_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// 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;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INTPTR_T_H
#ifndef MONOENUMINFO_T3694469084_H
#define MONOENUMINFO_T3694469084_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoEnumInfo
struct MonoEnumInfo_t3694469084
{
public:
// System.Type System.MonoEnumInfo::utype
Type_t * ___utype_0;
// System.Array System.MonoEnumInfo::values
RuntimeArray * ___values_1;
// System.String[] System.MonoEnumInfo::names
StringU5BU5D_t1281789340* ___names_2;
// System.Collections.Hashtable System.MonoEnumInfo::name_hash
Hashtable_t1853889766 * ___name_hash_3;
public:
inline static int32_t get_offset_of_utype_0() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084, ___utype_0)); }
inline Type_t * get_utype_0() const { return ___utype_0; }
inline Type_t ** get_address_of_utype_0() { return &___utype_0; }
inline void set_utype_0(Type_t * value)
{
___utype_0 = value;
Il2CppCodeGenWriteBarrier((&___utype_0), value);
}
inline static int32_t get_offset_of_values_1() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084, ___values_1)); }
inline RuntimeArray * get_values_1() const { return ___values_1; }
inline RuntimeArray ** get_address_of_values_1() { return &___values_1; }
inline void set_values_1(RuntimeArray * value)
{
___values_1 = value;
Il2CppCodeGenWriteBarrier((&___values_1), value);
}
inline static int32_t get_offset_of_names_2() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084, ___names_2)); }
inline StringU5BU5D_t1281789340* get_names_2() const { return ___names_2; }
inline StringU5BU5D_t1281789340** get_address_of_names_2() { return &___names_2; }
inline void set_names_2(StringU5BU5D_t1281789340* value)
{
___names_2 = value;
Il2CppCodeGenWriteBarrier((&___names_2), value);
}
inline static int32_t get_offset_of_name_hash_3() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084, ___name_hash_3)); }
inline Hashtable_t1853889766 * get_name_hash_3() const { return ___name_hash_3; }
inline Hashtable_t1853889766 ** get_address_of_name_hash_3() { return &___name_hash_3; }
inline void set_name_hash_3(Hashtable_t1853889766 * value)
{
___name_hash_3 = value;
Il2CppCodeGenWriteBarrier((&___name_hash_3), value);
}
};
struct MonoEnumInfo_t3694469084_StaticFields
{
public:
// System.Collections.Hashtable System.MonoEnumInfo::global_cache
Hashtable_t1853889766 * ___global_cache_5;
// System.Object System.MonoEnumInfo::global_cache_monitor
RuntimeObject * ___global_cache_monitor_6;
// System.MonoEnumInfo/SByteComparer System.MonoEnumInfo::sbyte_comparer
SByteComparer_t2329725001 * ___sbyte_comparer_7;
// System.MonoEnumInfo/ShortComparer System.MonoEnumInfo::short_comparer
ShortComparer_t2253094562 * ___short_comparer_8;
// System.MonoEnumInfo/IntComparer System.MonoEnumInfo::int_comparer
IntComparer_t3812095803 * ___int_comparer_9;
// System.MonoEnumInfo/LongComparer System.MonoEnumInfo::long_comparer
LongComparer_t1798269597 * ___long_comparer_10;
public:
inline static int32_t get_offset_of_global_cache_5() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084_StaticFields, ___global_cache_5)); }
inline Hashtable_t1853889766 * get_global_cache_5() const { return ___global_cache_5; }
inline Hashtable_t1853889766 ** get_address_of_global_cache_5() { return &___global_cache_5; }
inline void set_global_cache_5(Hashtable_t1853889766 * value)
{
___global_cache_5 = value;
Il2CppCodeGenWriteBarrier((&___global_cache_5), value);
}
inline static int32_t get_offset_of_global_cache_monitor_6() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084_StaticFields, ___global_cache_monitor_6)); }
inline RuntimeObject * get_global_cache_monitor_6() const { return ___global_cache_monitor_6; }
inline RuntimeObject ** get_address_of_global_cache_monitor_6() { return &___global_cache_monitor_6; }
inline void set_global_cache_monitor_6(RuntimeObject * value)
{
___global_cache_monitor_6 = value;
Il2CppCodeGenWriteBarrier((&___global_cache_monitor_6), value);
}
inline static int32_t get_offset_of_sbyte_comparer_7() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084_StaticFields, ___sbyte_comparer_7)); }
inline SByteComparer_t2329725001 * get_sbyte_comparer_7() const { return ___sbyte_comparer_7; }
inline SByteComparer_t2329725001 ** get_address_of_sbyte_comparer_7() { return &___sbyte_comparer_7; }
inline void set_sbyte_comparer_7(SByteComparer_t2329725001 * value)
{
___sbyte_comparer_7 = value;
Il2CppCodeGenWriteBarrier((&___sbyte_comparer_7), value);
}
inline static int32_t get_offset_of_short_comparer_8() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084_StaticFields, ___short_comparer_8)); }
inline ShortComparer_t2253094562 * get_short_comparer_8() const { return ___short_comparer_8; }
inline ShortComparer_t2253094562 ** get_address_of_short_comparer_8() { return &___short_comparer_8; }
inline void set_short_comparer_8(ShortComparer_t2253094562 * value)
{
___short_comparer_8 = value;
Il2CppCodeGenWriteBarrier((&___short_comparer_8), value);
}
inline static int32_t get_offset_of_int_comparer_9() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084_StaticFields, ___int_comparer_9)); }
inline IntComparer_t3812095803 * get_int_comparer_9() const { return ___int_comparer_9; }
inline IntComparer_t3812095803 ** get_address_of_int_comparer_9() { return &___int_comparer_9; }
inline void set_int_comparer_9(IntComparer_t3812095803 * value)
{
___int_comparer_9 = value;
Il2CppCodeGenWriteBarrier((&___int_comparer_9), value);
}
inline static int32_t get_offset_of_long_comparer_10() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084_StaticFields, ___long_comparer_10)); }
inline LongComparer_t1798269597 * get_long_comparer_10() const { return ___long_comparer_10; }
inline LongComparer_t1798269597 ** get_address_of_long_comparer_10() { return &___long_comparer_10; }
inline void set_long_comparer_10(LongComparer_t1798269597 * value)
{
___long_comparer_10 = value;
Il2CppCodeGenWriteBarrier((&___long_comparer_10), value);
}
};
struct MonoEnumInfo_t3694469084_ThreadStaticFields
{
public:
// System.Collections.Hashtable System.MonoEnumInfo::cache
Hashtable_t1853889766 * ___cache_4;
public:
inline static int32_t get_offset_of_cache_4() { return static_cast<int32_t>(offsetof(MonoEnumInfo_t3694469084_ThreadStaticFields, ___cache_4)); }
inline Hashtable_t1853889766 * get_cache_4() const { return ___cache_4; }
inline Hashtable_t1853889766 ** get_address_of_cache_4() { return &___cache_4; }
inline void set_cache_4(Hashtable_t1853889766 * value)
{
___cache_4 = value;
Il2CppCodeGenWriteBarrier((&___cache_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.MonoEnumInfo
struct MonoEnumInfo_t3694469084_marshaled_pinvoke
{
Type_t * ___utype_0;
RuntimeArray * ___values_1;
char** ___names_2;
Hashtable_t1853889766 * ___name_hash_3;
};
// Native definition for COM marshalling of System.MonoEnumInfo
struct MonoEnumInfo_t3694469084_marshaled_com
{
Type_t * ___utype_0;
RuntimeArray * ___values_1;
Il2CppChar** ___names_2;
Hashtable_t1853889766 * ___name_hash_3;
};
#endif // MONOENUMINFO_T3694469084_H
#ifndef SYSTEMEXCEPTION_T176217640_H
#define SYSTEMEXCEPTION_T176217640_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.SystemException
struct SystemException_t176217640 : public Exception_t
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SYSTEMEXCEPTION_T176217640_H
#ifndef UTF32ENCODING_T312252005_H
#define UTF32ENCODING_T312252005_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UTF32Encoding
struct UTF32Encoding_t312252005 : public Encoding_t1523322056
{
public:
// System.Boolean System.Text.UTF32Encoding::bigEndian
bool ___bigEndian_28;
// System.Boolean System.Text.UTF32Encoding::byteOrderMark
bool ___byteOrderMark_29;
public:
inline static int32_t get_offset_of_bigEndian_28() { return static_cast<int32_t>(offsetof(UTF32Encoding_t312252005, ___bigEndian_28)); }
inline bool get_bigEndian_28() const { return ___bigEndian_28; }
inline bool* get_address_of_bigEndian_28() { return &___bigEndian_28; }
inline void set_bigEndian_28(bool value)
{
___bigEndian_28 = value;
}
inline static int32_t get_offset_of_byteOrderMark_29() { return static_cast<int32_t>(offsetof(UTF32Encoding_t312252005, ___byteOrderMark_29)); }
inline bool get_byteOrderMark_29() const { return ___byteOrderMark_29; }
inline bool* get_address_of_byteOrderMark_29() { return &___byteOrderMark_29; }
inline void set_byteOrderMark_29(bool value)
{
___byteOrderMark_29 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UTF32ENCODING_T312252005_H
#ifndef UTF32DECODER_T635925672_H
#define UTF32DECODER_T635925672_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UTF32Encoding/UTF32Decoder
struct UTF32Decoder_t635925672 : public Decoder_t2204182725
{
public:
// System.Boolean System.Text.UTF32Encoding/UTF32Decoder::bigEndian
bool ___bigEndian_2;
// System.Int32 System.Text.UTF32Encoding/UTF32Decoder::leftOverByte
int32_t ___leftOverByte_3;
// System.Int32 System.Text.UTF32Encoding/UTF32Decoder::leftOverLength
int32_t ___leftOverLength_4;
public:
inline static int32_t get_offset_of_bigEndian_2() { return static_cast<int32_t>(offsetof(UTF32Decoder_t635925672, ___bigEndian_2)); }
inline bool get_bigEndian_2() const { return ___bigEndian_2; }
inline bool* get_address_of_bigEndian_2() { return &___bigEndian_2; }
inline void set_bigEndian_2(bool value)
{
___bigEndian_2 = value;
}
inline static int32_t get_offset_of_leftOverByte_3() { return static_cast<int32_t>(offsetof(UTF32Decoder_t635925672, ___leftOverByte_3)); }
inline int32_t get_leftOverByte_3() const { return ___leftOverByte_3; }
inline int32_t* get_address_of_leftOverByte_3() { return &___leftOverByte_3; }
inline void set_leftOverByte_3(int32_t value)
{
___leftOverByte_3 = value;
}
inline static int32_t get_offset_of_leftOverLength_4() { return static_cast<int32_t>(offsetof(UTF32Decoder_t635925672, ___leftOverLength_4)); }
inline int32_t get_leftOverLength_4() const { return ___leftOverLength_4; }
inline int32_t* get_address_of_leftOverLength_4() { return &___leftOverLength_4; }
inline void set_leftOverLength_4(int32_t value)
{
___leftOverLength_4 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UTF32DECODER_T635925672_H
#ifndef UTF7ENCODING_T2644108479_H
#define UTF7ENCODING_T2644108479_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UTF7Encoding
struct UTF7Encoding_t2644108479 : public Encoding_t1523322056
{
public:
// System.Boolean System.Text.UTF7Encoding::allowOptionals
bool ___allowOptionals_28;
public:
inline static int32_t get_offset_of_allowOptionals_28() { return static_cast<int32_t>(offsetof(UTF7Encoding_t2644108479, ___allowOptionals_28)); }
inline bool get_allowOptionals_28() const { return ___allowOptionals_28; }
inline bool* get_address_of_allowOptionals_28() { return &___allowOptionals_28; }
inline void set_allowOptionals_28(bool value)
{
___allowOptionals_28 = value;
}
};
struct UTF7Encoding_t2644108479_StaticFields
{
public:
// System.Byte[] System.Text.UTF7Encoding::encodingRules
ByteU5BU5D_t4116647657* ___encodingRules_29;
// System.SByte[] System.Text.UTF7Encoding::base64Values
SByteU5BU5D_t2651576203* ___base64Values_30;
public:
inline static int32_t get_offset_of_encodingRules_29() { return static_cast<int32_t>(offsetof(UTF7Encoding_t2644108479_StaticFields, ___encodingRules_29)); }
inline ByteU5BU5D_t4116647657* get_encodingRules_29() const { return ___encodingRules_29; }
inline ByteU5BU5D_t4116647657** get_address_of_encodingRules_29() { return &___encodingRules_29; }
inline void set_encodingRules_29(ByteU5BU5D_t4116647657* value)
{
___encodingRules_29 = value;
Il2CppCodeGenWriteBarrier((&___encodingRules_29), value);
}
inline static int32_t get_offset_of_base64Values_30() { return static_cast<int32_t>(offsetof(UTF7Encoding_t2644108479_StaticFields, ___base64Values_30)); }
inline SByteU5BU5D_t2651576203* get_base64Values_30() const { return ___base64Values_30; }
inline SByteU5BU5D_t2651576203** get_address_of_base64Values_30() { return &___base64Values_30; }
inline void set_base64Values_30(SByteU5BU5D_t2651576203* value)
{
___base64Values_30 = value;
Il2CppCodeGenWriteBarrier((&___base64Values_30), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UTF7ENCODING_T2644108479_H
#ifndef UTF7DECODER_T2247208115_H
#define UTF7DECODER_T2247208115_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UTF7Encoding/UTF7Decoder
struct UTF7Decoder_t2247208115 : public Decoder_t2204182725
{
public:
// System.Int32 System.Text.UTF7Encoding/UTF7Decoder::leftOver
int32_t ___leftOver_2;
public:
inline static int32_t get_offset_of_leftOver_2() { return static_cast<int32_t>(offsetof(UTF7Decoder_t2247208115, ___leftOver_2)); }
inline int32_t get_leftOver_2() const { return ___leftOver_2; }
inline int32_t* get_address_of_leftOver_2() { return &___leftOver_2; }
inline void set_leftOver_2(int32_t value)
{
___leftOver_2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UTF7DECODER_T2247208115_H
#ifndef UTF8ENCODING_T3956466879_H
#define UTF8ENCODING_T3956466879_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UTF8Encoding
struct UTF8Encoding_t3956466879 : public Encoding_t1523322056
{
public:
// System.Boolean System.Text.UTF8Encoding::emitIdentifier
bool ___emitIdentifier_28;
public:
inline static int32_t get_offset_of_emitIdentifier_28() { return static_cast<int32_t>(offsetof(UTF8Encoding_t3956466879, ___emitIdentifier_28)); }
inline bool get_emitIdentifier_28() const { return ___emitIdentifier_28; }
inline bool* get_address_of_emitIdentifier_28() { return &___emitIdentifier_28; }
inline void set_emitIdentifier_28(bool value)
{
___emitIdentifier_28 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UTF8ENCODING_T3956466879_H
#ifndef UTF8DECODER_T2159214862_H
#define UTF8DECODER_T2159214862_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UTF8Encoding/UTF8Decoder
struct UTF8Decoder_t2159214862 : public Decoder_t2204182725
{
public:
// System.UInt32 System.Text.UTF8Encoding/UTF8Decoder::leftOverBits
uint32_t ___leftOverBits_2;
// System.UInt32 System.Text.UTF8Encoding/UTF8Decoder::leftOverCount
uint32_t ___leftOverCount_3;
public:
inline static int32_t get_offset_of_leftOverBits_2() { return static_cast<int32_t>(offsetof(UTF8Decoder_t2159214862, ___leftOverBits_2)); }
inline uint32_t get_leftOverBits_2() const { return ___leftOverBits_2; }
inline uint32_t* get_address_of_leftOverBits_2() { return &___leftOverBits_2; }
inline void set_leftOverBits_2(uint32_t value)
{
___leftOverBits_2 = value;
}
inline static int32_t get_offset_of_leftOverCount_3() { return static_cast<int32_t>(offsetof(UTF8Decoder_t2159214862, ___leftOverCount_3)); }
inline uint32_t get_leftOverCount_3() const { return ___leftOverCount_3; }
inline uint32_t* get_address_of_leftOverCount_3() { return &___leftOverCount_3; }
inline void set_leftOverCount_3(uint32_t value)
{
___leftOverCount_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UTF8DECODER_T2159214862_H
#ifndef UNICODEENCODING_T1959134050_H
#define UNICODEENCODING_T1959134050_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UnicodeEncoding
struct UnicodeEncoding_t1959134050 : public Encoding_t1523322056
{
public:
// System.Boolean System.Text.UnicodeEncoding::bigEndian
bool ___bigEndian_28;
// System.Boolean System.Text.UnicodeEncoding::byteOrderMark
bool ___byteOrderMark_29;
public:
inline static int32_t get_offset_of_bigEndian_28() { return static_cast<int32_t>(offsetof(UnicodeEncoding_t1959134050, ___bigEndian_28)); }
inline bool get_bigEndian_28() const { return ___bigEndian_28; }
inline bool* get_address_of_bigEndian_28() { return &___bigEndian_28; }
inline void set_bigEndian_28(bool value)
{
___bigEndian_28 = value;
}
inline static int32_t get_offset_of_byteOrderMark_29() { return static_cast<int32_t>(offsetof(UnicodeEncoding_t1959134050, ___byteOrderMark_29)); }
inline bool get_byteOrderMark_29() const { return ___byteOrderMark_29; }
inline bool* get_address_of_byteOrderMark_29() { return &___byteOrderMark_29; }
inline void set_byteOrderMark_29(bool value)
{
___byteOrderMark_29 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UNICODEENCODING_T1959134050_H
#ifndef UNICODEDECODER_T872550992_H
#define UNICODEDECODER_T872550992_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Text.UnicodeEncoding/UnicodeDecoder
struct UnicodeDecoder_t872550992 : public Decoder_t2204182725
{
public:
// System.Boolean System.Text.UnicodeEncoding/UnicodeDecoder::bigEndian
bool ___bigEndian_2;
// System.Int32 System.Text.UnicodeEncoding/UnicodeDecoder::leftOverByte
int32_t ___leftOverByte_3;
public:
inline static int32_t get_offset_of_bigEndian_2() { return static_cast<int32_t>(offsetof(UnicodeDecoder_t872550992, ___bigEndian_2)); }
inline bool get_bigEndian_2() const { return ___bigEndian_2; }
inline bool* get_address_of_bigEndian_2() { return &___bigEndian_2; }
inline void set_bigEndian_2(bool value)
{
___bigEndian_2 = value;
}
inline static int32_t get_offset_of_leftOverByte_3() { return static_cast<int32_t>(offsetof(UnicodeDecoder_t872550992, ___leftOverByte_3)); }
inline int32_t get_leftOverByte_3() const { return ___leftOverByte_3; }
inline int32_t* get_address_of_leftOverByte_3() { return &___leftOverByte_3; }
inline void set_leftOverByte_3(int32_t value)
{
___leftOverByte_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UNICODEDECODER_T872550992_H
#ifndef TIMER_T716671026_H
#define TIMER_T716671026_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Timer
struct Timer_t716671026 : public MarshalByRefObject_t2760389100
{
public:
// System.Threading.TimerCallback System.Threading.Timer::callback
TimerCallback_t1438585625 * ___callback_2;
// System.Object System.Threading.Timer::state
RuntimeObject * ___state_3;
// System.Int64 System.Threading.Timer::due_time_ms
int64_t ___due_time_ms_4;
// System.Int64 System.Threading.Timer::period_ms
int64_t ___period_ms_5;
// System.Int64 System.Threading.Timer::next_run
int64_t ___next_run_6;
// System.Boolean System.Threading.Timer::disposed
bool ___disposed_7;
public:
inline static int32_t get_offset_of_callback_2() { return static_cast<int32_t>(offsetof(Timer_t716671026, ___callback_2)); }
inline TimerCallback_t1438585625 * get_callback_2() const { return ___callback_2; }
inline TimerCallback_t1438585625 ** get_address_of_callback_2() { return &___callback_2; }
inline void set_callback_2(TimerCallback_t1438585625 * value)
{
___callback_2 = value;
Il2CppCodeGenWriteBarrier((&___callback_2), value);
}
inline static int32_t get_offset_of_state_3() { return static_cast<int32_t>(offsetof(Timer_t716671026, ___state_3)); }
inline RuntimeObject * get_state_3() const { return ___state_3; }
inline RuntimeObject ** get_address_of_state_3() { return &___state_3; }
inline void set_state_3(RuntimeObject * value)
{
___state_3 = value;
Il2CppCodeGenWriteBarrier((&___state_3), value);
}
inline static int32_t get_offset_of_due_time_ms_4() { return static_cast<int32_t>(offsetof(Timer_t716671026, ___due_time_ms_4)); }
inline int64_t get_due_time_ms_4() const { return ___due_time_ms_4; }
inline int64_t* get_address_of_due_time_ms_4() { return &___due_time_ms_4; }
inline void set_due_time_ms_4(int64_t value)
{
___due_time_ms_4 = value;
}
inline static int32_t get_offset_of_period_ms_5() { return static_cast<int32_t>(offsetof(Timer_t716671026, ___period_ms_5)); }
inline int64_t get_period_ms_5() const { return ___period_ms_5; }
inline int64_t* get_address_of_period_ms_5() { return &___period_ms_5; }
inline void set_period_ms_5(int64_t value)
{
___period_ms_5 = value;
}
inline static int32_t get_offset_of_next_run_6() { return static_cast<int32_t>(offsetof(Timer_t716671026, ___next_run_6)); }
inline int64_t get_next_run_6() const { return ___next_run_6; }
inline int64_t* get_address_of_next_run_6() { return &___next_run_6; }
inline void set_next_run_6(int64_t value)
{
___next_run_6 = value;
}
inline static int32_t get_offset_of_disposed_7() { return static_cast<int32_t>(offsetof(Timer_t716671026, ___disposed_7)); }
inline bool get_disposed_7() const { return ___disposed_7; }
inline bool* get_address_of_disposed_7() { return &___disposed_7; }
inline void set_disposed_7(bool value)
{
___disposed_7 = value;
}
};
struct Timer_t716671026_StaticFields
{
public:
// System.Threading.Timer/Scheduler System.Threading.Timer::scheduler
Scheduler_t3215764947 * ___scheduler_1;
public:
inline static int32_t get_offset_of_scheduler_1() { return static_cast<int32_t>(offsetof(Timer_t716671026_StaticFields, ___scheduler_1)); }
inline Scheduler_t3215764947 * get_scheduler_1() const { return ___scheduler_1; }
inline Scheduler_t3215764947 ** get_address_of_scheduler_1() { return &___scheduler_1; }
inline void set_scheduler_1(Scheduler_t3215764947 * value)
{
___scheduler_1 = value;
Il2CppCodeGenWriteBarrier((&___scheduler_1), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TIMER_T716671026_H
#ifndef TIMESPAN_T881159249_H
#define TIMESPAN_T881159249_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.TimeSpan
struct TimeSpan_t881159249
{
public:
// System.Int64 System.TimeSpan::_ticks
int64_t ____ticks_8;
public:
inline static int32_t get_offset_of__ticks_8() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249, ____ticks_8)); }
inline int64_t get__ticks_8() const { return ____ticks_8; }
inline int64_t* get_address_of__ticks_8() { return &____ticks_8; }
inline void set__ticks_8(int64_t value)
{
____ticks_8 = value;
}
};
struct TimeSpan_t881159249_StaticFields
{
public:
// System.TimeSpan System.TimeSpan::MaxValue
TimeSpan_t881159249 ___MaxValue_5;
// System.TimeSpan System.TimeSpan::MinValue
TimeSpan_t881159249 ___MinValue_6;
// System.TimeSpan System.TimeSpan::Zero
TimeSpan_t881159249 ___Zero_7;
public:
inline static int32_t get_offset_of_MaxValue_5() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249_StaticFields, ___MaxValue_5)); }
inline TimeSpan_t881159249 get_MaxValue_5() const { return ___MaxValue_5; }
inline TimeSpan_t881159249 * get_address_of_MaxValue_5() { return &___MaxValue_5; }
inline void set_MaxValue_5(TimeSpan_t881159249 value)
{
___MaxValue_5 = value;
}
inline static int32_t get_offset_of_MinValue_6() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249_StaticFields, ___MinValue_6)); }
inline TimeSpan_t881159249 get_MinValue_6() const { return ___MinValue_6; }
inline TimeSpan_t881159249 * get_address_of_MinValue_6() { return &___MinValue_6; }
inline void set_MinValue_6(TimeSpan_t881159249 value)
{
___MinValue_6 = value;
}
inline static int32_t get_offset_of_Zero_7() { return static_cast<int32_t>(offsetof(TimeSpan_t881159249_StaticFields, ___Zero_7)); }
inline TimeSpan_t881159249 get_Zero_7() const { return ___Zero_7; }
inline TimeSpan_t881159249 * get_address_of_Zero_7() { return &___Zero_7; }
inline void set_Zero_7(TimeSpan_t881159249 value)
{
___Zero_7 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TIMESPAN_T881159249_H
#ifndef UINTPTR_T_H
#define UINTPTR_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.UIntPtr
struct UIntPtr_t
{
public:
// System.Void* System.UIntPtr::_pointer
void* ____pointer_1;
public:
inline static int32_t get_offset_of__pointer_1() { return static_cast<int32_t>(offsetof(UIntPtr_t, ____pointer_1)); }
inline void* get__pointer_1() const { return ____pointer_1; }
inline void** get_address_of__pointer_1() { return &____pointer_1; }
inline void set__pointer_1(void* value)
{
____pointer_1 = value;
}
};
struct UIntPtr_t_StaticFields
{
public:
// System.UIntPtr System.UIntPtr::Zero
uintptr_t ___Zero_0;
public:
inline static int32_t get_offset_of_Zero_0() { return static_cast<int32_t>(offsetof(UIntPtr_t_StaticFields, ___Zero_0)); }
inline uintptr_t get_Zero_0() const { return ___Zero_0; }
inline uintptr_t* get_address_of_Zero_0() { return &___Zero_0; }
inline void set_Zero_0(uintptr_t value)
{
___Zero_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UINTPTR_T_H
#ifndef ACCESSVIOLATIONEXCEPTION_T339633883_H
#define ACCESSVIOLATIONEXCEPTION_T339633883_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.AccessViolationException
struct AccessViolationException_t339633883 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ACCESSVIOLATIONEXCEPTION_T339633883_H
#ifndef ARGUMENTEXCEPTION_T132251570_H
#define ARGUMENTEXCEPTION_T132251570_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ArgumentException
struct ArgumentException_t132251570 : public SystemException_t176217640
{
public:
// System.String System.ArgumentException::param_name
String_t* ___param_name_12;
public:
inline static int32_t get_offset_of_param_name_12() { return static_cast<int32_t>(offsetof(ArgumentException_t132251570, ___param_name_12)); }
inline String_t* get_param_name_12() const { return ___param_name_12; }
inline String_t** get_address_of_param_name_12() { return &___param_name_12; }
inline void set_param_name_12(String_t* value)
{
___param_name_12 = value;
Il2CppCodeGenWriteBarrier((&___param_name_12), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ARGUMENTEXCEPTION_T132251570_H
#ifndef ARITHMETICEXCEPTION_T4283546778_H
#define ARITHMETICEXCEPTION_T4283546778_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ArithmeticException
struct ArithmeticException_t4283546778 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ARITHMETICEXCEPTION_T4283546778_H
#ifndef ARRAYTYPEMISMATCHEXCEPTION_T2342549375_H
#define ARRAYTYPEMISMATCHEXCEPTION_T2342549375_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ArrayTypeMismatchException
struct ArrayTypeMismatchException_t2342549375 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ARRAYTYPEMISMATCHEXCEPTION_T2342549375_H
#ifndef ATTRIBUTETARGETS_T1784037988_H
#define ATTRIBUTETARGETS_T1784037988_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.AttributeTargets
struct AttributeTargets_t1784037988
{
public:
// System.Int32 System.AttributeTargets::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(AttributeTargets_t1784037988, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ATTRIBUTETARGETS_T1784037988_H
#ifndef WHICH_T2943845661_H
#define WHICH_T2943845661_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DateTime/Which
struct Which_t2943845661
{
public:
// System.Int32 System.DateTime/Which::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(Which_t2943845661, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // WHICH_T2943845661_H
#ifndef DATETIMEKIND_T3468814247_H
#define DATETIMEKIND_T3468814247_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DateTimeKind
struct DateTimeKind_t3468814247
{
public:
// System.Int32 System.DateTimeKind::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(DateTimeKind_t3468814247, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DATETIMEKIND_T3468814247_H
#ifndef DAYOFWEEK_T3650621421_H
#define DAYOFWEEK_T3650621421_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DayOfWeek
struct DayOfWeek_t3650621421
{
public:
// System.Int32 System.DayOfWeek::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(DayOfWeek_t3650621421, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DAYOFWEEK_T3650621421_H
#ifndef SPECIALFOLDER_T3871784040_H
#define SPECIALFOLDER_T3871784040_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Environment/SpecialFolder
struct SpecialFolder_t3871784040
{
public:
// System.Int32 System.Environment/SpecialFolder::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(SpecialFolder_t3871784040, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SPECIALFOLDER_T3871784040_H
#ifndef EXECUTIONENGINEEXCEPTION_T1142598034_H
#define EXECUTIONENGINEEXCEPTION_T1142598034_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ExecutionEngineException
struct ExecutionEngineException_t1142598034 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EXECUTIONENGINEEXCEPTION_T1142598034_H
#ifndef FORMATEXCEPTION_T154580423_H
#define FORMATEXCEPTION_T154580423_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.FormatException
struct FormatException_t154580423 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FORMATEXCEPTION_T154580423_H
#ifndef INDEXOUTOFRANGEEXCEPTION_T1578797820_H
#define INDEXOUTOFRANGEEXCEPTION_T1578797820_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.IndexOutOfRangeException
struct IndexOutOfRangeException_t1578797820 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INDEXOUTOFRANGEEXCEPTION_T1578797820_H
#ifndef INVALIDCASTEXCEPTION_T3927145244_H
#define INVALIDCASTEXCEPTION_T3927145244_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.InvalidCastException
struct InvalidCastException_t3927145244 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INVALIDCASTEXCEPTION_T3927145244_H
#ifndef INVALIDOPERATIONEXCEPTION_T56020091_H
#define INVALIDOPERATIONEXCEPTION_T56020091_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.InvalidOperationException
struct InvalidOperationException_t56020091 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INVALIDOPERATIONEXCEPTION_T56020091_H
#ifndef INVALIDPROGRAMEXCEPTION_T3836716986_H
#define INVALIDPROGRAMEXCEPTION_T3836716986_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.InvalidProgramException
struct InvalidProgramException_t3836716986 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INVALIDPROGRAMEXCEPTION_T3836716986_H
#ifndef LOADEROPTIMIZATION_T1484956347_H
#define LOADEROPTIMIZATION_T1484956347_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.LoaderOptimization
struct LoaderOptimization_t1484956347
{
public:
// System.Int32 System.LoaderOptimization::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(LoaderOptimization_t1484956347, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LOADEROPTIMIZATION_T1484956347_H
#ifndef MEMBERACCESSEXCEPTION_T1734467078_H
#define MEMBERACCESSEXCEPTION_T1734467078_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MemberAccessException
struct MemberAccessException_t1734467078 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MEMBERACCESSEXCEPTION_T1734467078_H
#ifndef MONOASYNCCALL_T3023670838_H
#define MONOASYNCCALL_T3023670838_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MonoAsyncCall
struct MonoAsyncCall_t3023670838 : public RuntimeObject
{
public:
// System.Object System.MonoAsyncCall::msg
RuntimeObject * ___msg_0;
// System.IntPtr System.MonoAsyncCall::cb_method
intptr_t ___cb_method_1;
// System.Object System.MonoAsyncCall::cb_target
RuntimeObject * ___cb_target_2;
// System.Object System.MonoAsyncCall::state
RuntimeObject * ___state_3;
// System.Object System.MonoAsyncCall::res
RuntimeObject * ___res_4;
// System.Object System.MonoAsyncCall::out_args
RuntimeObject * ___out_args_5;
// System.Int64 System.MonoAsyncCall::wait_event
int64_t ___wait_event_6;
public:
inline static int32_t get_offset_of_msg_0() { return static_cast<int32_t>(offsetof(MonoAsyncCall_t3023670838, ___msg_0)); }
inline RuntimeObject * get_msg_0() const { return ___msg_0; }
inline RuntimeObject ** get_address_of_msg_0() { return &___msg_0; }
inline void set_msg_0(RuntimeObject * value)
{
___msg_0 = value;
Il2CppCodeGenWriteBarrier((&___msg_0), value);
}
inline static int32_t get_offset_of_cb_method_1() { return static_cast<int32_t>(offsetof(MonoAsyncCall_t3023670838, ___cb_method_1)); }
inline intptr_t get_cb_method_1() const { return ___cb_method_1; }
inline intptr_t* get_address_of_cb_method_1() { return &___cb_method_1; }
inline void set_cb_method_1(intptr_t value)
{
___cb_method_1 = value;
}
inline static int32_t get_offset_of_cb_target_2() { return static_cast<int32_t>(offsetof(MonoAsyncCall_t3023670838, ___cb_target_2)); }
inline RuntimeObject * get_cb_target_2() const { return ___cb_target_2; }
inline RuntimeObject ** get_address_of_cb_target_2() { return &___cb_target_2; }
inline void set_cb_target_2(RuntimeObject * value)
{
___cb_target_2 = value;
Il2CppCodeGenWriteBarrier((&___cb_target_2), value);
}
inline static int32_t get_offset_of_state_3() { return static_cast<int32_t>(offsetof(MonoAsyncCall_t3023670838, ___state_3)); }
inline RuntimeObject * get_state_3() const { return ___state_3; }
inline RuntimeObject ** get_address_of_state_3() { return &___state_3; }
inline void set_state_3(RuntimeObject * value)
{
___state_3 = value;
Il2CppCodeGenWriteBarrier((&___state_3), value);
}
inline static int32_t get_offset_of_res_4() { return static_cast<int32_t>(offsetof(MonoAsyncCall_t3023670838, ___res_4)); }
inline RuntimeObject * get_res_4() const { return ___res_4; }
inline RuntimeObject ** get_address_of_res_4() { return &___res_4; }
inline void set_res_4(RuntimeObject * value)
{
___res_4 = value;
Il2CppCodeGenWriteBarrier((&___res_4), value);
}
inline static int32_t get_offset_of_out_args_5() { return static_cast<int32_t>(offsetof(MonoAsyncCall_t3023670838, ___out_args_5)); }
inline RuntimeObject * get_out_args_5() const { return ___out_args_5; }
inline RuntimeObject ** get_address_of_out_args_5() { return &___out_args_5; }
inline void set_out_args_5(RuntimeObject * value)
{
___out_args_5 = value;
Il2CppCodeGenWriteBarrier((&___out_args_5), value);
}
inline static int32_t get_offset_of_wait_event_6() { return static_cast<int32_t>(offsetof(MonoAsyncCall_t3023670838, ___wait_event_6)); }
inline int64_t get_wait_event_6() const { return ___wait_event_6; }
inline int64_t* get_address_of_wait_event_6() { return &___wait_event_6; }
inline void set_wait_event_6(int64_t value)
{
___wait_event_6 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MONOASYNCCALL_T3023670838_H
#ifndef PRINCIPALPOLICY_T1761212333_H
#define PRINCIPALPOLICY_T1761212333_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Security.Principal.PrincipalPolicy
struct PrincipalPolicy_t1761212333
{
public:
// System.Int32 System.Security.Principal.PrincipalPolicy::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(PrincipalPolicy_t1761212333, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // PRINCIPALPOLICY_T1761212333_H
#ifndef EVENTRESETMODE_T3817241503_H
#define EVENTRESETMODE_T3817241503_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.EventResetMode
struct EventResetMode_t3817241503
{
public:
// System.Int32 System.Threading.EventResetMode::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(EventResetMode_t3817241503, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EVENTRESETMODE_T3817241503_H
#ifndef REGISTEREDWAITHANDLE_T1529538454_H
#define REGISTEREDWAITHANDLE_T1529538454_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.RegisteredWaitHandle
struct RegisteredWaitHandle_t1529538454 : public MarshalByRefObject_t2760389100
{
public:
// System.Threading.WaitHandle System.Threading.RegisteredWaitHandle::_waitObject
WaitHandle_t1743403487 * ____waitObject_1;
// System.Threading.WaitOrTimerCallback System.Threading.RegisteredWaitHandle::_callback
WaitOrTimerCallback_t1973723282 * ____callback_2;
// System.TimeSpan System.Threading.RegisteredWaitHandle::_timeout
TimeSpan_t881159249 ____timeout_3;
// System.Object System.Threading.RegisteredWaitHandle::_state
RuntimeObject * ____state_4;
// System.Boolean System.Threading.RegisteredWaitHandle::_executeOnlyOnce
bool ____executeOnlyOnce_5;
// System.Threading.WaitHandle System.Threading.RegisteredWaitHandle::_finalEvent
WaitHandle_t1743403487 * ____finalEvent_6;
// System.Threading.ManualResetEvent System.Threading.RegisteredWaitHandle::_cancelEvent
ManualResetEvent_t451242010 * ____cancelEvent_7;
// System.Int32 System.Threading.RegisteredWaitHandle::_callsInProcess
int32_t ____callsInProcess_8;
// System.Boolean System.Threading.RegisteredWaitHandle::_unregistered
bool ____unregistered_9;
public:
inline static int32_t get_offset_of__waitObject_1() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____waitObject_1)); }
inline WaitHandle_t1743403487 * get__waitObject_1() const { return ____waitObject_1; }
inline WaitHandle_t1743403487 ** get_address_of__waitObject_1() { return &____waitObject_1; }
inline void set__waitObject_1(WaitHandle_t1743403487 * value)
{
____waitObject_1 = value;
Il2CppCodeGenWriteBarrier((&____waitObject_1), value);
}
inline static int32_t get_offset_of__callback_2() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____callback_2)); }
inline WaitOrTimerCallback_t1973723282 * get__callback_2() const { return ____callback_2; }
inline WaitOrTimerCallback_t1973723282 ** get_address_of__callback_2() { return &____callback_2; }
inline void set__callback_2(WaitOrTimerCallback_t1973723282 * value)
{
____callback_2 = value;
Il2CppCodeGenWriteBarrier((&____callback_2), value);
}
inline static int32_t get_offset_of__timeout_3() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____timeout_3)); }
inline TimeSpan_t881159249 get__timeout_3() const { return ____timeout_3; }
inline TimeSpan_t881159249 * get_address_of__timeout_3() { return &____timeout_3; }
inline void set__timeout_3(TimeSpan_t881159249 value)
{
____timeout_3 = value;
}
inline static int32_t get_offset_of__state_4() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____state_4)); }
inline RuntimeObject * get__state_4() const { return ____state_4; }
inline RuntimeObject ** get_address_of__state_4() { return &____state_4; }
inline void set__state_4(RuntimeObject * value)
{
____state_4 = value;
Il2CppCodeGenWriteBarrier((&____state_4), value);
}
inline static int32_t get_offset_of__executeOnlyOnce_5() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____executeOnlyOnce_5)); }
inline bool get__executeOnlyOnce_5() const { return ____executeOnlyOnce_5; }
inline bool* get_address_of__executeOnlyOnce_5() { return &____executeOnlyOnce_5; }
inline void set__executeOnlyOnce_5(bool value)
{
____executeOnlyOnce_5 = value;
}
inline static int32_t get_offset_of__finalEvent_6() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____finalEvent_6)); }
inline WaitHandle_t1743403487 * get__finalEvent_6() const { return ____finalEvent_6; }
inline WaitHandle_t1743403487 ** get_address_of__finalEvent_6() { return &____finalEvent_6; }
inline void set__finalEvent_6(WaitHandle_t1743403487 * value)
{
____finalEvent_6 = value;
Il2CppCodeGenWriteBarrier((&____finalEvent_6), value);
}
inline static int32_t get_offset_of__cancelEvent_7() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____cancelEvent_7)); }
inline ManualResetEvent_t451242010 * get__cancelEvent_7() const { return ____cancelEvent_7; }
inline ManualResetEvent_t451242010 ** get_address_of__cancelEvent_7() { return &____cancelEvent_7; }
inline void set__cancelEvent_7(ManualResetEvent_t451242010 * value)
{
____cancelEvent_7 = value;
Il2CppCodeGenWriteBarrier((&____cancelEvent_7), value);
}
inline static int32_t get_offset_of__callsInProcess_8() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____callsInProcess_8)); }
inline int32_t get__callsInProcess_8() const { return ____callsInProcess_8; }
inline int32_t* get_address_of__callsInProcess_8() { return &____callsInProcess_8; }
inline void set__callsInProcess_8(int32_t value)
{
____callsInProcess_8 = value;
}
inline static int32_t get_offset_of__unregistered_9() { return static_cast<int32_t>(offsetof(RegisteredWaitHandle_t1529538454, ____unregistered_9)); }
inline bool get__unregistered_9() const { return ____unregistered_9; }
inline bool* get_address_of__unregistered_9() { return &____unregistered_9; }
inline void set__unregistered_9(bool value)
{
____unregistered_9 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // REGISTEREDWAITHANDLE_T1529538454_H
#ifndef SYNCHRONIZATIONLOCKEXCEPTION_T841761767_H
#define SYNCHRONIZATIONLOCKEXCEPTION_T841761767_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.SynchronizationLockException
struct SynchronizationLockException_t841761767 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SYNCHRONIZATIONLOCKEXCEPTION_T841761767_H
#ifndef THREADABORTEXCEPTION_T4074510458_H
#define THREADABORTEXCEPTION_T4074510458_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.ThreadAbortException
struct ThreadAbortException_t4074510458 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // THREADABORTEXCEPTION_T4074510458_H
#ifndef THREADINTERRUPTEDEXCEPTION_T3240955163_H
#define THREADINTERRUPTEDEXCEPTION_T3240955163_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.ThreadInterruptedException
struct ThreadInterruptedException_t3240955163 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // THREADINTERRUPTEDEXCEPTION_T3240955163_H
#ifndef THREADSTATE_T2533302383_H
#define THREADSTATE_T2533302383_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.ThreadState
struct ThreadState_t2533302383
{
public:
// System.Int32 System.Threading.ThreadState::value__
int32_t ___value___1;
public:
inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(ThreadState_t2533302383, ___value___1)); }
inline int32_t get_value___1() const { return ___value___1; }
inline int32_t* get_address_of_value___1() { return &___value___1; }
inline void set_value___1(int32_t value)
{
___value___1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // THREADSTATE_T2533302383_H
#ifndef THREADSTATEEXCEPTION_T3003788475_H
#define THREADSTATEEXCEPTION_T3003788475_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.ThreadStateException
struct ThreadStateException_t3003788475 : public SystemException_t176217640
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // THREADSTATEEXCEPTION_T3003788475_H
#ifndef WAITHANDLE_T1743403487_H
#define WAITHANDLE_T1743403487_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.WaitHandle
struct WaitHandle_t1743403487 : public MarshalByRefObject_t2760389100
{
public:
// Microsoft.Win32.SafeHandles.SafeWaitHandle System.Threading.WaitHandle::safe_wait_handle
SafeWaitHandle_t1972936122 * ___safe_wait_handle_2;
// System.Boolean System.Threading.WaitHandle::disposed
bool ___disposed_4;
public:
inline static int32_t get_offset_of_safe_wait_handle_2() { return static_cast<int32_t>(offsetof(WaitHandle_t1743403487, ___safe_wait_handle_2)); }
inline SafeWaitHandle_t1972936122 * get_safe_wait_handle_2() const { return ___safe_wait_handle_2; }
inline SafeWaitHandle_t1972936122 ** get_address_of_safe_wait_handle_2() { return &___safe_wait_handle_2; }
inline void set_safe_wait_handle_2(SafeWaitHandle_t1972936122 * value)
{
___safe_wait_handle_2 = value;
Il2CppCodeGenWriteBarrier((&___safe_wait_handle_2), value);
}
inline static int32_t get_offset_of_disposed_4() { return static_cast<int32_t>(offsetof(WaitHandle_t1743403487, ___disposed_4)); }
inline bool get_disposed_4() const { return ___disposed_4; }
inline bool* get_address_of_disposed_4() { return &___disposed_4; }
inline void set_disposed_4(bool value)
{
___disposed_4 = value;
}
};
struct WaitHandle_t1743403487_StaticFields
{
public:
// System.IntPtr System.Threading.WaitHandle::InvalidHandle
intptr_t ___InvalidHandle_3;
public:
inline static int32_t get_offset_of_InvalidHandle_3() { return static_cast<int32_t>(offsetof(WaitHandle_t1743403487_StaticFields, ___InvalidHandle_3)); }
inline intptr_t get_InvalidHandle_3() const { return ___InvalidHandle_3; }
inline intptr_t* get_address_of_InvalidHandle_3() { return &___InvalidHandle_3; }
inline void set_InvalidHandle_3(intptr_t value)
{
___InvalidHandle_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // WAITHANDLE_T1743403487_H
#ifndef TYPELOADEXCEPTION_T3707937253_H
#define TYPELOADEXCEPTION_T3707937253_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.TypeLoadException
struct TypeLoadException_t3707937253 : public SystemException_t176217640
{
public:
// System.String System.TypeLoadException::className
String_t* ___className_12;
// System.String System.TypeLoadException::assemblyName
String_t* ___assemblyName_13;
public:
inline static int32_t get_offset_of_className_12() { return static_cast<int32_t>(offsetof(TypeLoadException_t3707937253, ___className_12)); }
inline String_t* get_className_12() const { return ___className_12; }
inline String_t** get_address_of_className_12() { return &___className_12; }
inline void set_className_12(String_t* value)
{
___className_12 = value;
Il2CppCodeGenWriteBarrier((&___className_12), value);
}
inline static int32_t get_offset_of_assemblyName_13() { return static_cast<int32_t>(offsetof(TypeLoadException_t3707937253, ___assemblyName_13)); }
inline String_t* get_assemblyName_13() const { return ___assemblyName_13; }
inline String_t** get_address_of_assemblyName_13() { return &___assemblyName_13; }
inline void set_assemblyName_13(String_t* value)
{
___assemblyName_13 = value;
Il2CppCodeGenWriteBarrier((&___assemblyName_13), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TYPELOADEXCEPTION_T3707937253_H
#ifndef APPDOMAIN_T1571427825_H
#define APPDOMAIN_T1571427825_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.AppDomain
struct AppDomain_t1571427825 : public MarshalByRefObject_t2760389100
{
public:
// System.IntPtr System.AppDomain::_mono_app_domain
intptr_t ____mono_app_domain_1;
// System.Security.Policy.Evidence System.AppDomain::_evidence
Evidence_t2008144148 * ____evidence_6;
// System.Security.PermissionSet System.AppDomain::_granted
PermissionSet_t223948603 * ____granted_7;
// System.Security.Principal.PrincipalPolicy System.AppDomain::_principalPolicy
int32_t ____principalPolicy_8;
// System.AppDomainManager System.AppDomain::_domain_manager
AppDomainManager_t1420869192 * ____domain_manager_11;
// System.ActivationContext System.AppDomain::_activation
ActivationContext_t976916018 * ____activation_12;
// System.ApplicationIdentity System.AppDomain::_applicationIdentity
ApplicationIdentity_t1917735356 * ____applicationIdentity_13;
// System.AssemblyLoadEventHandler System.AppDomain::AssemblyLoad
AssemblyLoadEventHandler_t107971893 * ___AssemblyLoad_14;
// System.ResolveEventHandler System.AppDomain::AssemblyResolve
ResolveEventHandler_t2775508208 * ___AssemblyResolve_15;
// System.EventHandler System.AppDomain::DomainUnload
EventHandler_t1348719766 * ___DomainUnload_16;
// System.EventHandler System.AppDomain::ProcessExit
EventHandler_t1348719766 * ___ProcessExit_17;
// System.ResolveEventHandler System.AppDomain::ResourceResolve
ResolveEventHandler_t2775508208 * ___ResourceResolve_18;
// System.ResolveEventHandler System.AppDomain::TypeResolve
ResolveEventHandler_t2775508208 * ___TypeResolve_19;
// System.UnhandledExceptionEventHandler System.AppDomain::UnhandledException
UnhandledExceptionEventHandler_t3101989324 * ___UnhandledException_20;
// System.ResolveEventHandler System.AppDomain::ReflectionOnlyAssemblyResolve
ResolveEventHandler_t2775508208 * ___ReflectionOnlyAssemblyResolve_21;
public:
inline static int32_t get_offset_of__mono_app_domain_1() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ____mono_app_domain_1)); }
inline intptr_t get__mono_app_domain_1() const { return ____mono_app_domain_1; }
inline intptr_t* get_address_of__mono_app_domain_1() { return &____mono_app_domain_1; }
inline void set__mono_app_domain_1(intptr_t value)
{
____mono_app_domain_1 = value;
}
inline static int32_t get_offset_of__evidence_6() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ____evidence_6)); }
inline Evidence_t2008144148 * get__evidence_6() const { return ____evidence_6; }
inline Evidence_t2008144148 ** get_address_of__evidence_6() { return &____evidence_6; }
inline void set__evidence_6(Evidence_t2008144148 * value)
{
____evidence_6 = value;
Il2CppCodeGenWriteBarrier((&____evidence_6), value);
}
inline static int32_t get_offset_of__granted_7() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ____granted_7)); }
inline PermissionSet_t223948603 * get__granted_7() const { return ____granted_7; }
inline PermissionSet_t223948603 ** get_address_of__granted_7() { return &____granted_7; }
inline void set__granted_7(PermissionSet_t223948603 * value)
{
____granted_7 = value;
Il2CppCodeGenWriteBarrier((&____granted_7), value);
}
inline static int32_t get_offset_of__principalPolicy_8() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ____principalPolicy_8)); }
inline int32_t get__principalPolicy_8() const { return ____principalPolicy_8; }
inline int32_t* get_address_of__principalPolicy_8() { return &____principalPolicy_8; }
inline void set__principalPolicy_8(int32_t value)
{
____principalPolicy_8 = value;
}
inline static int32_t get_offset_of__domain_manager_11() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ____domain_manager_11)); }
inline AppDomainManager_t1420869192 * get__domain_manager_11() const { return ____domain_manager_11; }
inline AppDomainManager_t1420869192 ** get_address_of__domain_manager_11() { return &____domain_manager_11; }
inline void set__domain_manager_11(AppDomainManager_t1420869192 * value)
{
____domain_manager_11 = value;
Il2CppCodeGenWriteBarrier((&____domain_manager_11), value);
}
inline static int32_t get_offset_of__activation_12() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ____activation_12)); }
inline ActivationContext_t976916018 * get__activation_12() const { return ____activation_12; }
inline ActivationContext_t976916018 ** get_address_of__activation_12() { return &____activation_12; }
inline void set__activation_12(ActivationContext_t976916018 * value)
{
____activation_12 = value;
Il2CppCodeGenWriteBarrier((&____activation_12), value);
}
inline static int32_t get_offset_of__applicationIdentity_13() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ____applicationIdentity_13)); }
inline ApplicationIdentity_t1917735356 * get__applicationIdentity_13() const { return ____applicationIdentity_13; }
inline ApplicationIdentity_t1917735356 ** get_address_of__applicationIdentity_13() { return &____applicationIdentity_13; }
inline void set__applicationIdentity_13(ApplicationIdentity_t1917735356 * value)
{
____applicationIdentity_13 = value;
Il2CppCodeGenWriteBarrier((&____applicationIdentity_13), value);
}
inline static int32_t get_offset_of_AssemblyLoad_14() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___AssemblyLoad_14)); }
inline AssemblyLoadEventHandler_t107971893 * get_AssemblyLoad_14() const { return ___AssemblyLoad_14; }
inline AssemblyLoadEventHandler_t107971893 ** get_address_of_AssemblyLoad_14() { return &___AssemblyLoad_14; }
inline void set_AssemblyLoad_14(AssemblyLoadEventHandler_t107971893 * value)
{
___AssemblyLoad_14 = value;
Il2CppCodeGenWriteBarrier((&___AssemblyLoad_14), value);
}
inline static int32_t get_offset_of_AssemblyResolve_15() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___AssemblyResolve_15)); }
inline ResolveEventHandler_t2775508208 * get_AssemblyResolve_15() const { return ___AssemblyResolve_15; }
inline ResolveEventHandler_t2775508208 ** get_address_of_AssemblyResolve_15() { return &___AssemblyResolve_15; }
inline void set_AssemblyResolve_15(ResolveEventHandler_t2775508208 * value)
{
___AssemblyResolve_15 = value;
Il2CppCodeGenWriteBarrier((&___AssemblyResolve_15), value);
}
inline static int32_t get_offset_of_DomainUnload_16() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___DomainUnload_16)); }
inline EventHandler_t1348719766 * get_DomainUnload_16() const { return ___DomainUnload_16; }
inline EventHandler_t1348719766 ** get_address_of_DomainUnload_16() { return &___DomainUnload_16; }
inline void set_DomainUnload_16(EventHandler_t1348719766 * value)
{
___DomainUnload_16 = value;
Il2CppCodeGenWriteBarrier((&___DomainUnload_16), value);
}
inline static int32_t get_offset_of_ProcessExit_17() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___ProcessExit_17)); }
inline EventHandler_t1348719766 * get_ProcessExit_17() const { return ___ProcessExit_17; }
inline EventHandler_t1348719766 ** get_address_of_ProcessExit_17() { return &___ProcessExit_17; }
inline void set_ProcessExit_17(EventHandler_t1348719766 * value)
{
___ProcessExit_17 = value;
Il2CppCodeGenWriteBarrier((&___ProcessExit_17), value);
}
inline static int32_t get_offset_of_ResourceResolve_18() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___ResourceResolve_18)); }
inline ResolveEventHandler_t2775508208 * get_ResourceResolve_18() const { return ___ResourceResolve_18; }
inline ResolveEventHandler_t2775508208 ** get_address_of_ResourceResolve_18() { return &___ResourceResolve_18; }
inline void set_ResourceResolve_18(ResolveEventHandler_t2775508208 * value)
{
___ResourceResolve_18 = value;
Il2CppCodeGenWriteBarrier((&___ResourceResolve_18), value);
}
inline static int32_t get_offset_of_TypeResolve_19() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___TypeResolve_19)); }
inline ResolveEventHandler_t2775508208 * get_TypeResolve_19() const { return ___TypeResolve_19; }
inline ResolveEventHandler_t2775508208 ** get_address_of_TypeResolve_19() { return &___TypeResolve_19; }
inline void set_TypeResolve_19(ResolveEventHandler_t2775508208 * value)
{
___TypeResolve_19 = value;
Il2CppCodeGenWriteBarrier((&___TypeResolve_19), value);
}
inline static int32_t get_offset_of_UnhandledException_20() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___UnhandledException_20)); }
inline UnhandledExceptionEventHandler_t3101989324 * get_UnhandledException_20() const { return ___UnhandledException_20; }
inline UnhandledExceptionEventHandler_t3101989324 ** get_address_of_UnhandledException_20() { return &___UnhandledException_20; }
inline void set_UnhandledException_20(UnhandledExceptionEventHandler_t3101989324 * value)
{
___UnhandledException_20 = value;
Il2CppCodeGenWriteBarrier((&___UnhandledException_20), value);
}
inline static int32_t get_offset_of_ReflectionOnlyAssemblyResolve_21() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825, ___ReflectionOnlyAssemblyResolve_21)); }
inline ResolveEventHandler_t2775508208 * get_ReflectionOnlyAssemblyResolve_21() const { return ___ReflectionOnlyAssemblyResolve_21; }
inline ResolveEventHandler_t2775508208 ** get_address_of_ReflectionOnlyAssemblyResolve_21() { return &___ReflectionOnlyAssemblyResolve_21; }
inline void set_ReflectionOnlyAssemblyResolve_21(ResolveEventHandler_t2775508208 * value)
{
___ReflectionOnlyAssemblyResolve_21 = value;
Il2CppCodeGenWriteBarrier((&___ReflectionOnlyAssemblyResolve_21), value);
}
};
struct AppDomain_t1571427825_StaticFields
{
public:
// System.String System.AppDomain::_process_guid
String_t* ____process_guid_2;
// System.AppDomain System.AppDomain::default_domain
AppDomain_t1571427825 * ___default_domain_10;
public:
inline static int32_t get_offset_of__process_guid_2() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825_StaticFields, ____process_guid_2)); }
inline String_t* get__process_guid_2() const { return ____process_guid_2; }
inline String_t** get_address_of__process_guid_2() { return &____process_guid_2; }
inline void set__process_guid_2(String_t* value)
{
____process_guid_2 = value;
Il2CppCodeGenWriteBarrier((&____process_guid_2), value);
}
inline static int32_t get_offset_of_default_domain_10() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825_StaticFields, ___default_domain_10)); }
inline AppDomain_t1571427825 * get_default_domain_10() const { return ___default_domain_10; }
inline AppDomain_t1571427825 ** get_address_of_default_domain_10() { return &___default_domain_10; }
inline void set_default_domain_10(AppDomain_t1571427825 * value)
{
___default_domain_10 = value;
Il2CppCodeGenWriteBarrier((&___default_domain_10), value);
}
};
struct AppDomain_t1571427825_ThreadStaticFields
{
public:
// System.Collections.Hashtable System.AppDomain::type_resolve_in_progress
Hashtable_t1853889766 * ___type_resolve_in_progress_3;
// System.Collections.Hashtable System.AppDomain::assembly_resolve_in_progress
Hashtable_t1853889766 * ___assembly_resolve_in_progress_4;
// System.Collections.Hashtable System.AppDomain::assembly_resolve_in_progress_refonly
Hashtable_t1853889766 * ___assembly_resolve_in_progress_refonly_5;
// System.Security.Principal.IPrincipal System.AppDomain::_principal
RuntimeObject* ____principal_9;
public:
inline static int32_t get_offset_of_type_resolve_in_progress_3() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825_ThreadStaticFields, ___type_resolve_in_progress_3)); }
inline Hashtable_t1853889766 * get_type_resolve_in_progress_3() const { return ___type_resolve_in_progress_3; }
inline Hashtable_t1853889766 ** get_address_of_type_resolve_in_progress_3() { return &___type_resolve_in_progress_3; }
inline void set_type_resolve_in_progress_3(Hashtable_t1853889766 * value)
{
___type_resolve_in_progress_3 = value;
Il2CppCodeGenWriteBarrier((&___type_resolve_in_progress_3), value);
}
inline static int32_t get_offset_of_assembly_resolve_in_progress_4() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825_ThreadStaticFields, ___assembly_resolve_in_progress_4)); }
inline Hashtable_t1853889766 * get_assembly_resolve_in_progress_4() const { return ___assembly_resolve_in_progress_4; }
inline Hashtable_t1853889766 ** get_address_of_assembly_resolve_in_progress_4() { return &___assembly_resolve_in_progress_4; }
inline void set_assembly_resolve_in_progress_4(Hashtable_t1853889766 * value)
{
___assembly_resolve_in_progress_4 = value;
Il2CppCodeGenWriteBarrier((&___assembly_resolve_in_progress_4), value);
}
inline static int32_t get_offset_of_assembly_resolve_in_progress_refonly_5() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825_ThreadStaticFields, ___assembly_resolve_in_progress_refonly_5)); }
inline Hashtable_t1853889766 * get_assembly_resolve_in_progress_refonly_5() const { return ___assembly_resolve_in_progress_refonly_5; }
inline Hashtable_t1853889766 ** get_address_of_assembly_resolve_in_progress_refonly_5() { return &___assembly_resolve_in_progress_refonly_5; }
inline void set_assembly_resolve_in_progress_refonly_5(Hashtable_t1853889766 * value)
{
___assembly_resolve_in_progress_refonly_5 = value;
Il2CppCodeGenWriteBarrier((&___assembly_resolve_in_progress_refonly_5), value);
}
inline static int32_t get_offset_of__principal_9() { return static_cast<int32_t>(offsetof(AppDomain_t1571427825_ThreadStaticFields, ____principal_9)); }
inline RuntimeObject* get__principal_9() const { return ____principal_9; }
inline RuntimeObject** get_address_of__principal_9() { return &____principal_9; }
inline void set__principal_9(RuntimeObject* value)
{
____principal_9 = value;
Il2CppCodeGenWriteBarrier((&____principal_9), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // APPDOMAIN_T1571427825_H
#ifndef APPDOMAINSETUP_T123196401_H
#define APPDOMAINSETUP_T123196401_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.AppDomainSetup
struct AppDomainSetup_t123196401 : public RuntimeObject
{
public:
// System.String System.AppDomainSetup::application_base
String_t* ___application_base_0;
// System.String System.AppDomainSetup::application_name
String_t* ___application_name_1;
// System.String System.AppDomainSetup::cache_path
String_t* ___cache_path_2;
// System.String System.AppDomainSetup::configuration_file
String_t* ___configuration_file_3;
// System.String System.AppDomainSetup::dynamic_base
String_t* ___dynamic_base_4;
// System.String System.AppDomainSetup::license_file
String_t* ___license_file_5;
// System.String System.AppDomainSetup::private_bin_path
String_t* ___private_bin_path_6;
// System.String System.AppDomainSetup::private_bin_path_probe
String_t* ___private_bin_path_probe_7;
// System.String System.AppDomainSetup::shadow_copy_directories
String_t* ___shadow_copy_directories_8;
// System.String System.AppDomainSetup::shadow_copy_files
String_t* ___shadow_copy_files_9;
// System.Boolean System.AppDomainSetup::publisher_policy
bool ___publisher_policy_10;
// System.Boolean System.AppDomainSetup::path_changed
bool ___path_changed_11;
// System.LoaderOptimization System.AppDomainSetup::loader_optimization
int32_t ___loader_optimization_12;
// System.Boolean System.AppDomainSetup::disallow_binding_redirects
bool ___disallow_binding_redirects_13;
// System.Boolean System.AppDomainSetup::disallow_code_downloads
bool ___disallow_code_downloads_14;
// System.Runtime.Hosting.ActivationArguments System.AppDomainSetup::_activationArguments
ActivationArguments_t4219999170 * ____activationArguments_15;
// System.AppDomainInitializer System.AppDomainSetup::domain_initializer
AppDomainInitializer_t682969308 * ___domain_initializer_16;
// System.Security.Policy.ApplicationTrust System.AppDomainSetup::application_trust
ApplicationTrust_t3270368423 * ___application_trust_17;
// System.String[] System.AppDomainSetup::domain_initializer_args
StringU5BU5D_t1281789340* ___domain_initializer_args_18;
// System.Security.SecurityElement System.AppDomainSetup::application_trust_xml
SecurityElement_t1046076091 * ___application_trust_xml_19;
// System.Boolean System.AppDomainSetup::disallow_appbase_probe
bool ___disallow_appbase_probe_20;
// System.Byte[] System.AppDomainSetup::configuration_bytes
ByteU5BU5D_t4116647657* ___configuration_bytes_21;
public:
inline static int32_t get_offset_of_application_base_0() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___application_base_0)); }
inline String_t* get_application_base_0() const { return ___application_base_0; }
inline String_t** get_address_of_application_base_0() { return &___application_base_0; }
inline void set_application_base_0(String_t* value)
{
___application_base_0 = value;
Il2CppCodeGenWriteBarrier((&___application_base_0), value);
}
inline static int32_t get_offset_of_application_name_1() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___application_name_1)); }
inline String_t* get_application_name_1() const { return ___application_name_1; }
inline String_t** get_address_of_application_name_1() { return &___application_name_1; }
inline void set_application_name_1(String_t* value)
{
___application_name_1 = value;
Il2CppCodeGenWriteBarrier((&___application_name_1), value);
}
inline static int32_t get_offset_of_cache_path_2() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___cache_path_2)); }
inline String_t* get_cache_path_2() const { return ___cache_path_2; }
inline String_t** get_address_of_cache_path_2() { return &___cache_path_2; }
inline void set_cache_path_2(String_t* value)
{
___cache_path_2 = value;
Il2CppCodeGenWriteBarrier((&___cache_path_2), value);
}
inline static int32_t get_offset_of_configuration_file_3() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___configuration_file_3)); }
inline String_t* get_configuration_file_3() const { return ___configuration_file_3; }
inline String_t** get_address_of_configuration_file_3() { return &___configuration_file_3; }
inline void set_configuration_file_3(String_t* value)
{
___configuration_file_3 = value;
Il2CppCodeGenWriteBarrier((&___configuration_file_3), value);
}
inline static int32_t get_offset_of_dynamic_base_4() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___dynamic_base_4)); }
inline String_t* get_dynamic_base_4() const { return ___dynamic_base_4; }
inline String_t** get_address_of_dynamic_base_4() { return &___dynamic_base_4; }
inline void set_dynamic_base_4(String_t* value)
{
___dynamic_base_4 = value;
Il2CppCodeGenWriteBarrier((&___dynamic_base_4), value);
}
inline static int32_t get_offset_of_license_file_5() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___license_file_5)); }
inline String_t* get_license_file_5() const { return ___license_file_5; }
inline String_t** get_address_of_license_file_5() { return &___license_file_5; }
inline void set_license_file_5(String_t* value)
{
___license_file_5 = value;
Il2CppCodeGenWriteBarrier((&___license_file_5), value);
}
inline static int32_t get_offset_of_private_bin_path_6() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___private_bin_path_6)); }
inline String_t* get_private_bin_path_6() const { return ___private_bin_path_6; }
inline String_t** get_address_of_private_bin_path_6() { return &___private_bin_path_6; }
inline void set_private_bin_path_6(String_t* value)
{
___private_bin_path_6 = value;
Il2CppCodeGenWriteBarrier((&___private_bin_path_6), value);
}
inline static int32_t get_offset_of_private_bin_path_probe_7() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___private_bin_path_probe_7)); }
inline String_t* get_private_bin_path_probe_7() const { return ___private_bin_path_probe_7; }
inline String_t** get_address_of_private_bin_path_probe_7() { return &___private_bin_path_probe_7; }
inline void set_private_bin_path_probe_7(String_t* value)
{
___private_bin_path_probe_7 = value;
Il2CppCodeGenWriteBarrier((&___private_bin_path_probe_7), value);
}
inline static int32_t get_offset_of_shadow_copy_directories_8() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___shadow_copy_directories_8)); }
inline String_t* get_shadow_copy_directories_8() const { return ___shadow_copy_directories_8; }
inline String_t** get_address_of_shadow_copy_directories_8() { return &___shadow_copy_directories_8; }
inline void set_shadow_copy_directories_8(String_t* value)
{
___shadow_copy_directories_8 = value;
Il2CppCodeGenWriteBarrier((&___shadow_copy_directories_8), value);
}
inline static int32_t get_offset_of_shadow_copy_files_9() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___shadow_copy_files_9)); }
inline String_t* get_shadow_copy_files_9() const { return ___shadow_copy_files_9; }
inline String_t** get_address_of_shadow_copy_files_9() { return &___shadow_copy_files_9; }
inline void set_shadow_copy_files_9(String_t* value)
{
___shadow_copy_files_9 = value;
Il2CppCodeGenWriteBarrier((&___shadow_copy_files_9), value);
}
inline static int32_t get_offset_of_publisher_policy_10() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___publisher_policy_10)); }
inline bool get_publisher_policy_10() const { return ___publisher_policy_10; }
inline bool* get_address_of_publisher_policy_10() { return &___publisher_policy_10; }
inline void set_publisher_policy_10(bool value)
{
___publisher_policy_10 = value;
}
inline static int32_t get_offset_of_path_changed_11() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___path_changed_11)); }
inline bool get_path_changed_11() const { return ___path_changed_11; }
inline bool* get_address_of_path_changed_11() { return &___path_changed_11; }
inline void set_path_changed_11(bool value)
{
___path_changed_11 = value;
}
inline static int32_t get_offset_of_loader_optimization_12() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___loader_optimization_12)); }
inline int32_t get_loader_optimization_12() const { return ___loader_optimization_12; }
inline int32_t* get_address_of_loader_optimization_12() { return &___loader_optimization_12; }
inline void set_loader_optimization_12(int32_t value)
{
___loader_optimization_12 = value;
}
inline static int32_t get_offset_of_disallow_binding_redirects_13() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___disallow_binding_redirects_13)); }
inline bool get_disallow_binding_redirects_13() const { return ___disallow_binding_redirects_13; }
inline bool* get_address_of_disallow_binding_redirects_13() { return &___disallow_binding_redirects_13; }
inline void set_disallow_binding_redirects_13(bool value)
{
___disallow_binding_redirects_13 = value;
}
inline static int32_t get_offset_of_disallow_code_downloads_14() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___disallow_code_downloads_14)); }
inline bool get_disallow_code_downloads_14() const { return ___disallow_code_downloads_14; }
inline bool* get_address_of_disallow_code_downloads_14() { return &___disallow_code_downloads_14; }
inline void set_disallow_code_downloads_14(bool value)
{
___disallow_code_downloads_14 = value;
}
inline static int32_t get_offset_of__activationArguments_15() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ____activationArguments_15)); }
inline ActivationArguments_t4219999170 * get__activationArguments_15() const { return ____activationArguments_15; }
inline ActivationArguments_t4219999170 ** get_address_of__activationArguments_15() { return &____activationArguments_15; }
inline void set__activationArguments_15(ActivationArguments_t4219999170 * value)
{
____activationArguments_15 = value;
Il2CppCodeGenWriteBarrier((&____activationArguments_15), value);
}
inline static int32_t get_offset_of_domain_initializer_16() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___domain_initializer_16)); }
inline AppDomainInitializer_t682969308 * get_domain_initializer_16() const { return ___domain_initializer_16; }
inline AppDomainInitializer_t682969308 ** get_address_of_domain_initializer_16() { return &___domain_initializer_16; }
inline void set_domain_initializer_16(AppDomainInitializer_t682969308 * value)
{
___domain_initializer_16 = value;
Il2CppCodeGenWriteBarrier((&___domain_initializer_16), value);
}
inline static int32_t get_offset_of_application_trust_17() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___application_trust_17)); }
inline ApplicationTrust_t3270368423 * get_application_trust_17() const { return ___application_trust_17; }
inline ApplicationTrust_t3270368423 ** get_address_of_application_trust_17() { return &___application_trust_17; }
inline void set_application_trust_17(ApplicationTrust_t3270368423 * value)
{
___application_trust_17 = value;
Il2CppCodeGenWriteBarrier((&___application_trust_17), value);
}
inline static int32_t get_offset_of_domain_initializer_args_18() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___domain_initializer_args_18)); }
inline StringU5BU5D_t1281789340* get_domain_initializer_args_18() const { return ___domain_initializer_args_18; }
inline StringU5BU5D_t1281789340** get_address_of_domain_initializer_args_18() { return &___domain_initializer_args_18; }
inline void set_domain_initializer_args_18(StringU5BU5D_t1281789340* value)
{
___domain_initializer_args_18 = value;
Il2CppCodeGenWriteBarrier((&___domain_initializer_args_18), value);
}
inline static int32_t get_offset_of_application_trust_xml_19() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___application_trust_xml_19)); }
inline SecurityElement_t1046076091 * get_application_trust_xml_19() const { return ___application_trust_xml_19; }
inline SecurityElement_t1046076091 ** get_address_of_application_trust_xml_19() { return &___application_trust_xml_19; }
inline void set_application_trust_xml_19(SecurityElement_t1046076091 * value)
{
___application_trust_xml_19 = value;
Il2CppCodeGenWriteBarrier((&___application_trust_xml_19), value);
}
inline static int32_t get_offset_of_disallow_appbase_probe_20() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___disallow_appbase_probe_20)); }
inline bool get_disallow_appbase_probe_20() const { return ___disallow_appbase_probe_20; }
inline bool* get_address_of_disallow_appbase_probe_20() { return &___disallow_appbase_probe_20; }
inline void set_disallow_appbase_probe_20(bool value)
{
___disallow_appbase_probe_20 = value;
}
inline static int32_t get_offset_of_configuration_bytes_21() { return static_cast<int32_t>(offsetof(AppDomainSetup_t123196401, ___configuration_bytes_21)); }
inline ByteU5BU5D_t4116647657* get_configuration_bytes_21() const { return ___configuration_bytes_21; }
inline ByteU5BU5D_t4116647657** get_address_of_configuration_bytes_21() { return &___configuration_bytes_21; }
inline void set_configuration_bytes_21(ByteU5BU5D_t4116647657* value)
{
___configuration_bytes_21 = value;
Il2CppCodeGenWriteBarrier((&___configuration_bytes_21), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // APPDOMAINSETUP_T123196401_H
#ifndef ARGUMENTNULLEXCEPTION_T1615371798_H
#define ARGUMENTNULLEXCEPTION_T1615371798_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ArgumentNullException
struct ArgumentNullException_t1615371798 : public ArgumentException_t132251570
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ARGUMENTNULLEXCEPTION_T1615371798_H
#ifndef ARGUMENTOUTOFRANGEEXCEPTION_T777629997_H
#define ARGUMENTOUTOFRANGEEXCEPTION_T777629997_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ArgumentOutOfRangeException
struct ArgumentOutOfRangeException_t777629997 : public ArgumentException_t132251570
{
public:
// System.Object System.ArgumentOutOfRangeException::actual_value
RuntimeObject * ___actual_value_13;
public:
inline static int32_t get_offset_of_actual_value_13() { return static_cast<int32_t>(offsetof(ArgumentOutOfRangeException_t777629997, ___actual_value_13)); }
inline RuntimeObject * get_actual_value_13() const { return ___actual_value_13; }
inline RuntimeObject ** get_address_of_actual_value_13() { return &___actual_value_13; }
inline void set_actual_value_13(RuntimeObject * value)
{
___actual_value_13 = value;
Il2CppCodeGenWriteBarrier((&___actual_value_13), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ARGUMENTOUTOFRANGEEXCEPTION_T777629997_H
#ifndef DATETIME_T3738529785_H
#define DATETIME_T3738529785_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DateTime
struct DateTime_t3738529785
{
public:
// System.TimeSpan System.DateTime::ticks
TimeSpan_t881159249 ___ticks_10;
// System.DateTimeKind System.DateTime::kind
int32_t ___kind_11;
public:
inline static int32_t get_offset_of_ticks_10() { return static_cast<int32_t>(offsetof(DateTime_t3738529785, ___ticks_10)); }
inline TimeSpan_t881159249 get_ticks_10() const { return ___ticks_10; }
inline TimeSpan_t881159249 * get_address_of_ticks_10() { return &___ticks_10; }
inline void set_ticks_10(TimeSpan_t881159249 value)
{
___ticks_10 = value;
}
inline static int32_t get_offset_of_kind_11() { return static_cast<int32_t>(offsetof(DateTime_t3738529785, ___kind_11)); }
inline int32_t get_kind_11() const { return ___kind_11; }
inline int32_t* get_address_of_kind_11() { return &___kind_11; }
inline void set_kind_11(int32_t value)
{
___kind_11 = value;
}
};
struct DateTime_t3738529785_StaticFields
{
public:
// System.DateTime System.DateTime::MaxValue
DateTime_t3738529785 ___MaxValue_12;
// System.DateTime System.DateTime::MinValue
DateTime_t3738529785 ___MinValue_13;
// System.String[] System.DateTime::ParseTimeFormats
StringU5BU5D_t1281789340* ___ParseTimeFormats_14;
// System.String[] System.DateTime::ParseYearDayMonthFormats
StringU5BU5D_t1281789340* ___ParseYearDayMonthFormats_15;
// System.String[] System.DateTime::ParseYearMonthDayFormats
StringU5BU5D_t1281789340* ___ParseYearMonthDayFormats_16;
// System.String[] System.DateTime::ParseDayMonthYearFormats
StringU5BU5D_t1281789340* ___ParseDayMonthYearFormats_17;
// System.String[] System.DateTime::ParseMonthDayYearFormats
StringU5BU5D_t1281789340* ___ParseMonthDayYearFormats_18;
// System.String[] System.DateTime::MonthDayShortFormats
StringU5BU5D_t1281789340* ___MonthDayShortFormats_19;
// System.String[] System.DateTime::DayMonthShortFormats
StringU5BU5D_t1281789340* ___DayMonthShortFormats_20;
// System.Int32[] System.DateTime::daysmonth
Int32U5BU5D_t385246372* ___daysmonth_21;
// System.Int32[] System.DateTime::daysmonthleap
Int32U5BU5D_t385246372* ___daysmonthleap_22;
// System.Object System.DateTime::to_local_time_span_object
RuntimeObject * ___to_local_time_span_object_23;
// System.Int64 System.DateTime::last_now
int64_t ___last_now_24;
public:
inline static int32_t get_offset_of_MaxValue_12() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MaxValue_12)); }
inline DateTime_t3738529785 get_MaxValue_12() const { return ___MaxValue_12; }
inline DateTime_t3738529785 * get_address_of_MaxValue_12() { return &___MaxValue_12; }
inline void set_MaxValue_12(DateTime_t3738529785 value)
{
___MaxValue_12 = value;
}
inline static int32_t get_offset_of_MinValue_13() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MinValue_13)); }
inline DateTime_t3738529785 get_MinValue_13() const { return ___MinValue_13; }
inline DateTime_t3738529785 * get_address_of_MinValue_13() { return &___MinValue_13; }
inline void set_MinValue_13(DateTime_t3738529785 value)
{
___MinValue_13 = value;
}
inline static int32_t get_offset_of_ParseTimeFormats_14() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseTimeFormats_14)); }
inline StringU5BU5D_t1281789340* get_ParseTimeFormats_14() const { return ___ParseTimeFormats_14; }
inline StringU5BU5D_t1281789340** get_address_of_ParseTimeFormats_14() { return &___ParseTimeFormats_14; }
inline void set_ParseTimeFormats_14(StringU5BU5D_t1281789340* value)
{
___ParseTimeFormats_14 = value;
Il2CppCodeGenWriteBarrier((&___ParseTimeFormats_14), value);
}
inline static int32_t get_offset_of_ParseYearDayMonthFormats_15() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseYearDayMonthFormats_15)); }
inline StringU5BU5D_t1281789340* get_ParseYearDayMonthFormats_15() const { return ___ParseYearDayMonthFormats_15; }
inline StringU5BU5D_t1281789340** get_address_of_ParseYearDayMonthFormats_15() { return &___ParseYearDayMonthFormats_15; }
inline void set_ParseYearDayMonthFormats_15(StringU5BU5D_t1281789340* value)
{
___ParseYearDayMonthFormats_15 = value;
Il2CppCodeGenWriteBarrier((&___ParseYearDayMonthFormats_15), value);
}
inline static int32_t get_offset_of_ParseYearMonthDayFormats_16() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseYearMonthDayFormats_16)); }
inline StringU5BU5D_t1281789340* get_ParseYearMonthDayFormats_16() const { return ___ParseYearMonthDayFormats_16; }
inline StringU5BU5D_t1281789340** get_address_of_ParseYearMonthDayFormats_16() { return &___ParseYearMonthDayFormats_16; }
inline void set_ParseYearMonthDayFormats_16(StringU5BU5D_t1281789340* value)
{
___ParseYearMonthDayFormats_16 = value;
Il2CppCodeGenWriteBarrier((&___ParseYearMonthDayFormats_16), value);
}
inline static int32_t get_offset_of_ParseDayMonthYearFormats_17() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseDayMonthYearFormats_17)); }
inline StringU5BU5D_t1281789340* get_ParseDayMonthYearFormats_17() const { return ___ParseDayMonthYearFormats_17; }
inline StringU5BU5D_t1281789340** get_address_of_ParseDayMonthYearFormats_17() { return &___ParseDayMonthYearFormats_17; }
inline void set_ParseDayMonthYearFormats_17(StringU5BU5D_t1281789340* value)
{
___ParseDayMonthYearFormats_17 = value;
Il2CppCodeGenWriteBarrier((&___ParseDayMonthYearFormats_17), value);
}
inline static int32_t get_offset_of_ParseMonthDayYearFormats_18() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___ParseMonthDayYearFormats_18)); }
inline StringU5BU5D_t1281789340* get_ParseMonthDayYearFormats_18() const { return ___ParseMonthDayYearFormats_18; }
inline StringU5BU5D_t1281789340** get_address_of_ParseMonthDayYearFormats_18() { return &___ParseMonthDayYearFormats_18; }
inline void set_ParseMonthDayYearFormats_18(StringU5BU5D_t1281789340* value)
{
___ParseMonthDayYearFormats_18 = value;
Il2CppCodeGenWriteBarrier((&___ParseMonthDayYearFormats_18), value);
}
inline static int32_t get_offset_of_MonthDayShortFormats_19() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MonthDayShortFormats_19)); }
inline StringU5BU5D_t1281789340* get_MonthDayShortFormats_19() const { return ___MonthDayShortFormats_19; }
inline StringU5BU5D_t1281789340** get_address_of_MonthDayShortFormats_19() { return &___MonthDayShortFormats_19; }
inline void set_MonthDayShortFormats_19(StringU5BU5D_t1281789340* value)
{
___MonthDayShortFormats_19 = value;
Il2CppCodeGenWriteBarrier((&___MonthDayShortFormats_19), value);
}
inline static int32_t get_offset_of_DayMonthShortFormats_20() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___DayMonthShortFormats_20)); }
inline StringU5BU5D_t1281789340* get_DayMonthShortFormats_20() const { return ___DayMonthShortFormats_20; }
inline StringU5BU5D_t1281789340** get_address_of_DayMonthShortFormats_20() { return &___DayMonthShortFormats_20; }
inline void set_DayMonthShortFormats_20(StringU5BU5D_t1281789340* value)
{
___DayMonthShortFormats_20 = value;
Il2CppCodeGenWriteBarrier((&___DayMonthShortFormats_20), value);
}
inline static int32_t get_offset_of_daysmonth_21() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___daysmonth_21)); }
inline Int32U5BU5D_t385246372* get_daysmonth_21() const { return ___daysmonth_21; }
inline Int32U5BU5D_t385246372** get_address_of_daysmonth_21() { return &___daysmonth_21; }
inline void set_daysmonth_21(Int32U5BU5D_t385246372* value)
{
___daysmonth_21 = value;
Il2CppCodeGenWriteBarrier((&___daysmonth_21), value);
}
inline static int32_t get_offset_of_daysmonthleap_22() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___daysmonthleap_22)); }
inline Int32U5BU5D_t385246372* get_daysmonthleap_22() const { return ___daysmonthleap_22; }
inline Int32U5BU5D_t385246372** get_address_of_daysmonthleap_22() { return &___daysmonthleap_22; }
inline void set_daysmonthleap_22(Int32U5BU5D_t385246372* value)
{
___daysmonthleap_22 = value;
Il2CppCodeGenWriteBarrier((&___daysmonthleap_22), value);
}
inline static int32_t get_offset_of_to_local_time_span_object_23() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___to_local_time_span_object_23)); }
inline RuntimeObject * get_to_local_time_span_object_23() const { return ___to_local_time_span_object_23; }
inline RuntimeObject ** get_address_of_to_local_time_span_object_23() { return &___to_local_time_span_object_23; }
inline void set_to_local_time_span_object_23(RuntimeObject * value)
{
___to_local_time_span_object_23 = value;
Il2CppCodeGenWriteBarrier((&___to_local_time_span_object_23), value);
}
inline static int32_t get_offset_of_last_now_24() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___last_now_24)); }
inline int64_t get_last_now_24() const { return ___last_now_24; }
inline int64_t* get_address_of_last_now_24() { return &___last_now_24; }
inline void set_last_now_24(int64_t value)
{
___last_now_24 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DATETIME_T3738529785_H
#ifndef DIVIDEBYZEROEXCEPTION_T1856388118_H
#define DIVIDEBYZEROEXCEPTION_T1856388118_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DivideByZeroException
struct DivideByZeroException_t1856388118 : public ArithmeticException_t4283546778
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DIVIDEBYZEROEXCEPTION_T1856388118_H
#ifndef DLLNOTFOUNDEXCEPTION_T2721418633_H
#define DLLNOTFOUNDEXCEPTION_T2721418633_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DllNotFoundException
struct DllNotFoundException_t2721418633 : public TypeLoadException_t3707937253
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DLLNOTFOUNDEXCEPTION_T2721418633_H
#ifndef ENTRYPOINTNOTFOUNDEXCEPTION_T1356862416_H
#define ENTRYPOINTNOTFOUNDEXCEPTION_T1356862416_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.EntryPointNotFoundException
struct EntryPointNotFoundException_t1356862416 : public TypeLoadException_t3707937253
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ENTRYPOINTNOTFOUNDEXCEPTION_T1356862416_H
#ifndef FIELDACCESSEXCEPTION_T238379456_H
#define FIELDACCESSEXCEPTION_T238379456_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.FieldAccessException
struct FieldAccessException_t238379456 : public MemberAccessException_t1734467078
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FIELDACCESSEXCEPTION_T238379456_H
#ifndef METHODACCESSEXCEPTION_T190175859_H
#define METHODACCESSEXCEPTION_T190175859_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MethodAccessException
struct MethodAccessException_t190175859 : public MemberAccessException_t1734467078
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // METHODACCESSEXCEPTION_T190175859_H
#ifndef MISSINGMEMBEREXCEPTION_T1385081665_H
#define MISSINGMEMBEREXCEPTION_T1385081665_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MissingMemberException
struct MissingMemberException_t1385081665 : public MemberAccessException_t1734467078
{
public:
// System.String System.MissingMemberException::ClassName
String_t* ___ClassName_11;
// System.String System.MissingMemberException::MemberName
String_t* ___MemberName_12;
// System.Byte[] System.MissingMemberException::Signature
ByteU5BU5D_t4116647657* ___Signature_13;
public:
inline static int32_t get_offset_of_ClassName_11() { return static_cast<int32_t>(offsetof(MissingMemberException_t1385081665, ___ClassName_11)); }
inline String_t* get_ClassName_11() const { return ___ClassName_11; }
inline String_t** get_address_of_ClassName_11() { return &___ClassName_11; }
inline void set_ClassName_11(String_t* value)
{
___ClassName_11 = value;
Il2CppCodeGenWriteBarrier((&___ClassName_11), value);
}
inline static int32_t get_offset_of_MemberName_12() { return static_cast<int32_t>(offsetof(MissingMemberException_t1385081665, ___MemberName_12)); }
inline String_t* get_MemberName_12() const { return ___MemberName_12; }
inline String_t** get_address_of_MemberName_12() { return &___MemberName_12; }
inline void set_MemberName_12(String_t* value)
{
___MemberName_12 = value;
Il2CppCodeGenWriteBarrier((&___MemberName_12), value);
}
inline static int32_t get_offset_of_Signature_13() { return static_cast<int32_t>(offsetof(MissingMemberException_t1385081665, ___Signature_13)); }
inline ByteU5BU5D_t4116647657* get_Signature_13() const { return ___Signature_13; }
inline ByteU5BU5D_t4116647657** get_address_of_Signature_13() { return &___Signature_13; }
inline void set_Signature_13(ByteU5BU5D_t4116647657* value)
{
___Signature_13 = value;
Il2CppCodeGenWriteBarrier((&___Signature_13), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MISSINGMEMBEREXCEPTION_T1385081665_H
#ifndef EVENTWAITHANDLE_T777845177_H
#define EVENTWAITHANDLE_T777845177_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.EventWaitHandle
struct EventWaitHandle_t777845177 : public WaitHandle_t1743403487
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // EVENTWAITHANDLE_T777845177_H
#ifndef MUTEX_T3066672582_H
#define MUTEX_T3066672582_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Mutex
struct Mutex_t3066672582 : public WaitHandle_t1743403487
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MUTEX_T3066672582_H
#ifndef THREAD_T2300836069_H
#define THREAD_T2300836069_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.Thread
struct Thread_t2300836069 : public CriticalFinalizerObject_t701527852
{
public:
// System.Int32 System.Threading.Thread::lock_thread_id
int32_t ___lock_thread_id_0;
// System.IntPtr System.Threading.Thread::system_thread_handle
intptr_t ___system_thread_handle_1;
// System.Object System.Threading.Thread::cached_culture_info
RuntimeObject * ___cached_culture_info_2;
// System.IntPtr System.Threading.Thread::unused0
intptr_t ___unused0_3;
// System.Boolean System.Threading.Thread::threadpool_thread
bool ___threadpool_thread_4;
// System.IntPtr System.Threading.Thread::name
intptr_t ___name_5;
// System.Int32 System.Threading.Thread::name_len
int32_t ___name_len_6;
// System.Threading.ThreadState System.Threading.Thread::state
int32_t ___state_7;
// System.Object System.Threading.Thread::abort_exc
RuntimeObject * ___abort_exc_8;
// System.Int32 System.Threading.Thread::abort_state_handle
int32_t ___abort_state_handle_9;
// System.Int64 System.Threading.Thread::thread_id
int64_t ___thread_id_10;
// System.IntPtr System.Threading.Thread::start_notify
intptr_t ___start_notify_11;
// System.IntPtr System.Threading.Thread::stack_ptr
intptr_t ___stack_ptr_12;
// System.UIntPtr System.Threading.Thread::static_data
uintptr_t ___static_data_13;
// System.IntPtr System.Threading.Thread::jit_data
intptr_t ___jit_data_14;
// System.IntPtr System.Threading.Thread::lock_data
intptr_t ___lock_data_15;
// System.Object System.Threading.Thread::current_appcontext
RuntimeObject * ___current_appcontext_16;
// System.Int32 System.Threading.Thread::stack_size
int32_t ___stack_size_17;
// System.Object System.Threading.Thread::start_obj
RuntimeObject * ___start_obj_18;
// System.IntPtr System.Threading.Thread::appdomain_refs
intptr_t ___appdomain_refs_19;
// System.Int32 System.Threading.Thread::interruption_requested
int32_t ___interruption_requested_20;
// System.IntPtr System.Threading.Thread::suspend_event
intptr_t ___suspend_event_21;
// System.IntPtr System.Threading.Thread::suspended_event
intptr_t ___suspended_event_22;
// System.IntPtr System.Threading.Thread::resume_event
intptr_t ___resume_event_23;
// System.IntPtr System.Threading.Thread::synch_cs
intptr_t ___synch_cs_24;
// System.IntPtr System.Threading.Thread::serialized_culture_info
intptr_t ___serialized_culture_info_25;
// System.Int32 System.Threading.Thread::serialized_culture_info_len
int32_t ___serialized_culture_info_len_26;
// System.IntPtr System.Threading.Thread::serialized_ui_culture_info
intptr_t ___serialized_ui_culture_info_27;
// System.Int32 System.Threading.Thread::serialized_ui_culture_info_len
int32_t ___serialized_ui_culture_info_len_28;
// System.Boolean System.Threading.Thread::thread_dump_requested
bool ___thread_dump_requested_29;
// System.IntPtr System.Threading.Thread::end_stack
intptr_t ___end_stack_30;
// System.Boolean System.Threading.Thread::thread_interrupt_requested
bool ___thread_interrupt_requested_31;
// System.Byte System.Threading.Thread::apartment_state
uint8_t ___apartment_state_32;
// System.Int32 modreq(System.Runtime.CompilerServices.IsVolatile) System.Threading.Thread::critical_region_level
int32_t ___critical_region_level_33;
// System.Int32 System.Threading.Thread::small_id
int32_t ___small_id_34;
// System.IntPtr System.Threading.Thread::manage_callback
intptr_t ___manage_callback_35;
// System.Object System.Threading.Thread::pending_exception
RuntimeObject * ___pending_exception_36;
// System.Threading.ExecutionContext System.Threading.Thread::ec_to_set
ExecutionContext_t1748372627 * ___ec_to_set_37;
// System.IntPtr System.Threading.Thread::interrupt_on_stop
intptr_t ___interrupt_on_stop_38;
// System.IntPtr System.Threading.Thread::unused3
intptr_t ___unused3_39;
// System.IntPtr System.Threading.Thread::unused4
intptr_t ___unused4_40;
// System.IntPtr System.Threading.Thread::unused5
intptr_t ___unused5_41;
// System.IntPtr System.Threading.Thread::unused6
intptr_t ___unused6_42;
// System.MulticastDelegate System.Threading.Thread::threadstart
MulticastDelegate_t * ___threadstart_45;
// System.Int32 System.Threading.Thread::managed_id
int32_t ___managed_id_46;
// System.Security.Principal.IPrincipal System.Threading.Thread::_principal
RuntimeObject* ____principal_47;
// System.Boolean System.Threading.Thread::in_currentculture
bool ___in_currentculture_50;
public:
inline static int32_t get_offset_of_lock_thread_id_0() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___lock_thread_id_0)); }
inline int32_t get_lock_thread_id_0() const { return ___lock_thread_id_0; }
inline int32_t* get_address_of_lock_thread_id_0() { return &___lock_thread_id_0; }
inline void set_lock_thread_id_0(int32_t value)
{
___lock_thread_id_0 = value;
}
inline static int32_t get_offset_of_system_thread_handle_1() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___system_thread_handle_1)); }
inline intptr_t get_system_thread_handle_1() const { return ___system_thread_handle_1; }
inline intptr_t* get_address_of_system_thread_handle_1() { return &___system_thread_handle_1; }
inline void set_system_thread_handle_1(intptr_t value)
{
___system_thread_handle_1 = value;
}
inline static int32_t get_offset_of_cached_culture_info_2() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___cached_culture_info_2)); }
inline RuntimeObject * get_cached_culture_info_2() const { return ___cached_culture_info_2; }
inline RuntimeObject ** get_address_of_cached_culture_info_2() { return &___cached_culture_info_2; }
inline void set_cached_culture_info_2(RuntimeObject * value)
{
___cached_culture_info_2 = value;
Il2CppCodeGenWriteBarrier((&___cached_culture_info_2), value);
}
inline static int32_t get_offset_of_unused0_3() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___unused0_3)); }
inline intptr_t get_unused0_3() const { return ___unused0_3; }
inline intptr_t* get_address_of_unused0_3() { return &___unused0_3; }
inline void set_unused0_3(intptr_t value)
{
___unused0_3 = value;
}
inline static int32_t get_offset_of_threadpool_thread_4() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___threadpool_thread_4)); }
inline bool get_threadpool_thread_4() const { return ___threadpool_thread_4; }
inline bool* get_address_of_threadpool_thread_4() { return &___threadpool_thread_4; }
inline void set_threadpool_thread_4(bool value)
{
___threadpool_thread_4 = value;
}
inline static int32_t get_offset_of_name_5() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___name_5)); }
inline intptr_t get_name_5() const { return ___name_5; }
inline intptr_t* get_address_of_name_5() { return &___name_5; }
inline void set_name_5(intptr_t value)
{
___name_5 = value;
}
inline static int32_t get_offset_of_name_len_6() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___name_len_6)); }
inline int32_t get_name_len_6() const { return ___name_len_6; }
inline int32_t* get_address_of_name_len_6() { return &___name_len_6; }
inline void set_name_len_6(int32_t value)
{
___name_len_6 = value;
}
inline static int32_t get_offset_of_state_7() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___state_7)); }
inline int32_t get_state_7() const { return ___state_7; }
inline int32_t* get_address_of_state_7() { return &___state_7; }
inline void set_state_7(int32_t value)
{
___state_7 = value;
}
inline static int32_t get_offset_of_abort_exc_8() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___abort_exc_8)); }
inline RuntimeObject * get_abort_exc_8() const { return ___abort_exc_8; }
inline RuntimeObject ** get_address_of_abort_exc_8() { return &___abort_exc_8; }
inline void set_abort_exc_8(RuntimeObject * value)
{
___abort_exc_8 = value;
Il2CppCodeGenWriteBarrier((&___abort_exc_8), value);
}
inline static int32_t get_offset_of_abort_state_handle_9() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___abort_state_handle_9)); }
inline int32_t get_abort_state_handle_9() const { return ___abort_state_handle_9; }
inline int32_t* get_address_of_abort_state_handle_9() { return &___abort_state_handle_9; }
inline void set_abort_state_handle_9(int32_t value)
{
___abort_state_handle_9 = value;
}
inline static int32_t get_offset_of_thread_id_10() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___thread_id_10)); }
inline int64_t get_thread_id_10() const { return ___thread_id_10; }
inline int64_t* get_address_of_thread_id_10() { return &___thread_id_10; }
inline void set_thread_id_10(int64_t value)
{
___thread_id_10 = value;
}
inline static int32_t get_offset_of_start_notify_11() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___start_notify_11)); }
inline intptr_t get_start_notify_11() const { return ___start_notify_11; }
inline intptr_t* get_address_of_start_notify_11() { return &___start_notify_11; }
inline void set_start_notify_11(intptr_t value)
{
___start_notify_11 = value;
}
inline static int32_t get_offset_of_stack_ptr_12() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___stack_ptr_12)); }
inline intptr_t get_stack_ptr_12() const { return ___stack_ptr_12; }
inline intptr_t* get_address_of_stack_ptr_12() { return &___stack_ptr_12; }
inline void set_stack_ptr_12(intptr_t value)
{
___stack_ptr_12 = value;
}
inline static int32_t get_offset_of_static_data_13() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___static_data_13)); }
inline uintptr_t get_static_data_13() const { return ___static_data_13; }
inline uintptr_t* get_address_of_static_data_13() { return &___static_data_13; }
inline void set_static_data_13(uintptr_t value)
{
___static_data_13 = value;
}
inline static int32_t get_offset_of_jit_data_14() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___jit_data_14)); }
inline intptr_t get_jit_data_14() const { return ___jit_data_14; }
inline intptr_t* get_address_of_jit_data_14() { return &___jit_data_14; }
inline void set_jit_data_14(intptr_t value)
{
___jit_data_14 = value;
}
inline static int32_t get_offset_of_lock_data_15() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___lock_data_15)); }
inline intptr_t get_lock_data_15() const { return ___lock_data_15; }
inline intptr_t* get_address_of_lock_data_15() { return &___lock_data_15; }
inline void set_lock_data_15(intptr_t value)
{
___lock_data_15 = value;
}
inline static int32_t get_offset_of_current_appcontext_16() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___current_appcontext_16)); }
inline RuntimeObject * get_current_appcontext_16() const { return ___current_appcontext_16; }
inline RuntimeObject ** get_address_of_current_appcontext_16() { return &___current_appcontext_16; }
inline void set_current_appcontext_16(RuntimeObject * value)
{
___current_appcontext_16 = value;
Il2CppCodeGenWriteBarrier((&___current_appcontext_16), value);
}
inline static int32_t get_offset_of_stack_size_17() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___stack_size_17)); }
inline int32_t get_stack_size_17() const { return ___stack_size_17; }
inline int32_t* get_address_of_stack_size_17() { return &___stack_size_17; }
inline void set_stack_size_17(int32_t value)
{
___stack_size_17 = value;
}
inline static int32_t get_offset_of_start_obj_18() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___start_obj_18)); }
inline RuntimeObject * get_start_obj_18() const { return ___start_obj_18; }
inline RuntimeObject ** get_address_of_start_obj_18() { return &___start_obj_18; }
inline void set_start_obj_18(RuntimeObject * value)
{
___start_obj_18 = value;
Il2CppCodeGenWriteBarrier((&___start_obj_18), value);
}
inline static int32_t get_offset_of_appdomain_refs_19() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___appdomain_refs_19)); }
inline intptr_t get_appdomain_refs_19() const { return ___appdomain_refs_19; }
inline intptr_t* get_address_of_appdomain_refs_19() { return &___appdomain_refs_19; }
inline void set_appdomain_refs_19(intptr_t value)
{
___appdomain_refs_19 = value;
}
inline static int32_t get_offset_of_interruption_requested_20() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___interruption_requested_20)); }
inline int32_t get_interruption_requested_20() const { return ___interruption_requested_20; }
inline int32_t* get_address_of_interruption_requested_20() { return &___interruption_requested_20; }
inline void set_interruption_requested_20(int32_t value)
{
___interruption_requested_20 = value;
}
inline static int32_t get_offset_of_suspend_event_21() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___suspend_event_21)); }
inline intptr_t get_suspend_event_21() const { return ___suspend_event_21; }
inline intptr_t* get_address_of_suspend_event_21() { return &___suspend_event_21; }
inline void set_suspend_event_21(intptr_t value)
{
___suspend_event_21 = value;
}
inline static int32_t get_offset_of_suspended_event_22() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___suspended_event_22)); }
inline intptr_t get_suspended_event_22() const { return ___suspended_event_22; }
inline intptr_t* get_address_of_suspended_event_22() { return &___suspended_event_22; }
inline void set_suspended_event_22(intptr_t value)
{
___suspended_event_22 = value;
}
inline static int32_t get_offset_of_resume_event_23() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___resume_event_23)); }
inline intptr_t get_resume_event_23() const { return ___resume_event_23; }
inline intptr_t* get_address_of_resume_event_23() { return &___resume_event_23; }
inline void set_resume_event_23(intptr_t value)
{
___resume_event_23 = value;
}
inline static int32_t get_offset_of_synch_cs_24() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___synch_cs_24)); }
inline intptr_t get_synch_cs_24() const { return ___synch_cs_24; }
inline intptr_t* get_address_of_synch_cs_24() { return &___synch_cs_24; }
inline void set_synch_cs_24(intptr_t value)
{
___synch_cs_24 = value;
}
inline static int32_t get_offset_of_serialized_culture_info_25() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___serialized_culture_info_25)); }
inline intptr_t get_serialized_culture_info_25() const { return ___serialized_culture_info_25; }
inline intptr_t* get_address_of_serialized_culture_info_25() { return &___serialized_culture_info_25; }
inline void set_serialized_culture_info_25(intptr_t value)
{
___serialized_culture_info_25 = value;
}
inline static int32_t get_offset_of_serialized_culture_info_len_26() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___serialized_culture_info_len_26)); }
inline int32_t get_serialized_culture_info_len_26() const { return ___serialized_culture_info_len_26; }
inline int32_t* get_address_of_serialized_culture_info_len_26() { return &___serialized_culture_info_len_26; }
inline void set_serialized_culture_info_len_26(int32_t value)
{
___serialized_culture_info_len_26 = value;
}
inline static int32_t get_offset_of_serialized_ui_culture_info_27() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___serialized_ui_culture_info_27)); }
inline intptr_t get_serialized_ui_culture_info_27() const { return ___serialized_ui_culture_info_27; }
inline intptr_t* get_address_of_serialized_ui_culture_info_27() { return &___serialized_ui_culture_info_27; }
inline void set_serialized_ui_culture_info_27(intptr_t value)
{
___serialized_ui_culture_info_27 = value;
}
inline static int32_t get_offset_of_serialized_ui_culture_info_len_28() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___serialized_ui_culture_info_len_28)); }
inline int32_t get_serialized_ui_culture_info_len_28() const { return ___serialized_ui_culture_info_len_28; }
inline int32_t* get_address_of_serialized_ui_culture_info_len_28() { return &___serialized_ui_culture_info_len_28; }
inline void set_serialized_ui_culture_info_len_28(int32_t value)
{
___serialized_ui_culture_info_len_28 = value;
}
inline static int32_t get_offset_of_thread_dump_requested_29() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___thread_dump_requested_29)); }
inline bool get_thread_dump_requested_29() const { return ___thread_dump_requested_29; }
inline bool* get_address_of_thread_dump_requested_29() { return &___thread_dump_requested_29; }
inline void set_thread_dump_requested_29(bool value)
{
___thread_dump_requested_29 = value;
}
inline static int32_t get_offset_of_end_stack_30() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___end_stack_30)); }
inline intptr_t get_end_stack_30() const { return ___end_stack_30; }
inline intptr_t* get_address_of_end_stack_30() { return &___end_stack_30; }
inline void set_end_stack_30(intptr_t value)
{
___end_stack_30 = value;
}
inline static int32_t get_offset_of_thread_interrupt_requested_31() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___thread_interrupt_requested_31)); }
inline bool get_thread_interrupt_requested_31() const { return ___thread_interrupt_requested_31; }
inline bool* get_address_of_thread_interrupt_requested_31() { return &___thread_interrupt_requested_31; }
inline void set_thread_interrupt_requested_31(bool value)
{
___thread_interrupt_requested_31 = value;
}
inline static int32_t get_offset_of_apartment_state_32() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___apartment_state_32)); }
inline uint8_t get_apartment_state_32() const { return ___apartment_state_32; }
inline uint8_t* get_address_of_apartment_state_32() { return &___apartment_state_32; }
inline void set_apartment_state_32(uint8_t value)
{
___apartment_state_32 = value;
}
inline static int32_t get_offset_of_critical_region_level_33() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___critical_region_level_33)); }
inline int32_t get_critical_region_level_33() const { return ___critical_region_level_33; }
inline int32_t* get_address_of_critical_region_level_33() { return &___critical_region_level_33; }
inline void set_critical_region_level_33(int32_t value)
{
___critical_region_level_33 = value;
}
inline static int32_t get_offset_of_small_id_34() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___small_id_34)); }
inline int32_t get_small_id_34() const { return ___small_id_34; }
inline int32_t* get_address_of_small_id_34() { return &___small_id_34; }
inline void set_small_id_34(int32_t value)
{
___small_id_34 = value;
}
inline static int32_t get_offset_of_manage_callback_35() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___manage_callback_35)); }
inline intptr_t get_manage_callback_35() const { return ___manage_callback_35; }
inline intptr_t* get_address_of_manage_callback_35() { return &___manage_callback_35; }
inline void set_manage_callback_35(intptr_t value)
{
___manage_callback_35 = value;
}
inline static int32_t get_offset_of_pending_exception_36() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___pending_exception_36)); }
inline RuntimeObject * get_pending_exception_36() const { return ___pending_exception_36; }
inline RuntimeObject ** get_address_of_pending_exception_36() { return &___pending_exception_36; }
inline void set_pending_exception_36(RuntimeObject * value)
{
___pending_exception_36 = value;
Il2CppCodeGenWriteBarrier((&___pending_exception_36), value);
}
inline static int32_t get_offset_of_ec_to_set_37() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___ec_to_set_37)); }
inline ExecutionContext_t1748372627 * get_ec_to_set_37() const { return ___ec_to_set_37; }
inline ExecutionContext_t1748372627 ** get_address_of_ec_to_set_37() { return &___ec_to_set_37; }
inline void set_ec_to_set_37(ExecutionContext_t1748372627 * value)
{
___ec_to_set_37 = value;
Il2CppCodeGenWriteBarrier((&___ec_to_set_37), value);
}
inline static int32_t get_offset_of_interrupt_on_stop_38() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___interrupt_on_stop_38)); }
inline intptr_t get_interrupt_on_stop_38() const { return ___interrupt_on_stop_38; }
inline intptr_t* get_address_of_interrupt_on_stop_38() { return &___interrupt_on_stop_38; }
inline void set_interrupt_on_stop_38(intptr_t value)
{
___interrupt_on_stop_38 = value;
}
inline static int32_t get_offset_of_unused3_39() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___unused3_39)); }
inline intptr_t get_unused3_39() const { return ___unused3_39; }
inline intptr_t* get_address_of_unused3_39() { return &___unused3_39; }
inline void set_unused3_39(intptr_t value)
{
___unused3_39 = value;
}
inline static int32_t get_offset_of_unused4_40() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___unused4_40)); }
inline intptr_t get_unused4_40() const { return ___unused4_40; }
inline intptr_t* get_address_of_unused4_40() { return &___unused4_40; }
inline void set_unused4_40(intptr_t value)
{
___unused4_40 = value;
}
inline static int32_t get_offset_of_unused5_41() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___unused5_41)); }
inline intptr_t get_unused5_41() const { return ___unused5_41; }
inline intptr_t* get_address_of_unused5_41() { return &___unused5_41; }
inline void set_unused5_41(intptr_t value)
{
___unused5_41 = value;
}
inline static int32_t get_offset_of_unused6_42() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___unused6_42)); }
inline intptr_t get_unused6_42() const { return ___unused6_42; }
inline intptr_t* get_address_of_unused6_42() { return &___unused6_42; }
inline void set_unused6_42(intptr_t value)
{
___unused6_42 = value;
}
inline static int32_t get_offset_of_threadstart_45() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___threadstart_45)); }
inline MulticastDelegate_t * get_threadstart_45() const { return ___threadstart_45; }
inline MulticastDelegate_t ** get_address_of_threadstart_45() { return &___threadstart_45; }
inline void set_threadstart_45(MulticastDelegate_t * value)
{
___threadstart_45 = value;
Il2CppCodeGenWriteBarrier((&___threadstart_45), value);
}
inline static int32_t get_offset_of_managed_id_46() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___managed_id_46)); }
inline int32_t get_managed_id_46() const { return ___managed_id_46; }
inline int32_t* get_address_of_managed_id_46() { return &___managed_id_46; }
inline void set_managed_id_46(int32_t value)
{
___managed_id_46 = value;
}
inline static int32_t get_offset_of__principal_47() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ____principal_47)); }
inline RuntimeObject* get__principal_47() const { return ____principal_47; }
inline RuntimeObject** get_address_of__principal_47() { return &____principal_47; }
inline void set__principal_47(RuntimeObject* value)
{
____principal_47 = value;
Il2CppCodeGenWriteBarrier((&____principal_47), value);
}
inline static int32_t get_offset_of_in_currentculture_50() { return static_cast<int32_t>(offsetof(Thread_t2300836069, ___in_currentculture_50)); }
inline bool get_in_currentculture_50() const { return ___in_currentculture_50; }
inline bool* get_address_of_in_currentculture_50() { return &___in_currentculture_50; }
inline void set_in_currentculture_50(bool value)
{
___in_currentculture_50 = value;
}
};
struct Thread_t2300836069_StaticFields
{
public:
// System.Collections.Hashtable System.Threading.Thread::datastorehash
Hashtable_t1853889766 * ___datastorehash_48;
// System.Object System.Threading.Thread::datastore_lock
RuntimeObject * ___datastore_lock_49;
// System.Object System.Threading.Thread::culture_lock
RuntimeObject * ___culture_lock_51;
public:
inline static int32_t get_offset_of_datastorehash_48() { return static_cast<int32_t>(offsetof(Thread_t2300836069_StaticFields, ___datastorehash_48)); }
inline Hashtable_t1853889766 * get_datastorehash_48() const { return ___datastorehash_48; }
inline Hashtable_t1853889766 ** get_address_of_datastorehash_48() { return &___datastorehash_48; }
inline void set_datastorehash_48(Hashtable_t1853889766 * value)
{
___datastorehash_48 = value;
Il2CppCodeGenWriteBarrier((&___datastorehash_48), value);
}
inline static int32_t get_offset_of_datastore_lock_49() { return static_cast<int32_t>(offsetof(Thread_t2300836069_StaticFields, ___datastore_lock_49)); }
inline RuntimeObject * get_datastore_lock_49() const { return ___datastore_lock_49; }
inline RuntimeObject ** get_address_of_datastore_lock_49() { return &___datastore_lock_49; }
inline void set_datastore_lock_49(RuntimeObject * value)
{
___datastore_lock_49 = value;
Il2CppCodeGenWriteBarrier((&___datastore_lock_49), value);
}
inline static int32_t get_offset_of_culture_lock_51() { return static_cast<int32_t>(offsetof(Thread_t2300836069_StaticFields, ___culture_lock_51)); }
inline RuntimeObject * get_culture_lock_51() const { return ___culture_lock_51; }
inline RuntimeObject ** get_address_of_culture_lock_51() { return &___culture_lock_51; }
inline void set_culture_lock_51(RuntimeObject * value)
{
___culture_lock_51 = value;
Il2CppCodeGenWriteBarrier((&___culture_lock_51), value);
}
};
struct Thread_t2300836069_ThreadStaticFields
{
public:
// System.Object[] System.Threading.Thread::local_slots
ObjectU5BU5D_t2843939325* ___local_slots_43;
// System.Threading.ExecutionContext System.Threading.Thread::_ec
ExecutionContext_t1748372627 * ____ec_44;
public:
inline static int32_t get_offset_of_local_slots_43() { return static_cast<int32_t>(offsetof(Thread_t2300836069_ThreadStaticFields, ___local_slots_43)); }
inline ObjectU5BU5D_t2843939325* get_local_slots_43() const { return ___local_slots_43; }
inline ObjectU5BU5D_t2843939325** get_address_of_local_slots_43() { return &___local_slots_43; }
inline void set_local_slots_43(ObjectU5BU5D_t2843939325* value)
{
___local_slots_43 = value;
Il2CppCodeGenWriteBarrier((&___local_slots_43), value);
}
inline static int32_t get_offset_of__ec_44() { return static_cast<int32_t>(offsetof(Thread_t2300836069_ThreadStaticFields, ____ec_44)); }
inline ExecutionContext_t1748372627 * get__ec_44() const { return ____ec_44; }
inline ExecutionContext_t1748372627 ** get_address_of__ec_44() { return &____ec_44; }
inline void set__ec_44(ExecutionContext_t1748372627 * value)
{
____ec_44 = value;
Il2CppCodeGenWriteBarrier((&____ec_44), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // THREAD_T2300836069_H
#ifndef DATETIMEOFFSET_T3229287507_H
#define DATETIMEOFFSET_T3229287507_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.DateTimeOffset
struct DateTimeOffset_t3229287507
{
public:
// System.DateTime System.DateTimeOffset::dt
DateTime_t3738529785 ___dt_2;
// System.TimeSpan System.DateTimeOffset::utc_offset
TimeSpan_t881159249 ___utc_offset_3;
public:
inline static int32_t get_offset_of_dt_2() { return static_cast<int32_t>(offsetof(DateTimeOffset_t3229287507, ___dt_2)); }
inline DateTime_t3738529785 get_dt_2() const { return ___dt_2; }
inline DateTime_t3738529785 * get_address_of_dt_2() { return &___dt_2; }
inline void set_dt_2(DateTime_t3738529785 value)
{
___dt_2 = value;
}
inline static int32_t get_offset_of_utc_offset_3() { return static_cast<int32_t>(offsetof(DateTimeOffset_t3229287507, ___utc_offset_3)); }
inline TimeSpan_t881159249 get_utc_offset_3() const { return ___utc_offset_3; }
inline TimeSpan_t881159249 * get_address_of_utc_offset_3() { return &___utc_offset_3; }
inline void set_utc_offset_3(TimeSpan_t881159249 value)
{
___utc_offset_3 = value;
}
};
struct DateTimeOffset_t3229287507_StaticFields
{
public:
// System.DateTimeOffset System.DateTimeOffset::MaxValue
DateTimeOffset_t3229287507 ___MaxValue_0;
// System.DateTimeOffset System.DateTimeOffset::MinValue
DateTimeOffset_t3229287507 ___MinValue_1;
public:
inline static int32_t get_offset_of_MaxValue_0() { return static_cast<int32_t>(offsetof(DateTimeOffset_t3229287507_StaticFields, ___MaxValue_0)); }
inline DateTimeOffset_t3229287507 get_MaxValue_0() const { return ___MaxValue_0; }
inline DateTimeOffset_t3229287507 * get_address_of_MaxValue_0() { return &___MaxValue_0; }
inline void set_MaxValue_0(DateTimeOffset_t3229287507 value)
{
___MaxValue_0 = value;
}
inline static int32_t get_offset_of_MinValue_1() { return static_cast<int32_t>(offsetof(DateTimeOffset_t3229287507_StaticFields, ___MinValue_1)); }
inline DateTimeOffset_t3229287507 get_MinValue_1() const { return ___MinValue_1; }
inline DateTimeOffset_t3229287507 * get_address_of_MinValue_1() { return &___MinValue_1; }
inline void set_MinValue_1(DateTimeOffset_t3229287507 value)
{
___MinValue_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // DATETIMEOFFSET_T3229287507_H
#ifndef MISSINGFIELDEXCEPTION_T1989070983_H
#define MISSINGFIELDEXCEPTION_T1989070983_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MissingFieldException
struct MissingFieldException_t1989070983 : public MissingMemberException_t1385081665
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MISSINGFIELDEXCEPTION_T1989070983_H
#ifndef MISSINGMETHODEXCEPTION_T1274661534_H
#define MISSINGMETHODEXCEPTION_T1274661534_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MissingMethodException
struct MissingMethodException_t1274661534 : public MissingMemberException_t1385081665
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MISSINGMETHODEXCEPTION_T1274661534_H
#ifndef MANUALRESETEVENT_T451242010_H
#define MANUALRESETEVENT_T451242010_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Threading.ManualResetEvent
struct ManualResetEvent_t451242010 : public EventWaitHandle_t777845177
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MANUALRESETEVENT_T451242010_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize800 = { sizeof (StringBuilder_t), sizeof(char*), 0, 0 };
extern const int32_t g_FieldOffsetTable800[5] =
{
0,
StringBuilder_t::get_offset_of__length_1(),
StringBuilder_t::get_offset_of__str_2(),
StringBuilder_t::get_offset_of__cached_str_3(),
StringBuilder_t::get_offset_of__maxCapacity_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize801 = { sizeof (UTF32Encoding_t312252005), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable801[2] =
{
UTF32Encoding_t312252005::get_offset_of_bigEndian_28(),
UTF32Encoding_t312252005::get_offset_of_byteOrderMark_29(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize802 = { sizeof (UTF32Decoder_t635925672), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable802[3] =
{
UTF32Decoder_t635925672::get_offset_of_bigEndian_2(),
UTF32Decoder_t635925672::get_offset_of_leftOverByte_3(),
UTF32Decoder_t635925672::get_offset_of_leftOverLength_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize803 = { sizeof (UTF7Encoding_t2644108479), -1, sizeof(UTF7Encoding_t2644108479_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable803[3] =
{
UTF7Encoding_t2644108479::get_offset_of_allowOptionals_28(),
UTF7Encoding_t2644108479_StaticFields::get_offset_of_encodingRules_29(),
UTF7Encoding_t2644108479_StaticFields::get_offset_of_base64Values_30(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize804 = { sizeof (UTF7Decoder_t2247208115), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable804[1] =
{
UTF7Decoder_t2247208115::get_offset_of_leftOver_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize805 = { sizeof (UTF8Encoding_t3956466879), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable805[1] =
{
UTF8Encoding_t3956466879::get_offset_of_emitIdentifier_28(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize806 = { sizeof (UTF8Decoder_t2159214862), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable806[2] =
{
UTF8Decoder_t2159214862::get_offset_of_leftOverBits_2(),
UTF8Decoder_t2159214862::get_offset_of_leftOverCount_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize807 = { sizeof (UnicodeEncoding_t1959134050), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable807[2] =
{
UnicodeEncoding_t1959134050::get_offset_of_bigEndian_28(),
UnicodeEncoding_t1959134050::get_offset_of_byteOrderMark_29(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize808 = { sizeof (UnicodeDecoder_t872550992), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable808[2] =
{
UnicodeDecoder_t872550992::get_offset_of_bigEndian_2(),
UnicodeDecoder_t872550992::get_offset_of_leftOverByte_3(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize809 = { sizeof (CompressedStack_t1202932761), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable809[1] =
{
CompressedStack_t1202932761::get_offset_of__list_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize810 = { sizeof (EventResetMode_t3817241503)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable810[3] =
{
EventResetMode_t3817241503::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize811 = { sizeof (EventWaitHandle_t777845177), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize812 = { sizeof (ExecutionContext_t1748372627), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable812[3] =
{
ExecutionContext_t1748372627::get_offset_of__sc_0(),
ExecutionContext_t1748372627::get_offset_of__suppressFlow_1(),
ExecutionContext_t1748372627::get_offset_of__capture_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize813 = { sizeof (Interlocked_t2273387594), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize814 = { sizeof (ManualResetEvent_t451242010), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize815 = { sizeof (Monitor_t2197244473), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize816 = { sizeof (Mutex_t3066672582), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize817 = { sizeof (NativeEventCalls_t570794723), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize818 = { sizeof (RegisteredWaitHandle_t1529538454), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable818[9] =
{
RegisteredWaitHandle_t1529538454::get_offset_of__waitObject_1(),
RegisteredWaitHandle_t1529538454::get_offset_of__callback_2(),
RegisteredWaitHandle_t1529538454::get_offset_of__timeout_3(),
RegisteredWaitHandle_t1529538454::get_offset_of__state_4(),
RegisteredWaitHandle_t1529538454::get_offset_of__executeOnlyOnce_5(),
RegisteredWaitHandle_t1529538454::get_offset_of__finalEvent_6(),
RegisteredWaitHandle_t1529538454::get_offset_of__cancelEvent_7(),
RegisteredWaitHandle_t1529538454::get_offset_of__callsInProcess_8(),
RegisteredWaitHandle_t1529538454::get_offset_of__unregistered_9(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize819 = { sizeof (SynchronizationContext_t2326897723), -1, 0, sizeof(SynchronizationContext_t2326897723_ThreadStaticFields) };
extern const int32_t g_FieldOffsetTable819[1] =
{
SynchronizationContext_t2326897723_ThreadStaticFields::get_offset_of_currentContext_0() | THREAD_LOCAL_STATIC_MASK,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize820 = { sizeof (SynchronizationLockException_t841761767), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize821 = { sizeof (Thread_t2300836069), -1, sizeof(Thread_t2300836069_StaticFields), sizeof(Thread_t2300836069_ThreadStaticFields) };
extern const int32_t g_FieldOffsetTable821[52] =
{
Thread_t2300836069::get_offset_of_lock_thread_id_0(),
Thread_t2300836069::get_offset_of_system_thread_handle_1(),
Thread_t2300836069::get_offset_of_cached_culture_info_2(),
Thread_t2300836069::get_offset_of_unused0_3(),
Thread_t2300836069::get_offset_of_threadpool_thread_4(),
Thread_t2300836069::get_offset_of_name_5(),
Thread_t2300836069::get_offset_of_name_len_6(),
Thread_t2300836069::get_offset_of_state_7(),
Thread_t2300836069::get_offset_of_abort_exc_8(),
Thread_t2300836069::get_offset_of_abort_state_handle_9(),
Thread_t2300836069::get_offset_of_thread_id_10(),
Thread_t2300836069::get_offset_of_start_notify_11(),
Thread_t2300836069::get_offset_of_stack_ptr_12(),
Thread_t2300836069::get_offset_of_static_data_13(),
Thread_t2300836069::get_offset_of_jit_data_14(),
Thread_t2300836069::get_offset_of_lock_data_15(),
Thread_t2300836069::get_offset_of_current_appcontext_16(),
Thread_t2300836069::get_offset_of_stack_size_17(),
Thread_t2300836069::get_offset_of_start_obj_18(),
Thread_t2300836069::get_offset_of_appdomain_refs_19(),
Thread_t2300836069::get_offset_of_interruption_requested_20(),
Thread_t2300836069::get_offset_of_suspend_event_21(),
Thread_t2300836069::get_offset_of_suspended_event_22(),
Thread_t2300836069::get_offset_of_resume_event_23(),
Thread_t2300836069::get_offset_of_synch_cs_24(),
Thread_t2300836069::get_offset_of_serialized_culture_info_25(),
Thread_t2300836069::get_offset_of_serialized_culture_info_len_26(),
Thread_t2300836069::get_offset_of_serialized_ui_culture_info_27(),
Thread_t2300836069::get_offset_of_serialized_ui_culture_info_len_28(),
Thread_t2300836069::get_offset_of_thread_dump_requested_29(),
Thread_t2300836069::get_offset_of_end_stack_30(),
Thread_t2300836069::get_offset_of_thread_interrupt_requested_31(),
Thread_t2300836069::get_offset_of_apartment_state_32(),
Thread_t2300836069::get_offset_of_critical_region_level_33(),
Thread_t2300836069::get_offset_of_small_id_34(),
Thread_t2300836069::get_offset_of_manage_callback_35(),
Thread_t2300836069::get_offset_of_pending_exception_36(),
Thread_t2300836069::get_offset_of_ec_to_set_37(),
Thread_t2300836069::get_offset_of_interrupt_on_stop_38(),
Thread_t2300836069::get_offset_of_unused3_39(),
Thread_t2300836069::get_offset_of_unused4_40(),
Thread_t2300836069::get_offset_of_unused5_41(),
Thread_t2300836069::get_offset_of_unused6_42(),
Thread_t2300836069_ThreadStaticFields::get_offset_of_local_slots_43() | THREAD_LOCAL_STATIC_MASK,
Thread_t2300836069_ThreadStaticFields::get_offset_of__ec_44() | THREAD_LOCAL_STATIC_MASK,
Thread_t2300836069::get_offset_of_threadstart_45(),
Thread_t2300836069::get_offset_of_managed_id_46(),
Thread_t2300836069::get_offset_of__principal_47(),
Thread_t2300836069_StaticFields::get_offset_of_datastorehash_48(),
Thread_t2300836069_StaticFields::get_offset_of_datastore_lock_49(),
Thread_t2300836069::get_offset_of_in_currentculture_50(),
Thread_t2300836069_StaticFields::get_offset_of_culture_lock_51(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize822 = { sizeof (ThreadAbortException_t4074510458), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize823 = { sizeof (ThreadInterruptedException_t3240955163), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize824 = { sizeof (ThreadPool_t2177989550), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize825 = { sizeof (ThreadState_t2533302383)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable825[11] =
{
ThreadState_t2533302383::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize826 = { sizeof (ThreadStateException_t3003788475), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize827 = { sizeof (Timer_t716671026), -1, sizeof(Timer_t716671026_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable827[7] =
{
Timer_t716671026_StaticFields::get_offset_of_scheduler_1(),
Timer_t716671026::get_offset_of_callback_2(),
Timer_t716671026::get_offset_of_state_3(),
Timer_t716671026::get_offset_of_due_time_ms_4(),
Timer_t716671026::get_offset_of_period_ms_5(),
Timer_t716671026::get_offset_of_next_run_6(),
Timer_t716671026::get_offset_of_disposed_7(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize828 = { sizeof (TimerComparer_t2774265395), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize829 = { sizeof (Scheduler_t3215764947), -1, sizeof(Scheduler_t3215764947_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable829[2] =
{
Scheduler_t3215764947_StaticFields::get_offset_of_instance_0(),
Scheduler_t3215764947::get_offset_of_list_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize830 = { sizeof (WaitHandle_t1743403487), -1, sizeof(WaitHandle_t1743403487_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable830[4] =
{
0,
WaitHandle_t1743403487::get_offset_of_safe_wait_handle_2(),
WaitHandle_t1743403487_StaticFields::get_offset_of_InvalidHandle_3(),
WaitHandle_t1743403487::get_offset_of_disposed_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize831 = { sizeof (AccessViolationException_t339633883), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize832 = { sizeof (ActivationContext_t976916018), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable832[1] =
{
ActivationContext_t976916018::get_offset_of__disposed_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize833 = { sizeof (Activator_t1841325713), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize834 = { sizeof (AppDomain_t1571427825), -1, sizeof(AppDomain_t1571427825_StaticFields), sizeof(AppDomain_t1571427825_ThreadStaticFields) };
extern const int32_t g_FieldOffsetTable834[21] =
{
AppDomain_t1571427825::get_offset_of__mono_app_domain_1(),
AppDomain_t1571427825_StaticFields::get_offset_of__process_guid_2(),
AppDomain_t1571427825_ThreadStaticFields::get_offset_of_type_resolve_in_progress_3() | THREAD_LOCAL_STATIC_MASK,
AppDomain_t1571427825_ThreadStaticFields::get_offset_of_assembly_resolve_in_progress_4() | THREAD_LOCAL_STATIC_MASK,
AppDomain_t1571427825_ThreadStaticFields::get_offset_of_assembly_resolve_in_progress_refonly_5() | THREAD_LOCAL_STATIC_MASK,
AppDomain_t1571427825::get_offset_of__evidence_6(),
AppDomain_t1571427825::get_offset_of__granted_7(),
AppDomain_t1571427825::get_offset_of__principalPolicy_8(),
AppDomain_t1571427825_ThreadStaticFields::get_offset_of__principal_9() | THREAD_LOCAL_STATIC_MASK,
AppDomain_t1571427825_StaticFields::get_offset_of_default_domain_10(),
AppDomain_t1571427825::get_offset_of__domain_manager_11(),
AppDomain_t1571427825::get_offset_of__activation_12(),
AppDomain_t1571427825::get_offset_of__applicationIdentity_13(),
AppDomain_t1571427825::get_offset_of_AssemblyLoad_14(),
AppDomain_t1571427825::get_offset_of_AssemblyResolve_15(),
AppDomain_t1571427825::get_offset_of_DomainUnload_16(),
AppDomain_t1571427825::get_offset_of_ProcessExit_17(),
AppDomain_t1571427825::get_offset_of_ResourceResolve_18(),
AppDomain_t1571427825::get_offset_of_TypeResolve_19(),
AppDomain_t1571427825::get_offset_of_UnhandledException_20(),
AppDomain_t1571427825::get_offset_of_ReflectionOnlyAssemblyResolve_21(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize835 = { sizeof (AppDomainManager_t1420869192), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize836 = { sizeof (AppDomainSetup_t123196401), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable836[22] =
{
AppDomainSetup_t123196401::get_offset_of_application_base_0(),
AppDomainSetup_t123196401::get_offset_of_application_name_1(),
AppDomainSetup_t123196401::get_offset_of_cache_path_2(),
AppDomainSetup_t123196401::get_offset_of_configuration_file_3(),
AppDomainSetup_t123196401::get_offset_of_dynamic_base_4(),
AppDomainSetup_t123196401::get_offset_of_license_file_5(),
AppDomainSetup_t123196401::get_offset_of_private_bin_path_6(),
AppDomainSetup_t123196401::get_offset_of_private_bin_path_probe_7(),
AppDomainSetup_t123196401::get_offset_of_shadow_copy_directories_8(),
AppDomainSetup_t123196401::get_offset_of_shadow_copy_files_9(),
AppDomainSetup_t123196401::get_offset_of_publisher_policy_10(),
AppDomainSetup_t123196401::get_offset_of_path_changed_11(),
AppDomainSetup_t123196401::get_offset_of_loader_optimization_12(),
AppDomainSetup_t123196401::get_offset_of_disallow_binding_redirects_13(),
AppDomainSetup_t123196401::get_offset_of_disallow_code_downloads_14(),
AppDomainSetup_t123196401::get_offset_of__activationArguments_15(),
AppDomainSetup_t123196401::get_offset_of_domain_initializer_16(),
AppDomainSetup_t123196401::get_offset_of_application_trust_17(),
AppDomainSetup_t123196401::get_offset_of_domain_initializer_args_18(),
AppDomainSetup_t123196401::get_offset_of_application_trust_xml_19(),
AppDomainSetup_t123196401::get_offset_of_disallow_appbase_probe_20(),
AppDomainSetup_t123196401::get_offset_of_configuration_bytes_21(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize837 = { sizeof (ApplicationException_t2339761290), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize838 = { sizeof (ApplicationIdentity_t1917735356), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable838[1] =
{
ApplicationIdentity_t1917735356::get_offset_of__fullName_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize839 = { sizeof (ArgumentException_t132251570), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable839[2] =
{
0,
ArgumentException_t132251570::get_offset_of_param_name_12(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize840 = { sizeof (ArgumentNullException_t1615371798), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable840[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize841 = { sizeof (ArgumentOutOfRangeException_t777629997), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable841[1] =
{
ArgumentOutOfRangeException_t777629997::get_offset_of_actual_value_13(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize842 = { sizeof (ArithmeticException_t4283546778), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize843 = { sizeof (ArrayTypeMismatchException_t2342549375), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable843[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize844 = { sizeof (AssemblyLoadEventArgs_t2792010465), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize845 = { sizeof (AttributeTargets_t1784037988)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable845[17] =
{
AttributeTargets_t1784037988::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize846 = { sizeof (BitConverter_t3118986983), -1, sizeof(BitConverter_t3118986983_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable846[2] =
{
BitConverter_t3118986983_StaticFields::get_offset_of_SwappedWordsInDouble_0(),
BitConverter_t3118986983_StaticFields::get_offset_of_IsLittleEndian_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize847 = { sizeof (Buffer_t1599081364), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize848 = { sizeof (CharEnumerator_t1121470421), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable848[3] =
{
CharEnumerator_t1121470421::get_offset_of_str_0(),
CharEnumerator_t1121470421::get_offset_of_index_1(),
CharEnumerator_t1121470421::get_offset_of_length_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize849 = { sizeof (Console_t3208230065), -1, sizeof(Console_t3208230065_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable849[5] =
{
Console_t3208230065_StaticFields::get_offset_of_stdout_0(),
Console_t3208230065_StaticFields::get_offset_of_stderr_1(),
Console_t3208230065_StaticFields::get_offset_of_stdin_2(),
Console_t3208230065_StaticFields::get_offset_of_inputEncoding_3(),
Console_t3208230065_StaticFields::get_offset_of_outputEncoding_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize850 = { sizeof (ContextBoundObject_t1394786030), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize851 = { sizeof (Convert_t2465617642), -1, sizeof(Convert_t2465617642_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable851[2] =
{
Convert_t2465617642_StaticFields::get_offset_of_DBNull_0(),
Convert_t2465617642_StaticFields::get_offset_of_conversionTable_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize852 = { sizeof (DBNull_t3725197148), -1, sizeof(DBNull_t3725197148_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable852[1] =
{
DBNull_t3725197148_StaticFields::get_offset_of_Value_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize853 = { sizeof (DateTime_t3738529785)+ sizeof (RuntimeObject), -1, sizeof(DateTime_t3738529785_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable853[25] =
{
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
DateTime_t3738529785::get_offset_of_ticks_10() + static_cast<int32_t>(sizeof(RuntimeObject)),
DateTime_t3738529785::get_offset_of_kind_11() + static_cast<int32_t>(sizeof(RuntimeObject)),
DateTime_t3738529785_StaticFields::get_offset_of_MaxValue_12(),
DateTime_t3738529785_StaticFields::get_offset_of_MinValue_13(),
DateTime_t3738529785_StaticFields::get_offset_of_ParseTimeFormats_14(),
DateTime_t3738529785_StaticFields::get_offset_of_ParseYearDayMonthFormats_15(),
DateTime_t3738529785_StaticFields::get_offset_of_ParseYearMonthDayFormats_16(),
DateTime_t3738529785_StaticFields::get_offset_of_ParseDayMonthYearFormats_17(),
DateTime_t3738529785_StaticFields::get_offset_of_ParseMonthDayYearFormats_18(),
DateTime_t3738529785_StaticFields::get_offset_of_MonthDayShortFormats_19(),
DateTime_t3738529785_StaticFields::get_offset_of_DayMonthShortFormats_20(),
DateTime_t3738529785_StaticFields::get_offset_of_daysmonth_21(),
DateTime_t3738529785_StaticFields::get_offset_of_daysmonthleap_22(),
DateTime_t3738529785_StaticFields::get_offset_of_to_local_time_span_object_23(),
DateTime_t3738529785_StaticFields::get_offset_of_last_now_24(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize854 = { sizeof (Which_t2943845661)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable854[5] =
{
Which_t2943845661::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize855 = { sizeof (DateTimeKind_t3468814247)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable855[4] =
{
DateTimeKind_t3468814247::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize856 = { sizeof (DateTimeOffset_t3229287507)+ sizeof (RuntimeObject), -1, sizeof(DateTimeOffset_t3229287507_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable856[4] =
{
DateTimeOffset_t3229287507_StaticFields::get_offset_of_MaxValue_0(),
DateTimeOffset_t3229287507_StaticFields::get_offset_of_MinValue_1(),
DateTimeOffset_t3229287507::get_offset_of_dt_2() + static_cast<int32_t>(sizeof(RuntimeObject)),
DateTimeOffset_t3229287507::get_offset_of_utc_offset_3() + static_cast<int32_t>(sizeof(RuntimeObject)),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize857 = { sizeof (DateTimeUtils_t3080864452), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize858 = { sizeof (DayOfWeek_t3650621421)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable858[8] =
{
DayOfWeek_t3650621421::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize859 = { sizeof (DelegateData_t1677132599), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable859[2] =
{
DelegateData_t1677132599::get_offset_of_target_type_0(),
DelegateData_t1677132599::get_offset_of_method_name_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize860 = { sizeof (DelegateSerializationHolder_t3408600559), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable860[1] =
{
DelegateSerializationHolder_t3408600559::get_offset_of__delegate_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize861 = { sizeof (DelegateEntry_t1019584161), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable861[7] =
{
DelegateEntry_t1019584161::get_offset_of_type_0(),
DelegateEntry_t1019584161::get_offset_of_assembly_1(),
DelegateEntry_t1019584161::get_offset_of_target_2(),
DelegateEntry_t1019584161::get_offset_of_targetTypeAssembly_3(),
DelegateEntry_t1019584161::get_offset_of_targetTypeName_4(),
DelegateEntry_t1019584161::get_offset_of_methodName_5(),
DelegateEntry_t1019584161::get_offset_of_delegateEntry_6(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize862 = { sizeof (DivideByZeroException_t1856388118), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable862[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize863 = { sizeof (DllNotFoundException_t2721418633), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable863[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize864 = { sizeof (EntryPointNotFoundException_t1356862416), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable864[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize865 = { sizeof (MonoEnumInfo_t3694469084)+ sizeof (RuntimeObject), -1, sizeof(MonoEnumInfo_t3694469084_StaticFields), sizeof(MonoEnumInfo_t3694469084_ThreadStaticFields) };
extern const int32_t g_FieldOffsetTable865[11] =
{
MonoEnumInfo_t3694469084::get_offset_of_utype_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
MonoEnumInfo_t3694469084::get_offset_of_values_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
MonoEnumInfo_t3694469084::get_offset_of_names_2() + static_cast<int32_t>(sizeof(RuntimeObject)),
MonoEnumInfo_t3694469084::get_offset_of_name_hash_3() + static_cast<int32_t>(sizeof(RuntimeObject)),
MonoEnumInfo_t3694469084_ThreadStaticFields::get_offset_of_cache_4() | THREAD_LOCAL_STATIC_MASK,
MonoEnumInfo_t3694469084_StaticFields::get_offset_of_global_cache_5(),
MonoEnumInfo_t3694469084_StaticFields::get_offset_of_global_cache_monitor_6(),
MonoEnumInfo_t3694469084_StaticFields::get_offset_of_sbyte_comparer_7(),
MonoEnumInfo_t3694469084_StaticFields::get_offset_of_short_comparer_8(),
MonoEnumInfo_t3694469084_StaticFields::get_offset_of_int_comparer_9(),
MonoEnumInfo_t3694469084_StaticFields::get_offset_of_long_comparer_10(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize866 = { sizeof (SByteComparer_t2329725001), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize867 = { sizeof (ShortComparer_t2253094562), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize868 = { sizeof (IntComparer_t3812095803), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize869 = { sizeof (LongComparer_t1798269597), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize870 = { sizeof (Environment_t2712485525), -1, sizeof(Environment_t2712485525_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable870[2] =
{
0,
Environment_t2712485525_StaticFields::get_offset_of_os_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize871 = { sizeof (SpecialFolder_t3871784040)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable871[24] =
{
SpecialFolder_t3871784040::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize872 = { sizeof (EventArgs_t3591816995), -1, sizeof(EventArgs_t3591816995_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable872[1] =
{
EventArgs_t3591816995_StaticFields::get_offset_of_Empty_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize873 = { sizeof (ExecutionEngineException_t1142598034), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize874 = { sizeof (FieldAccessException_t238379456), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize875 = { sizeof (FlagsAttribute_t2262502849), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize876 = { sizeof (FormatException_t154580423), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable876[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize877 = { sizeof (GC_t959872083), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize878 = { sizeof (Guid_t)+ sizeof (RuntimeObject), sizeof(Guid_t ), sizeof(Guid_t_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable878[15] =
{
Guid_t::get_offset_of__a_0() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__b_1() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__c_2() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__d_3() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__e_4() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__f_5() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__g_6() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__h_7() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__i_8() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__j_9() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t::get_offset_of__k_10() + static_cast<int32_t>(sizeof(RuntimeObject)),
Guid_t_StaticFields::get_offset_of_Empty_11(),
Guid_t_StaticFields::get_offset_of__rngAccess_12(),
Guid_t_StaticFields::get_offset_of__rng_13(),
Guid_t_StaticFields::get_offset_of__fastRng_14(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize879 = { sizeof (GuidParser_t2761237274), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable879[3] =
{
GuidParser_t2761237274::get_offset_of__src_0(),
GuidParser_t2761237274::get_offset_of__length_1(),
GuidParser_t2761237274::get_offset_of__cur_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize880 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize881 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize882 = { 0, -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize883 = { sizeof (IndexOutOfRangeException_t1578797820), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize884 = { sizeof (InvalidCastException_t3927145244), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable884[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize885 = { sizeof (InvalidOperationException_t56020091), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable885[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize886 = { sizeof (InvalidProgramException_t3836716986), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize887 = { sizeof (LoaderOptimization_t1484956347)+ sizeof (RuntimeObject), sizeof(int32_t), 0, 0 };
extern const int32_t g_FieldOffsetTable887[7] =
{
LoaderOptimization_t1484956347::get_offset_of_value___1() + static_cast<int32_t>(sizeof(RuntimeObject)),
0,
0,
0,
0,
0,
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize888 = { sizeof (LocalDataStoreSlot_t740841968), -1, sizeof(LocalDataStoreSlot_t740841968_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable888[5] =
{
LocalDataStoreSlot_t740841968::get_offset_of_slot_0(),
LocalDataStoreSlot_t740841968::get_offset_of_thread_local_1(),
LocalDataStoreSlot_t740841968_StaticFields::get_offset_of_lock_obj_2(),
LocalDataStoreSlot_t740841968_StaticFields::get_offset_of_slot_bitmap_thread_3(),
LocalDataStoreSlot_t740841968_StaticFields::get_offset_of_slot_bitmap_context_4(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize889 = { sizeof (Math_t1671470975), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize890 = { sizeof (MemberAccessException_t1734467078), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize891 = { sizeof (MethodAccessException_t190175859), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable891[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize892 = { sizeof (MissingFieldException_t1989070983), -1, 0, 0 };
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize893 = { sizeof (MissingMemberException_t1385081665), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable893[3] =
{
MissingMemberException_t1385081665::get_offset_of_ClassName_11(),
MissingMemberException_t1385081665::get_offset_of_MemberName_12(),
MissingMemberException_t1385081665::get_offset_of_Signature_13(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize894 = { sizeof (MissingMethodException_t1274661534), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable894[1] =
{
0,
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize895 = { sizeof (MonoAsyncCall_t3023670838), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable895[7] =
{
MonoAsyncCall_t3023670838::get_offset_of_msg_0(),
MonoAsyncCall_t3023670838::get_offset_of_cb_method_1(),
MonoAsyncCall_t3023670838::get_offset_of_cb_target_2(),
MonoAsyncCall_t3023670838::get_offset_of_state_3(),
MonoAsyncCall_t3023670838::get_offset_of_res_4(),
MonoAsyncCall_t3023670838::get_offset_of_out_args_5(),
MonoAsyncCall_t3023670838::get_offset_of_wait_event_6(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize896 = { sizeof (MonoCustomAttrs_t3634537737), -1, sizeof(MonoCustomAttrs_t3634537737_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable896[3] =
{
MonoCustomAttrs_t3634537737_StaticFields::get_offset_of_corlib_0(),
MonoCustomAttrs_t3634537737_StaticFields::get_offset_of_AttributeUsageType_1(),
MonoCustomAttrs_t3634537737_StaticFields::get_offset_of_DefaultAttributeUsage_2(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize897 = { sizeof (AttributeInfo_t2216804170), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable897[2] =
{
AttributeInfo_t2216804170::get_offset_of__usage_0(),
AttributeInfo_t2216804170::get_offset_of__inheritanceLevel_1(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize898 = { sizeof (MonoTouchAOTHelper_t570977590), -1, sizeof(MonoTouchAOTHelper_t570977590_StaticFields), 0 };
extern const int32_t g_FieldOffsetTable898[1] =
{
MonoTouchAOTHelper_t570977590_StaticFields::get_offset_of_FalseFlag_0(),
};
extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize899 = { sizeof (MonoTypeInfo_t3366989025), -1, 0, 0 };
extern const int32_t g_FieldOffsetTable899[2] =
{
MonoTypeInfo_t3366989025::get_offset_of_full_name_0(),
MonoTypeInfo_t3366989025::get_offset_of_default_ctor_1(),
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"[email protected]"
] | |
98a0abd656cb94ddef2dc9444cffd420338cfb4b | a278262a622032cfa6fa8c3c62ed5eb63866310b | /include/MetaInfo.h | 346837801d1c94a460bd09b850c6e0c2b6ad8d41 | [] | no_license | WindLeafSing/lrc_system | 38c8de0262c30ffa08a999c4aff7717800bdf3b4 | 82f88ad8a57efec8f54593bf4132f723bcf0919c | refs/heads/master | 2023-04-08T04:10:52.244527 | 2021-04-19T08:42:54 | 2021-04-19T08:42:54 | 358,582,183 | 0 | 0 | null | 2021-04-19T08:42:55 | 2021-04-16T11:50:17 | null | UTF-8 | C++ | false | false | 3,174 | h | //
// Created by 杜清鹏 on 2021/3/29.
//
#ifndef LRC_METAINFO_H
#define LRC_METAINFO_H
#include "devcommon.h"
namespace lrc{
/*
* this file provides general filesystem meta infomation such as StripeInfo , ClusterInfo etc.
*/
struct ECSchema{
ECSchema() =default;
ECSchema(int datablk, int localparityblk, int globalparityblk, int blksize) : datablk(datablk),
localparityblk{localparityblk},globalparityblk{globalparityblk},blksize{blksize}{}
int datablk;
int localparityblk;
int globalparityblk;
int blksize; // count Bytes
};
struct ECSchemaHash{
std::size_t operator()(const ECSchema & ecSchema)const {
return std::hash<int>()(ecSchema.datablk)+std::hash<int>()(ecSchema.localparityblk)+std::hash<int>()(ecSchema.globalparityblk);
}
};
struct ECSchemaCMP{
bool operator()(const ECSchema & left,const ECSchema & right) const
{
return left.datablk==right.datablk&&
left.localparityblk==right.localparityblk&&
left.globalparityblk==right.globalparityblk;
}
};
enum ErasureCodingPolicy{
LRC = 0 // default
};
struct StripeInfo{
/*
* describe a stripe[same as a file in this project] , consists of stripe width , local parity
* and global parity blocks , currently our own LRC ECSchema
*/
//location : an uri vector
//ie : [{datablk :}ip:port1,ip:port2,...|{local_parity_blk :}ip:port k+1,...|{global_parityblk : }... ]
std::vector<std::string> blklocation;
//ie : [cluster1 , cluster1 ,cluster2,] means blklocation[i] coming from clusterdistribution[i]
std::vector<int> clusterdistribution;
std::string dir;
int stripeid;
ECSchema ecschema;
ErasureCodingPolicy ecpolicy;
bool operator<(const StripeInfo &rhs) const {
return stripeid < rhs.stripeid;
}
};
struct DataNodeInfo{
std::unordered_set<int> stored_stripeid;//{stripeid,block_type(0:data 1:localp 2:globalp)}
std::string crosscluster_routeruri;
int clusterid;
int consumed_space;//count in MB because blk size count in MB too
int port;
};
struct ClusterInfo{
std::vector<std::string> datanodesuri;
std::string gatewayuri;
int clusterid;
int stripeload;//stripes number
ClusterInfo(const std::vector<std::string> &datanodesuri, const std::string &gatewayuri, int clusterid,
int stripeload) : datanodesuri(datanodesuri), gatewayuri(gatewayuri), clusterid(clusterid),
stripeload(stripeload) {}
ClusterInfo()=default;
};
/*
* decribe a filesystem namespace
*/
/*
struct FileSystemDirectoryTree{
struct FileSystemDirectoryNode{
FileSystemObject
std::vector<FileSystemDirectoryNode *> childnodes;
};
};
*/
}
#endif //LRC_METAINFO_H
| [
"[email protected]"
] | |
206de379eb1b9d0a9e3fd9a01a004c66c50b3be0 | 4da19b7f48cb480788bd77e067560789d6d22158 | /Pikachu/Classes/CommonFunctions.h | 56daa9693a8aa7189f3502b71cf6cfc8dd9c0dc1 | [] | no_license | caothetoan/iOS-Pikachu | 898d53e8e0c55875be959b7916c25c146e43fcfb | 1fdbcae81dc92c7461909572dd04cb83455b10d7 | refs/heads/master | 2021-01-01T05:57:23.258013 | 2017-07-15T13:34:51 | 2017-07-15T13:34:51 | 97,317,916 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 298 | h | //
// CommonFunctions.h
// Pikachu
//
// Created by tinvukhac on 8/25/13.
//
//
#ifndef __Pikachu__CommonFunctions__
#define __Pikachu__CommonFunctions__
#include "cocos2d.h"
using namespace cocos2d;
CCString* getPngPath(const char* path);
#endif /* defined(__Pikachu__CommonFunctions__) */
| [
"[email protected]"
] | |
1320fda8ea20ab8b3f37b1891fe3511a2d0aa956 | 977d375905ced27aab3f40d152d78a2506501571 | /Source/GameDevWeekendDemo/Private/DemoGameInstance.cpp | 0b8e42a4be51a50b00e2d9fb937f16dcc39556ac | [] | no_license | Samukus/GameDevWeekendDemo | 49cb14cad5643ae20694b05e7649856a92d84d19 | 6146cc5369baf584f8a77bafd7c698196fc166b9 | refs/heads/master | 2023-07-11T00:32:24.094282 | 2021-08-12T14:27:28 | 2021-08-12T14:27:28 | 395,038,629 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,759 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "DemoGameInstance.h"
#include "UObject/Class.h"
#include "Interfaces/OnlineIdentityInterface.h"
#include "ConfigDemonstration.h"
void UDemoGameInstance::Init() {
Super::Init();
OSS_Native = IOnlineSubsystem::GetByPlatform();
OSS_Default = IOnlineSubsystem::Get();
if (OSS_Default)
{
OSS_Default->GetIdentityInterface()->AddOnLoginCompleteDelegate_Handle(0, FOnLoginCompleteDelegate::CreateUObject(this, &UDemoGameInstance::OnLoginComplete));
}
}
void UDemoGameInstance::Shutdown()
{
Super::Shutdown();
}
void UDemoGameInstance::OnLoginComplete(int32 LocalUserNum, bool bWasSuccessful,
const FUniqueNetId& UserId, const FString& Error)
{
LogEventDelegate.Broadcast(FString::Format(TEXT("Autologin[{0}]: {1}, {2}\n"),
{UserId.ToString(), bWasSuccessful ? TEXT("Succesfull") : TEXT("Error"), Error}));
}
// Config Demo
FString UDemoGameInstance::GetPlatformConfigProperty()
{
return GetDefault<UConfigDemonstration>()->PlatformProperty;
}
FString UDemoGameInstance::GetDefaultConfigProperty()
{
return GetDefault<UConfigDemonstration>()->DefaultProperty;
}
// OSS by config Demo
FString UDemoGameInstance::GetNativeOSSServiceName() {
if (OSS_Native)
{
return OSS_Native->GetOnlineServiceName().ToString();
}
return TEXT("None");
}
FString UDemoGameInstance::GetDefaultOSSServiceName() {
if (OSS_Default) {
return OSS_Default->GetOnlineServiceName().ToString();
}
return TEXT("None");
}
// OSS identity inheritance demo
void UDemoGameInstance::OSSPlatformLoginDemo()
{
if (OSS_Default) {
OSS_Default->GetIdentityInterface()->AutoLogin(0);
}
} | [
"[email protected]"
] | |
2bfacd0fe97599a9ff580eefedadec0ebd27ac5c | 97fde28997b618180cfa5dd979b142fd54dd2105 | /core/dep/acelite/ace/Dynamic.inl | 54052b8e52bef58be89157ce2cf806f2f0124cee | [] | no_license | Refuge89/sunwell-2 | 5897f4e78c693e791e368761904e79d2b7af20da | f01a89300394065f33eaec799c8779c2cac5c320 | refs/heads/master | 2020-12-31T05:55:43.496145 | 2016-02-16T20:46:50 | 2016-02-16T20:46:50 | 80,622,543 | 1 | 0 | null | 2017-02-01T13:30:06 | 2017-02-01T13:30:06 | null | UTF-8 | C++ | false | false | 559 | inl | // -*- C++ -*-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE
ACE_Dynamic::~ACE_Dynamic (void)
{
// ACE_TRACE ("ACE_Dynamic::~ACE_Dynamic");
}
ACE_INLINE void
ACE_Dynamic::set (void)
{
// ACE_TRACE ("ACE_Dynamic::set");
this->is_dynamic_ = true;
}
ACE_INLINE bool
ACE_Dynamic::is_dynamic (void)
{
// ACE_TRACE ("ACE_Dynamic::is_dynamic");
return this->is_dynamic_;
}
ACE_INLINE void
ACE_Dynamic::reset (void)
{
// ACE_TRACE ("ACE_Dynamic::reset");
this->is_dynamic_ = false;
}
ACE_END_VERSIONED_NAMESPACE_DECL
| [
"[email protected]"
] | |
72b14d3d04a9cb329694c2479ffb2b74677901d6 | b9575b7d4299110e663a7432381ce7534c234b40 | /4_ExtLib/4.4_GuiFrameworks/4.4.2_HaxeUI/4.4.2.1_SimpleGui/4.4.2.1.1_HaxeuiBackends/4.4.2.1.1.2_haxeui-hxwidgets/4.4.2.1.1.2.3_Dialogs/SimpleMessageDialog/Export/cpp/debug/include/hx/widgets/CheckBox.h | c8d7d0399096c565be2a2f64bd6d8bfdbe8e3312 | [] | no_license | R3D9477/haxe-basics | dc912670731ac891f359c73db68f1a683af03f6a | cd12a1cb250447afa877fc30cf671f00e62717ef | refs/heads/master | 2021-09-02T12:22:55.398965 | 2018-01-02T15:29:40 | 2018-01-02T15:29:40 | 72,667,406 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,488 | h | // GeneratedByHaxe
#ifndef INCLUDED_hx_widgets_CheckBox
#define INCLUDED_hx_widgets_CheckBox
#ifndef HXCPP_H
#include <hxcpp.h>
#endif
#ifndef INCLUDED_hx_widgets_Control
#include <hx/widgets/Control.h>
#endif
#ifndef INCLUDED_a958b609e3b635d9
#define INCLUDED_a958b609e3b635d9
#include "wx/checkbox.h"
#endif
HX_DECLARE_CLASS2(hx,widgets,CheckBox)
HX_DECLARE_CLASS2(hx,widgets,Control)
HX_DECLARE_CLASS2(hx,widgets,EvtHandler)
HX_DECLARE_CLASS2(hx,widgets,Object)
HX_DECLARE_CLASS2(hx,widgets,Trackable)
HX_DECLARE_CLASS2(hx,widgets,Window)
namespace hx{
namespace widgets{
class HXCPP_CLASS_ATTRIBUTES CheckBox_obj : public ::hx::widgets::Control_obj
{
public:
typedef ::hx::widgets::Control_obj super;
typedef CheckBox_obj OBJ_;
CheckBox_obj();
public:
enum { _hx_ClassId = 0x58d6973e };
void __construct( ::hx::widgets::Window parent,::String label,hx::Null< int > __o_style,hx::Null< int > __o_id);
inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="hx.widgets.CheckBox")
{ return hx::Object::operator new(inSize,inContainer,inName); }
inline void *operator new(size_t inSize, int extra)
{ return hx::Object::operator new(inSize+extra,true,"hx.widgets.CheckBox"); }
static hx::ObjectPtr< CheckBox_obj > __new( ::hx::widgets::Window parent,::String label,hx::Null< int > __o_style,hx::Null< int > __o_id);
static hx::ObjectPtr< CheckBox_obj > __alloc(hx::Ctx *_hx_ctx, ::hx::widgets::Window parent,::String label,hx::Null< int > __o_style,hx::Null< int > __o_id);
static void * _hx_vtable;
static Dynamic __CreateEmpty();
static Dynamic __Create(hx::DynamicArray inArgs);
//~CheckBox_obj();
HX_DO_RTTI_ALL;
hx::Val __Field(const ::String &inString, hx::PropertyAccess inCallProp);
hx::Val __SetField(const ::String &inString,const hx::Val &inValue, hx::PropertyAccess inCallProp);
void __GetFields(Array< ::String> &outFields);
static void __register();
void __Mark(HX_MARK_PARAMS);
void __Visit(HX_VISIT_PARAMS);
bool _hx_isInstanceOf(int inClassId);
::String __ToString() const { return HX_HCSTRING("CheckBox","\x43","\x46","\x8f","\x86"); }
bool get_value();
::Dynamic get_value_dyn();
bool set_value(bool value);
::Dynamic set_value_dyn();
::cpp::Pointer< wxCheckBox > checkboxRef;
::cpp::Pointer< wxCheckBox > get_checkboxRef();
::Dynamic get_checkboxRef_dyn();
};
} // end namespace hx
} // end namespace widgets
#endif /* INCLUDED_hx_widgets_CheckBox */
| [
"[email protected]"
] | |
2371b0d0c33d76cc6c2989eab05c6982d5c36064 | 0322b03bea0c57f7c7866037f41ee3e5b792826a | /source/serializer/decoder/decoder.cpp | c1715e581a983e390067f1f43d0876efe4cd4a7d | [] | no_license | tiberiu/super-duper-octo-robot | 0be0c48dc838502d66081df29a106cf137dc50a7 | 0778ef0e54c51b20b506bdfb7b305c3c84c0a716 | refs/heads/master | 2021-01-01T03:58:00.773780 | 2016-05-21T08:56:50 | 2016-05-21T08:56:50 | 56,438,609 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 350 | cpp | #include "serializer/decoder/decoder.h"
#include "serializer/decoder/textdecoder.h"
Decoder* Decoder::GetDecoder(std::string dataFormat) {
return new TextDecoder();
}
Decoder::Node::Node() {
this->isList = false;
this->isObj = false;
this->isValue = false;
this->data = NULL;
}
Decoder::Node::~Node() {
// TODO: clean up
}
| [
"[email protected]"
] | |
4df4b72b14509c6b9839bf1988682230ba66523d | 927b1ceac19262d5dfb71fdfe03dc2eb0471126a | /src/qt/signverifymessagedialog.cpp | 2ee132f776e9e952b65ae5ab7efc758fa10c187b | [
"MIT"
] | permissive | cryptovein/ZedCoin | 7f3c16a4d640eeb5f1767e1fdef0e49b4dda889b | b9a72b685e0b3be069b8e477fae9aec8ab619da8 | refs/heads/master | 2020-04-04T02:01:57.575672 | 2014-03-07T02:17:09 | 2014-03-07T02:17:09 | 17,498,769 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,694 | cpp | #include "signverifymessagedialog.h"
#include "ui_signverifymessagedialog.h"
#include "addressbookpage.h"
#include "base58.h"
#include "guiutil.h"
#include "init.h"
#include "main.h"
#include "optionsmodel.h"
#include "walletmodel.h"
#include "wallet.h"
#include <string>
#include <vector>
#include <QClipboard>
SignVerifyMessageDialog::SignVerifyMessageDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SignVerifyMessageDialog),
model(0)
{
ui->setupUi(this);
#if (QT_VERSION >= 0x040700)
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
ui->addressIn_SM->setPlaceholderText(tr("Enter a ZedCoin address"));
ui->signatureOut_SM->setPlaceholderText(tr("Click \"Sign Message\" to generate signature"));
ui->addressIn_VM->setPlaceholderText(tr("Enter a ZedCoin address"));
ui->signatureIn_VM->setPlaceholderText(tr("Enter ZedCoin signature"));
#endif
GUIUtil::setupAddressWidget(ui->addressIn_SM, this);
GUIUtil::setupAddressWidget(ui->addressIn_VM, this);
ui->addressIn_SM->installEventFilter(this);
ui->messageIn_SM->installEventFilter(this);
ui->signatureOut_SM->installEventFilter(this);
ui->addressIn_VM->installEventFilter(this);
ui->messageIn_VM->installEventFilter(this);
ui->signatureIn_VM->installEventFilter(this);
ui->signatureOut_SM->setFont(GUIUtil::bitcoinAddressFont());
ui->signatureIn_VM->setFont(GUIUtil::bitcoinAddressFont());
}
SignVerifyMessageDialog::~SignVerifyMessageDialog()
{
delete ui;
}
void SignVerifyMessageDialog::setModel(WalletModel *model)
{
this->model = model;
}
void SignVerifyMessageDialog::setAddress_SM(QString address)
{
ui->addressIn_SM->setText(address);
ui->messageIn_SM->setFocus();
}
void SignVerifyMessageDialog::setAddress_VM(QString address)
{
ui->addressIn_VM->setText(address);
ui->messageIn_VM->setFocus();
}
void SignVerifyMessageDialog::showTab_SM(bool fShow)
{
ui->tabWidget->setCurrentIndex(0);
if (fShow)
this->show();
}
void SignVerifyMessageDialog::showTab_VM(bool fShow)
{
ui->tabWidget->setCurrentIndex(1);
if (fShow)
this->show();
}
void SignVerifyMessageDialog::on_addressBookButton_SM_clicked()
{
if (model && model->getAddressTableModel())
{
AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::ReceivingTab, this);
dlg.setModel(model->getAddressTableModel());
if (dlg.exec())
{
setAddress_SM(dlg.getReturnValue());
}
}
}
void SignVerifyMessageDialog::on_pasteButton_SM_clicked()
{
setAddress_SM(QApplication::clipboard()->text());
}
void SignVerifyMessageDialog::on_signMessageButton_SM_clicked()
{
/* Clear old signature to ensure users don't get confused on error with an old signature displayed */
ui->signatureOut_SM->clear();
CBitcoinAddress addr(ui->addressIn_SM->text().toStdString());
if (!addr.IsValid())
{
ui->addressIn_SM->setValid(false);
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_SM->setText(tr("The entered address is invalid.") + QString(" ") + tr("Please check the address and try again."));
return;
}
CKeyID keyID;
if (!addr.GetKeyID(keyID))
{
ui->addressIn_SM->setValid(false);
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_SM->setText(tr("The entered address does not refer to a key.") + QString(" ") + tr("Please check the address and try again."));
return;
}
WalletModel::UnlockContext ctx(model->requestUnlock());
if (!ctx.isValid())
{
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_SM->setText(tr("Wallet unlock was canceled."));
return;
}
CKey key;
if (!pwalletMain->GetKey(keyID, key))
{
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_SM->setText(tr("Private key for the entered address is not available."));
return;
}
CDataStream ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << ui->messageIn_SM->document()->toPlainText().toStdString();
std::vector<unsigned char> vchSig;
if (!key.SignCompact(Hash(ss.begin(), ss.end()), vchSig))
{
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_SM->setText(QString("<nobr>") + tr("Message signing failed.") + QString("</nobr>"));
return;
}
ui->statusLabel_SM->setStyleSheet("QLabel { color: green; }");
ui->statusLabel_SM->setText(QString("<nobr>") + tr("Message signed.") + QString("</nobr>"));
ui->signatureOut_SM->setText(QString::fromStdString(EncodeBase64(&vchSig[0], vchSig.size())));
}
void SignVerifyMessageDialog::on_copySignatureButton_SM_clicked()
{
QApplication::clipboard()->setText(ui->signatureOut_SM->text());
}
void SignVerifyMessageDialog::on_clearButton_SM_clicked()
{
ui->addressIn_SM->clear();
ui->messageIn_SM->clear();
ui->signatureOut_SM->clear();
ui->statusLabel_SM->clear();
ui->addressIn_SM->setFocus();
}
void SignVerifyMessageDialog::on_addressBookButton_VM_clicked()
{
if (model && model->getAddressTableModel())
{
AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this);
dlg.setModel(model->getAddressTableModel());
if (dlg.exec())
{
setAddress_VM(dlg.getReturnValue());
}
}
}
void SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked()
{
CBitcoinAddress addr(ui->addressIn_VM->text().toStdString());
if (!addr.IsValid())
{
ui->addressIn_VM->setValid(false);
ui->statusLabel_VM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_VM->setText(tr("The entered address is invalid.") + QString(" ") + tr("Please check the address and try again."));
return;
}
CKeyID keyID;
if (!addr.GetKeyID(keyID))
{
ui->addressIn_VM->setValid(false);
ui->statusLabel_VM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_VM->setText(tr("The entered address does not refer to a key.") + QString(" ") + tr("Please check the address and try again."));
return;
}
bool fInvalid = false;
std::vector<unsigned char> vchSig = DecodeBase64(ui->signatureIn_VM->text().toStdString().c_str(), &fInvalid);
if (fInvalid)
{
ui->signatureIn_VM->setValid(false);
ui->statusLabel_VM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_VM->setText(tr("The signature could not be decoded.") + QString(" ") + tr("Please check the signature and try again."));
return;
}
CDataStream ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << ui->messageIn_VM->document()->toPlainText().toStdString();
CKey key;
if (!key.SetCompactSignature(Hash(ss.begin(), ss.end()), vchSig))
{
ui->signatureIn_VM->setValid(false);
ui->statusLabel_VM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_VM->setText(tr("The signature did not match the message digest.") + QString(" ") + tr("Please check the signature and try again."));
return;
}
if (!(CBitcoinAddress(key.GetPubKey().GetID()) == addr))
{
ui->statusLabel_VM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_VM->setText(QString("<nobr>") + tr("Message verification failed.") + QString("</nobr>"));
return;
}
ui->statusLabel_VM->setStyleSheet("QLabel { color: green; }");
ui->statusLabel_VM->setText(QString("<nobr>") + tr("Message verified.") + QString("</nobr>"));
}
void SignVerifyMessageDialog::on_clearButton_VM_clicked()
{
ui->addressIn_VM->clear();
ui->signatureIn_VM->clear();
ui->messageIn_VM->clear();
ui->statusLabel_VM->clear();
ui->addressIn_VM->setFocus();
}
bool SignVerifyMessageDialog::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::FocusIn)
{
if (ui->tabWidget->currentIndex() == 0)
{
/* Clear status message on focus change */
ui->statusLabel_SM->clear();
/* Select generated signature */
if (object == ui->signatureOut_SM)
{
ui->signatureOut_SM->selectAll();
return true;
}
}
else if (ui->tabWidget->currentIndex() == 1)
{
/* Clear status message on focus change */
ui->statusLabel_VM->clear();
}
}
return QDialog::eventFilter(object, event);
}
| [
"[email protected]"
] | |
53b019bf7af6c946cb28120dff6e8a1dcfdb7bca | 573b127ac411ac7b1c865df4faa302f86686f1f5 | /src/nettest.cpp | 250912797d3ea111556adc3c4f64c52c08bb2db1 | [
"LGPL-2.1-only",
"BSD-3-Clause"
] | permissive | ericloewe/MCIS | db454631646c7fecbe5a32fca45e1aa2358925c5 | 2d740e715de55acfc57ba2048ebd5f0409ee7c5f | refs/heads/master | 2021-05-03T22:07:07.504796 | 2019-07-24T22:40:56 | 2019-07-24T22:40:56 | 120,386,541 | 0 | 0 | BSD-3-Clause | 2019-05-05T23:18:34 | 2018-02-06T01:48:28 | C++ | UTF-8 | C++ | false | false | 4,074 | cpp | /*
Copyright (c) 2018, Eric Loewenthal
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the organization nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 <iostream>
#include <fstream>
#include <vector>
#include <chrono>
#include "include/MCIS_config.h"
#include "include/MCIS_MDA.h"
#include "include/discreteMath.h"
#include "include/MCIS_xplane_sock.h"
#include "include/MCIS_fileio.h"
#define configFileName "MCISconfig.bin"
#define outFilename "nettest.csv"
#define inputsLogname "nettestinputs.csv"
#define inPort 10555
int main()
{
MCISconfig config;
std::ofstream outfile;
std::ofstream inputslog;
std::ifstream configFile;
char *fileIn = (char *)&config;
std::cout << "MCIS network test" << std::endl;
//Try to open the config file...
configFile.open(configFileName, std::ios_base::binary);
if (!configFile.good())
{
std::cout << "Error opening config file " << configFileName << std::endl;
return 0;
}
//And try to read it.
configFile.read(fileIn, sizeof(MCISconfig));
if (configFile.gcount() != sizeof(MCISconfig))
{
std::cout << "Config file truncated! Cannot start MCIS using config file " << configFileName << std::endl;
return 0;
}
std::cout << "Configuration loaded." << std::endl;
MCIS_MDA mda{config};
outfile.open(outFilename);
if (!outfile.good())
{
std::cout << "Failed to open output file: " << outFilename << std::endl;
return 0;
}
inputslog.open(inputsLogname);
if (!inputslog.good())
{
std::cout << "Failed to open inputs log file: " << inputsLogname << std::endl;
return 0;
}
MCISvector sfIn, angIn, posOut, angOut;
xplaneSocket inSock(inPort, XP9);
auto nextTick = std::chrono::high_resolution_clock::now();
//std::chrono::high_resolution_clock::duration oneSecond(std::chrono::duration<long long>(1));
auto sampleTime = std::chrono::nanoseconds( (int)(1e9 / config.sampleRate));
//auto sampleTime = std::chrono::microseconds((unsigned long)(10e9));
/*std::cout << "std::chrono::duration = " << sampleTime.count() << " ns" << std::endl;
std::cout << " = " << sampleTime.count() * 1e-9 << " s" << std::endl;
std::cout << "sampleRate = " << config.sampleRate << std::endl;*/
//for (int i = 0; i < 120; i++)
while (true)
{
nextTick += sampleTime;
inSock.getData(sfIn, angIn);
writeMCISoutputs(inputslog, sfIn, angIn);
mda.nextSample(sfIn, angIn);
writeMCISfullOutputs(outfile, mda.getPos(), mda.getangle(), mda.getAngleNoTC());
std::this_thread::sleep_until(nextTick);
}
} | [
"[email protected]"
] | |
9dceb7b5ab98a39ed44318ad1a8489ac3d595a88 | 079fc299d6a1622832f738bac1f28167df6b0b9c | /cpp_module05/ex02/main.cpp | 36aed6f73e1e0188ce12a0fc390a0946ebb73e73 | [] | no_license | xogml123/cpp | 294fa038e078a18cf3e24fdd7eea32692b634b25 | 4e2a24e169ad2e31cb8d9d6ba3afa2f8de21d9f3 | refs/heads/master | 2023-08-14T01:40:37.260112 | 2021-10-06T14:59:55 | 2021-10-06T14:59:55 | 374,075,489 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 627 | cpp | #include "Bureaucrat.hpp"
#include "Form.hpp"
#include "ShrubberyCreationForm.hpp"
#include "RobotomyRequestForm.hpp"
#include "PresidentialPardonForm.hpp"
int main()
{
Bureaucrat* b1 = NULL;
Form* f1 = NULL;
Form* f2 = NULL;
Form* f3 = NULL;
try
{
b1 = new Bureaucrat("tom",44);
f1 = new ShrubberyCreationForm("tomForm");
f2 = new RobotomyRequestForm("johnForm");
f3 = new PresidentialPardonForm("jamesForm");
}
catch(const std::exception& e)
{
std::cerr << e.what() << '\n';
}
b1->executeForm(*f1);
b1->executeForm(*f2);
b1->executeForm(*f3);
delete b1;
delete f1;
delete f2;
delete f3;
} | [
"[email protected]"
] | |
42a1f28c68cf3d4f8460835b19d904feedeb9606 | 30bdd8ab897e056f0fb2f9937dcf2f608c1fd06a | /CodesNew/3876.cpp | 5d8d199136db873e3ce23a43f172739d6ff23f7f | [] | no_license | thegamer1907/Code_Analysis | 0a2bb97a9fb5faf01d983c223d9715eb419b7519 | 48079e399321b585efc8a2c6a84c25e2e7a22a61 | refs/heads/master | 2020-05-27T01:20:55.921937 | 2019-11-20T11:15:11 | 2019-11-20T11:15:11 | 188,403,594 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 884 | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long l;
typedef long long ll;
typedef unsigned long long ull;
#define sc(a) scanf("%d",&a)
const int MAX = 1e5+5;
const ll inf = 2*1e9+77;
const int MOD = 1e8+7;
int a[MAX];
int n;
bool check(ll d)
{
ll hold = d;
for(int i = 0 ; i < n ; ++i)
{
hold -= (d-a[i]);
if(hold <= 0)
return 1;
}
return 0;
}
int main()
{
cin>>n;
for(int i = 0 ; i < n ; ++i)
cin>>a[i];
sort(a,a+n,greater<int>());
ll st = a[0],en = inf;
ll res = 0;
while(st <= en)
{
ll md = (st + en)/2;
if(check(md))
{
res = md;
en = md - 1;
}
else
st = md + 1;
}
cout<<res<<endl;
return 0;
} | [
"[email protected]"
] | |
f69039f513ef26156f52104bff97d4d7c8309d4f | b7f3edb5b7c62174bed808079c3b21fb9ea51d52 | /third_party/blink/public/platform/interface_registry.h | 73c378e9f6e8f2c3eba7304551392816cc4dabd0 | [
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | otcshare/chromium-src | 26a7372773b53b236784c51677c566dc0ad839e4 | 64bee65c921db7e78e25d08f1e98da2668b57be5 | refs/heads/webml | 2023-03-21T03:20:15.377034 | 2020-11-16T01:40:14 | 2020-11-16T01:40:14 | 209,262,645 | 18 | 21 | BSD-3-Clause | 2023-03-23T06:20:07 | 2019-09-18T08:52:07 | null | UTF-8 | C++ | false | false | 3,602 | h | // Copyright 2016 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 THIRD_PARTY_BLINK_PUBLIC_PLATFORM_INTERFACE_REGISTRY_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_INTERFACE_REGISTRY_H_
#include <utility>
#include "base/callback_forward.h"
#include "base/memory/scoped_refptr.h"
#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "third_party/blink/public/platform/web_common.h"
#if INSIDE_BLINK
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" // nogncheck
#include "third_party/blink/renderer/platform/wtf/functional.h" // nogncheck
#endif
namespace base {
class SingleThreadTaskRunner;
}
namespace blink {
using InterfaceFactory =
base::RepeatingCallback<void(mojo::ScopedMessagePipeHandle)>;
using AssociatedInterfaceFactory =
base::RepeatingCallback<void(mojo::ScopedInterfaceEndpointHandle)>;
class BLINK_PLATFORM_EXPORT InterfaceRegistry {
public:
virtual void AddInterface(
const char* name,
const InterfaceFactory&,
scoped_refptr<base::SingleThreadTaskRunner> = nullptr) = 0;
// The usage of associated interfaces should be very limited. Please
// consult the owners of public/platform before adding one.
virtual void AddAssociatedInterface(const char* name,
const AssociatedInterfaceFactory&) = 0;
static InterfaceRegistry* GetEmptyInterfaceRegistry();
#if INSIDE_BLINK
template <typename Interface>
void AddInterface(
base::RepeatingCallback<void(mojo::PendingReceiver<Interface>)> factory) {
AddInterface(
Interface::Name_,
WTF::BindRepeating(&InterfaceRegistry::ForwardToInterfaceFactory<
mojo::PendingReceiver<Interface>>,
std::move(factory)));
}
template <typename Interface>
void AddInterface(
base::RepeatingCallback<void(mojo::PendingReceiver<Interface>)> factory,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
DCHECK(task_runner->RunsTasksInCurrentSequence());
AddInterface(
Interface::Name_,
WTF::BindRepeating(&InterfaceRegistry::ForwardToInterfaceFactory<
mojo::PendingReceiver<Interface>>,
std::move(factory)),
std::move(task_runner));
}
template <typename Interface>
void AddAssociatedInterface(
base::RepeatingCallback<void(mojo::PendingAssociatedReceiver<Interface>)>
factory) {
AddAssociatedInterface(
Interface::Name_,
WTF::BindRepeating(
&InterfaceRegistry::ForwardToAssociatedInterfaceFactory<
mojo::PendingAssociatedReceiver<Interface>>,
std::move(factory)));
}
private:
template <typename MojoType>
static void ForwardToInterfaceFactory(
base::RepeatingCallback<void(MojoType)> factory,
mojo::ScopedMessagePipeHandle handle) {
factory.Run(MojoType(std::move(handle)));
}
template <typename MojoType>
static void ForwardToAssociatedInterfaceFactory(
base::RepeatingCallback<void(MojoType)> factory,
mojo::ScopedInterfaceEndpointHandle handle) {
factory.Run(MojoType(std::move(handle)));
}
#endif // INSIDE_BLINK
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_INTERFACE_REGISTRY_H_
| [
"[email protected]"
] | |
ca0c3b13465618bea0dfd72c097003afb2d6d543 | dae66863ac441ab98adbd2d6dc2cabece7ba90be | /examples/flexrun/ASWorkFlexRun.h | aad3385447c35be6ad42d6653b4001fb392c9140 | [] | no_license | bitcrystal/flexcppbridge | 2485e360f47f8d8d124e1d7af5237f7e30dd1980 | 474c17cfa271a9d260be6afb2496785e69e72ead | refs/heads/master | 2021-01-10T14:14:30.928229 | 2008-11-11T06:11:34 | 2008-11-11T06:11:34 | 48,993,836 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,045 | h | /*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Flex C++ Bridge.
*
* The Initial Developer of the Original Code is
* Anirudh Sasikumar (http://anirudhs.chaosnet.org/).
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*/
#pragma once
#include "aswork.h"
class CASWorkFlexRun :
public CASWork
{
protected:
virtual void Worker();
public:
CASWorkFlexRun(void);
virtual ~CASWorkFlexRun(void);
virtual CASWork* Clone();
};
| [
"anirudhsasikumar@1c1c0844-4f48-0410-9872-0bebc774e022"
] | anirudhsasikumar@1c1c0844-4f48-0410-9872-0bebc774e022 |
9ffac9f1d826ab1bbf92bf58abe9d1b9d78165c6 | 6bee9b8fd4a49715e33c76eb255d0fd4529c5d24 | /src/MPC.cpp | d766f88f72df41ecc8794bde9e4c6a4182fa994f | [
"MIT"
] | permissive | SebastianDrynda/CarND-MPC-Project-P10 | a727c210f53061fc13acde0feb599030e9f7f822 | 12373572d24ee0941bb23c03d342b1675db3b6bd | refs/heads/master | 2020-03-26T07:58:47.738002 | 2018-08-15T13:31:37 | 2018-08-15T13:31:37 | 144,680,433 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,051 | cpp | #include "MPC.h"
#include <cppad/cppad.hpp>
#include <cppad/ipopt/solve.hpp>
#include "Eigen-3.3/Eigen/Core"
using CppAD::AD;
// TODO: Set the timestep length and duration
size_t N = 10;
double dt = 0.1;
// This value assumes the model presented in the classroom is used.
//
// It was obtained by measuring the radius formed by running the vehicle in the
// simulator around in a circle with a constant steering angle and velocity on a
// flat terrain.
//
// Lf was tuned until the the radius formed by the simulating the model
// presented in the classroom matched the previous radius.
//
// This is the length from front to CoG that has a similar radius.
const double Lf = 2.67;
const double ref_cte = 0;
const double ref_epsi = 0;
const double ref_v = 70;
const size_t x_start = 0;
const size_t y_start = x_start + N;
const size_t psi_start = y_start + N;
const size_t v_start = psi_start + N;
const size_t cte_start = v_start + N;
const size_t epsi_start = cte_start + N;
const size_t delta_start = epsi_start + N;
const size_t a_start = delta_start + N - 1;
class FG_eval {
public:
// Fitted polynomial coefficients
Eigen::VectorXd coeffs;
FG_eval(Eigen::VectorXd coeffs) {
this->coeffs = coeffs;
}
typedef CPPAD_TESTVECTOR(AD<double>)ADvector;
void operator()(ADvector& fg, const ADvector& vars) {
// TODO: implement MPC
// `fg` a vector of the cost constraints, `vars` is a vector of variable values (state & actuators)
// NOTE: You'll probably go back and forth between this function and
// the Solver function below.
// The cost is stored is the first element of `fg`.
// Any additions to the cost should be added to `fg[0]`.
fg[0] = 0;
// The part of the cost based on the reference state.
for( int i = 0; i < N; i++ ) {
fg[0] += 3000*CppAD::pow(vars[cte_start + i] - ref_cte, 2);
fg[0] += 3000*CppAD::pow(vars[epsi_start + i] - ref_epsi, 2);
fg[0] += CppAD::pow(vars[v_start + i] - ref_v, 2);
}
// Minimize the use of actuators.
for (int i = 0; i< N - 1; i++) {
fg[0] += 5*CppAD::pow(vars[delta_start + i], 2);
fg[0] += 5*CppAD::pow(vars[a_start + i], 2);
// penalty for speed + steer
fg[0] += 700*CppAD::pow(vars[delta_start + i] * vars[v_start+i], 2);
}
// Minimize the value gap between sequential actuations.
// (how smooth the actuations are)
for (int i = 0; i < N - 2; i++) {
fg[0] += 200*CppAD::pow(vars[delta_start + i + 1] - vars[delta_start + i], 2);
fg[0] += 10*CppAD::pow(vars[a_start + i + 1] - vars[a_start + i], 2);
}
// Setup constraints
fg[1 + x_start] = vars[x_start];
fg[1 + y_start] = vars[y_start];
fg[1 + psi_start] = vars[psi_start];
fg[1 + v_start] = vars[v_start];
fg[1 + cte_start] = vars[cte_start];
fg[1 + epsi_start] = vars[epsi_start];
for (int t = 1; t < N; t++) {
// The state at time t+1 .
AD<double> x1 = vars[x_start + t];
AD<double> y1 = vars[y_start + t];
AD<double> psi1 = vars[psi_start + t];
AD<double> v1 = vars[v_start + t];
AD<double> cte1 = vars[cte_start + t];
AD<double> epsi1 = vars[epsi_start + t];
// The state at time t.
AD<double> x0 = vars[x_start + t - 1];
AD<double> y0 = vars[y_start + t - 1];
AD<double> psi0 = vars[psi_start + t - 1];
AD<double> v0 = vars[v_start + t - 1];
AD<double> cte0 = vars[cte_start + t - 1];
AD<double> epsi0 = vars[epsi_start + t - 1];
// Only consider the actuation at time t.
AD<double> delta0 = vars[delta_start + t - 1];
AD<double> a0 = vars[a_start + t - 1];
AD<double> f0 = coeffs[0] + coeffs[1] * x0 + coeffs[2] * CppAD::pow(x0, 2) + coeffs[3] * CppAD::pow(x0, 3);
AD<double> psides0 = CppAD::atan(coeffs[1] + 2 * coeffs[2] * x0 + 3 * coeffs[3] * CppAD::pow(x0, 2));
// Here's `x` to get you started.
// The idea here is to constraint this value to be 0.
//
// NOTE: The use of `AD<double>` and use of `CppAD`!
// This is also CppAD can compute derivatives and pass
// these to the solver.
// TODO: Setup the rest of the model constraints
fg[1 + x_start + t] = x1 - (x0 + v0 * CppAD::cos(psi0) * dt);
fg[1 + y_start + t] = y1 - (y0 + v0 * CppAD::sin(psi0) * dt);
fg[1 + psi_start + t] = psi1 - (psi0 - v0 / Lf * delta0 * dt);
fg[1 + v_start + t] = v1 - (v0 + a0 * dt);
fg[1 + cte_start + t] = cte1 - ((f0 - y0) + (v0 * CppAD::sin(epsi0) * dt));
fg[1 + epsi_start + t] = epsi1 - ((psi0 - psides0) - v0 / Lf * delta0 * dt);
}
}
};
//
// MPC class definition implementation.
//
MPC::MPC() {
}
MPC::~MPC() {
}
vector<double> MPC::Solve(Eigen::VectorXd state, Eigen::VectorXd coeffs) {
bool ok = true;
// size_t i;
typedef CPPAD_TESTVECTOR(double)Dvector;
const double x = state[0];
const double y = state[1];
const double psi = state[2];
const double v = state[3];
const double cte = state[4];
const double epsi = state[5];
// TODO: Set the number of model variables (includes both states and inputs).
// For example: If the state is a 4 element vector, the actuators is a 2
// element vector and there are 10 timesteps. The number of variables is:
//
// 4 * 10 + 2 * 9
const size_t n_vars = N * 6 + (N - 1) * 2;
// TODO: Set the number of constraints
const size_t n_constraints = N * 6;
// Initial value of the independent variables.
// SHOULD BE 0 besides initial state.
Dvector vars(n_vars);
for (int i = 0; i < n_vars; i++) {
vars[i] = 0;
}
Dvector vars_lowerbound(n_vars);
Dvector vars_upperbound(n_vars);
// TODO: Set lower and upper limits for variables.
// Set the initial variable values
// Set all non-actuators upper and lower limits
// to the max negative and positive values.
for (int i = 0; i < delta_start; i++) {
vars_lowerbound[i] = -1.0e19;
vars_upperbound[i] = 1.0e19;
}
// The upper and lower limits of delta are set to -25 to 25
// degrees (values in radians).
for (int i = delta_start; i < a_start; i++) {
vars_lowerbound[i] = -0.436332 * Lf;
vars_upperbound[i] = 0.43632 * Lf;
}
// Actuator limits.
for (int i = a_start; i < n_vars; i++) {
vars_lowerbound[i] = -1.0;
vars_upperbound[i] = 1.0;
}
// Lower and upper limits for the constraints
// Should be 0 besides initial state.
Dvector constraints_lowerbound(n_constraints);
Dvector constraints_upperbound(n_constraints);
for (int i = 0; i < n_constraints; i++) {
constraints_lowerbound[i] = 0;
constraints_upperbound[i] = 0;
}
constraints_lowerbound[x_start] = x;
constraints_lowerbound[y_start] = y;
constraints_lowerbound[psi_start] = psi;
constraints_lowerbound[v_start] = v;
constraints_lowerbound[cte_start] = cte;
constraints_lowerbound[epsi_start] = epsi;
constraints_upperbound[x_start] = x;
constraints_upperbound[y_start] = y;
constraints_upperbound[psi_start] = psi;
constraints_upperbound[v_start] = v;
constraints_upperbound[cte_start] = cte;
constraints_upperbound[epsi_start] = epsi;
// object that computes objective and constraints
FG_eval fg_eval(coeffs);
//
// NOTE: You don't have to worry about these options
//
// options for IPOPT solver
std::string options;
// Uncomment this if you'd like more print information
options += "Integer print_level 0\n";
// NOTE: Setting sparse to true allows the solver to take advantage
// of sparse routines, this makes the computation MUCH FASTER. If you
// can uncomment 1 of these and see if it makes a difference or not but
// if you uncomment both the computation time should go up in orders of
// magnitude.
options += "Sparse true forward\n";
options += "Sparse true reverse\n";
// NOTE: Currently the solver has a maximum time limit of 0.5 seconds.
// Change this as you see fit.
options += "Numeric max_cpu_time 0.5\n";
// place to return solution
CppAD::ipopt::solve_result<Dvector> solution;
// solve the problem
CppAD::ipopt::solve<Dvector, FG_eval>(options, vars, vars_lowerbound,
vars_upperbound, constraints_lowerbound,
constraints_upperbound, fg_eval,
solution);
// Check some of the solution values
ok &= solution.status == CppAD::ipopt::solve_result<Dvector>::success;
// Cost
// auto cost = solution.obj_value;
// std::cout << "Cost " << cost << std::endl;
// TODO: Return the first actuator values. The variables can be accessed with
// `solution.x[i]`.
//
// {...} is shorthand for creating a vector, so auto x1 = {1.0,2.0}
// creates a 2 element double vector.
vector<double> result;
result.push_back(solution.x[delta_start]);
result.push_back(solution.x[a_start]);
for (int i = 0; i < N - 2; i++) {
result.push_back(solution.x[x_start + i + 1]);
result.push_back(solution.x[y_start + i + 1]);
}
return result;
}
| [
"[email protected]"
] | |
742c2c624c60b403dbee7243cb6ce0ee5135442e | d2fb019e63eb66f9ddcbdf39d07f7670f8cf79de | /groups/bsl/bslscm/bslscm_versiontag.t.cpp | fcdc88f471b98cb4463c449665ccff9ae75739eb | [
"MIT"
] | permissive | gosuwachu/bsl | 4fa8163a7e4b39e4253ad285b97f8a4d58020494 | 88cc2b2c480bcfca19e0f72753b4ec0359aba718 | refs/heads/master | 2021-01-17T05:36:55.605787 | 2013-01-15T19:48:00 | 2013-01-15T19:48:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,181 | cpp | // bslscm_versiontag.t.cpp -*-C++-*-
#include <bslscm_versiontag.h>
#include <cstdlib> // atoi()
#include <cstring>
#include <cstdio>
using namespace BloombergLP;
//==========================================================================
// STANDARD BDE ASSERT TEST MACRO
//--------------------------------------------------------------------------
// NOTE: THIS IS A LOW-LEVEL COMPONENT AND MAY NOT USE ANY C++ LIBRARY
// FUNCTIONS, INCLUDING IOSTREAMS.
static int testStatus = 0;
static bool verbose = false;
static bool veryVerbose = false;
static void aSsErT(int c, const char *s, int i) {
if (c) {
std::fprintf(stderr, "Error " __FILE__ "(%d): %s (failed)\n", i, s);
if (testStatus >= 0 && testStatus <= 100) ++testStatus;
}
}
#define ASSERT(X) { aSsErT(!(X), #X, __LINE__); }
#define LOOP_ASSERT(I,X) { \
if (!(X)) { std::printf("%s: %d\n", #I, I); \
aSsErT(1, #X, __LINE__); } }
//--------------------------------------------------------------------------
//=============================================================================
// SEMI-STANDARD TEST OUTPUT MACROS
//-----------------------------------------------------------------------------
// #define P(X) cout << #X " = " << (X) << endl; // Print identifier and value.
#define Q(X) std::printf("<| " #X " |>\n"); // Quote identifier literally.
//#define P_(X) cout << #X " = " << (X) << ", " << flush; // P(X) without '\n'
#define L_ __LINE__ // current Line number
#define T_ std::printf("\t"); // Print a tab (w/o newline)
//=============================================================================
// USAGE EXAMPLE HELPER FUNCTIONS
//-----------------------------------------------------------------------------
int newFunction()
// Return 1
{
return 1;
}
// int OldFunction()
// Not defined and never called due to conditional compilation
//=============================================================================
// MAIN PROGRAM
//-----------------------------------------------------------------------------
int main(int argc, char *argv[])
{
int test = argc > 1 ? std::atoi(argv[1]) : 0;
verbose = (argc > 2);
veryVerbose = (argc > 3);
std::printf("TEST %s CASE %d\n", __FILE__, test);
switch (test) { case 0:
case 3: {
//--------------------------------------------------------------------
// TEST USAGE EXAMPLE
//
// Concern:
// That the usage example in the user documentation compiles and
// runs as expected.
//
// Plan:
// Use the exact text of the usage example from the user
// documentation, but change uses of 'assert' to 'ASSERT'.
//
// Testing:
// USAGE EXAMPLE
//--------------------------------------------------------------------
if (verbose) std::printf("\nTEST USAGE EXAMPLE"
"\n==================\n");
// At compile time, the version of BSL can be used to select an older or newer
// way to accomplish a task, to enable new functionality, or to accommodate an
// interface change. For example, if a function changed names (a rare
// occurrence, but disruptive when it does happen), disruption can be minimized
// by conditionally calling the old or new function name using conditional
// compilation. The '#if' directive compares 'BSL_VERSION' to a specified
// major, minor, and patch version 4 composed using 'BSL_MAKE_VERSION':
//..
#if BSL_VERSION > BSL_MAKE_VERSION(1, 2)
// Call 'newFunction' for BSL version 1.2 and later:
int result = newFunction();
#else
// Call 'oldFunction' for BSL older than version 1.2:
int result = oldFunction();
#endif
ASSERT(result);
//..
} break;
case 2: {
//--------------------------------------------------------------------
// TEST BSL_MAKE_VERSION MACRO
//
// Concerns:
// That BSL_MAKE_VERSION create a compile-time constant if its
// arguments are all compile-time constants.
// That BSL_MAKE_VERSION correctly composes a major, minor, and
// patch version number into a single integer. Each component can
// be in the range 0-99.
//
// Plan:
// Use the result of BSL_MAKE_VERSION as an array dimension to
// prove that it is a compile-time constant.
// Using ad-hoc data selection, create a number of version values
// using the 'BSL_MAKE_VERSION' macro and verify that the expected
// value matches the actual value.
//
// Testing:
// BSL_MAKE_VERSION(major, minor)
//--------------------------------------------------------------------
if (verbose) std::printf("\nTEST BSL_MAKE_VERSION MACRO"
"\n===========================\n");
#if 0
// Test that 'BSL_MAKE_VERSION(0,1,2)' is a compile-time constant.
static const char COMPILE_ASSERT[BSL_MAKE_VERSION(0,1,2)] = { 0 };
ASSERT(sizeof(COMPILE_ASSERT) == 102);
static struct {
int d_line;
int d_major;
int d_minor;
int d_patch;
int d_version;
} const DATA[] = {
//line major minor patch version
//---- ----- ----- ----- -------
{ L_, 0, 0, 0, 0 },
{ L_, 0, 0, 1, 1 },
{ L_, 0, 1, 0, 100 },
{ L_, 0, 1, 1, 101 },
{ L_, 1, 0, 0, 10000 },
{ L_, 1, 0, 1, 10001 },
{ L_, 1, 1, 0, 10100 },
{ L_, 12, 34, 56, 123456 },
{ L_, 99, 99, 99, 999999 },
{ L_, 9, 9, 9, 90909 },
{ L_, 10, 20, 30, 102030 }
};
static const int NUM_DATA = sizeof(DATA) / sizeof(*DATA);
for (int i = 0; i < NUM_DATA; ++i) {
const int LINE = DATA[i].d_line;
const int MAJOR = DATA[i].d_major;
const int MINOR = DATA[i].d_minor;
const int PATCH = DATA[i].d_patch;
const int EXP = DATA[i].d_version;
LOOP_ASSERT(LINE, EXP == BSL_MAKE_VERSION(MAJOR, MINOR, PATCH));
}
#endif
static const char COMPILE_ASSERT[BSL_MAKE_VERSION(0,1)] = { 0 };
ASSERT(sizeof(COMPILE_ASSERT) == 100);
static struct {
int d_line;
int d_major;
int d_minor;
int d_version;
} const DATA[] = {
//line major minor version
//---- ----- ----- -------
{ L_, 0, 0, 0 },
{ L_, 0, 1, 100 },
{ L_, 1, 0, 10000 },
{ L_, 1, 1, 10100 },
{ L_, 12, 34, 123400 },
{ L_, 99, 99, 999900 },
{ L_, 9, 9, 90900 },
{ L_, 10, 20, 102000 }
};
static const int NUM_DATA = sizeof(DATA) / sizeof(*DATA);
for (int i = 0; i < NUM_DATA; ++i) {
const int LINE = DATA[i].d_line;
const int MAJOR = DATA[i].d_major;
const int MINOR = DATA[i].d_minor;
const int EXP = DATA[i].d_version;
LOOP_ASSERT(LINE, EXP == BSL_MAKE_VERSION(MAJOR, MINOR));
}
} break;
case 1: {
//--------------------------------------------------------------------
// TEST VERSION CONSISTENCY
//
// Concerns:
// That BSL_VERSION corresponds to the two components
// BSL_VERSION_MAJOR and BSL_VERSION_MINOR
//
// Plan:
// Decompose BSL_VERSION into its three components and verify
// that they correspond to the defined macros.
//
// Testing:
// BSL_VERSION
// BSL_VERSION_MAJOR
// BSL_VERSION_MINOR
//--------------------------------------------------------------------
if (verbose) std::printf("\nTEST VERSION CONSISTENCY"
"\n========================\n");
int major = (BSL_VERSION / 10000) % 100;
int minor = (BSL_VERSION / 100) % 100;
ASSERT(BSL_VERSION_MAJOR == major);
ASSERT(BSL_VERSION_MINOR == minor);
} break;
default: {
std::fprintf(stderr, "WARNING: CASE `%d' NOT FOUND.\n", test);
testStatus = -1;
}
}
if (testStatus > 0) {
std::fprintf(stderr, "Error, non-zero test status = %d.\n",
testStatus);
}
return testStatus;
}
// ----------------------------------------------------------------------------
// Copyright (C) 2012 Bloomberg L.P.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
// ----------------------------- END-OF-FILE ----------------------------------
| [
"[email protected]"
] | |
620aee5d02c9c243ef3a39ed96ff79d657ddda08 | 508fff84ee929a68daac4ff900d36912f0d6b6ed | /WSEExternal/include/Common/GeometryUtilities/Mesh/Utils/IndexSet/hkIndexSet.h | 32337cce9fc583f33ac7b5100c28cf36e8a1d649 | [
"WTFPL"
] | permissive | blockspacer/wse | f2e05755ba1263c645d0b021548a73e5a5a33ba6 | 3ad901f1a463139b320c30ea08bdc343358ea6b6 | refs/heads/master | 2023-03-16T13:15:04.153026 | 2014-02-13T08:10:03 | 2014-02-13T08:10:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,731 | h | /*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Level 2 and Level 3 source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2009 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*
*/
#ifndef HK_INDEX_SET_H
#define HK_INDEX_SET_H
/// Holds a unique set of int indices.
///
/// This implements a 'mathematical' style set of int values or 'indices'.
///
/// A set either contains or does not contain an index. Sets can be combined via the standard set
/// operations of setIntersection, setUnion and setDifference. This operations are designed to be relatively
/// fast. Note that the sets passed in cannot be the same as the set that is being modified.
///
/// Its possible to modify the contents using startUpdate/endUpdate. Members can be added/removed from the
/// set by manipulating the array. Doing endUpdate will sort the members, and remove any duplicates.
///
/// The implementation holds the indices held in the set in a sorted array. Having a sorted list, allows for fast
/// comparison, and the boolean operations. It also allows relatively fast containment tesing - using a binary chop
/// giving O(log2(n)) performance.
class hkIndexSet
{
public:
HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_SCENE_DATA, hkIndexSet);
/// Returns the index of index if found, else -1 if not
/// Complexity - O(log(n)) n is is size of set
int findIndex(int index) const;
/// Returns true if the set contains the index
/// Complexity - O(log(n)) n is is size of set
hkBool contains(int index) const { return findIndex(index) >= 0; }
/// Returns the indices which are in both sets
/// Complexity O(n + m) n is size of a, m is size of b
void setIntersection(const hkIndexSet& a, const hkIndexSet& b);
/// Returns the union of both sets
/// Complexity O(n + m) n is size of a, m is size of b
void setUnion(const hkIndexSet& a, const hkIndexSet& b);
/// Set the set as the members of a minus the members of b
/// Complexity O(n + m) n is size of a, m is size of b
void setDifference(const hkIndexSet& a, const hkIndexSet& b);
/// Read only access to contained indices
const hkArray<int>& getIndices() const { return m_indices; }
/// Start updating the contents
/// Complexity - O(1)
hkArray<int>& startUpdate();
/// End the update
/// Complexity - O(n), will reorder indices and remove duplicates
void endUpdate();
/// Get the number of indices. Note the can be incorrect in an update if there are repeated indices.
int getSize() const { return m_indices.getSize(); }
/// Remove a value (can only be done in an update)
/// Complextiy - O(n)
void removeIndex(int index);
/// Add a value (can only be done in an update)
/// Complexity O(1). Note that each addition will consume memory, duplicates are only removed in the end update
void addIndex(int index);
/// Remove all of the contents
void clear() { m_indices.clear(); }
/// Optimizes memory allocation
void optimizeAllocation();
/// Clears and deallocates
void clearAndDeallocate() { m_indices.clearAndDeallocate(); }
/// Swap
void swap(hkIndexSet& rhs) { m_indices.swap(rhs.m_indices); }
/// Returns true if the index sets are the same
hkBool operator==(const hkIndexSet& rhs) const;
/// Returns true if the index sets are not equal
hkBool operator!=(const hkIndexSet& rhs) const { return !(*this == rhs); }
/// Assignment
void operator=(const hkIndexSet& rhs);
/// Calculate the number members of both this and the parameter
int calculateNumIntersecting(const hkIndexSet& rhs) const;
/// Calculate the total unique members in both
int calculateNumUnion(const hkIndexSet& rhs) const;
/// Ctor
hkIndexSet();
/// Copy ctor
hkIndexSet(const hkIndexSet& rhs);
/// Calculates the number of members which intersect and are union
static void HK_CALL calculateNumIntersectAndUnion(const hkIndexSet& setA, const hkIndexSet& setB, int& numIntersectOut, int& numUnionOut);
#ifdef HK_DEBUG
// Used to test this class is functioning correctly
static void HK_CALL selfTest();
#endif
protected:
hkArray<int> m_indices;
hkBool m_inUpdate;
};
#endif // HK_INDEX_SET_H
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20090704)
*
* Confidential Information of Havok. (C) Copyright 1999-2009
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
| [
"[email protected]"
] | |
5a8f3467de34e86805a49959e6c63124d3a990b2 | 90f9ab77e2c2c1e63d0e1cb79c1a6b5c287d794e | /Recursion/Permutation3.cpp | 123ada7eca3215470f33e247401b86c2aa21a237 | [] | no_license | mukeshkumar7470/Practice-Cpp | caa8de851dbf907a53d8bad128dba6357819b48a | fa72f7468902c64a995e2e2ac36091f52285008c | refs/heads/master | 2023-03-20T19:15:06.687538 | 2021-03-25T07:24:26 | 2021-03-25T07:24:26 | 339,183,104 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 879 | cpp | #include <iostream>
#include <climits>
#include "bits/stdc++.h"
using namespace std;
/* Permutations using STL */
/* Next_permutation(start,end):
If the function can determine the next higher permutation, it rearranges the
elements as such and returns true. If that was not possible (because it is already
at the largest possible permutation), it rearranges the elements according to the
first permutation (sorted in ascending order) and returns false. */
vector<vector<int>> permute(vector<int> nums) {
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
do {
ans.push_back(nums);
} while (next_permutation(nums.begin(), nums.end()));
return ans;
}
int main(){
vector<vector<int>> res = permute({1, 2, 2});
for (auto i : res) {
for (auto ii : i) {
cout << ii << " ";
}
cout << "\n";
}
}
| [
"[email protected]"
] | |
8be3524622ff56dcdbea5ced99d2fab1644b6dae | 56738bc398f8445f5ebcba74d5e8b7d6a9eaa57d | /blazetest/blazetest/mathtest/strictlylowermatrix/SparseTest.h | 324af22fe1aee16d371199b6909a280414fc47aa | [
"BSD-3-Clause"
] | permissive | praveenmunagapati/blaze | bc1fd9f6d49e3976dac54c8bcdf9e95ea1a0296c | a5fb3d165a4c332cec4974ed222271615a7fe0e6 | refs/heads/master | 2021-06-09T13:49:54.139830 | 2017-01-02T04:45:23 | 2017-01-02T04:45:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,000 | h | //=================================================================================================
/*!
// \file blazetest/mathtest/strictlylowermatrix/SparseTest.h
// \brief Header file for the StrictlyLowerMatrix sparse test
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
#ifndef _BLAZETEST_MATHTEST_STRICTLYLOWERMATRIX_SPARSETEST_H_
#define _BLAZETEST_MATHTEST_STRICTLYLOWERMATRIX_SPARSETEST_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <sstream>
#include <stdexcept>
#include <string>
#include <blaze/math/CompressedMatrix.h>
#include <blaze/math/constraints/ColumnMajorMatrix.h>
#include <blaze/math/constraints/RequiresEvaluation.h>
#include <blaze/math/constraints/RowMajorMatrix.h>
#include <blaze/math/constraints/SparseMatrix.h>
#include <blaze/math/constraints/StrictlyLower.h>
#include <blaze/math/constraints/StrictlyUpper.h>
#include <blaze/math/StrictlyLowerMatrix.h>
#include <blaze/math/typetraits/IsRowMajorMatrix.h>
#include <blaze/util/constraints/SameType.h>
#include <blazetest/system/Types.h>
namespace blazetest {
namespace mathtest {
namespace strictlylowermatrix {
//=================================================================================================
//
// CLASS DEFINITION
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Auxiliary class for all tests of the sparse StrictlyLowerMatrix specialization.
//
// This class represents a test suite for the blaze::StrictlyLowerMatrix class template
// specialization for sparse matrices. It performs a series of both compile time as well as
// runtime tests.
*/
class SparseTest
{
public:
//**Constructors********************************************************************************
/*!\name Constructors */
//@{
explicit SparseTest();
// No explicitly declared copy constructor.
//@}
//**********************************************************************************************
//**Destructor**********************************************************************************
// No explicitly declared destructor.
//**********************************************************************************************
private:
//**Test functions******************************************************************************
/*!\name Test functions */
//@{
void testConstructors();
void testAssignment ();
void testAddAssign ();
void testSubAssign ();
void testMultAssign ();
void testScaling ();
void testFunctionCall();
void testIterator ();
void testNonZeros ();
void testReset ();
void testClear ();
void testSet ();
void testInsert ();
void testAppend ();
void testResize ();
void testReserve ();
void testTrim ();
void testSwap ();
void testErase ();
void testFind ();
void testLowerBound ();
void testUpperBound ();
void testIsDefault ();
void testSubmatrix ();
void testRow ();
void testColumn ();
template< typename Type >
void checkRows( const Type& matrix, size_t expectedRows ) const;
template< typename Type >
void checkColumns( const Type& matrix, size_t expectedColumns ) const;
template< typename Type >
void checkCapacity( const Type& matrix, size_t minCapacity ) const;
template< typename Type >
void checkCapacity( const Type& matrix, size_t index, size_t minCapacity ) const;
template< typename Type >
void checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const;
template< typename Type >
void checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const;
//@}
//**********************************************************************************************
//**Member variables****************************************************************************
/*!\name Member variables */
//@{
std::string test_; //!< Label of the currently performed test.
//@}
//**********************************************************************************************
//**Type definitions****************************************************************************
//! Type of the row-major strictly lower matrix.
typedef blaze::StrictlyLowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > LT;
//! Type of the column-major strictly lower matrix.
typedef blaze::StrictlyLowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > OLT;
typedef LT::Rebind<double>::Other RLT; //!< Rebound row-major strictly lower matrix type.
typedef OLT::Rebind<double>::Other ORLT; //!< Rebound column-major strictly lower matrix type.
//**********************************************************************************************
//**Compile time checks*************************************************************************
/*! \cond BLAZE_INTERNAL */
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( LT );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( LT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( LT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( LT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OLT );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( OLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( OLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( RLT );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( RLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORLT );
BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( ORLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE ( ORLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( LT );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( LT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( LT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( LT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( OLT );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( OLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( OLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( OLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( RLT );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( RLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( RLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( RLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( ORLT );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( ORLT::ResultType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( ORLT::OppositeType );
BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( ORLT::TransposeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( LT::ResultType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( LT::OppositeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( LT::TransposeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OLT::ResultType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OLT::OppositeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OLT::TransposeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RLT::ResultType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RLT::OppositeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RLT::TransposeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORLT::ResultType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORLT::OppositeType );
BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORLT::TransposeType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( LT::ElementType, LT::ResultType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( LT::ElementType, LT::OppositeType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( LT::ElementType, LT::TransposeType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OLT::ElementType, OLT::ResultType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OLT::ElementType, OLT::OppositeType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OLT::ElementType, OLT::TransposeType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RLT::ElementType, RLT::ResultType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RLT::ElementType, RLT::OppositeType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RLT::ElementType, RLT::TransposeType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORLT::ElementType, ORLT::ResultType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORLT::ElementType, ORLT::OppositeType::ElementType );
BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORLT::ElementType, ORLT::TransposeType::ElementType );
/*! \endcond */
//**********************************************************************************************
};
//*************************************************************************************************
//=================================================================================================
//
// TEST FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Checking the number of rows of the given matrix.
//
// \param matrix The matrix to be checked.
// \param expectedRows The expected number of rows of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of rows of the given matrix. In case the actual number of
// rows does not correspond to the given expected number of rows, a \a std::runtime_error
// exception is thrown.
*/
template< typename Type > // Type of the matrix
void SparseTest::checkRows( const Type& matrix, size_t expectedRows ) const
{
if( matrix.rows() != expectedRows ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of rows detected\n"
<< " Details:\n"
<< " Number of rows : " << matrix.rows() << "\n"
<< " Expected number of rows: " << expectedRows << "\n";
throw std::runtime_error( oss.str() );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Checking the number of columns of the given matrix.
//
// \param matrix The matrix to be checked.
// \param expectedRows The expected number of columns of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of columns of the given matrix. In case the actual number of
// columns does not correspond to the given expected number of columns, a \a std::runtime_error
// exception is thrown.
*/
template< typename Type > // Type of the matrix
void SparseTest::checkColumns( const Type& matrix, size_t expectedColumns ) const
{
if( matrix.columns() != expectedColumns ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of columns detected\n"
<< " Details:\n"
<< " Number of columns : " << matrix.columns() << "\n"
<< " Expected number of columns: " << expectedColumns << "\n";
throw std::runtime_error( oss.str() );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Checking the capacity of the given matrix.
//
// \param matrix The matrix to be checked.
// \param minCapacity The expected minimum capacity of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the capacity of the given matrix. In case the actual capacity is smaller
// than the given expected minimum capacity, a \a std::runtime_error exception is thrown.
*/
template< typename Type > // Type of the matrix
void SparseTest::checkCapacity( const Type& matrix, size_t minCapacity ) const
{
if( capacity( matrix ) < minCapacity ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid capacity detected\n"
<< " Details:\n"
<< " Capacity : " << capacity( matrix ) << "\n"
<< " Expected minimum capacity: " << minCapacity << "\n";
throw std::runtime_error( oss.str() );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Checking the capacity of a specific row/column of the given matrix.
//
// \param matrix The matrix to be checked.
// \param index The row/column to be checked.
// \param minCapacity The expected minimum capacity of the specified row/column.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the capacity of a specific row/column of the given matrix. In case the
// actual capacity is smaller than the given expected minimum capacity, a \a std::runtime_error
// exception is thrown.
*/
template< typename Type > // Type of the matrix
void SparseTest::checkCapacity( const Type& matrix, size_t index, size_t minCapacity ) const
{
if( capacity( matrix, index ) < minCapacity ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid capacity detected in "
<< ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
<< " Details:\n"
<< " Capacity : " << capacity( matrix, index ) << "\n"
<< " Expected minimum capacity: " << minCapacity << "\n";
throw std::runtime_error( oss.str() );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Checking the number of non-zero elements of the given matrix.
//
// \param matrix The matrix to be checked.
// \param expectedNonZeros The expected number of non-zero elements of the matrix.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of non-zero elements of the given matrix. In case the
// actual number of non-zero elements does not correspond to the given expected number,
// a \a std::runtime_error exception is thrown.
*/
template< typename Type > // Type of the matrix
void SparseTest::checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const
{
if( nonZeros( matrix ) != expectedNonZeros ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of non-zero elements\n"
<< " Details:\n"
<< " Number of non-zeros : " << nonZeros( matrix ) << "\n"
<< " Expected number of non-zeros: " << expectedNonZeros << "\n";
throw std::runtime_error( oss.str() );
}
if( capacity( matrix ) < nonZeros( matrix ) ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid capacity detected\n"
<< " Details:\n"
<< " Number of non-zeros: " << nonZeros( matrix ) << "\n"
<< " Capacity : " << capacity( matrix ) << "\n";
throw std::runtime_error( oss.str() );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Checking the number of non-zero elements in a specific row/column of the given matrix.
//
// \param matrix The matrix to be checked.
// \param index The row/column to be checked.
// \param expectedNonZeros The expected number of non-zero elements in the specified row/column.
// \return void
// \exception std::runtime_error Error detected.
//
// This function checks the number of non-zero elements in the specified row/column of the
// given matrix. In case the actual number of non-zero elements does not correspond to the
// given expected number, a \a std::runtime_error exception is thrown.
*/
template< typename Type > // Type of the matrix
void SparseTest::checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const
{
if( nonZeros( matrix, index ) != expectedNonZeros ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of non-zero elements in "
<< ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
<< " Details:\n"
<< " Number of non-zeros : " << nonZeros( matrix, index ) << "\n"
<< " Expected number of non-zeros: " << expectedNonZeros << "\n";
throw std::runtime_error( oss.str() );
}
if( capacity( matrix, index ) < nonZeros( matrix, index ) ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid capacity detected in "
<< ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
<< " Details:\n"
<< " Number of non-zeros: " << nonZeros( matrix, index ) << "\n"
<< " Capacity : " << capacity( matrix, index ) << "\n";
throw std::runtime_error( oss.str() );
}
}
//*************************************************************************************************
//=================================================================================================
//
// GLOBAL TEST FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Testing the functionality of the sparse StrictlyLowerMatrix specialization.
//
// \return void
*/
void runTest()
{
SparseTest();
}
//*************************************************************************************************
//=================================================================================================
//
// MACRO DEFINITIONS
//
//=================================================================================================
//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Macro for the execution of the StrictlyLowerMatrix sparse test.
*/
#define RUN_STRICTLYLOWERMATRIX_SPARSE_TEST \
blazetest::mathtest::strictlylowermatrix::runTest()
/*! \endcond */
//*************************************************************************************************
} // namespace strictlylowermatrix
} // namespace mathtest
} // namespace blazetest
#endif
| [
"[email protected]"
] | |
344192cf2d35fe4a5b47e9c8c5d6cd4c80354b78 | 4bb83687710716d91b5da55054c04f430474ee52 | /src/engine/shared/library/sharedGame/src/shared/objectTemplate/SharedGroupObjectTemplate.h | 972985665fa4c671a7a6ba0afc2993f54ce439f1 | [] | no_license | geralex/SWG-NGE | 0846566a44f4460c32d38078e0a1eb115a9b08b0 | fa8ae0017f996e400fccc5ba3763e5bb1c8cdd1c | refs/heads/master | 2020-04-06T11:18:36.110302 | 2018-03-19T15:42:32 | 2018-03-19T15:42:32 | 157,411,938 | 1 | 0 | null | 2018-11-13T16:35:01 | 2018-11-13T16:35:01 | null | UTF-8 | C++ | false | false | 2,103 | h | //========================================================================
//
// SharedGroupObjectTemplate.h
//
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
//overwritten the next time the template definition is compiled. Do not
//make changes to code inside these blocks.
//
// copyright 2001 Sony Online Entertainment
//
//========================================================================
#ifndef _INCLUDED_SharedGroupObjectTemplate_H
#define _INCLUDED_SharedGroupObjectTemplate_H
#include "SharedUniverseObjectTemplate.h"
#include "sharedFoundation/DynamicVariable.h"
#include "sharedUtility/TemplateParameter.h"
class Vector;
typedef StructParam<ObjectTemplate> StructParamOT;
//@BEGIN TFD TEMPLATE REFS
//@END TFD TEMPLATE REFS
class SharedGroupObjectTemplate : public SharedUniverseObjectTemplate
{
public:
//@BEGIN TFD ID
enum
{
SharedGroupObjectTemplate_tag = TAG(S,G,R,P)
};
//@END TFD ID
public:
SharedGroupObjectTemplate(const std::string & filename);
virtual ~SharedGroupObjectTemplate();
virtual Tag getId(void) const;
virtual Tag getTemplateVersion(void) const;
virtual Tag getHighestTemplateVersion(void) const;
static void install(bool allowDefaultTemplateParams = true);
//@BEGIN TFD
public:
protected:
virtual void load(Iff &file);
private:
//@END TFD
private:
Tag m_templateVersion; // the template version
bool m_versionOk; // flag that the template version loaded is the one we expect
static bool ms_allowDefaultTemplateParams; // flag to allow defaut params instead of fataling
static void registerMe(void);
static ObjectTemplate * create(const std::string & filename);
// no copying
SharedGroupObjectTemplate(const SharedGroupObjectTemplate &);
SharedGroupObjectTemplate & operator =(const SharedGroupObjectTemplate &);
};
inline void SharedGroupObjectTemplate::install(bool allowDefaultTemplateParams)
{
ms_allowDefaultTemplateParams = allowDefaultTemplateParams;
//@BEGIN TFD INSTALL
SharedGroupObjectTemplate::registerMe();
//@END TFD INSTALL
}
#endif // _INCLUDED_SharedGroupObjectTemplate_H
| [
"[email protected]"
] | |
0adcab4e274f1941b92df03e282b9e57e3de2efc | 04f52c481c7d6eb1b4156b296fe5d81ddccfb161 | /lib/opencv/OpenCVSocketUtils.cpp | 17d11d4308a8c53471370fde9b652b1b2e89011e | [] | no_license | starand/cpp_fw | 39c9d78439602b43498310e86f8bf704b4feceb2 | 5d2ebfe7dc3aef61558ed9f6f49293746499492c | refs/heads/master | 2021-01-11T23:59:05.013523 | 2017-02-20T09:36:05 | 2017-02-20T09:36:05 | 78,653,984 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,148 | cpp | #include "StdAfx.h"
#include "OpenCVSocketUtils.h"
#include "socket.h"
#include <opencv\cv.h>
#define BLOCK_HEIGHT 8
#define BLOCK_WIDTH 8
#define BLOCK_STRIDE 24
#define IMAGE_HEIGHT(pipImage) pipImage->height
#define IMAGE_WIDTH(pipImage) pipImage->width
#define IMAGE_DATA(pipImage) pipImage->imageData
static const sizeint g_siImageHeaderSize = sizeof(IplImage);
namespace OpenCVSocketUtils
{
bool RetrieveImageHeader(CSocket *psSocket, IplImage *pipOutImage)
{
ASSERTE(psSocket); ASSERTE(psSocket->IsConnected()); ASSERTE(pipOutImage);
bool bResult = psSocket->Recv((char*)pipOutImage, g_siImageHeaderSize);
return bResult;
}
bool RetrieveImageData(CSocket *psSocket, IplImage *pipVarImage)
{
ASSERTE(psSocket); ASSERTE(psSocket->IsConnected()); ASSERTE(pipVarImage); ASSERTE(pipVarImage->imageData);
bool bResult = psSocket->Recv(pipVarImage->imageData, pipVarImage->imageSize);
return bResult;
}
void SetImageBuffer(IplImage *pipVarImage, char *szBuffer)
{
ASSERTE(pipVarImage);
pipVarImage->imageData = pipVarImage->imageDataOrigin = szBuffer;
}
bool SendImageHeader(CSocket *psSocket, IplImage *pipImage)
{
ASSERTE(psSocket); ASSERTE(psSocket->IsConnected()); ASSERTE(pipImage);
bool bResult = psSocket->Send((char*)pipImage, g_siImageHeaderSize);
return bResult;
}
bool SendImageData(CSocket *psSocket, IplImage *pipImage)
{
ASSERTE(psSocket); ASSERTE(psSocket->IsConnected()); ASSERTE(pipImage); ASSERTE(pipImage->imageData);
bool bResult = psSocket->Send(pipImage->imageData, pipImage->imageSize);
return bResult;
}
IplImage *CloneImage(IplImage *piInputImage)
{
ASSERTE(piInputImage);
IplImage *pPrevImage = cvCloneImage(piInputImage);
cvCopyImage(piInputImage, pPrevImage);
return pPrevImage;
}
struct CUpdateBlock
{
CUpdateBlock(sizeint siBlockIndex) : m_siBlockIdx(siBlockIndex) { }
sizeint m_siBlockIdx;
char m_pvBlockData[BLOCK_HEIGHT * BLOCK_WIDTH];
};
bool SendImageDiffs(CSocket *psSocket, IplImage *pipImage, IplImage *pipPrevImage)
{
ASSERTE(psSocket); ASSERTE(psSocket->IsConnected()); ASSERTE(pipImage); ASSERTE(pipPrevImage);
sizeint siBlockIndex = 0;
sizeint siStrideSize = IMAGE_WIDTH(pipImage) * 3;
bool bAnyFault = false;
for (int Y = 0; Y < IMAGE_HEIGHT(pipImage); Y += BLOCK_HEIGHT)
{
for (int X = 0; X < IMAGE_WIDTH(pipImage); X += BLOCK_WIDTH)
{
CUpdateBlock ubUpdateBlock(siBlockIndex++);
char *szDstAddr = ubUpdateBlock.m_pvBlockData;
char *szSrcAddr = IMAGE_DATA(pipImage) + siStrideSize * Y + X * 3;
for (int idx = 0; idx < BLOCK_HEIGHT; ++idx, szDstAddr += BLOCK_STRIDE, szSrcAddr += siStrideSize)
{
memcpy(szDstAddr, szSrcAddr, BLOCK_STRIDE);
}
if (!psSocket->Send((char *)&ubUpdateBlock, sizeof(ubUpdateBlock)))
{
bAnyFault = true;
break;
}
}
if (bAnyFault)
{
break;
}
}
bool bResult = !bAnyFault;
return bResult;
}
bool RetrieveImageDiffs(CSocket *psSocket, IplImage *pipImage)
{
ASSERTE(psSocket); ASSERTE(psSocket->IsConnected()); ASSERTE(pipImage);
return RetrieveImageData(psSocket, pipImage);
}
};
| [
"[email protected]"
] | |
b3fe332665380d6d7aac889a1512266915d37926 | 8f02939917edda1e714ffc26f305ac6778986e2d | /BOJ/11066/main.cc | d90c597b2fa4b30c0d0c261b46aff4f87df0893f | [] | no_license | queuedq/ps | fd6ee880d67484d666970e7ef85459683fa5b106 | d45bd3037a389495d9937afa47cf0f74cd3f09cf | refs/heads/master | 2023-08-18T16:45:18.970261 | 2023-08-17T17:04:19 | 2023-08-17T17:04:19 | 134,966,734 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,070 | cc | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long lld;
typedef pair<int, int> pii;
typedef pair<lld, lld> pll;
////////////////////////////////////////////////////////////////
const int MAX_K = 505;
int K, A[MAX_K], S[MAX_K];
lld score[MAX_K][MAX_K];
void reset() {
for (int i = 0; i < MAX_K; i++) {
for (int j = 0; j < MAX_K; j++) {
score[i][j] = 0;
}
}
}
void input() {
cin >> K;
for (int i = 0; i < K; i++) {
cin >> A[i];
S[i + 1] = S[i] + A[i];
}
}
lld dp(int l, int r) {
if (l + 1 == r) { return 0; }
if (score[l][r] > 0) { return score[l][r]; }
lld minScore = LLONG_MAX;
for (int i = l + 1; i < r; i++) {
minScore = min(minScore, dp(l, i) + dp(i, r) + S[r] - S[l]);
}
score[l][r] = minScore;
return minScore;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
////////////////////////////////
int T; cin >> T;
for (int i = 0; i < T; i++) {
reset();
input();
cout << dp(0, K) << endl;
}
////////////////////////////////
return 0;
}
| [
"[email protected]"
] | |
d11c84ecd3cdb9dcfda66f90229ac90e04134384 | 7d391a176f5b54848ebdedcda271f0bd37206274 | /src/Samples/include/babylon/samples/loaders/babylon/import_dummy3_scene.h | 511d690e2c31232654478e1ae417889385e407e6 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | pthom/BabylonCpp | c37ea256f310d4fedea1a0b44922a1379df77690 | 52b04a61467ef56f427c2bb7cfbafc21756ea915 | refs/heads/master | 2021-06-20T21:15:18.007678 | 2019-08-09T08:23:12 | 2019-08-09T08:23:12 | 183,211,708 | 2 | 0 | Apache-2.0 | 2019-04-24T11:06:28 | 2019-04-24T11:06:28 | null | UTF-8 | C++ | false | false | 709 | h | #ifndef BABYLON_SAMPLES_LOADERS_BABYLON_IMPORT_DUMMY3_SCENE_H
#define BABYLON_SAMPLES_LOADERS_BABYLON_IMPORT_DUMMY3_SCENE_H
#include <babylon/interfaces/irenderable_scene.h>
namespace BABYLON {
namespace Samples {
/**
* @brief Import Dummy 3 Scene.
* @see https://www.babylonjs-playground.com/#C38BUD#1
*/
struct ImportDummy3Scene : public IRenderableScene {
ImportDummy3Scene(ICanvas* iCanvas);
~ImportDummy3Scene() override;
const char* getName() override;
void initializeScene(ICanvas* canvas, Scene* scene) override;
}; // end of struct ImportDummy3Scene
} // end of namespace Samples
} // end of namespace BABYLON
#endif // end of BABYLON_SAMPLES_LOADERS_BABYLON_IMPORT_DUMMY3_SCENE_H
| [
"[email protected]"
] | |
b28f1d8c67d06ce39c7eaed5142ca7e68b77c729 | 261a5b12cba37d0cc82e9536a80e5124b3da08d1 | /Framework/Source/Core/OpenGL/ShaderStorageBufferGL.cpp | fcb1a5e61071517701b99bc871bfbc08818b5c24 | [] | no_license | hsdk/Falcor | d977d33402a2cf45229caa02054aaffb2cba1717 | 732bb6c57498636d705605d425aa0beee9c6094f | refs/heads/master | 2021-01-17T18:19:05.029027 | 2016-08-20T01:23:06 | 2016-08-20T01:23:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,795 | cpp | /***************************************************************************
# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of NVIDIA CORPORATION 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 ``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 "Framework.h"
#ifdef FALCOR_GL
#include "../ShaderStorageBuffer.h"
#include "glm/glm.hpp"
#include "../Buffer.h"
namespace Falcor
{
using namespace ShaderReflection;
bool checkVariableByOffset(VariableDesc::Type callType, size_t offset, size_t count, const VariableDescMap& uniforms, const std::string& bufferName);
bool checkVariableType(VariableDesc::Type callType, VariableDesc::Type shaderType, const std::string& name, const std::string& bufferName);
ShaderStorageBuffer::SharedPtr ShaderStorageBuffer::create(const ProgramVersion* pProgram, const std::string& bufferName, size_t overrideSize)
{
auto pBuffer = SharedPtr(new ShaderStorageBuffer(bufferName));
if(pBuffer->init(pProgram, bufferName, overrideSize, false) == false)
{
return nullptr;
}
return pBuffer;
}
ShaderStorageBuffer::ShaderStorageBuffer(const std::string& bufferName) : UniformBuffer(bufferName)
{
}
void ShaderStorageBuffer::readFromGPU(size_t offset, size_t size)
{
if(size == -1)
{
size = mSize - offset;
}
if(size + offset > mSize)
{
Logger::log(Logger::Level::Warning, "ShaderStorageBuffer::readFromGPU() - trying to read more data than what the buffer contains. Call is ignored.");
return;
}
mpBuffer->readData(mData.data(), offset, size);
}
ShaderStorageBuffer::~ShaderStorageBuffer() = default;
void ShaderStorageBuffer::readBlob(void* pDest, size_t offset, size_t size) const
{
if(size + offset > mSize)
{
Logger::log(Logger::Level::Warning, "ShaderStorageBuffer::readBlob() - trying to read more data than what the buffer contains. Call is ignored.");
return;
}
memcpy(pDest, mData.data() + offset, size);
}
#define get_uniform_offset(_var_type, _c_type) \
template<> void ShaderStorageBuffer::getVariable(size_t offset, _c_type& value) const \
{ \
if(checkVariableByOffset(VariableDesc::Type::_var_type, offset, 1, mVariables, mName)) \
{ \
const uint8_t* pVar = mData.data() + offset; \
value = *(const _c_type*)pVar; \
} \
}
get_uniform_offset(Bool, bool);
get_uniform_offset(Bool2, glm::bvec2);
get_uniform_offset(Bool3, glm::bvec3);
get_uniform_offset(Bool4, glm::bvec4);
get_uniform_offset(Uint, uint32_t);
get_uniform_offset(Uint2, glm::uvec2);
get_uniform_offset(Uint3, glm::uvec3);
get_uniform_offset(Uint4, glm::uvec4);
get_uniform_offset(Int, int32_t);
get_uniform_offset(Int2, glm::ivec2);
get_uniform_offset(Int3, glm::ivec3);
get_uniform_offset(Int4, glm::ivec4);
get_uniform_offset(Float, float);
get_uniform_offset(Float2, glm::vec2);
get_uniform_offset(Float3, glm::vec3);
get_uniform_offset(Float4, glm::vec4);
get_uniform_offset(Float2x2, glm::mat2);
get_uniform_offset(Float2x3, glm::mat2x3);
get_uniform_offset(Float2x4, glm::mat2x4);
get_uniform_offset(Float3x3, glm::mat3);
get_uniform_offset(Float3x2, glm::mat3x2);
get_uniform_offset(Float3x4, glm::mat3x4);
get_uniform_offset(Float4x4, glm::mat4);
get_uniform_offset(Float4x2, glm::mat4x2);
get_uniform_offset(Float4x3, glm::mat4x3);
get_uniform_offset(GpuPtr, uint64_t);
#undef get_uniform_offset
#define get_uniform_string(_var_type, _c_type) \
template<> void ShaderStorageBuffer::getVariable(const std::string& name, _c_type& value) const \
{ \
size_t offset; \
const auto* pUniform = getVariableData<true>(name, offset); \
if((_LOG_ENABLED == 0) || (pUniform && checkVariableType(VariableDesc::Type::_var_type, pUniform->type, name, mName))) \
{ \
getVariable(offset, value); \
} \
}
get_uniform_string(Bool, bool);
get_uniform_string(Bool2, glm::bvec2);
get_uniform_string(Bool3, glm::bvec3);
get_uniform_string(Bool4, glm::bvec4);
get_uniform_string(Uint, uint32_t);
get_uniform_string(Uint2, glm::uvec2);
get_uniform_string(Uint3, glm::uvec3);
get_uniform_string(Uint4, glm::uvec4);
get_uniform_string(Int, int32_t);
get_uniform_string(Int2, glm::ivec2);
get_uniform_string(Int3, glm::ivec3);
get_uniform_string(Int4, glm::ivec4);
get_uniform_string(Float, float);
get_uniform_string(Float2, glm::vec2);
get_uniform_string(Float3, glm::vec3);
get_uniform_string(Float4, glm::vec4);
get_uniform_string(Float2x2, glm::mat2);
get_uniform_string(Float2x3, glm::mat2x3);
get_uniform_string(Float2x4, glm::mat2x4);
get_uniform_string(Float3x3, glm::mat3);
get_uniform_string(Float3x2, glm::mat3x2);
get_uniform_string(Float3x4, glm::mat3x4);
get_uniform_string(Float4x4, glm::mat4);
get_uniform_string(Float4x2, glm::mat4x2);
get_uniform_string(Float4x3, glm::mat4x3);
get_uniform_string(GpuPtr, uint64_t);
#undef get_uniform_string
#define get_uniform_array_offset(_var_type, _c_type) \
template<> void ShaderStorageBuffer::getVariableArray(size_t offset, size_t count, _c_type value[]) const \
{ \
if(checkVariableByOffset(VariableDesc::Type::_var_type, offset, count, mVariables, mName)) \
{ \
const uint8_t* pVar = mData.data() + offset; \
const _c_type* pMat = (_c_type*)pVar; \
for(size_t i = 0; i < count; i++) \
{ \
value[i] = pMat[i]; \
} \
} \
}
get_uniform_array_offset(Bool, bool);
get_uniform_array_offset(Bool2, glm::bvec2);
get_uniform_array_offset(Bool3, glm::bvec3);
get_uniform_array_offset(Bool4, glm::bvec4);
get_uniform_array_offset(Uint, uint32_t);
get_uniform_array_offset(Uint2, glm::uvec2);
get_uniform_array_offset(Uint3, glm::uvec3);
get_uniform_array_offset(Uint4, glm::uvec4);
get_uniform_array_offset(Int, int32_t);
get_uniform_array_offset(Int2, glm::ivec2);
get_uniform_array_offset(Int3, glm::ivec3);
get_uniform_array_offset(Int4, glm::ivec4);
get_uniform_array_offset(Float, float);
get_uniform_array_offset(Float2, glm::vec2);
get_uniform_array_offset(Float3, glm::vec3);
get_uniform_array_offset(Float4, glm::vec4);
get_uniform_array_offset(Float2x2, glm::mat2);
get_uniform_array_offset(Float2x3, glm::mat2x3);
get_uniform_array_offset(Float2x4, glm::mat2x4);
get_uniform_array_offset(Float3x3, glm::mat3);
get_uniform_array_offset(Float3x2, glm::mat3x2);
get_uniform_array_offset(Float3x4, glm::mat3x4);
get_uniform_array_offset(Float4x4, glm::mat4);
get_uniform_array_offset(Float4x2, glm::mat4x2);
get_uniform_array_offset(Float4x3, glm::mat4x3);
get_uniform_array_offset(GpuPtr, uint64_t);
#undef get_uniform_array_offset
#define get_uniform_array_string(_var_type, _c_type) \
template<> void ShaderStorageBuffer::getVariableArray(const std::string& name, size_t count, _c_type value[]) const \
{ \
size_t offset; \
const auto* pUniform = getVariableData<false>(name, offset); \
if((_LOG_ENABLED == 0) || (pUniform && checkVariableType(VariableDesc::Type::_var_type, pUniform->type, name, mName))) \
{ \
getVariableArray(offset, count, value); \
} \
}
get_uniform_array_string(Bool, bool);
get_uniform_array_string(Bool2, glm::bvec2);
get_uniform_array_string(Bool3, glm::bvec3);
get_uniform_array_string(Bool4, glm::bvec4);
get_uniform_array_string(Uint, uint32_t);
get_uniform_array_string(Uint2, glm::uvec2);
get_uniform_array_string(Uint3, glm::uvec3);
get_uniform_array_string(Uint4, glm::uvec4);
get_uniform_array_string(Int, int32_t);
get_uniform_array_string(Int2, glm::ivec2);
get_uniform_array_string(Int3, glm::ivec3);
get_uniform_array_string(Int4, glm::ivec4);
get_uniform_array_string(Float, float);
get_uniform_array_string(Float2, glm::vec2);
get_uniform_array_string(Float3, glm::vec3);
get_uniform_array_string(Float4, glm::vec4);
get_uniform_array_string(Float2x2, glm::mat2);
get_uniform_array_string(Float2x3, glm::mat2x3);
get_uniform_array_string(Float2x4, glm::mat2x4);
get_uniform_array_string(Float3x3, glm::mat3);
get_uniform_array_string(Float3x2, glm::mat3x2);
get_uniform_array_string(Float3x4, glm::mat3x4);
get_uniform_array_string(Float4x4, glm::mat4);
get_uniform_array_string(Float4x2, glm::mat4x2);
get_uniform_array_string(Float4x3, glm::mat4x3);
get_uniform_array_string(GpuPtr, uint64_t);
#undef get_uniform_array_string
}
#endif //#ifdef FALCOR_GL
| [
"[email protected]"
] | |
05c62a294527454eff25e74da825ed5031d4a23f | 1897e0530fbee7fe72d85b5fb15089174ea36de0 | /ImageSDL2/ImageSDL2/main.cpp | a2c115a1fbe7831820ba4af81d258e09ae7fe76b | [] | no_license | kafkaphoenix/sdl2bitmap | 8944545dfcbb1739949b8143a5e3494cf787c03f | 867fc2b55b9cb6761bfc1a28fe3478022952e29d | refs/heads/master | 2021-06-18T09:06:30.196098 | 2017-06-13T17:22:38 | 2017-06-13T17:22:38 | 93,310,957 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 824 | cpp | #include <SDL.h>
int main(int argc, char ** argv)
{
bool quit = false;
SDL_Event event;
SDL_Init(SDL_INIT_VIDEO);
SDL_Window * window = SDL_CreateWindow("SDL Displaying Image", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0);
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0);
SDL_Surface *image = SDL_LoadBMP("image.bmp");
SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, image);
while (!quit)
{
SDL_WaitEvent(&event);
switch (event.type)
{
case SDL_QUIT:
quit = true;
break;
}
SDL_Rect dstrect = { 50, 50, 320 ,240 };
SDL_RenderCopy(renderer, texture, NULL, &dstrect);
SDL_RenderPresent(renderer);
}
SDL_DestroyTexture(texture);
SDL_FreeSurface(image);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
} | [
"[email protected]"
] | |
5f7b00dbedb6a79658a15699b2948338b5ddb0a1 | 6ca2f2333123ed9dd96001b38c23833214bb066f | /sketch_sep06c/sketch_sep06c.ino | 711f93f5d3ead8d155425ca7efd65e2df430673d | [
"MIT"
] | permissive | nityanandaz/BotController | a29ef0e2e657c653316acc9e0ebf77cb41c1f78e | 034e00135d42c640666f70cbfe5b0b2726a6d89c | refs/heads/master | 2020-07-21T18:53:22.454451 | 2020-07-10T18:27:17 | 2020-07-10T18:27:17 | 206,948,909 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,205 | ino | #include <Adafruit_NeoPixel.h>
#include <EasyNeoPixels.h>
#include <Servo.h>
#include <IFX9201_XMC1300_StepperMotor.h>
/*
Alpha Wheel
*/
#define DIR_PIN 4 // Pin 9 is standard DIR Pin
#define STP_PIN 3 // Pin 10 is standard STP Pin
#define DIS_PIN 2 // Pin 11 is standard DIS Pin
const int StepsPerRevolution = 200 * 8; // change this to fit the total number of steps per revolution for your motor
Stepper_motor AlphaWheelStepper = Stepper_motor(StepsPerRevolution, DIR_PIN, STP_PIN, DIS_PIN);
/*
Spray Servo
*/
Servo SprayCanServo;
/*
Commands
*/
#define DONOTHING 0
#define SPRAY 1
#define ROTATECLOCKWISE 2
#define ROTATEANTICLOCKWISE 3
/*
Input
*/
String inputString = "";
int InputCommand = 0;
/*
Framework
*/
void setup()
{
// Spray Can
SprayCanServo.attach(6);
SprayCanServo.write(0);
// USB
Serial.begin(9600);
// Alpha Wheel
AlphaWheelStepper.begin(); // set pins' mode as OUTPUT, set default speed and enable the stepper motor
AlphaWheelStepper.setSpeed(10); //changed from 40
// LEDs
pinMode(10, OUTPUT);
setupEasyNeoPixels(11, 14);
}
void loop()
{
readInput();
executeCommand();
}
/*
Commands
*/
void spray()
{
// Actual
int pos = 0;
for (pos = 0; pos <= 60; pos += 2) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
SprayCanServo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
// delay(5000);
for (pos = 60; pos >= 0; pos -= 2) { // goes from 180 degrees to 0 degrees
SprayCanServo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
}
void lightOn()
{
digitalWrite(10, HIGH);
}
void lightOff()
{
digitalWrite(10, LOW);
}
void rotateClockwise()
{
AlphaWheelStepper.move_degree(14.4);
delay(1000);
}
void rotateAnticlockwise()
{
AlphaWheelStepper.move_degree(-14.4);
delay(1000);
}
/*
Input
*/
void readInput()
{
while (Serial.available() > 0)
{
int inChar = Serial.read();
if (isDigit(inChar))
{
// convert the incoming byte to a char and add it to the string:
inputString += (char)inChar;
}
// if you get a newline, print the string, then the string's value:
if (inChar == '\n')
{
InputCommand = (inputString.toInt());
Serial.print("Value: ");
Serial.println(InputCommand);
// clear the string for new input:
inputString = "";
}
}
}
void executeCommand()
{
switch (InputCommand)
{
case DONOTHING: break;
case SPRAY: spray(); break;
case ROTATECLOCKWISE: rotateClockwise(); break;
case ROTATEANTICLOCKWISE: rotateAnticlockwise(); break; // prefer
case 4: lightOn(); delay(5000); lightOff(); break;
default:
if (InputCommand < 200 && InputCommand > 100)
{
int steps = InputCommand % 100;
AlphaWheelStepper.move_degree(-14.4 * steps);
delay(1000);
}
break;
}
InputCommand = DONOTHING;
}
| [
"[email protected]"
] | |
b2c81f40c7b698f7e9626b27e70a4fdb87ed994a | a202b62726204f62141ea0de4cdd29edf94281da | /demo/ios/Pods/hippy/ios/sdk/layout/MTTLayoutCache.h | 68402f67395bcc1c16c246d921e7925148adde08 | [
"MIT",
"Apache-2.0"
] | permissive | hippy-contrib/hippy-react-ui | 8145dd7d5fbdc9352e479f3ea1efbcc48cc90415 | e3446b75a098b6f200a2c56f32078ab3b83e0e28 | refs/heads/master | 2023-03-23T20:16:41.113313 | 2020-04-23T13:59:05 | 2020-04-23T13:59:05 | 258,219,692 | 8 | 0 | MIT | 2021-03-12T12:31:10 | 2020-04-23T13:46:26 | JavaScript | UTF-8 | C++ | false | false | 1,307 | h | /**
* Copyright (c) 2017-present, Tencent, Inc.
* All rights reserved.
* Author: ianwang <[email protected]>
* Created on: 2018-01-08
*/
#ifndef MTTLAYOUTCACHE_H_
#define MTTLAYOUTCACHE_H_
#include "MTTFlex.h"
#include <stdint.h>
typedef struct {
MTTSize availableSize;
MTTSize resultSize;
MeasureMode widthMeasureMode;
MeasureMode heightMeasureMode;
FlexLayoutAction layoutAction;
} MeasureResult;
#define MAX_MEASURES_COUNT 6
class MTTLayoutCache {
public:
MTTLayoutCache();
virtual ~MTTLayoutCache();
void cacheResult(MTTSize availableSize, MTTSize resultSize,
MTTSizeMode measureMode, FlexLayoutAction layoutAction);
MeasureResult* getCachedMeasureResult(MTTSize availableSize,MTTSizeMode measureMode,
FlexLayoutAction layoutAction,
bool isMeasureNode);
MeasureResult* getCachedLayout();
void clearCache();
protected:
void initCache();
MeasureResult* useLayoutCacheIfPossible(MTTSize availableSize, MTTSizeMode measureMode);
MeasureResult* useMeasureCacheIfPossible(MTTSize availableSize, MTTSizeMode measureMode,
FlexLayoutAction layoutAction,
bool isMeasureNode);
private:
MeasureResult cachedLayout;
MeasureResult cachedMeasures[MAX_MEASURES_COUNT];
uint32_t nextMeasureIndex;
};
#endif /* MTTLAYOUTCACHE_H_ */
| [
"[email protected]"
] | |
9fa337c89f6762362f18c5adc3a434ebf68a35ea | d2190cbb5ea5463410eb84ec8b4c6a660e4b3d0e | /old_hydra/hydra/branches/v3_04stable/shower/hshowergeanthit.cc | cda112ac640b4de9a2fc0a83e6fbcebc3cddd17a | [] | no_license | wesmail/hydra | 6c681572ff6db2c60c9e36ec864a3c0e83e6aa6a | ab934d4c7eff335cc2d25f212034121f050aadf1 | refs/heads/master | 2021-07-05T17:04:53.402387 | 2020-08-12T08:54:11 | 2020-08-12T08:54:11 | 149,625,232 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,892 | cc | #include "TObject.h"
#include "hshowergeanthit.h"
#include <iostream.h>
//////////////////////////////////////////////////////
// HShowerGeantHit
//
// This class contains one hit in one cell of the rich.
//
//////////////////////////////////////////////////////
ClassImp(HShowerGeantHit)
HShowerGeantHit::HShowerGeantHit() {
}
HShowerGeantHit::~HShowerGeantHit() {
}
void HShowerGeantHit::Clear() {
fBetaHit = 0.0;
fMomHit = 0.0;
fELosHit = 0.0;
nDetHit = 0;
fPhiHit = 0.0;
fThetaHit = 0.0;
fXHit = 0.0;
fYHit = 0.0;
nTrack = -1;
}
void HShowerGeantHit::getXY(Float_t* pfX, Float_t* pfY) {
*pfX = fXHit;
*pfY = fYHit;
}
void HShowerGeantHit::getAngles(Float_t* pfTheta, Float_t* pfPhi) {
*pfTheta = fThetaHit;
*pfPhi = fPhiHit;
}
Float_t HShowerGeantHit::getEnerLos() {
return fELosHit;
}
Float_t HShowerGeantHit::getBeta() {
return fBetaHit;
}
Float_t HShowerGeantHit::getMom() {
return fMomHit;
}
Int_t HShowerGeantHit::getDetector() {
return nDetHit;
}
Int_t HShowerGeantHit::getSector() {
return nSectHit;
}
Int_t HShowerGeantHit::getTrack() {
return nTrack;
}
void HShowerGeantHit::setXY(Float_t fX, Float_t fY) {
fXHit = fX;
fYHit= fY;
}
void HShowerGeantHit::setAngles(Float_t fTheta, Float_t fPhi) {
fThetaHit= fTheta;
fPhiHit = fPhi;
}
void HShowerGeantHit::setEnerLos(Float_t fEner) {
fELosHit = fEner;
}
void HShowerGeantHit::setBeta(Float_t fBeta) {
fBetaHit = fBeta;
}
void HShowerGeantHit::setMom(Float_t fMom) {
fMomHit = fMom;
}
void HShowerGeantHit::setDetector(Int_t nDet) {
nDetHit = nDet;
}
void HShowerGeantHit::setSector(Int_t nSect) {
nSectHit = nSect;
}
void HShowerGeantHit::setTrack(Int_t nTrk) {
nTrack = nTrk;
}
ostream& operator<< (ostream& output, HShowerGeantHit& raw) {
// output<<"pad charge:"<<raw.charge;
return output;
}
| [
"[email protected]"
] | |
96313719299a7b445f286865c1d6d76848a692a8 | 8b4119aaf6bb9af99c2480493ffc44a29e23d8d5 | /Battleship/boat.h | 2ab7302a4b255989b741d9b0acd054214f78f22f | [] | no_license | ahhTyler/Battleship | 35031c592ac7396b9f1cd1109be1d9c53c5b61e4 | 2df4aed8882cb8004ce95a1f73874223e8163634 | refs/heads/master | 2016-09-06T18:24:52.903652 | 2015-05-26T16:03:31 | 2015-05-26T16:03:31 | 35,825,848 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 182 | h | #include "stdafx.h"
#include "board.h"
using namespace std;
class ship : public Board
{
public:
int length;
int width;
void createBoat(int _boat, int x, int y, int direction);
}; | [
"[email protected]"
] | |
789a2829cfc6bcdb6f4dca510bc0928f6b0d64ba | e11fec2011295290742a9b305fcd4387a5d2426c | /teste_dois_botoes_MOTORES_3_E_4_INTERRUP_AO_3/teste_dois_botoes_MOTORES_3_E_4_INTERRUP_AO_3.ino | 7769522d796b7266b94c590ab249b31e499fa0d4 | [] | no_license | leohfigueiredo/Arduino | 5fbda0fc7efd25cd3b839ec65219f8ccfc1cf39d | f71dc86e07a9716e67634dceba7e2863c0020aab | refs/heads/master | 2021-04-27T19:06:07.146467 | 2020-09-07T22:00:00 | 2020-09-07T22:00:00 | 122,350,755 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,262 | ino | #include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Inicializa o display no endereco 0x3F
LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7,3, POSITIVE);
boolean start = true;
volatile boolean e_stop = false;
volatile boolean e_stop3 = false;
int botaoinicio = 3; // define pino 9 como entrada botao liga
int chaveSW2 = 4; // define botao 8 como botao desliga
int chaveSW3 = 5;
#define rele00 8 // rele motor 3
#define rele02 9 // rele motor 4
#define pin12 12
#define pin13 13
int estadorele00 = 1;
int estadorele02 = 1;
int estadorele08 = 1;
int i;
void setup() {
Serial.begin(9600);
delay(100);
lcd.begin (20,4);
pinMode (pin12,OUTPUT);
pinMode (pin13,OUTPUT);
pinMode (botaoinicio, INPUT); // define como entrada
pinMode (chaveSW2, INPUT); // define como entrada
pinMode (chaveSW3, INPUT_PULLUP); // define como entrada
pinMode (rele00, OUTPUT); // define como saida
pinMode (rele02, OUTPUT); // define como saida
attachInterrupt(0,e_stop_ISR, RISING);
digitalWrite(rele00, estadorele00);
digitalWrite(rele02, estadorele02);
lcd.setBacklight(HIGH);
lcd.setCursor(0,0);
lcd.print("ETO ESTERILIZACIONES");
delay(1000);
lcd.setCursor(0,1);
lcd.print("PROCESSO ETO");
delay(1000);
lcd.setCursor(0,2);
lcd.print(" INICIALIZADO ");
lcd.setCursor(0,3);
lcd.print("--****************--");
delay(5000);
delay(100);
//Faz o efeito de deslocamento para esquerda
for (i =0; i <20; i++){
lcd.scrollDisplayLeft();
delay(20); }
delay(1000);
//Faz o efeito de deslocamento para esquerda
for (i =0; i <20; i++){
lcd.scrollDisplayLeft();
delay(20); }
delay(3000);
tone(12,262,200); //DO
delay(1000);
tone(12,262,200); //DO
delay(1000);
tone(12,262,200); //DO
delay(1000);
tone(12,349,300); //FA
delay(1000);
}
void loop() {
if(start == true){
if(e_stop == false){
Serial.println("tudo ok");
delay(300);
}
else{
Serial.println("EMERGENCIA!!!! RESETAR ARDUINO");
digitalWrite (rele02, HIGH); // envia saida para nivel alto
digitalWrite (rele00,HIGH); // envia a saida para nivel baixo
delay (100);
lcd.clear();
lcd.setBacklight(HIGH);
lcd.setCursor(3,0);
lcd.print("EMERGENCIA!!!");
delay(100);
lcd.setCursor(3,1);
lcd.print("RESETAR ARDUINO");
lcd.setCursor(5,2);
lcd.print("!!!!!!!!!!!!!!!");
delay(100);
tone(12,349,300); //FA RUÍDO ALARME
delay(1000);
tone(12,349,300); //FA RUÍDO ALARME
delay(1000);
tone(12,349,300); //FA RUÍDO ALARME
delay(1000);
tone(12,349,300); //FA RUÍDO ALARME
delay(1000);
tone(12,349,300); //FA RUÍDO ALARME
delay(1000);
tone(12,349,300); //FA RUÍDO ALARME
delay(1000);
}
}
int valorInicio = digitalRead (botaoinicio);// le o valor de botao
int valorSW2 = digitalRead (chaveSW2); // le o valor de botao1
int valorSW3 = digitalRead (chaveSW3); // le o valor de botao2
if (valorInicio == HIGH && valorSW2 == LOW && valorSW2 == LOW) {// Testa o estado dos botoes
digitalWrite (rele02, HIGH); // envia saida para nivel alto
digitalWrite (rele00,LOW); // envia a saida para nivel baixo
lcd.clear();
lcd.setBacklight(HIGH);
lcd.setCursor(0,0);
lcd.print("ETO ESTERILIZACIONES");
delay(1000);
lcd.setCursor(6,1);
lcd.print("MOTOR 3");
lcd.setCursor(6,2);
lcd.print("EN MARCHA");
delay(1000);
}
else
if (valorInicio == LOW){
digitalWrite (rele00,HIGH); // envia a saida para nivel baixo
digitalWrite (rele02,HIGH); // envia a saida para nivel baixo
}
if (valorInicio == LOW && valorSW2 == HIGH && valorSW2 == LOW) { // Testa saida dos botoes
digitalWrite (rele00,HIGH); // envia a saida para nivel alto
digitalWrite (rele02,LOW); // envia a saida para nivel baixo
lcd.clear();
lcd.setBacklight(HIGH);
lcd.setCursor(0,0);
lcd.print("ETO ESTERILIZACIONES");
delay(1000);
lcd.setCursor(6,1);
lcd.print("MOTOR 4");
lcd.setCursor(6,2);
lcd.print("EN MARCHA");
}
else
if (valorSW2 == LOW){
digitalWrite (rele00,HIGH); // envia a saida para nivel baixo
digitalWrite (rele02,HIGH); // envia a saida para nivel baixo
}
if (valorSW3 == HIGH && valorInicio == LOW && valorSW2 == LOW) { // Testa saida dos botoes
digitalWrite (rele00,LOW); // envia a saida para nivel baixo
digitalWrite (rele02,LOW); // envia a saida para nivel baixo
lcd.clear();
lcd.setBacklight(HIGH);
lcd.setCursor(0,0);
lcd.print("ETO ESTERILIZACIONES");
delay(1000);
lcd.setCursor(3,1);
lcd.print("MOTORES 3 E 4");
lcd.setCursor(6,2);
lcd.print("EN MARCHA");
}
else{
if (valorSW3 == LOW){
digitalWrite (rele00,HIGH); // envia a saida para nivel baixo
digitalWrite (rele02,HIGH); // envia a saida para nivel baixo
lcd.clear();
lcd.setBacklight(HIGH);
lcd.setCursor(6,0);
lcd.print("MOTORES");
lcd.setCursor(6,1);
lcd.print("APAGADOS");
delay(6000);
lcd.clear();
tone(12,349,300); //FA
delay(500);
tone(12,349,300); //FA
delay(500);
tone(12,349,300); //FA
delay(500);
tone(12,262,200); //DO
delay(500);
tone(12,262,200); //DO
delay(500);
tone(12,262,200); //DO
delay(500);
}
while(1);
}
}
void e_stop_ISR(void){
detachInterrupt(0);
e_stop = !e_stop;
}
| [
"[email protected]"
] | |
0f01647c14d016815b368f43af09cbc0c5300e1d | b012b15ec5edf8a52ecf3d2f390adc99633dfb82 | /releases/moos-ivp-13.5/ivp/src/lib_geometry/XYConvexGrid.cpp | d83d11212623fef840182e583797100b846eaac9 | [] | no_license | crosslore/moos-ivp-aro | cbe697ba3a842961d08b0664f39511720102342b | cf2f1abe0e27ccedd0bbc66e718be950add71d9b | refs/heads/master | 2022-12-06T08:14:18.641803 | 2020-08-18T06:39:14 | 2020-08-18T06:39:14 | 263,586,714 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,707 | cpp | /*****************************************************************/
/* NAME: Michael Benjamin, Henrik Schmidt, and John Leonard */
/* ORGN: Dept of Mechanical Eng / CSAIL, MIT Cambridge MA */
/* FILE: XYConvexGrid.cpp */
/* DATE: Aug 27th 2005 */
/* */
/* This program is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation; either version */
/* 2 of the License, or (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be */
/* useful, but WITHOUT ANY WARRANTY; without even the implied */
/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
/* PURPOSE. See the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public */
/* License along with this program; if not, write to the Free */
/* Software Foundation, Inc., 59 Temple Place - Suite 330, */
/* Boston, MA 02111-1307, USA. */
/*****************************************************************/
#include <iostream>
#include <cmath>
#include <cstdlib>
#include "XYConvexGrid.h"
#include "MBUtils.h"
#include "XYFormatUtilsPoly.h"
using namespace std;
//-------------------------------------------------------------
// Procedure: initialize
// Note: A convenience function. Only one cell variable is
// implied with an initial value as given. Calles the
// more generaly initialize function.
bool XYConvexGrid::initialize(const XYPolygon& poly,
double cell_size,
double init_value)
{
vector<string> cell_vars;
cell_vars.push_back("v");
vector<double> cell_init_vals;
cell_init_vals.push_back(init_value);
return(initialize(poly, cell_size, cell_vars, cell_init_vals));
}
//-------------------------------------------------------------
// Procedure: initialize
// Purpose: The general initialize function.
bool XYConvexGrid::initialize(const XYPolygon& poly,
double cell_size,
vector<string> cell_vars,
vector<double> cell_init_vals)
{
unsigned int i, psize = poly.size();
if(psize == 0)
return(false);
if(cell_vars.size() != cell_init_vals.size())
return(false);
// If for some reason there is no cell_vars info, use simple default
if(cell_vars.size() == 0) {
m_cell_vars.push_back("v");
m_cell_init_vals.push_back(0);
}
XYSquare unit_square(cell_size);
// Part One: get bounding box for the polygon and create
// elements based on that square
double xlow = poly.get_vx(0);
double xhigh = poly.get_vx(0);
double ylow = poly.get_vy(0);
double yhigh = poly.get_vy(0);
for(i=1; i<psize; i++) {
double x = poly.get_vx(i);
double y = poly.get_vy(i);
if(x < xlow) xlow = x;
if(x > xhigh) xhigh = x;
if(y < ylow) ylow = y;
if(y > yhigh) yhigh = y;
}
XYSquare outer_square(xlow, xhigh, ylow, yhigh);
vector<XYSquare> int_elements;
bool ok = initialize(outer_square, unit_square);
if(!ok)
return(false);
unsigned int esize = m_elements.size();
for(i=0; i<esize; i++) {
xlow = m_elements[i].getVal(0,0);
xhigh = m_elements[i].getVal(0,1);
ylow = m_elements[i].getVal(1,0);
yhigh = m_elements[i].getVal(1,1);
XYPolygon spoly;
spoly.add_vertex(xlow, ylow);
spoly.add_vertex(xhigh, ylow);
spoly.add_vertex(xhigh, yhigh);
spoly.add_vertex(xlow, yhigh);
if(spoly.intersects(poly))
int_elements.push_back(m_elements[i]);
}
m_elements = int_elements;
// Store some config information for serializing the grid (get_spec)
m_config_poly = poly;
m_config_cell_size = cell_size;
for(i=0; i<esize; i++)
m_cell_vals.push_back(cell_init_vals);
m_cell_vars = cell_vars;
m_cell_init_vals = cell_init_vals;
// Now that we know how many cell_vars, initialize the vectors
// containing one entry per cell_var.
unsigned int cix, csize = m_cell_vars.size();
for(cix=0; cix<csize; cix++) {
m_cell_max_limit.push_back(0);
m_cell_min_limit.push_back(0);
m_cell_max_limited.push_back(false);
m_cell_min_limited.push_back(false);
m_cell_max_sofar.push_back(0);
m_cell_min_sofar.push_back(0);
m_cell_minmax_noted.push_back(false);
}
return(true);
}
//-------------------------------------------------------------
// Procedure: ptIntersect
// Purpose: Determine is a given point is contained within the
// the given grid cell index.
bool XYConvexGrid::ptIntersect(unsigned int ix, double x, double y) const
{
if(ix >= m_elements.size())
return(false);
return(m_elements[ix].containsPoint(x, y));
}
//-------------------------------------------------------------
// Procedure: setIntersect
// Purpose: Determine the length of the given line segment that
// intersects with the given grid cell.
double XYConvexGrid::segIntersect(unsigned int ix,
double x1, double y1,
double x2, double y2)
{
if(ix >= m_elements.size())
return(0);
return(m_elements[ix].segIntersectLength(x1,y1,x2,y2));
}
//-------------------------------------------------------------
// Procedure: getElement
XYSquare XYConvexGrid::getElement(unsigned int ix) const
{
XYSquare retElement;
if(ix < m_elements.size())
return(m_elements[ix]);
else
return(retElement);
}
//-------------------------------------------------------------
// Procedure: hasCellVar()
bool XYConvexGrid::hasCellVar(const string& cell_var) const
{
unsigned int i, vsize = m_cell_vars.size();
for(i=0; i<vsize; i++) {
if(m_cell_vars[i] == cell_var)
return(true);
}
return(false);
}
//-------------------------------------------------------------
// Procedure: getCellVarIX()
unsigned int XYConvexGrid::getCellVarIX(const string& cell_var) const
{
unsigned int i, vsize = m_cell_vars.size();
for(i=0; i<vsize; i++) {
if(m_cell_vars[i] == cell_var)
return(i);
}
return(0);
}
//-------------------------------------------------------------
// Procedure: setVal
void XYConvexGrid::setVal(unsigned int ix, double val,
unsigned int cix)
{
if((ix >= m_elements.size()) || (cix >= m_cell_vars.size()))
return;
// Make sure new value is within bounds, if limited
if(m_cell_max_limited[cix] && (val > m_cell_max_limit[cix]))
val = m_cell_max_limit[cix];
if(m_cell_min_limited[cix] && (val < m_cell_min_limit[cix]))
val = m_cell_min_limit[cix];
// Set the value of the cell IX for cell var CIX
m_cell_vals[ix][cix] = val;
// Update the minimum value so far noted for cell_var CIX
if(!m_cell_minmax_noted[cix] || (val < m_cell_min_sofar[cix]))
m_cell_min_sofar[cix] = val;
// Update the maximum value so far noted for cell_var CIX
if(!m_cell_minmax_noted[cix] || (val > m_cell_max_sofar[cix]))
m_cell_max_sofar[cix] = val;
// Now that an update has been made for cell_var CIX, note it.
m_cell_minmax_noted[cix] = true;
}
//-------------------------------------------------------------
// Procedure: incVal
void XYConvexGrid::incVal(unsigned int ix, double val,
unsigned int cix)
{
if((ix >= m_elements.size()) || (cix >= m_cell_vars.size()))
return;
double curr_val = m_cell_vals[ix][cix];
setVal(ix, curr_val+val, cix);
}
//-------------------------------------------------------------
// Procedure: getVal
double XYConvexGrid::getVal(unsigned int ix, unsigned int cix) const
{
if((ix >= m_elements.size()) || (cix >= m_cell_vars.size()))
return(0);
return(m_cell_vals[ix][cix]);
}
//-------------------------------------------------------------
// Procedure: getVar
string XYConvexGrid::getVar(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return("");
return(m_cell_vars[cix]);
}
//-------------------------------------------------------------
// Procedure: getMin
double XYConvexGrid::getMin(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return(0);
return(m_cell_min_sofar[cix]);
}
//-------------------------------------------------------------
// Procedure: getMax
double XYConvexGrid::getMax(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return(0);
return(m_cell_max_sofar[cix]);
}
//-------------------------------------------------------------
// Procedure: getInitVal
double XYConvexGrid::getInitVal(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return(0);
return(m_cell_init_vals[cix]);
}
//-------------------------------------------------------------
// Procedure: getMinLimit
double XYConvexGrid::getMinLimit(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return(0);
return(m_cell_min_limit[cix]);
}
//-------------------------------------------------------------
// Procedure: cellVarMinLimited()
bool XYConvexGrid::cellVarMinLimited(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return(false);
return(m_cell_min_limited[cix]);
}
//-------------------------------------------------------------
// Procedure: cellVarMaxLimited()
bool XYConvexGrid::cellVarMaxLimited(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return(false);
return(m_cell_max_limited[cix]);
}
//-------------------------------------------------------------
// Procedure: getMaxLimit
double XYConvexGrid::getMaxLimit(unsigned int cix) const
{
if(cix >= m_cell_vars.size())
return(0);
return(m_cell_max_limit[cix]);
}
//-------------------------------------------------------------
// Procedure: setMinLimit
void XYConvexGrid::setMinLimit(double min_limit, unsigned int cix)
{
if(cix >= m_cell_vars.size())
return;
m_cell_min_limit[cix] = min_limit;
m_cell_min_limited[cix] = true;
// If there is a cell_max_limit in force
if(m_cell_max_limited[cix])
// And the new min_limit is actually greater(!) than max_limit
if(min_limit > m_cell_max_limit[cix])
// Then clip the min_limit to be no more than the max_limit
m_cell_min_limit[cix] = m_cell_max_limit[cix];
}
//-------------------------------------------------------------
// Procedure: setMaxLimit
void XYConvexGrid::setMaxLimit(double max_limit, unsigned int cix)
{
if(cix >= m_cell_vars.size())
return;
m_cell_max_limit[cix] = max_limit;
m_cell_max_limited[cix] = true;
// If there is a cell min_limit in force
if(m_cell_min_limited[cix])
// And the new max_limit is actually greater(!) than min_limit
if(max_limit < m_cell_min_limit[cix])
// Then clip the max_limit to be no more than the min_limit
m_cell_max_limit[cix] = m_cell_min_limit[cix];
}
//-------------------------------------------------------------
// Procedure: ptIntersect
// Purpose: Determine is a given point is contained within the
// the grid, i.e., within any one element
bool XYConvexGrid::ptIntersect(double x, double y) const
{
unsigned int i, vsize = m_elements.size();
for(i=0; i<vsize; i++)
if(m_elements[i].containsPoint(x, y))
return(true);
return(false);
}
//-------------------------------------------------------------
// Procedure: ptIntersectBound
// Purpose: Determine is a given point is contained within the
// bounding box of all grid squares.
bool XYConvexGrid::ptIntersectBound(double x, double y) const
{
return(m_bounding_square.containsPoint(x, y));
}
//-------------------------------------------------------------
// Procedure: segIntersectBound
// Purpose: Determine is a given line segment intersects the
// bounding box of all grid squares.
bool XYConvexGrid::segIntersectBound(double x1, double y1,
double x2, double y2) const
{
return(m_bounding_square.segIntersectLength(x1,y1,x2,y2) > 0);
}
//-------------------------------------------------------------
// Procedure: initialize
bool XYConvexGrid::initialize(const XYSquare& outer_square,
const XYSquare& unit_square)
{
double outer_x_len = outer_square.getLengthX();
double outer_y_len = outer_square.getLengthY();
double unit_x_len = unit_square.getLengthX();
double unit_y_len = unit_square.getLengthY();
if(outer_y_len < unit_y_len)
return(false);
if(outer_x_len < unit_x_len)
return(false);
double x_whole = floor(outer_x_len / unit_x_len);
double x_extra = (outer_x_len - (x_whole * unit_x_len));
int x_count = (int)(x_whole);
if(x_extra > 0)
x_count++;
double y_whole = floor(outer_y_len / unit_y_len);
double y_extra = (outer_y_len - (y_whole * unit_y_len));
int y_count = (int)(y_whole);
if(y_extra > 0)
y_count++;
XYSquare new_square;
for(int i=0; i<x_count; i++) {
for(int j=0; j<y_count; j++) {
double x_low = (i * unit_x_len) + outer_square.getVal(0,0);
double x_high = x_low + unit_x_len;
double y_low = (j * unit_y_len) + outer_square.getVal(1,0);
double y_high = y_low + unit_y_len;
new_square.set(x_low, x_high, y_low, y_high);
m_elements.push_back(new_square);
}
}
m_bounding_square = outer_square;
return(true);
}
//-------------------------------------------------------------
// Procedure: reset
// Purpose: Reset the grid (without changing the grid structure).
// Reset all the initial values back, and reset the
// min_sofar and max_sofar values for each cellvar.
void XYConvexGrid::reset()
{
// For each element (grid cell) and each cell_var, reset to the
// cell_var's initial value.
unsigned int ix, esize = m_elements.size();
unsigned int cix, csize = m_cell_vars.size();
for(ix=0; ix<esize; ix++) {
for(cix=0; cix<csize; cix++) {
double init_val = m_cell_init_vals[cix];
m_cell_vals[ix][cix] = init_val;
}
}
// For each cell_var indicate no values yet noted.
for(cix=0; ix<csize; ix++)
m_cell_minmax_noted[cix] = false;
}
//-------------------------------------------------------------
// Procedure: reset (for a given cell_var)
// Purpose: Reset the grid (without changing the grid structure).
// Reset all the initial values back, and reset the
// min_sofar and max_sofar values for each cellvar.
void XYConvexGrid::reset(const string& cell_var)
{
if(!hasCellVar(cell_var))
return;
unsigned int cix = getCellVarIX(cell_var);
// For each element (grid cell), for the given cell_var, reset
// to the cell_var's initial value.
unsigned int ix, esize = m_elements.size();
for(ix=0; ix<esize; ix++) {
double init_val = m_cell_init_vals[cix];
m_cell_vals[ix][cix] = init_val;
}
// For given cell_var indicate that no values yet noted
m_cell_minmax_noted[cix] = false;
}
//-------------------------------------------------------------
// Procedure: get_spec
string XYConvexGrid::get_spec() const
{
string spec = getConfigStr();
// Now build all the cell information. If a cell has no changes
// from the defaults, for any of its cell vars, there will be no
// info for that cell included. Format is generally like:
// cell=ix:var:val:var:val:var:val, or
// cell=23:force_angle:180:magnitude:2.3
unsigned int ix, esize = m_elements.size();
for(ix=0; ix<esize; ix++) {
string cell_spec;
unsigned int cix, csize = m_cell_vars.size();
for(cix=0; cix<csize; cix++) {
if(m_cell_vals[ix][cix] != m_cell_init_vals[cix]) {
double dval = m_cell_vals[ix][cix];
cell_spec += m_cell_vars[cix] + ":" + doubleToStringX(dval);
}
}
if(cell_spec != "") {
cell_spec = ",cell=" + uintToString(ix) + ":" + cell_spec;
spec += cell_spec;
}
}
string obj_spec = XYObject::get_spec();
if(obj_spec != "")
spec += ("," + obj_spec);
return(spec);
}
//-------------------------------------------------------------
// Procedure: getConfigStr
// Purpose: Return a serialized version of just the grid config
// components; likely its original configuration string.
// "pts={0,0:100,0:100,100:0,100},cell_size=10,
// cell_vars=x:0:y:0:z:0,cell_min=x:0,cell_max=x:100"
string XYConvexGrid::getConfigStr() const
{
string spec = m_config_poly.get_spec();
spec += ",cell_size=" + doubleToStringX(m_config_cell_size);
string cell_vars_spec;
unsigned int j, jsize = m_cell_vars.size();
for(j=0; j<jsize; j++) {
if(j != 0)
cell_vars_spec += ":";
cell_vars_spec += m_cell_vars[j] + ":";
cell_vars_spec += doubleToStringX(m_cell_init_vals[j]);
}
if(cell_vars_spec != "")
spec += ",cell_vars=" + cell_vars_spec;
unsigned int cix, cvsize = m_cell_vars.size();
for(cix=0; cix<cvsize; cix++) {
if(cellVarMinLimited(cix)) {
spec += ",cell_min=";
spec += m_cell_vars[cix] + ":";
double min_limit = getMinLimit(cix);
spec += doubleToStringX(min_limit);
}
if(cellVarMaxLimited(cix)) {
spec += ",cell_max=";
spec += m_cell_vars[cix] + ":";
double max_limit = getMaxLimit(cix);
spec += doubleToStringX(max_limit);
}
}
return(spec);
}
//-------------------------------------------------------------
// Procedure: print
// Purpose: For debugging.
void XYConvexGrid::print() const
{
unsigned int i, vsize = m_elements.size();
for(i=0; i<vsize; i++)
cout << "[" << i << "]: " << m_elements[i].get_spec() << endl;
}
| [
"[email protected]"
] | |
c61f710b32716d8cd6a4029b7ac1bcec4490cf64 | 63ef2786b4ae49aa77ec0279065226a8ceea27e1 | /Steering Behaviors for Autonomous characters/src/my_viewer.h | 394c13a565cd8b19f27b54c529be084fcf5830c3 | [] | no_license | arjunprakash05/Computer_Animation_and_Simulation | fc3a8080326f001b1975b7ded6547a02bc51e787 | 657216fc4512d48fe44443cf04c57145b52761de | refs/heads/master | 2020-04-21T19:46:28.757142 | 2019-06-11T05:47:57 | 2019-06-11T05:47:57 | 169,819,185 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,518 | h | # pragma once
# include <sig/sn_group.h>
# include <sig/sn_points.h>
# include <sig/sn_lines.h>
# include <sigogl/ui_radio_button.h>
# include <sigogl/ui_slider.h>
# include <sigogl/ui_button.h>
# include <sigogl/ui_check_button.h>
# include <sigogl/ws_viewer.h>
# include "particle_system.h"
class MyViewer : public WsViewer
{ public: // scene and other data:
SnGroup* _root;
SnGroup* _spheres;
SnPoints* _points;
SnLines* _lines;
SnLines* _world;
GsArray<GsMat*> _positions;
float _sphereradius;
ParticleSystem* _psys;
int _nfaces;
SnGroup* _targets;
public: // ui:
UiButton* _init;
UiCheckButton* _run;
UiCheckButton* _seek;
UiCheckButton* _seek1;
UiCheckButton* _flee;
UiCheckButton* _persue;
UiCheckButton* _persue2;
UiCheckButton* _attack;
UiCheckButton* _gather;
UiCheckButton* _scenario1;
UiCheckButton* _scenario2;
UiCheckButton* _scenario3;
UiCheckButton* _scol;
UiCheckButton* _vcol;
UiCheckButton* _bounce;
UiSlider* _windslider;
UiSlider* _tscaleslider;
UiSlider* _crestslider;
UiCheckButton* _vvel;
UiCheckButton* _vworld;
UiCheckButton* _vsphere;
public:
MyViewer ( int x, int y, int w, int h, const char *l=0 );
~MyViewer ();
void build_ui ();
void sphere_radius ( float r ) { _sphereradius=r; }
void view ( bool vel, bool world, bool spheres );
void build_scene ( ParticleSystem& psys, int nfaces );
void update_scene ();
void run ();
public :
virtual int handle_scene_event ( const GsEvent &e );
virtual int uievent ( int e );
};
| [
"[email protected]"
] | |
83eaa84a0a7a3e4d4a486e04a5a000aca871fcc2 | 325a3a48500a2cf9246453d611c628f10742953e | /MMOCoreORB/src/templates/tangible/FamiliarPetDeedTemplate.h | 428a4b4c1b00207bfc81b347897747559c8cb97f | [] | no_license | SWGEmu-Private-Servers/SWG-Sentinels-Republic | 39be3fb5655d57bfd8f44a75b234129dc85714be | cd96f476a51296370ffa7b19531a6db05a06d20a | refs/heads/master | 2022-12-17T08:31:57.793579 | 2020-09-22T07:28:57 | 2020-09-22T07:28:57 | 297,396,568 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 855 | h | /*
* FamiliarPetDeedTemplate.h
*
* Created on: August 17, 2013
* Author: washu
*/
#ifndef FamiliarPetDeedTemplate_H_
#define FamiliarPetDeedTemplate_H_
#include "templates/tangible/DeedTemplate.h"
class FamiliarPetDeedTemplate : public DeedTemplate {
private:
String controlDeviceObjectTemplate;
String mobileTemplate;
public:
FamiliarPetDeedTemplate() {
}
~FamiliarPetDeedTemplate() {
}
void readObject(LuaObject* templateData) {
DeedTemplate::readObject(templateData);
controlDeviceObjectTemplate = templateData->getStringField("controlDeviceObjectTemplate");
mobileTemplate = templateData->getStringField("mobileTemplate");
}
String getControlDeviceObjectTemplate() {
return controlDeviceObjectTemplate;
}
String getMobileTemplate() {
return mobileTemplate;
}
};
#endif /* FamiliarPetDeedTemplate_H_ */
| [
"[email protected]"
] | |
4029ad1e24bf1564010fbc4030363ee10e2a2c3b | 30b2a6f387e889ef7bc323921a1a6c521fbc47d1 | /MetropolHotel/LogPassword.cpp | ade6162d169aae343ab00134c5d8e2b5ef477a5d | [] | no_license | aKovalchuk1999/HotelService | 1228745756f6db27f8141dbbf9cbfcfd99f7e87e | a44301a84dd2107ad305bd7885e3b150f43ad002 | refs/heads/master | 2020-03-26T08:07:30.505596 | 2018-08-14T07:51:35 | 2018-08-14T07:51:35 | 144,686,763 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 46 | cpp | #include "StdAfx.h"
#include "LogPassword.h"
| [
"[email protected]"
] | |
4ded28aff8b76776996cf682c8701d1f2cb2fbfc | 908a6574871ece7d736724f8a0e07cd7e0147493 | /Stochastic/UCP-Stochastique/src/eoUCPMutation5.h~ | cd0a2ec73249e0150359314df0728246b689e4a2 | [] | no_license | sophiejacquin/UCP | fef5894a5b1a5fbb4faa0344ad332bd4f3c3871f | 9e770e1beb69c953efbae423cf553d1f6f702ad2 | refs/heads/master | 2021-01-17T20:50:48.278512 | 2016-07-27T15:11:42 | 2016-07-27T15:11:42 | 64,318,354 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,451 | /** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
The above line is useful in Emacs-like editors
*/
/*
Template for simple mutation operators
======================================
*/
#ifndef eoUCPMutation5_H
#define eoUCPMutation5_H
#include <eoOp.h>
#include <iostream>
using namespace std;
/**
* Always write a comment in this format before class definition
* if you want the class to be documented by Doxygen
*
* THere is NO ASSUMPTION on the class GenoypeT.
* In particular, it does not need to derive from EO
*/
template<class GenotypeT>
class eoUCPMutation5: public eoMonOp<GenotypeT>
{
private:
// START Private data of an eoUCPMutation object
// varType anyVariable;
vector<eoUCPData> scenarios;
vector<int> tUp;
vector<int > tDown;
vector<int> tColdStart;
int longueur;
int nbUnitsS;
int nbEtats;
// END Private data of an eoUCPMutation object
public:
/**
* Ctor - no requirement
*/
// START eventually add or modify the anyVariable argument
eoUCPMutation5 (vector<int> & _tUp, vector<int> & _tDown, vector<int> & _tCS,vector<eoUCPData> _scenarios,int _longueur,int _nb)
{
tUp= _tUp;
tDown= _tDown;
tColdStart=_tCS;
scenarios=_scenarios;
longueur=_longueur;
nbUnitsS= _nb;
nbEtats=pow(2,nbUnitsS)+1;
}
// END Code of Ctor of an eoUCPEvalFunc object
/// The class name. Used to display statistics
string className() const { return "eoUCPMutation"; }
/**
* modifies the parent
* @param _genotype The parent genotype (will be modified)
*/
bool operator()(GenotypeT & _genotype)
{
////////cout<<"deb mut2"<<endl;
bool isModified(true);
vector<int> unitsS;
int nbUnits =_genotype.getNbUnits();
int h,i,j,k;
//choix heure début :
int nbHeures =_genotype.getNbHeures();
eoUniformGenerator<int> choixHDeb(1,nbHeures-longueur-1);
int hDeb=choixHDeb();
int hFin=hDeb+longueur;
// cout<<"hDeb : "<<hDeb<<" hFin : "<<hFin<<endl;
//choix unités :
int der=0;
for(j=0;j<nbUnitsS;j++)
{
eoUniformGenerator<int> choixUnit(0,nbUnits );
der= choixUnit();
bool deja=false;
for(k=0;k<j;k++)
if(unitsS[k]==der)deja=true;
if (deja) j--;
else {
unitsS.push_back(der);
//cout<<der<<" ";
}
}
//cout<<endl;
// tableaux du graphe :
//cout<<"av declaration"<<endl;
double graphEval[longueur+1][nbEtats];
int** graphPred = new int*[longueur+1];
for (j=0;j<longueur+1;j++) graphPred[j]=new int[nbEtats];
//////cout<<"debut remplissage"<<endl;
//verification à priori :
for(j=hDeb;j<hFin+1;j++)
{
for(k=0;k<nbUnitsS;k++)
{
if(_genotype.getTemps(j,unitsS[k])<0 && _genotype.getTemps(j-1,unitsS[k])>0 )
{
if( _genotype.getTemps(j-1,unitsS[k])<tUp[unitsS[k]]) cout<<"attention pb 1ap :"<<j<<" "<<k<<" tUp "<<tUp[unitsS[k]]<<" hDeb "<<hDeb<<"val pred "<<_genotype.getTemps(j-1,unitsS[k])<<endl;
}
else if(_genotype.getTemps(j,unitsS[k])>0 && _genotype.getTemps(j-1,unitsS[k])<0)
{
if( _genotype.getTemps(j-1,unitsS[k])>tDown[unitsS[k]]) cout<<"attention pb 2ap "<<j<<endl;
}
}
}
//Remplissage du graphe :
for(h=0;h<longueur+1;h++)
{
//////cout<<h<<endl;
vector<int> description=_genotype.getTemps()[hDeb+h];
for(i=0;i<nbEtats-1;i++)
{
//////cout<<i<<endl;
//vérifier réalisabilité de l'état:
bool realisable=true;
double CS=0;
//vérifier si non interdit par condition initiale ou finale et construction vecteur descriptif de l'état:
int puis=1;
int puisSup=2;
for(j=0;j<nbUnitsS;j++)
{
int unite=unitsS[j];
int tpsIni=_genotype.getTemps(hDeb-1,unite);
int tpsFin;
if(hFin+1<nbHeures)tpsFin=_genotype.getTemps(hFin+1,unite);
int etat;
if(i%puisSup>=puis)etat=1;
else etat=-1;
puisSup*=2;
puis*=2;
if((tpsIni>0&&tpsIni+h<tUp[unite] &&etat==-1)||(tpsIni<0 && tpsIni-h >tDown[unite] && etat==1))
{realisable=false; //cout <<"realisable faux 1: heure "<< h << " "<<j<<" "<<etat<<endl;
}
else if((hFin+1<nbHeures)&&((tpsFin>0 && tpsFin-(longueur -h +1)>0 && etat<0)||(tpsFin<0 && -tpsFin-(longueur -h +1)>0)&&etat==1))
{realisable=false;// cout <<"realisable faux2 : heure "<< h << " "<<j<<" "<<etat<<endl;
}
else if((hFin+1<nbHeures)&& tpsFin>0 && tpsFin<tUp[unite] && h>longueur+1-tpsFin && etat==-1)
{realisable=false;// cout <<"realisable faux 3 : heure "<< h << " "<<j<<" "<<etat<<endl;
}
else if((hFin+1<nbHeures)&& tpsFin>0 && tpsFin<tUp[unite] && longueur+1-tpsFin-tDown[unite]<h<=longueur+1-tpsFin && etat==1)
{realisable=false; //cout <<"realisable faux 3 : heure "<< h << " "<<j<<" "<<etat<<endl;
}
else if((hFin+1<nbHeures)&& tpsFin<0 && tpsFin>tColdStart[unite] && h<=longueur+1+tpsFin&& h>longueur+1+tpsFin-tUp[unite] &&etat==-1)
{realisable=false; cout <<"realisable faux 4 "<< h << " "<<j<<" "<<etat<<endl;}
description[unite]=etat;
}
//////cout<<"verif accessibilité finie "<<realisable<<endl;
if(realisable==true)
{
//cout<<realisable<<endl;
double penalite=0;
////cout<<"réalisable"<<endl;
// vérifier si réalisable au sens des demandes et réserves :
//recherche meilleur pred:
if(h==0)
{
graphPred[0][i]=0;
penalite=penalityHour(description,hDeb);
//eval avec CS + evalPred :
graphEval[0][i]=penalite;
//if(graphPred[0][i]==0){
int puissance=1;
int puisSup=2;
for(j=0;j<nbUnitsS;j++)
{
int tempsIni=_genotype.getTemps(hDeb-1,unitsS[j]);
int etat=description[unitsS[j]];
if(i%puisSup>=puissance)etat=1;
else etat=-1;
puissance*=2;
puisSup*=2;
if(etat<0 && tempsIni>0 && tempsIni< tUp[unitsS[j]])
graphPred[0][i]=-1;
else if(etat>0 && tempsIni<0 &&tempsIni>tDown[unitsS[j]])
graphPred[0][i]=-1;
else if(etat>0 && tempsIni<0 &&tempsIni>tColdStart[unitsS[j]])
graphEval[h][i]+=(*units)[unitsS[j]].get_sHot();
else if(etat>0 && tempsIni==tColdStart[unitsS[j]]) graphEval[h][i]=(*units)[unitsS[j]].get_sCold();
}
//}
//////cout<<"recherche meilleur pred h=0 finie"<<endl;
}
else //si h>0
{
graphPred[h][i]=-1;
penalite=penalityHour(description,h+hDeb);
for(j=0;j<nbEtats;j++)
{
bool possible=true;
if(graphPred[h-1][j]<0)possible=false;
k=0;
int CS=0;
//>0){ possible=false;}
//else ////cout<<"là c'est bon"<<endl;
int puissance=1;
int puisSup=2;
while(possible&& k<nbUnitsS)
{
int etat;
if(j<nbEtats-1 && j%puisSup>=puissance)etat=1;
else if(j<nbEtats-1)etat=-1;
else etat=_genotype.getTemps(hDeb+h,unitsS[k]);
puissance*=2;
puisSup*=2;
//if(h==13&& k==2)cout<<"etat "<<etat<<" description "<<description[unitsS[k]]<<endl;
if((etat<0 && description[unitsS[k]]>0)||(etat>0 && description[unitsS[k]]<0))
{
//calcul temps mm état :
//cout<<"changement d'etat"<<endl;
int tps=tempsMemeEtat(_genotype,graphPred,h-1,j,k,hDeb,unitsS[k]);
if(etat>0 && tps<tUp[unitsS[k]])
{
possible=false;
}
else if(etat<0)
{
if(tps< -tDown[unitsS[k]])
{
possible=false;
}
else if(tps< -tColdStart[unitsS[k]])
CS+=(*units)[unitsS[k]].get_sHot();
else CS+=(*units)[unitsS[k]].get_sCold();
}
//if(h==4 &&k==0 &&tps==3)cout<<tps<<" "<<possible<<"etat "<<etat<<" description "<<description[unitsS[k]]<<" "<<tUp[unitsS[k]]<<endl;
}
k++;
}//fin tq
if(possible)
{
//cout<<possible<<" "<<j<<" "<<graphPred[h][i]<<" "<<graphEval[h][i]<<" "<<graphEval[h-1][j]<<" CS "<<CS<<" penalite "<<penalite<<endl;
//regarde si meilleur predesseur :
if(graphPred[h][i]==-1|| graphEval[h][i]>graphEval[h-1][j]+CS+penalite)
{
//cout<<"là "<<h<<endl;
graphPred[h][i]=j;
graphEval[h][i]=graphEval[h-1][j]+CS+penalite;
}
}
}//fin pour
}
//////cout<<"autre cas fini"<<endl;
//calcul de FC:
if(graphPred[h][i]>-1&&penalite==0)
{
graphEval[h][i]+=fuelCost(_genotype,h+hDeb,description);
}
//////cout<<"calcul Fuel Cost effectué"<<endl;
}
else graphPred[h][i]=-1;
//////cout<<"fin iteration grde boucle états"<<endl;
}
//////cout<<"graphe rempli sauf dernier état"<<endl;
//dernier état: ajout possibilité de ratacher à d'autres sommets
graphPred[h][nbEtats-1]=nbEtats-1;
description=_genotype.getTemps()[hDeb+h];
double penalite=penalityHour(description,h+hDeb);
//Calcul de CS et numero autre sommet pred possible :
int puis=1;
int num=0;
double CS=0;
for(k=0;k<nbUnitsS;k++)
{
if(_genotype.getTemps(hDeb+h-1,unitsS[k])>0)num=num+puis;
puis*2;
if(description[unitsS[k]]==1)
{
if(_genotype.getTemps(hDeb+h-1,unitsS[k])<0 && _genotype.getTemps(hDeb+h-1,unitsS[k])>tColdStart[unitsS[k]])
CS+=(*units)[unitsS[k]].get_sHot();
else CS+=(*units)[unitsS[k]].get_sCold();
}
}
//Calcul de FC:
graphEval[h][nbEtats-1]+=CS;
if(h>0)graphEval[h][nbEtats-1]+=graphEval[h-1][nbEtats-1];
graphEval[h][nbEtats-1]+=penalite;
//regarder si autre pred est un pred possible :
/*if(h>0)
{
bool acceptable = true;
int k=0;
while(k<nbUnitsS && acceptable)
{
int tps=tempsMemeEtat(_genotype,graphPred,h-1,num,k,hDeb,unitsS[k]);
bool pos=false;
if(description[unitsS[k]]==tUp[unitsS[k]] && tps>=tUp[unitsS[k]]-1)
{
pos=true;
}
else if(description[unitsS[k]]==1 && tps>=-tDown[unitsS[k]])
{
pos=true;
}
else if(description[unitsS[k]]==-1 && tps>=tUp[unitsS[k]])
{
pos=true;
}
else if(description[unitsS[k]]==tColdStart[unitsS[k]] && tps>= -tColdStart[unitsS[k]]-1)
{
pos=true;
}
else if(description[unitsS[k]]>0 && tps== description[unitsS[k]]-1)
{
pos=true;
}
else if(description[unitsS[k]]<0 && tps== -description[unitsS[k]]-1)
{
pos=true;
}
acceptable= acceptable&& pos;
k++;
}
if(acceptable && graphEval[h-1][num]+CS+penalite<graphEval[h][nbEtats-1])
{
graphPred[h][nbEtats-1]=num;
graphEval[h][nbEtats-1]=graphEval[h-1][num]+CS+penalite;
}
}*/
//////cout<<"pred de base mis"<<endl;
//chercher si il existe un autre pred meilleur :
/*int nbPred=0;
for(j=0;j<nbEtats-1;j++)
{
bool possible=true;
if(h==0||graphPred[h-1][j]<0)possible=false;
else nbPred++;
k=0;
int CS=0;
int puissance=1;
int puisSup=2;
while(possible&& k<nbUnitsS)
{
int etat;
if( j%puisSup>=puissance)etat=1;
else etat=-1;
puisSup*=2;puissance*=2;
if(etat* description[unitsS[k]]<0)
{
//calcul temps mm état :
int tps=tempsMemeEtat(_genotype,graphPred,h-1,j,k,hDeb,unitsS[k]);
if(etat<0 && tps<tUp[unitsS[k]])
{
possible=false;
}
else if(etat>0)
{
if(tps< -tDown[unitsS[k]])
{
possible=false;
}
else if(tps< tColdStart[unitsS[k]])
CS+=(*units)[unitsS[k]].get_sHot();
else CS+=(*units)[unitsS[k]].get_sCold();
}
}
k++;
}//fin tq
//////cout<<"fin tq"<<endl;
if(possible)
{
//////cout<<possible<<endl;
//regarde si meilleur predesseur :
if(graphPred[h][nbEtats-1]==-1|| graphEval[h][nbEtats-1]>graphEval[h-1][j]+CS+penalite)
{
graphPred[h][nbEtats-1]=j;
graphEval[h][nbEtats-1]=graphEval[h-1][j]+CS+penalite;
}
}
}//fin pour*/
//cout<<" h "<<h<<" nbPred "<<nbPred<<endl;
//////cout<<"fin pour"<<endl;
//Calcul penalites :
if(penalite==0) graphEval[h][nbEtats-1]+=fuelCost(_genotype,h+hDeb,description);
//////cout<<"derbier etat"<<endl;
}
//////cout<<"fin remplisage graph"<<endl;
//fin remplissage graphes
//retour solution:
//recherche meilleur dernier etat valide:
int actu=nbEtats-1;
for(j=0;j<nbEtats-1;j++)
{
if(graphPred[longueur-1][j]>-1)
{
//cout<<graphEval[longueur-1][j]<<endl;
if(graphEval[longueur-1][j]<graphEval[longueur-1][actu]) actu=j;
}
}
//cout <<"actu def "<<actu<<endl;
//restitution des solutions sous forme binaire:
for(j=longueur;j>=0;j--)
{
int puissance=1;int puisSup=2;
for(k=0;k<nbUnitsS;k++)
{
if(actu<nbEtats-1)
{
int etat;
if(actu%puisSup>=puissance)etat=1;
else etat=-1;
_genotype.setTemps(hDeb+j,unitsS[k],etat);
puisSup*=2;puissance*=2;
// cout<<j<<": "<<actu<<" "<<tempsMemeEtat(_genotype,graphPred,j,actu,k,hDeb,unitsS[k])<<etat<<endl;
}
//else cout<< j<<": "<<actu<<" "<<_genotype
}
//cout<<j<<": "<<actu<<endl;
actu=graphPred[j][actu];
_genotype.setModif(hDeb+j,true);
}
//cout<<endl;
//////cout<<"rest binaire"<<endl;
//remise des temps comme il faut :
for(j=hDeb;j<hFin+1;j++)
{
for(k=0;k<nbUnitsS;k++)
{
if(_genotype.getTemps(j,unitsS[k])<0 && _genotype.getTemps(j-1,unitsS[k])<0 )
{
if(_genotype.getTemps(j-1,unitsS[k])>tColdStart[unitsS[k]])_genotype.setTemps(j,unitsS[k],_genotype.getTemps(j-1,unitsS[k])-1);
else _genotype.setTemps(j,unitsS[k],tColdStart[unitsS[k]]);
}
else if(_genotype.getTemps(j,unitsS[k])<0 && _genotype.getTemps(j-1,unitsS[k])>0 )
{
_genotype.setTemps(j,unitsS[k],-1);
if( _genotype.getTemps(j-1,unitsS[k])<tUp[unitsS[k]]) cout<<"attention pb 1 :"<<j<<" "<<k<<": "<<unitsS[k]<<" tUp "<<tUp[unitsS[k]]<<" hDeb "<<hDeb<<"val pred "<<_genotype.getTemps(j-1,unitsS[k])<<endl;
}
else if(_genotype.getTemps(j,unitsS[k])>0 && _genotype.getTemps(j-1,unitsS[k])>0)
{
if(_genotype.getTemps(j-1,unitsS[k])<tUp[unitsS[k]])_genotype.setTemps(j,unitsS[k],_genotype.getTemps(j-1,unitsS[k])+1);
else _genotype.setTemps(j,unitsS[k],tUp[unitsS[k]]);
}
else if(_genotype.getTemps(j,unitsS[k])>0 && _genotype.getTemps(j-1,unitsS[k])<0)
{
_genotype.setTemps(j,unitsS[k],1);
if( _genotype.getTemps(j-1,unitsS[k])>tDown[unitsS[k]]) cout<<"attention pb 2 "<<j<<" "<<unitsS[k]<<" tDown "<<tDown[unitsS[k]]<<" hDeb "<<hDeb<<"val pred "<<_genotype.getTemps(j-1,unitsS[k])<<endl;
}
}
}
//////cout<<"rest"<<endl;
//désalouage :
//////cout<<"deb desalouage"<<endl;
for (j=0;j<longueur+1;j++)
delete[] graphPred[j];
//////cout<<"ici"<<endl;
delete[] graphPred;
//////cout<<"desaloué"<<endl;
return isModified;
// END code for mutation of the _genotype object
}
int tempsMemeEtat(GenotypeT & _eo,int** graphPred,int h,int i,int u,int hDeb,int unit)
{
int tps=1;
int etat;
if(i<nbEtats-1)
{
if(i%( static_cast<int>(pow(2,u+1)))>=static_cast<int>(pow(2,u)))etat=1;
else etat=-1;
}
else
{
if(_eo.getTemps(h+hDeb,unit)>0)etat=1;
else etat=-1;
}
int pred= graphPred[h][i];
int etatPred;
if(pred<nbEtats-1)
{
if(pred%(static_cast<int>(pow(2,u+1)))>=static_cast<int>(pow(2,u)))etatPred=1;
else etatPred=-1;
}
else{
if(_eo.getTemps(h-1+hDeb,unit)>0)etatPred=1;
else etatPred=-1;
}
while(etat==etatPred && h>0)
{
tps++;
i=pred;
etat=etatPred;
h--;
pred=graphPred[h][i];
if(pred<nbEtats-1){
if(pred%(static_cast<int>(pow(2,u+1)))>=static_cast<int>(pow(2,u)))etatPred=1;
else etatPred=-1;}
else
{
if(_eo.getTemps(h-1+hDeb,unit)>0)etatPred=1;
else etatPred=-1;
}
}
if(h==0 && etat>0 &&_eo.getTemps(hDeb-1,unit)>0) tps+=_eo.getTemps(hDeb-1,unit);
else if(h==0 && etat<0 &&_eo.getTemps(hDeb-1,unit)<0) tps-=_eo.getTemps(hDeb-1,unit);
// else tps++;
return tps;
}
double fuelCost(GenotypeT & _eo,int h,vector<int> description)
{
double lamb,delt;
////////cout<<"deblambda"<<endl;
lambda_delta(lamb,delt,h,_eo,description);
//////cout<<"la"<<endl;
int nbUnits=(*units).size();
double prod[nbUnits];
double a1,a2,a0,pi,diff,sum=0;
//int indice;
do
{
sum=0;
for(unsigned int i=0;i<nbUnits;i++)
{
//indice = _eo.indiceUnitAtTime(i,h);
if(description[i]>0)
{
eoUCPUnit & unite =(*units)[i];
a1=unite.get_a1();
a2=unite.get_a2();
pi=0.5*(lamb-a1)/(a2);
if(pi<unite.get_Pmin())
pi=unite.get_Pmin();
else if(pi>unite.get_Pmax())
pi=unite.get_Pmax();
prod[i]=pi;
sum += pi;
}
}
diff=(*load)[h-1]-sum;
if(diff<0)
lamb=lamb-delt;
else
lamb=lamb+delt;
delt=delt*0.5;
}
while(fabs(diff)>0.00001);
////////cout<<"fin while"<<endl;
double res=0;
for(unsigned int i=0;i<nbUnits;i++)
{
if(description[i]>0)
{
eoUCPUnit & unite =(*units)[i];
a1=unite.get_a1();
a2=unite.get_a2();
a0=unite.get_a0();
double p=prod[i];
double fc=a0+(a2*p+a1)*p;
res += fc;
}
}
return res;
}
double StartUpCostHour(GenotypeT & _eo, int h,int usine,int tps, int tpsPred)
{
int nbUnits=(*units).size();
unsigned i;
double cost=0;
for(i=0;i<nbUnits;i++)
{
if((i!=usine && _eo.getTemps(h,i)==1)||(i==usine &&tps==1))
{
if((i!=usine &&_eo.getTemps(h-1,i)>-(*units)[i].get_tColdStart())||(i==usine && tpsPred>-(*units)[i].get_tColdStart()))
{
cost=cost+(*units)[i].get_sHot();
}
else cost=cost+(*units)[i].get_sCold();
}
}
return cost;
}
double penalityHour(vector<int> description, int h)
{
//Test existence :
//retour :
double Pmax,Pmin,sumPmin=0, sumPmax=0,demandReserve=0;
int nbUnits=(*units).size();
for(unsigned i=0;i<nbUnits;i++)
{
eoUCPUnit & unite = (*units)[i];
Pmax = unite.get_Pmax();
Pmin = unite.get_Pmin();
if(description[i]>0)
{
sumPmax+=Pmax;
sumPmin+=Pmin;
}
}
demandReserve= (*load)[h-1]+(*reserve)[h-1];
//////cout<<sumPmax <<" "<<sumPmin<<endl;
if (sumPmax >=demandReserve && sumPmin<=(*load)[h-1])
{
return 0;
}
else return 1000000;
}
void lambda_delta(double & lambda,double & delta,unsigned int h,GenotypeT & _eo,vector<int> description)
{
double res=0.0;
int Pmax=0;
int Pmin=0;
int nbUnitsS;
int nbUnits=(*units).size();
// std::vector<bool> * mbits = _eo.get_p_mbits();
double a1=0;
double a2=0;
double lmin=numeric_limits<double>::max();
double lmax=0;
double lminTmp=0;
double lmaxTmp=0;
for(unsigned i=0;i<nbUnits;i++)
{
eoUCPUnit & unite = (*units)[i];
if(description[i]>0)
{
Pmax = unite.get_Pmax();
Pmin = unite.get_Pmin();
a1 = unite.get_a1();
a2 = unite.get_a2();
lminTmp = a1+(2*a2*Pmin);
lmaxTmp = a1+(2*a2*Pmax);
if(lminTmp<lmin)
lmin=lminTmp;
if(lmaxTmp>lmax)
lmax=lmaxTmp;
}
}
lambda=(lmax+lmin)/2;
delta= (lmax-lmin)/2;
}
};
#endif
| [
"[email protected]"
] | ||
f186d8357e2f790ab4d074c0fbf763dcf0a54fe5 | e099f3450ccb982c9fa06f6d411a3b1d99b5c8d1 | /threadPool/main.cpp | f96bc47671e4ede3bd13325481fd64003a8a75fb | [] | no_license | Request2609/summer2019 | 71d9370edd9be3d703a86695400201cee11b34ef | 2e621b2d9c7278c7f897cc1cd98ad01ea950b661 | refs/heads/master | 2022-02-18T04:08:58.495086 | 2019-09-04T15:18:45 | 2019-09-04T15:18:45 | 197,857,588 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,132 | cpp | #include"threadPool.h"
#include<iostream>
struct gfunc{
int operator()(int n) {
std::cout << n << std::endl ;
return n ;
}
int func() {
printf("hello " ) ;
return 1 ;
}
} ;
int func1(std :: string a, int b) {
std :: cout << "字符串的值为:" << a << " 整型值为:" << b << std :: endl ;
return 0 ;
}
void func(int i) {
std :: cout << "该函数返回值为void,传的参数是" << i << std :: endl ;
}
int func2(int a, int b) {
std :: cout << "有个返回值的线程池" << " int"<< std :: endl ;
return a+b ;
}
int main()
{
try {
//线程池队列正在等待
threadPool pool(10) ;
//往队列中加入任务
std :: future<void> ff = pool.commit(func, 1);
std :: future<int> ff1 = pool.commit(func2, 1,2) ;
printf("ff:") ;
ff.get();
printf("ff1:") ;
ff1.get() ;
printf("ff2:") ;
} catch(std :: exception& e) {
std :: cout << "some unhappy happened..." << std :: this_thread :: get_id() << e.what() << std :: endl ;
}
return 0;
}
| [
"[email protected]"
] | |
7d289c99f191ea82c24dc5ae299c24ed35941a35 | a702fd5e803eca1fc66a4bb435ed68837db4a47b | /core/modules/replica/WorkerProcessorThread.h | 2508f51216d8ca5039859c7a70cb85829edf949d | [] | no_license | fjammes/qserv | f65c5775ca7f5a286b0bef2fd215a71ca47bc249 | 00595c8e6a3ec538c191976045c3c06fc0a15626 | refs/heads/master | 2020-04-27T18:02:32.130713 | 2019-03-18T08:42:36 | 2019-03-18T08:42:36 | 25,034,564 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,066 | h | // -*- LSST-C++ -*-
/*
* LSST Data Management System
* Copyright 2017 LSST Corporation.
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the LSST License Statement and
* the GNU General Public License along with this program. If not,
* see <http://www.lsstcorp.org/LegalNotices/>.
*/
#ifndef LSST_QSERV_REPLICA_WORKERPROCESSORTHREAD_H
#define LSST_QSERV_REPLICA_WORKERPROCESSORTHREAD_H
// System headers
#include <atomic>
#include <memory>
#include <thread>
// This header declarations
namespace lsst {
namespace qserv {
namespace replica {
/// Forward declaration for the class
class WorkerProcessor;
/**
* Class WorkerProcessorThread is a thread-based request processing engine
* for replication requests within worker-side services.
*/
class WorkerProcessorThread
: public std::enable_shared_from_this<WorkerProcessorThread> {
public:
/// Smart reference to objects of the class
typedef std::shared_ptr<WorkerProcessorThread> Ptr;
/// Smart reference for the WorkerProcessor's objects
typedef std::shared_ptr<WorkerProcessor> WorkerProcessorPtr;
/**
* Static factory method is needed to prevent issue with the lifespan
* and memory management of instances created otherwise (as values or via
* low-level pointers).
*
* @param processor
* pointer to the processor
*
* @return
* pointer to the created object
*/
static Ptr create(WorkerProcessorPtr const& processor);
// Default construction and copy semantics are prohibited
WorkerProcessorThread() = delete;
WorkerProcessorThread(WorkerProcessorThread const&) = delete;
WorkerProcessorThread& operator=(WorkerProcessorThread const&) = delete;
~WorkerProcessorThread() = default;
/// @return identifier of this thread object
unsigned int id() const { return _id; }
/// @return 'true' if the processing thread is still running
bool isRunning() const;
/**
* Create and run the thread (if none is still running) fetching
* and processing requests until method stop() is called.
*/
void run();
/**
* Tell the running thread to abort processing the current
* request (if any), put that request back into the input queue,
* stop fetching new requests and finish. The thread can be resumed
* later by calling method run().
*
* NOTE: This is an asynchronous operation.
*/
void stop();
/// @return context string
std::string context() const { return "THREAD: " + std::to_string(_id) + " "; }
private:
/**
* The constructor of the class.
*
* @param processor pointer to the processor
* @param id a unique identifier of this object
*/
WorkerProcessorThread(WorkerProcessorPtr const& processor,
unsigned int id);
/**
* Event handler called by the thread when it's about to stop
*/
void stopped();
private:
/// The processor
WorkerProcessorPtr const _processor;
/// The identifier of this thread object
unsigned int const _id;
/// The processing thread is created on demand when calling method run()
std::unique_ptr<std::thread> _thread;
/// The flag to be raised to tell the running thread to stop.
/// The thread will reset this flag when it finishes.
std::atomic<bool> _stop;
};
}}} // namespace lsst::qserv::replica
#endif // LSST_QSERV_REPLICA_WORKERPROCESSORTHREAD_H
| [
"[email protected]"
] | |
b46883309d3403394815915fedb1262cec4aba8c | 59b2d9114592a1151713996a8888456a7fbfe56c | /hdu/1867.cpp | a59daf1a9c461a67b12ba99c52070e3c11d93084 | [] | no_license | 111qqz/ACM-ICPC | 8a8e8f5653d8b6dc43524ef96b2cf473135e28bf | 0a1022bf13ddf1c1e3a705efcc4a12df506f5ed2 | refs/heads/master | 2022-04-02T21:43:33.759517 | 2020-01-18T14:14:07 | 2020-01-18T14:14:07 | 98,531,401 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,869 | cpp | /* ***********************************************
Author :111qqz
Created Time :2016年08月11日 星期四 05时08分32秒
File Name :code/hdu/1867.cpp
************************************************ */
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <ctime>
#define fst first
#define sec second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define ms(a,x) memset(a,x,sizeof(a))
typedef long long LL;
#define pi pair < int ,int >
#define MP make_pair
using namespace std;
const double eps = 1E-8;
const int dx4[4]={1,0,0,-1};
const int dy4[4]={0,-1,1,0};
const int inf = 0x3f3f3f3f;
const int N=1E5+7;
char a[N],b[N];
int nxt[N];
void getnxt( char *s)
{
int n = strlen(s);
int i = 0 ;
int j = -1;
nxt[0] = -1;
while (i<n)
if (j==-1||s[i]==s[j]) nxt[++i] = ++j;
else j = nxt[j];
}
int kmp(char *a,char *b)
{
int n = strlen(a);
int m = strlen(b);
int i = 0;
int j = 0;
getnxt(b);
while (i<n&&j<m)
{
if (j==-1||a[i]==b[j]) i++,j++;
else j = nxt[j];
}
if (i==n)
return j; //为什么要判断i==n...?
return 0;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("code/in.txt","r",stdin);
#endif
while (scanf("%s\n%s",a,b)!=EOF)
{
int k1 = kmp(a,b);
int k2 = kmp(b,a);
cout<<"k1:"<<k1<<" k2:"<<k2<<endl;
if (k1==k2)
{
if (strcmp(a,b)>0)
{
printf("%s",b);
printf("%s\n",a+k1);
}else
{
printf("%s",a);
printf("%s\n",b+k1);
}
}
else if (k1>k2)
{
printf("%s",a);
printf("%s\n",b+k1);
}
else
{
printf("%s",b);
printf("%s\n",a+k2);
}
}
#ifndef ONLINE_JUDGE
fclose(stdin);
#endif
return 0;
}
| [
"111qqz"
] | 111qqz |
1f0129cbf42826edc5a43bfaf6f852af00588bd4 | 1aaeaeaf042529cb0e5b551cde992c91e501e46c | /lab1/src/treewidget.h | ee5b15b3a3e38a62180f8a1566361c19758a0e04 | [] | no_license | Kazeshirou/ppo | 17c3371de5a2f9d06a1a6cedd738b98fa52d0576 | b857fb8ba6b6cf712e4b365911ace4d7f814a1dc | refs/heads/master | 2020-03-09T06:03:02.540815 | 2018-05-31T13:51:57 | 2018-05-31T13:51:57 | 128,628,825 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,109 | h | #ifndef TREEWIDGET_H
#define TREEWIDGET_H
#include <QTreeWidget>
class GeoRoute;
class QGeoCoordinate;
class TreeWidget: public QTreeWidget
{
Q_OBJECT
public:
explicit TreeWidget(QWidget *parent = nullptr);
~TreeWidget() = default;
void insertRoute(const GeoRoute &route, const int index = -1);
void removeRoute(const int index = -1);
void insertCoordinate(const QGeoCoordinate &coordinate, const int route, const int index = -1);
void removeCoordinate(const int route, const int index = -1);
int currentRoute();
int currentCoordinate();
bool currentIsRoute();
void changeRoute(int index, QString newname);
void changeRouteLength(int index, double newlength);
void changeCoordinate(int route, int index, int column, double newvalue);
signals:
void s_changeRoute(int index, QString newname);
void s_changeCoordinate(int route, int index, int column, double newvalue);
protected:
bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);
protected slots:
void commitData(QWidget *editor);
};
#endif // TREEWIDGET_H
| [
"[email protected]"
] | |
ba79dc6fc05c09a8231f0eec2c475e2c0d081d39 | a250908fe2c6b3b38c6834ae04b065f650109d52 | /lecture12/List.h | ec9d4ba151250a53c33d37eb137da21e64ec32bf | [
"MIT"
] | permissive | msareebhakak/ncstate-ece309-examples | 395e05385208f15ccfe0b1fc0b835e02ee46c5be | 4f36ac249af8a7910c146994abd541b03d7fdbd9 | refs/heads/master | 2020-12-06T07:54:55.005212 | 2019-12-02T20:17:07 | 2019-12-02T20:17:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 939 | h | #ifndef LIST_H
#define LIST_H
#include <string>
using Item = int;
class List {
private:
class ListNode {
public:
Item item;
ListNode * next;
ListNode(Item i, ListNode *n=nullptr) {
item = i;
next = n;
}
};
ListNode * head;
ListNode * tail;
public:
class iterator {
ListNode *node;
public:
iterator(ListNode *n = nullptr) {
node = n;
}
Item& getItem() { return node->item; }
void next() { node = node->next; }
bool end() { return node==nullptr; }
friend class List;
};
public:
List() {
// list is empty
head = nullptr;
tail = nullptr;
}
bool empty() {
return head==nullptr;
}
// Only declared, here, implemented
// in List.cpp
void append(Item a);
bool remove (Item ©);
void insertAfter(iterator, Item);
void removeAfter(iterator, Item&);
iterator begin() {
return iterator(head);
}
};
#endif
| [
"[email protected]"
] | |
9f195a25b7211cd51d1c56baed8fff6393bdba48 | b4f42eed62aa7ef0e28f04c1f455f030115ec58e | /messagingfw/senduiservices/launcher/src/senduilauncher.cpp | e2251487f4c9c92697f28e5b58eaaf3c7094becc | [] | no_license | SymbianSource/oss.FCL.sf.mw.messagingmw | 6addffd79d854f7a670cbb5d89341b0aa6e8c849 | 7af85768c2d2bc370cbb3b95e01103f7b7577455 | refs/heads/master | 2021-01-17T16:45:41.697969 | 2010-11-03T17:11:46 | 2010-11-03T17:11:46 | 71,851,820 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,227 | cpp | /*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: Server application for launching SendUI services with
* low capabilites.
*
*/
#include <eikstart.h>
#include "senduilauncherapp.h"
// ======== GLOBAL FUNCTIONS ========
// ---------------------------------------------------------------------------
// Constructs and returns an application object.
// ---------------------------------------------------------------------------
//
LOCAL_C CApaApplication* NewApplication()
{
return new CSendUiLauncherApplication;
}
// ---------------------------------------------------------------------------
// Main function of the application executable.
// ---------------------------------------------------------------------------
//
TInt E32Main()
{
return EikStart::RunApplication(NewApplication);
}
| [
"[email protected]"
] | |
64ce5431eae0aa9863b3ed5d77d21895aefc952c | ccab578b41a5a563344355164c2814fe47b86642 | /algorithm/jps.cpp | 2e1b47037db99029d4b0e815a84be3e9c770fa8b | [] | no_license | gavr97/path-search | 7e0c140591b2581b8c259812a8f4a16e7cb6e61c | 777ca510ee2564438b8566547a6c1c511592ad31 | refs/heads/master | 2021-09-24T22:05:08.959401 | 2018-10-15T14:00:54 | 2018-10-15T14:00:54 | 74,914,971 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,572 | cpp | #include "heuristics.h"
#include <ctime>
#include "../algorithm/jps.h"
void Jps::setLevelPath(Output &output)
{
output.isLowLevel = false;
}
std::vector<Node> Jps::getSuccessors(const Node &node, const Map &map) const
{
// p -> u -> v
std::vector<Node> successors;
unsigned ux = node.getX();
unsigned uy = node.getY();
unsigned px, py;
if (node != nodeStart) {
px = node.getParent()->getX();
py = node.getParent()->getY();
}
for (unsigned indDirection = 0; indDirection != dyVec.size(); ++indDirection) {
unsigned vx = ux + dxVec[indDirection];
unsigned vy = uy + dyVec[indDirection];
if (!map.isObstacle(vx, vy) && map.isAllowedFromTo(ux, uy, vx, vy))
{
if (node != nodeStart && !isNatural(px, py, ux, uy, vx, vy, map) &&
!isForced(px, py, ux, uy, vx, vy, map))
{
// prune;
continue;
}
std::pair<bool, Node> jumpRes = jump(ux, uy, dxVec[indDirection], dyVec[indDirection], map);
if (jumpRes.first && close.find(jumpRes.second) == close.end())
successors.push_back(jumpRes.second);
}
}
return successors;
}
bool Jps::isNatural(unsigned px, unsigned py, unsigned ux, unsigned uy, unsigned vx, unsigned vy, const Map &map) const
{
// p ->(dx1, dy1)-> u ->(dx2, dy2)-> v
if (map.isObstacle(vx, vy)) {
return false;
}
int dx1, dx2, dy1, dy2;
getCoordinats(px, py, ux, uy, vx, vy, dx1, dy1, dx2, dy2);
if (dx1 * dy1 != 0) { // from p to u diagonal move
return (px != vx && py != vy);
} else { // from p to u straight
return (dx1 == dx2 && dy1 == dy2);
}
}
bool Jps::isForced(unsigned px, unsigned py, unsigned ux, unsigned uy, unsigned vx, unsigned vy, const Map &map) const
{
// p ->(dx1, dy1)-> u ->(dx2, dy2)-> v
if (map.isObstacle(vx, vy)) {
return false;
}
int dx1, dx2, dy1, dy2;
getCoordinats(px, py, ux, uy, vx, vy, dx1, dy1, dx2, dy2);
if (dx1 * dy1 != 0) { // from p to u diagonal move
if ((px + 2 * dx1 == vx) && (py == vy) && map.isObstacle(px + dx1, py)) {
return true;
} else if ((py + 2 * dy1 == vy) && (px == vx) && map.isObstacle(px, py + dy1)) {
return true;
} else {
return false;
}
} else { // from p to u straight
if ((px + 2 * dx2 == vx) && (py + dy2 == vy) && map.isObstacle(px + dx2, py + dy2)) {
return true;
} else if ((py + 2 * dy2 == vy) && (px + dx2 == vx) && map.isObstacle(px + dx2, py + dy2)) {
return true;
} else {
return false;
}
}
}
std::pair<bool, Node> Jps::jump(unsigned ux, unsigned uy, int dx, int dy, const Map &map) const
{
unsigned vx = ux + dx;
unsigned vy = uy + dy;
if (map.isObstacle(vx, vy)) {
return {false, Node{0, 0}};
}
if (nodeFinish == Node{vx, vy}) {
return {true, Node{vx, vy}};
}
bool isThereForcedNeig = false;
for (unsigned indDirection = 0; indDirection != dyVec.size(); ++indDirection) {
unsigned zx = vx + dxVec[indDirection];
unsigned zy = vy + dyVec[indDirection];
if (isForced(ux, uy, vx, vy, zx, zy, map)) {
isThereForcedNeig = true;
break;
}
}
if (isThereForcedNeig) {
return {true, Node{vx, vy}};
}
if (dx * dy != 0) { // diagonal move from u to v
std::pair<bool, Node> jumpRes = jump(vx, vy, dx, 0, map);
if (jumpRes.first) {
return {true, Node{vx, vy}};
}
jumpRes = jump(vx, vy, 0, dy, map);
if (jumpRes.first) {
return {true, Node{vx, vy}};
}
}
return jump(vx, vy, dx, dy, map);
}
void Jps::getCoordinats(unsigned &px, unsigned &py, unsigned &ux, unsigned &uy, unsigned &vx, unsigned &vy,
int &dx1, int &dy1, int &dx2, int &dy2) const
{
// p ->(dx1, dy1)-> u ->(dx2, dy2)-> v
dx1 = ux - px;
dy1 = uy - py;
// now normalize towards 1
if (dx1 > 0)
dx1 = 1;
else if (dx1 < 0)
dx1 = -1;
if (dy1 > 0)
dy1 = 1;
else if (dy1 < 0)
dy1 = -1;
// respevtively
dx2 = vx - ux;
dy2 = vy - uy;
if (dx2 > 0)
dx2 = 1;
else if (dx2 < 0)
dx2 = -1;
if (dy2 > 0)
dy2 = 1;
else if (dy2 < 0)
dy2 = -1;
// consider parent to just near in right direction
px = ux - dx1;
py = uy - dy1;
} | [
"[email protected]"
] | |
78f703c537e3fb5e250de0a7bb78d3420bae65d9 | 71907ad3b0c3790f8599b14e72df495ce94d1da6 | /IndependentEntrypoint.cpp | c5c4f06ecc22851c39ebfa4549c20dcb7b738c9d | [] | no_license | ohm314/cl_forward | 751b30a653a333ce25f68dd9dc3992de834752f4 | 2dd635fe3b069e10afd8d1a41cb0fb49db72525f | refs/heads/master | 2021-01-18T09:14:21.608168 | 2015-09-16T10:39:45 | 2015-09-16T10:39:45 | 42,575,834 | 0 | 1 | null | 2015-09-16T08:50:10 | 2015-09-16T08:50:09 | null | UTF-8 | C++ | false | false | 4,796 | cpp |
/**
* Autocontained cross-platform independent entrypoint
* for Gaudi offloaded algorithms.
*
* Intended for testing and debugging, completely decoupled
* from the Gaudi framework.
*
* author - Daniel Campora
* email - [email protected]
*
* June, 2014
* CERN
*/
#include <iostream>
#include <string>
#include <cstring>
#include <exception>
#include <fstream>
#include <cstdlib>
#include <vector>
#include <algorithm>
/**
* execute entrypoint of algorithm
* Same signature as offloaded gaudi-algorithm
*
* @param output
* @param input
*/
extern int independent_execute(
const std::vector<std::vector<unsigned char> >& input,
std::vector<std::vector<unsigned char> >& output);
/**
* Post execution entrypoint
* @param output
*/
extern void independent_post_execute(
const std::vector<std::vector<unsigned char> >& output);
void printUsage(char* argv[]){
std::cerr << "Usage: "
<< argv[0] << " <comma separated input filenames>"
<< std::endl;
}
/**
* Generic StrException launcher
*/
class StrException : public std::exception
{
public:
std::string s;
StrException(std::string ss) : s(ss) {}
~StrException() throw () {} // Updated
const char* what() const throw() { return s.c_str(); }
};
/**
* Checks file existence
* @param name
* @return
*/
bool fileExists (const std::string& name) {
if (FILE *file = fopen(name.c_str(), "r")) {
fclose(file);
return true;
} else {
return false;
}
}
/**
* Reads some data from an input file, following the
* specified format of choice
*
* Format expected in file:
*
* int funcNameLen
* char* funcName
* int dataSize
* char* data
*/
void readFileIntoVector(std::string filename, std::vector<unsigned char> & output){
// Check if file exists
if (!fileExists(filename)){
throw StrException("Error: File " + filename + " does not exist.");
}
std::ifstream infile (filename.c_str(), std::ifstream::binary);
// get size of file
infile.seekg(0, std::ifstream::end);
int size = infile.tellg();
infile.seekg(0);
// Read format expected:
// int funcNameLen
// char* funcName
// int dataSize
// char* data
int funcNameLen;
int dataSize;
std::vector<char> funcName;
char* pFuncNameLen = (char*) &funcNameLen;
char* pDataSize = (char*) &dataSize;
infile.read(pFuncNameLen, sizeof(int));
funcName.resize(funcNameLen);
infile.read(&(funcName[0]), funcNameLen);
infile.read(pDataSize, sizeof(int));
// read content of infile with a vector
output.resize(dataSize);
infile.read ((char*) &(output[0]), dataSize);
infile.close();
}
/**
* This is if the function is called on its own
* (ie. non-gaudi execution)
*
* In that case, the file input is expected.
* As a convention, multiple files would be specified
* with comma-separated values
*
* @param argc
* @param argv
* @return
*/
int main(int argc, char *argv[])
{
std::string filename;
int fileNumber = 1;
std::string delimiter = ",";
std::vector<std::vector<unsigned char> > input;
// Get params (getopt independent)
if (argc != 2){
printUsage(argv);
return 0;
}
filename = std::string(argv[1]);
// Check how many files were specified and
// call the entrypoint with the suggested format
if(filename.empty()){
std::cerr << "No filename specified" << std::endl;
printUsage(argv);
return -1;
}
size_t numberOfOcurrences = std::count(filename.begin(), filename.end(), ',') + 1;
input.resize(numberOfOcurrences);
int input_index = 0;
size_t posFound = filename.find(delimiter);
if (posFound != std::string::npos){
size_t prevFound = 0;
while(prevFound != std::string::npos){
if (posFound == std::string::npos){
readFileIntoVector(filename.substr(prevFound, posFound-prevFound), input[input_index]);
prevFound = posFound;
}
else {
readFileIntoVector(filename.substr(prevFound, posFound-prevFound), input[input_index]);
prevFound = posFound + 1;
posFound = filename.find(delimiter, posFound + 1);
}
input_index++;
}
}
else {
readFileIntoVector(filename, input[0]);
}
// Print out first byte from formatter->inputPointer
std::cout << input.size() << " files read" << std::endl;
// Call offloaded algo
std::vector<std::vector<unsigned char> > output;
independent_execute(input, output);
// Post execution entrypoint
independent_post_execute(output);
return 0;
}
| [
"[email protected]"
] | |
d816b188a26fbde223b7c8515374dec05c723951 | 2cf838b54b556987cfc49f42935f8aa7563ea1f4 | /aws-cpp-sdk-codeguruprofiler/include/aws/codeguruprofiler/model/GetNotificationConfigurationResult.h | 57c4b202033db90252f0f76f2c4302a76d351045 | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | QPC-database/aws-sdk-cpp | d11e9f0ff6958c64e793c87a49f1e034813dac32 | 9f83105f7e07fe04380232981ab073c247d6fc85 | refs/heads/main | 2023-06-14T17:41:04.817304 | 2021-07-09T20:28:20 | 2021-07-09T20:28:20 | 384,714,703 | 1 | 0 | Apache-2.0 | 2021-07-10T14:16:41 | 2021-07-10T14:16:41 | null | UTF-8 | C++ | false | false | 2,487 | h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/codeguruprofiler/CodeGuruProfiler_EXPORTS.h>
#include <aws/codeguruprofiler/model/NotificationConfiguration.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace CodeGuruProfiler
{
namespace Model
{
/**
* <p>The structure representing the
* GetNotificationConfigurationResponse.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/codeguruprofiler-2019-07-18/GetNotificationConfigurationResponse">AWS
* API Reference</a></p>
*/
class AWS_CODEGURUPROFILER_API GetNotificationConfigurationResult
{
public:
GetNotificationConfigurationResult();
GetNotificationConfigurationResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetNotificationConfigurationResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The current notification configuration for this profiling group.</p>
*/
inline const NotificationConfiguration& GetNotificationConfiguration() const{ return m_notificationConfiguration; }
/**
* <p>The current notification configuration for this profiling group.</p>
*/
inline void SetNotificationConfiguration(const NotificationConfiguration& value) { m_notificationConfiguration = value; }
/**
* <p>The current notification configuration for this profiling group.</p>
*/
inline void SetNotificationConfiguration(NotificationConfiguration&& value) { m_notificationConfiguration = std::move(value); }
/**
* <p>The current notification configuration for this profiling group.</p>
*/
inline GetNotificationConfigurationResult& WithNotificationConfiguration(const NotificationConfiguration& value) { SetNotificationConfiguration(value); return *this;}
/**
* <p>The current notification configuration for this profiling group.</p>
*/
inline GetNotificationConfigurationResult& WithNotificationConfiguration(NotificationConfiguration&& value) { SetNotificationConfiguration(std::move(value)); return *this;}
private:
NotificationConfiguration m_notificationConfiguration;
};
} // namespace Model
} // namespace CodeGuruProfiler
} // namespace Aws
| [
"[email protected]"
] | |
c9b782acecce2c28e76949dbf014a51c4434705a | 585957053b8dbf7e8a2febef4f828e654cf53dc5 | /src/net/Misc.h | 1c63342f502fe7ba8c0bbfda0e656bc341639217 | [] | no_license | elefant/libmintress | a8e34dc907399028fc27f9244c9482fcee2d80d4 | 7f5ecc1cc95ad42f045faf73c0a943cfcb0553d4 | refs/heads/master | 2021-01-17T08:25:58.776477 | 2016-08-12T02:46:14 | 2016-08-12T02:46:14 | 65,517,734 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 529 | h | #ifndef NET_MISC_H
#define NET_MISC_H
#include <string>
namespace net
{
enum Protocol
{
PROTOCOL_TCP,
PROTOCOL_UDP,
PROTOCOL_HTTP,
PROTOCOL_RTP,
PROTOCOL_RTSP,
PROTOCOL_UNKNOWN,
};
std::string getLocalIp();
std::string encodeUrl
(
const std::string& aUrl
);
std::string decodeUrl
(
const std::string& aUrl
);
Protocol getProtocol
(
const std::string& aUrl
);
}
#endif
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.