blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 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 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
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 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbe0f9bd239e4a87358e8da6f9eb7308744f4d58 | 23ddb434cce3feda32b34f6903d884f42718c084 | /minicurso_arduino/codigosFuente/reto_06_c/reto_06_c.ino | 77e7e45b8ff20ade20efc91c211c23d474b1e2e0 | [] | no_license | pedroruizf/arduino | 54b621fa482ed011b1daef16c97171f036f6e4f3 | dfa087387a3e7bf47ea9299679792f3bf4e95255 | refs/heads/master | 2021-11-09T11:36:50.505432 | 2021-10-28T14:58:12 | 2021-10-28T14:58:12 | 36,158,240 | 5 | 6 | null | null | null | null | UTF-8 | C++ | false | false | 906 | ino | int leds[] = {3, 4, 5};
int n = 0;
int tiempo = 200;
int zumbador = 7;
int pulsador = 2;
void setup () {
for (n = 0; n < 3; n++) {
pinMode(leds[n], OUTPUT);
}
pinMode(zumbador, OUTPUT);
pinMode(pulsador, INPUT);
}
void compruebaacierto() {
if (digitalRead(pulsador) == HIGH && n == 1) {
digitalWrite(zumbador, HIGH);
delay (1000);
digitalWrite(zumbador, LOW);
tiempo = tiempo - 20;
if (tiempo < 10) {
tiempo = 200;
}
}
if (digitalRead(pulsador) == HIGH && n != 1) {
for (n = 0; n < 3; n++) {
digitalWrite(leds[n], HIGH);
}
delay(100);
for (n = 0; n < 3; n++) {
digitalWrite(leds[n], LOW);
}
delay (100);
tiempo = 200;
}
void loop () {
for (n = 0; n < 3; n++) {
digitalWrite(leds[n], HIGH);
delay(tiempo);
compruebaacierto();
digitalWrite(leds[n], LOW);
delay(tiempo);
}
}
| [
"pedroruizf@gmail.com"
] | pedroruizf@gmail.com |
53e57ce5e1fc664363128cbe34299b4b0a283f39 | a3ebb7445087e39b2c9868d1a63e7298fb2c78cc | /src/qt/bitcoingui.cpp | ec18a80069bb41883f42deacf3aa30b22fba47b0 | [
"MIT"
] | permissive | CCPorg/REX-RecyclingCoin-Ver-631-Original | 17e46616f5e5abe440a11b9fe1a5383630e76f3e | 4b4620282685ef82b22c5718eda3454e6c520ea2 | refs/heads/master | 2021-01-02T09:37:17.217339 | 2014-05-19T13:59:28 | 2014-05-19T13:59:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 34,805 | cpp | /*
* Qt4 bitcoin GUI.
*
* W.J. van der Laan 2011-2012
* The Bitcoin Developers 2011-2012
* The Litecoin Developers 2011-2013
* The RecyclingCoin Developers 2013
*/
#include "bitcoingui.h"
#include "transactiontablemodel.h"
#include "addressbookpage.h"
#include "sendcoinsdialog.h"
#include "signverifymessagedialog.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "editaddressdialog.h"
#include "optionsmodel.h"
#include "transactiondescdialog.h"
#include "addresstablemodel.h"
#include "transactionview.h"
#include "overviewpage.h"
#include "miningpage.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "askpassphrasedialog.h"
#include "notificator.h"
#include "guiutil.h"
#include "rpcconsole.h"
#ifdef Q_WS_MAC
#include "macdockiconhandler.h"
#endif
#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QMenu>
#include <QIcon>
#include <QTabWidget>
#include <QVBoxLayout>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QLocale>
#include <QMessageBox>
#include <QProgressBar>
#include <QStackedWidget>
#include <QDateTime>
#include <QMovie>
#include <QFileDialog>
#include <QDesktopServices>
#include <QTimer>
#include <QDragEnterEvent>
#include <QUrl>
#include <iostream>
BitcoinGUI::BitcoinGUI(QWidget *parent):
QMainWindow(parent),
clientModel(0),
walletModel(0),
encryptWalletAction(0),
changePassphraseAction(0),
aboutQtAction(0),
trayIcon(0),
notificator(0),
rpcConsole(0)
{
resize(850, 550);
setWindowTitle(tr("RecyclingCoin") + " - " + tr("Wallet"));
#ifndef Q_WS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin"));
setWindowIcon(QIcon(":icons/bitcoin"));
#else
setUnifiedTitleAndToolBarOnMac(true);
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
createActions();
// Create application menu bar
createMenuBar();
// Create the toolbars
createToolBars();
// Create the tray icon (or setup the dock icon)
createTrayIcon();
// Create tabs
overviewPage = new OverviewPage();
miningPage = new MiningPage(this);
transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
transactionView = new TransactionView(this);
vbox->addWidget(transactionView);
transactionsPage->setLayout(vbox);
addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
sendCoinsPage = new SendCoinsDialog(this);
signVerifyMessageDialog = new SignVerifyMessageDialog(this);
centralWidget = new QStackedWidget(this);
centralWidget->addWidget(overviewPage);
centralWidget->addWidget(miningPage);
centralWidget->addWidget(transactionsPage);
centralWidget->addWidget(addressBookPage);
centralWidget->addWidget(receiveCoinsPage);
centralWidget->addWidget(sendCoinsPage);
#ifdef FIRST_CLASS_MESSAGING
centralWidget->addWidget(signVerifyMessageDialog);
#endif
setCentralWidget(centralWidget);
// Create status bar
statusBar();
// Status bar notification icons
QFrame *frameBlocks = new QFrame();
frameBlocks->setContentsMargins(0,0,0,0);
frameBlocks->setMinimumWidth(73);
frameBlocks->setMaximumWidth(73);
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
frameBlocksLayout->setContentsMargins(3,0,3,0);
frameBlocksLayout->setSpacing(3);
labelEncryptionIcon = new QLabel();
labelMiningIcon = new QLabel();
labelConnectionsIcon = new QLabel();
labelBlocksIcon = new QLabel();
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelEncryptionIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelMiningIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelConnectionsIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelBlocksIcon);
frameBlocksLayout->addStretch();
// Progress bar and label for blocks download
progressBarLabel = new QLabel();
progressBarLabel->setVisible(false);
progressBar = new QProgressBar();
progressBar->setAlignment(Qt::AlignCenter);
progressBar->setVisible(false);
statusBar()->addWidget(progressBarLabel);
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);
syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);
// Clicking on a transaction on the overview page simply sends you to transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
// Doubleclicking on a transaction on the transaction history page shows details
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
rpcConsole = new RPCConsole(this);
connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
// Clicking on "Verify Message" in the address book sends you to the verify message tab
connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
// Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
gotoOverviewPage();
}
BitcoinGUI::~BitcoinGUI()
{
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
trayIcon->hide();
#ifdef Q_WS_MAC
delete appMenuBar;
#endif
}
void BitcoinGUI::createActions()
{
QActionGroup *tabGroup = new QActionGroup(this);
overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this);
overviewAction->setToolTip(tr("Show general overview of wallet"));
overviewAction->setCheckable(true);
overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
tabGroup->addAction(overviewAction);
miningAction = new QAction(QIcon(":/icons/mining"), tr("&Mining"), this);
miningAction->setToolTip(tr("Configure mining"));
miningAction->setCheckable(true);
tabGroup->addAction(miningAction);
historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
historyAction->setToolTip(tr("Browse transaction history"));
historyAction->setCheckable(true);
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(historyAction);
addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels"));
addressBookAction->setCheckable(true);
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction);
receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this);
receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments"));
receiveCoinsAction->setCheckable(true);
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
tabGroup->addAction(receiveCoinsAction);
sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
sendCoinsAction->setToolTip(tr("Send coins to a RecyclingCoin address"));
sendCoinsAction->setCheckable(true);
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
tabGroup->addAction(sendCoinsAction);
signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this);
signMessageAction->setToolTip(tr("Sign a message to prove you own a Bitcoin address"));
tabGroup->addAction(signMessageAction);
verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this);
verifyMessageAction->setToolTip(tr("Verify a message to ensure it was signed with a specified Bitcoin address"));
tabGroup->addAction(verifyMessageAction);
#ifdef FIRST_CLASS_MESSAGING
firstClassMessagingAction = new QAction(QIcon(":/icons/edit"), tr("S&ignatures"), this);
firstClassMessagingAction->setToolTip(signMessageAction->toolTip() + QString(". / ") + verifyMessageAction->toolTip() + QString("."));
firstClassMessagingAction->setCheckable(true);
tabGroup->addAction(firstClassMessagingAction);
#endif
connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
connect(miningAction, SIGNAL(triggered()), this, SLOT(gotoMiningPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab()));
#ifdef FIRST_CLASS_MESSAGING
connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
// Always start with the sign message tab for FIRST_CLASS_MESSAGING
connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));
#endif
quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
quitAction->setToolTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole);
aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About RecyclingCoin"), this);
aboutAction->setToolTip(tr("Show information about RecyclingCoin"));
aboutAction->setMenuRole(QAction::AboutRole);
aboutQtAction = new QAction(tr("About &Qt"), this);
aboutQtAction->setToolTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
optionsAction->setToolTip(tr("Modify configuration options for RecyclingCoin"));
optionsAction->setMenuRole(QAction::PreferencesRole);
toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("Show/Hide &RecyclingCoin"), this);
toggleHideAction->setToolTip(tr("Show or hide the RecyclingCoin window"));
exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this);
exportAction->setToolTip(tr("Export the data in the current tab to a file"));
encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this);
encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet"));
encryptWalletAction->setCheckable(true);
backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this);
backupWalletAction->setToolTip(tr("Backup wallet to another location"));
changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this);
changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this);
openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden()));
connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet()));
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
}
void BitcoinGUI::createMenuBar()
{
#ifdef Q_WS_MAC
// Create a decoupled menu bar on Mac which stays even if the window is closed
appMenuBar = new QMenuBar();
#else
// Get the main window's menu bar on other platforms
appMenuBar = menuBar();
#endif
// Configure the menus
QMenu *file = appMenuBar->addMenu(tr("&File"));
file->addAction(backupWalletAction);
file->addAction(exportAction);
#ifndef FIRST_CLASS_MESSAGING
file->addAction(signMessageAction);
file->addAction(verifyMessageAction);
#endif
file->addSeparator();
file->addAction(quitAction);
QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
settings->addAction(encryptWalletAction);
settings->addAction(changePassphraseAction);
settings->addSeparator();
settings->addAction(optionsAction);
QMenu *help = appMenuBar->addMenu(tr("&Help"));
help->addAction(openRPCConsoleAction);
help->addSeparator();
help->addAction(aboutAction);
help->addAction(aboutQtAction);
}
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(miningAction);
#ifdef FIRST_CLASS_MESSAGING
toolbar->addAction(firstClassMessagingAction);
#endif
QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar2->addAction(exportAction);
}
void BitcoinGUI::setClientModel(ClientModel *clientModel)
{
this->clientModel = clientModel;
if(clientModel)
{
// Replace some strings and icons, when using the testnet
if(clientModel->isTestNet())
{
setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]"));
#ifndef Q_WS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet"));
setWindowIcon(QIcon(":icons/bitcoin_testnet"));
#else
MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
#endif
if(trayIcon)
{
trayIcon->setToolTip(tr("RecyclingCoin client") + QString(" ") + tr("[testnet]"));
trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet"));
}
aboutAction->setIcon(QIcon(":/icons/toolbar_testnet"));
}
// Keep up to date with client
setNumConnections(clientModel->getNumConnections());
connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers());
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
setMining(false, 0);
connect(clientModel, SIGNAL(miningChanged(bool,int)), this, SLOT(setMining(bool,int)));
// Report errors from network/worker thread
connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool)));
rpcConsole->setClientModel(clientModel);
addressBookPage->setOptionsModel(clientModel->getOptionsModel());
receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel());
}
}
void BitcoinGUI::setWalletModel(WalletModel *walletModel)
{
this->walletModel = walletModel;
if(walletModel)
{
// Report errors from wallet thread
connect(walletModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool)));
// Put transaction list in tabs
transactionView->setModel(walletModel);
overviewPage->setModel(walletModel);
addressBookPage->setModel(walletModel->getAddressTableModel());
receiveCoinsPage->setModel(walletModel->getAddressTableModel());
sendCoinsPage->setModel(walletModel);
signVerifyMessageDialog->setModel(walletModel);
miningPage->setModel(clientModel);
setEncryptionStatus(walletModel->getEncryptionStatus());
connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int)));
// Balloon popup for new transaction
connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(incomingTransaction(QModelIndex,int,int)));
// Ask for passphrase if needed
connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
}
}
void BitcoinGUI::createTrayIcon()
{
QMenu *trayIconMenu;
#ifndef Q_WS_MAC
trayIcon = new QSystemTrayIcon(this);
trayIconMenu = new QMenu(this);
trayIcon->setContextMenu(trayIconMenu);
trayIcon->setToolTip(tr("RecyclingCoin client"));
trayIcon->setIcon(QIcon(":/icons/toolbar"));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
trayIcon->show();
#else
// Note: On Mac, the dock icon is used to provide the tray's functionality.
MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
trayIconMenu = dockIconHandler->dockMenu();
#endif
// Configuration of the tray icon (or dock icon) icon menu
trayIconMenu->addAction(toggleHideAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(sendCoinsAction);
trayIconMenu->addAction(receiveCoinsAction);
#ifndef FIRST_CLASS_MESSAGING
trayIconMenu->addSeparator();
#endif
trayIconMenu->addAction(signMessageAction);
trayIconMenu->addAction(verifyMessageAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(optionsAction);
trayIconMenu->addAction(openRPCConsoleAction);
#ifndef Q_WS_MAC // This is built-in on Mac
trayIconMenu->addSeparator();
trayIconMenu->addAction(quitAction);
#endif
notificator = new Notificator(qApp->applicationName(), trayIcon);
}
#ifndef Q_WS_MAC
void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
{
if(reason == QSystemTrayIcon::Trigger)
{
// Click on system tray icon triggers "show/hide RecyclingCoin"
toggleHideAction->trigger();
}
}
#endif
void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
return;
OptionsDialog dlg;
dlg.setModel(clientModel->getOptionsModel());
dlg.exec();
}
void BitcoinGUI::aboutClicked()
{
AboutDialog dlg;
dlg.setModel(clientModel);
dlg.exec();
}
void BitcoinGUI::setNumConnections(int count)
{
QString icon;
switch(count)
{
case 0: icon = ":/icons/connect_0"; break;
case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
default: icon = ":/icons/connect_4"; break;
}
labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelConnectionsIcon->setToolTip(tr("%n active connection(s) to RecyclingCoin network", "", count));
}
void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
{
// don't show / hide progressBar and it's label if we have no connection(s) to the network
if (!clientModel || clientModel->getNumConnections() == 0)
{
progressBarLabel->setVisible(false);
progressBar->setVisible(false);
return;
}
QString tooltip;
if(count < nTotalBlocks)
{
int nRemainingBlocks = nTotalBlocks - count;
float nPercentageDone = count / (nTotalBlocks * 0.01f);
if (clientModel->getStatusBarWarnings() == "")
{
progressBarLabel->setText(tr("Synchronizing with network..."));
progressBarLabel->setVisible(true);
progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks));
progressBar->setMaximum(nTotalBlocks);
progressBar->setValue(count);
progressBar->setVisible(true);
}
else
{
progressBarLabel->setText(clientModel->getStatusBarWarnings());
progressBarLabel->setVisible(true);
progressBar->setVisible(false);
}
tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2);
}
else
{
if (clientModel->getStatusBarWarnings() == "")
progressBarLabel->setVisible(false);
else
{
progressBarLabel->setText(clientModel->getStatusBarWarnings());
progressBarLabel->setVisible(true);
}
progressBar->setVisible(false);
tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count);
}
tooltip = tr("Current difficulty is %1.").arg(clientModel->GetDifficulty()) + QString("<br>") + tooltip;
QDateTime now = QDateTime::currentDateTime();
QDateTime lastBlockDate = clientModel->getLastBlockDate();
int secs = lastBlockDate.secsTo(now);
QString text;
// Represent time from last generated block in human readable text
if(secs <= 0)
{
// Fully up to date. Leave text empty.
}
else if(secs < 60)
{
text = tr("%n second(s) ago","",secs);
}
else if(secs < 60*60)
{
text = tr("%n minute(s) ago","",secs/60);
}
else if(secs < 24*60*60)
{
text = tr("%n hour(s) ago","",secs/(60*60));
}
else
{
text = tr("%n day(s) ago","",secs/(60*60*24));
}
// Set icon state: spinning if catching up, tick otherwise
if(secs < 90*60 && count >= nTotalBlocks)
{
tooltip = tr("Up to date") + QString(".<br>") + tooltip;
labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
overviewPage->showOutOfSyncWarning(false);
}
else
{
tooltip = tr("Catching up...") + QString("<br>") + tooltip;
labelBlocksIcon->setMovie(syncIconMovie);
syncIconMovie->start();
overviewPage->showOutOfSyncWarning(true);
}
if(!text.isEmpty())
{
tooltip += QString("<br>");
tooltip += tr("Last received block was generated %1.").arg(text);
}
// Don't word-wrap this (fixed-width) tooltip
tooltip = QString("<nobr>") + tooltip + QString("</nobr>");
labelBlocksIcon->setToolTip(tooltip);
progressBarLabel->setToolTip(tooltip);
progressBar->setToolTip(tooltip);
}
void BitcoinGUI::setMining(bool mining, int hashrate)
{
if (mining)
{
labelMiningIcon->setPixmap(QIcon(":/icons/mining_active").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelMiningIcon->setToolTip(tr("Mining RecyclingCoins at %1 hashes per second").arg(hashrate));
}
else
{
labelMiningIcon->setPixmap(QIcon(":/icons/mining_inactive").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelMiningIcon->setToolTip(tr("Not mining RecyclingCoins"));
}
}
void BitcoinGUI::error(const QString &title, const QString &message, bool modal)
{
// Report errors from network/worker thread
if(modal)
{
QMessageBox::critical(this, title, message, QMessageBox::Ok, QMessageBox::Ok);
} else {
notificator->notify(Notificator::Critical, title, message);
}
}
void BitcoinGUI::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
#ifndef Q_WS_MAC // Ignored on Mac
if(e->type() == QEvent::WindowStateChange)
{
if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
{
QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
{
QTimer::singleShot(0, this, SLOT(hide()));
e->ignore();
}
}
}
#endif
}
void BitcoinGUI::closeEvent(QCloseEvent *event)
{
if(clientModel)
{
#ifndef Q_WS_MAC // Ignored on Mac
if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
!clientModel->getOptionsModel()->getMinimizeOnClose())
{
qApp->quit();
}
#endif
}
QMainWindow::closeEvent(event);
}
void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
{
QString strMessage =
tr("This transaction is over the size limit. You can still send it for a fee of %1, "
"which goes to the nodes that process your transaction and helps to support the network. "
"Do you want to pay the fee?").arg(
BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired));
QMessageBox::StandardButton retval = QMessageBox::question(
this, tr("Confirm transaction fee"), strMessage,
QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes);
*payFee = (retval == QMessageBox::Yes);
}
void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int end)
{
if(!walletModel || !clientModel)
return;
TransactionTableModel *ttm = walletModel->getTransactionTableModel();
qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent)
.data(Qt::EditRole).toULongLong();
if(!clientModel->inInitialBlockDownload())
{
// On new transaction, make an info balloon
// Unless the initial block download is in progress, to prevent balloon-spam
QString date = ttm->index(start, TransactionTableModel::Date, parent)
.data().toString();
QString type = ttm->index(start, TransactionTableModel::Type, parent)
.data().toString();
QString address = ttm->index(start, TransactionTableModel::ToAddress, parent)
.data().toString();
QIcon icon = qvariant_cast<QIcon>(ttm->index(start,
TransactionTableModel::ToAddress, parent)
.data(Qt::DecorationRole));
notificator->notify(Notificator::Information,
(amount)<0 ? tr("Sent transaction") :
tr("Incoming transaction"),
tr("Date: %1\n"
"Amount: %2\n"
"Type: %3\n"
"Address: %4\n")
.arg(date)
.arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), amount, true))
.arg(type)
.arg(address), icon);
}
}
void BitcoinGUI::gotoOverviewPage()
{
overviewAction->setChecked(true);
centralWidget->setCurrentWidget(overviewPage);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoMiningPage()
{
miningAction->setChecked(true);
centralWidget->setCurrentWidget(miningPage);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoHistoryPage()
{
historyAction->setChecked(true);
centralWidget->setCurrentWidget(transactionsPage);
exportAction->setEnabled(true);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
}
void BitcoinGUI::gotoAddressBookPage()
{
addressBookAction->setChecked(true);
centralWidget->setCurrentWidget(addressBookPage);
exportAction->setEnabled(true);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked()));
}
void BitcoinGUI::gotoReceiveCoinsPage()
{
receiveCoinsAction->setChecked(true);
centralWidget->setCurrentWidget(receiveCoinsPage);
exportAction->setEnabled(true);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
}
void BitcoinGUI::gotoSendCoinsPage()
{
sendCoinsAction->setChecked(true);
centralWidget->setCurrentWidget(sendCoinsPage);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoSignMessageTab(QString addr)
{
#ifdef FIRST_CLASS_MESSAGING
firstClassMessagingAction->setChecked(true);
centralWidget->setCurrentWidget(signVerifyMessageDialog);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
signVerifyMessageDialog->showTab_SM(false);
#else
// call show() in showTab_SM()
signVerifyMessageDialog->showTab_SM(true);
#endif
if(!addr.isEmpty())
signVerifyMessageDialog->setAddress_SM(addr);
}
void BitcoinGUI::gotoVerifyMessageTab(QString addr)
{
#ifdef FIRST_CLASS_MESSAGING
firstClassMessagingAction->setChecked(true);
centralWidget->setCurrentWidget(signVerifyMessageDialog);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
signVerifyMessageDialog->showTab_VM(false);
#else
// call show() in showTab_VM()
signVerifyMessageDialog->showTab_VM(true);
#endif
if(!addr.isEmpty())
signVerifyMessageDialog->setAddress_VM(addr);
}
void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
{
// Accept only URIs
if(event->mimeData()->hasUrls())
event->acceptProposedAction();
}
void BitcoinGUI::dropEvent(QDropEvent *event)
{
if(event->mimeData()->hasUrls())
{
int nValidUrisFound = 0;
QList<QUrl> uris = event->mimeData()->urls();
foreach(const QUrl &uri, uris)
{
if (sendCoinsPage->handleURI(uri.toString()))
nValidUrisFound++;
}
// if valid URIs were found
if (nValidUrisFound)
gotoSendCoinsPage();
else
notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid RecyclingCoin address or malformed URI parameters."));
}
event->acceptProposedAction();
}
void BitcoinGUI::handleURI(QString strURI)
{
// URI has to be valid
if (sendCoinsPage->handleURI(strURI))
{
showNormalIfMinimized();
gotoSendCoinsPage();
}
else
notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid RecyclingCoin address or malformed URI parameters."));
}
void BitcoinGUI::setEncryptionStatus(int status)
{
switch(status)
{
case WalletModel::Unencrypted:
labelEncryptionIcon->hide();
encryptWalletAction->setChecked(false);
changePassphraseAction->setEnabled(false);
encryptWalletAction->setEnabled(true);
break;
case WalletModel::Unlocked:
labelEncryptionIcon->show();
labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
encryptWalletAction->setChecked(true);
changePassphraseAction->setEnabled(true);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
break;
case WalletModel::Locked:
labelEncryptionIcon->show();
labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
encryptWalletAction->setChecked(true);
changePassphraseAction->setEnabled(true);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
break;
}
}
void BitcoinGUI::encryptWallet(bool status)
{
if(!walletModel)
return;
AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt:
AskPassphraseDialog::Decrypt, this);
dlg.setModel(walletModel);
dlg.exec();
setEncryptionStatus(walletModel->getEncryptionStatus());
}
void BitcoinGUI::backupWallet()
{
QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)"));
if(!filename.isEmpty()) {
if(!walletModel->backupWallet(filename)) {
QMessageBox::warning(this, tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location."));
}
}
}
void BitcoinGUI::changePassphrase()
{
AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);
dlg.setModel(walletModel);
dlg.exec();
}
void BitcoinGUI::unlockWallet()
{
if(!walletModel)
return;
// Unlock wallet when requested by wallet model
if(walletModel->getEncryptionStatus() == WalletModel::Locked)
{
AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
dlg.setModel(walletModel);
dlg.exec();
}
}
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
{
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (isHidden())
{
show();
activateWindow();
}
else if (isMinimized())
{
showNormal();
activateWindow();
}
else if (GUIUtil::isObscured(this))
{
raise();
activateWindow();
}
else if(fToggleHidden)
hide();
}
void BitcoinGUI::toggleHidden()
{
showNormalIfMinimized(true);
}
| [
"root@ns236334.ip-192-99-44.net"
] | root@ns236334.ip-192-99-44.net |
db935ca26dd3ea6e0e4a0a49b8ea1ce224505913 | 6a2b4d2299949863c8c7470900353869974ad1b0 | /QLauncher/socket.cpp | 1ec196005691c158450334f5e144c4641e7bca9f | [] | no_license | whwpdn/QLauncher | 94aebb889ed75d764fea63b659d1169552f26378 | fec53d0193edbbeab554268f3cdccc34e64b800b | refs/heads/master | 2020-04-08T06:54:05.314368 | 2014-05-07T09:09:46 | 2014-05-07T09:09:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,667 | cpp | ////////////////////////////////////////////////////////////////////////////////////////
//
// Socket
// Copyright (C) 2000 Thierry Tremblay
//
// http://frogengine.net-connect.net/
//
////////////////////////////////////////////////////////////////////////////////////////
//#include "stdafx.h"
#include "socket.h"
#include "internet.h"
#include <cassert>
////////////////////////////////////////////////////////////////////////////////////////
//
// Automatically link the proper library
//
////////////////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#if WINSOCK_VERSION == 1
#pragma comment( lib, "wsock32" )
#elif WINSOCK_VERSION == 2
#pragma comment( lib, "ws2_32" );
#endif
#endif
////////////////////////////////////////////////////////////////////////////////////////
//
// NetworkAddress - This is an interface to a socket address
//
////////////////////////////////////////////////////////////////////////////////////////
bool NetworkAddress::operator==( const NetworkAddress& other ) const
{
int size = GetSize();
if (size != other.GetSize())
return false;
return memcmp( *this, other, size ) == 0;
}
bool NetworkAddress::operator!=( const NetworkAddress& other ) const
{
int size = GetSize();
if (size != other.GetSize())
return true;
return memcmp(*this, other, size) != 0;
}
////////////////////////////////////////////////////////////////////////////////////////
//
// Socket
//
////////////////////////////////////////////////////////////////////////////////////////
bool Socket::s_bInitialized = false;
Socket::Socket( int iAddressFamily, int type, int protocol ) :
m_socket(INVALID_SOCKET),
m_lastError(0),
m_addressFamily(iAddressFamily),
m_recvTimeout(-1),
m_sendTimeout(-1),
m_pLocalAddress(0),
m_pRemoteAddress(0)//,
//m_pIStream(0),
//m_pOStream(0),
//m_pIOStream(0)
{
if (!s_bInitialized)
{
WSADATA data;
WORD version;
#if WINSOCK_VERSION == 1
version = MAKEWORD(1,1);
#elif WINSOCK_VERSION == 2
version = MAKEWORD(2,2);
#endif
m_lastError = WSAStartup( version, &data );
if (m_lastError == 0)
s_bInitialized = true;
}
if (m_lastError == 0)
{
m_socket = socket( iAddressFamily, type, protocol );
if (m_socket == INVALID_SOCKET)
{
m_lastError = WSAGetLastError();
}
}
}
Socket::Socket( SOCKET socket )
: m_socket(socket),
m_lastError(0),
m_addressFamily(AF_UNSPEC),
m_recvTimeout(-1),
m_sendTimeout(-1),
m_pLocalAddress(0),
m_pRemoteAddress(0)
{
// Discover address family
BYTE address[1024];
int lenAddress = sizeof(address);
if (getsockname( m_socket, (sockaddr*)address, &lenAddress ) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
}
else
{
m_addressFamily = ((SOCKADDR*)address)->sa_family;
}
}
Socket::~Socket()
{
if (m_socket != INVALID_SOCKET)
Close();
if (m_pLocalAddress)
delete m_pLocalAddress;
if (m_pRemoteAddress)
delete m_pRemoteAddress;
}
bool Socket::Accept( Socket** ppSocket, NetworkAddress* pAddress ) const
{
SOCKET socket;
if (pAddress)
{
assert( pAddress->GetFamily() == m_addressFamily );
int size = pAddress->GetSize();
socket = accept( m_socket, *pAddress, &size );
}
else
{
socket = accept( m_socket, 0, 0 );
}
if (socket == INVALID_SOCKET)
{
*ppSocket = 0;
m_lastError = WSAGetLastError();
return false;
}
*ppSocket = new Socket( socket );
return true;
}
bool Socket::Bind( const NetworkAddress& address ) const
{
if (bind( m_socket, address, address.GetSize() ) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
return true;
}
bool Socket::Close()
{
if (closesocket(m_socket) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
m_socket = INVALID_SOCKET;
return true;
}
bool Socket::Connect( const NetworkAddress& address ) const
{
if (connect( m_socket, address, address.GetSize() ) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
return true;
}
NetworkAddress* Socket::CreateAddress() const
{
if (m_addressFamily == AF_INET)
return new InternetAddress();
// Unsupported address family
assert(0);
return 0;
}
/*
std::istream& Socket::GetInputStream()
{
if (m_pIStream==0)
{
m_pIStream = new ISocketStream( *this );
if (m_pOStream)
m_pIStream->tie( m_pOStream );
}
return *m_pIStream;
}
std::ostream& Socket::GetOutputStream()
{
if (m_pOStream==0)
{
m_pOStream = new OSocketStream( *this );
if (m_pIStream)
m_pIStream->tie( m_pOStream );
}
return *m_pOStream;
}
std::iostream& Socket::GetIOStream()
{
if (m_pIOStream==0)
{
m_pIOStream = new IOSocketStream( *this );
}
return *m_pIOStream;
}
*/
const NetworkAddress& Socket::GetLocalAddress() const
{
if (m_pLocalAddress==0)
m_pLocalAddress = CreateAddress();
int lenAddress = m_pLocalAddress->GetSize();
if (getsockname( m_socket, m_pLocalAddress->GetSockAddr(), &lenAddress ) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
}
return *m_pLocalAddress;
}
const NetworkAddress& Socket::GetRemoteAddress() const
{
if (m_pRemoteAddress==0)
m_pRemoteAddress = CreateAddress();
int lenAddress = m_pRemoteAddress->GetSize();
if (getpeername( m_socket, m_pRemoteAddress->GetSockAddr(), &lenAddress ) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
}
return *m_pRemoteAddress;
}
bool Socket::IsExceptionPending( int sec, int usec ) const
{
fd_set fds;
FD_ZERO( &fds );
FD_SET( m_socket, &fds );
timeval tv;
tv.tv_sec = sec;
tv.tv_usec = usec;
int result = select( m_socket+1, 0, 0, &fds, &tv );
if (result == 0 || result == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
return true;
}
long
Socket::GetReadyBytes()
{
unsigned long len = 0;
int r = ::ioctlsocket(m_socket, FIONREAD, & len);
if (r != 0) {
//nvThrow nvIOException("socketAvailableBytes");
m_lastError = WSAGetLastError();
return -1;
}
return len;
}
bool Socket::IsReadReady( int sec, int usec ) const
{
/*
unsigned long len;
int r = ioctlsocket(m_socket, FIONREAD, & len);
if (r < 0) {
// ERROR
}
return len > 0;
*/
fd_set fds;
FD_ZERO( &fds );
FD_SET( m_socket, &fds );
timeval tv;
tv.tv_sec = sec;
tv.tv_usec = usec;
int result = select( m_socket+1, &fds, 0, 0, &tv );
if (result == 0 || result == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
return true;
}
bool Socket::IsWriteReady( int sec, int usec ) const
{
fd_set fds;
FD_ZERO( &fds );
FD_SET( m_socket, &fds );
timeval tv;
tv.tv_sec = sec;
tv.tv_usec = usec;
int result = select( m_socket+1, 0, &fds, 0, &tv );
if (result == 0 || result == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
return true;
}
bool Socket::Listen( int queueSize ) const
{
if (listen( m_socket, queueSize ) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
return true;
}
int Socket::Receive( char* pBuffer, int lenBuffer, int flags ) const
{
if (m_recvTimeout >= 0 && !IsReadReady( m_recvTimeout ))
return 0;
int nbRecv = recv( m_socket, pBuffer, lenBuffer, flags );
if (nbRecv == SOCKET_ERROR)
{
int error = WSAGetLastError();
if (error == WSAEMSGSIZE)
return lenBuffer;
m_lastError = error;
return 0;
}
return nbRecv;
}
int Socket::ReceiveFrom( char* pBuffer, int lenBuffer, NetworkAddress& address, int flags ) const
{
if (m_recvTimeout >= 0 && !IsReadReady( m_recvTimeout ))
return 0;
assert( address.GetFamily() == m_addressFamily );
int addressSize = address.GetSize();
int nbRecv = recvfrom( m_socket, pBuffer, lenBuffer, flags, address, &addressSize );
if (nbRecv == SOCKET_ERROR)
{
int error = WSAGetLastError();
if (error == WSAEMSGSIZE)
return lenBuffer;
m_lastError = error;
return 0;
}
return nbRecv;
}
int Socket::ReceiveFrom( char* pBuffer, int lenBuffer, int flags ) const
{
if (m_recvTimeout >= 0 && !IsReadReady( m_recvTimeout ))
return 0;
//assert( address.GetFamily() == m_addressFamily );
//int addressSize = address.GetSize();
int nbRecv = recvfrom( m_socket, pBuffer, lenBuffer, flags, NULL, NULL);
if (nbRecv == SOCKET_ERROR)
{
int error = WSAGetLastError();
if (error == WSAEMSGSIZE)
return lenBuffer;
m_lastError = error;
return 0;
}
return nbRecv;
}
int Socket::Send( const char* pBuffer, int lenBuffer, int flags ) const
{
if (m_sendTimeout >= 0 && !IsWriteReady( m_sendTimeout ))
return 0;
int nbSent = send( m_socket, pBuffer, lenBuffer, flags );
if (nbSent == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return 0;
}
return nbSent;
}
int Socket::SendTo( const char* pBuffer, int lenBuffer, const NetworkAddress& address, int flags ) const
{
if (m_sendTimeout >= 0 && !IsWriteReady( m_sendTimeout ))
return 0;
int nbSent = sendto( m_socket, pBuffer, lenBuffer, flags, address, address.GetSize() );
if (nbSent == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return 0;
}
return nbSent;
}
bool Socket::SetBlocking( bool bBlocking )
{
ULONG param = bBlocking ? 0 : 1;
if (ioctlsocket( m_socket, FIONBIO, ¶m ) == SOCKET_ERROR)
{
m_lastError = WSAGetLastError();
return false;
}
return true;
}
/*
////////////////////////////////////////////////////////////////////////////////////////
//
// Socket::StreamBuffer
//
////////////////////////////////////////////////////////////////////////////////////////
Socket::StreamBuffer::StreamBuffer( Socket& socket )
: m_socket( socket )
{
char* pBeginInput = m_inputBuffer;
char* pEndInput = m_inputBuffer + sizeof(m_inputBuffer);
setg( pBeginInput, pEndInput, pEndInput );
setp( m_outputBuffer, m_outputBuffer + sizeof(m_outputBuffer) );
}
Socket::StreamBuffer::~StreamBuffer()
{
FlushOutput();
}
int Socket::StreamBuffer::FlushOutput()
{
// Return 0 if nothing to flush or success
// Return EOF if couldnt flush
if (pptr() < pbase())
return 0;
if (!m_socket.Send( pbase(), pptr() - pbase() ))
return EOF;
setp( m_outputBuffer, m_outputBuffer + sizeof(m_outputBuffer) );
return 0;
}
int Socket::StreamBuffer::overflow( int c )
{
if (c == EOF)
return FlushOutput();
*pptr() = c;
pbump(1);
if (c == '\n' || pptr() >= epptr())
{
if (FlushOutput() == EOF)
return EOF;
}
return c;
}
int Socket::StreamBuffer::sync()
{
return FlushOutput();
}
int Socket::StreamBuffer::underflow()
{
if (gptr() < egptr())
return *(unsigned char*)gptr();
int nbRead = m_socket.Receive( m_inputBuffer, sizeof(m_inputBuffer) );
if (nbRead == 0)
return EOF;
setg( eback(), eback(), eback() + nbRead );
return *(unsigned char*)gptr();
}
*/
int Socket::SetOption(int level, int optname, void *optval, int optlen)
{
return setsockopt(m_socket, level, optname, (const char FAR*) optval, optlen);
}
| [
"whwpdn@gmail.com"
] | whwpdn@gmail.com |
4c8f5c2b55224dec0c7073d95152bb8c54cf9379 | 1f423ee086aa545d4cf039d4e48d8a4ea824e857 | /RenderSystems/Vulkan/include/OgreVulkanHardwareBufferCommon.h | c3939ea4c72da74b063e85d32983c964ae590245 | [
"MIT"
] | permissive | yiliu1203/ogre-next | df77dc6a1e03e967dc577830e86c81d3881258ee | d45fda9a65659d26211e0003eb46e06ac7d490d2 | refs/heads/master | 2021-07-13T08:36:33.580335 | 2021-04-01T15:41:41 | 2021-04-01T15:41:41 | 242,904,107 | 1 | 0 | NOASSERTION | 2020-02-25T03:50:46 | 2020-02-25T03:50:45 | null | UTF-8 | C++ | false | false | 3,643 | h | /*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2014 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef _OgreVulkanHardwareBufferCommon_H_
#define _OgreVulkanHardwareBufferCommon_H_
#include "OgreVulkanPrerequisites.h"
#include "OgreHardwareBuffer.h"
#include "Vao/OgreVulkanVaoManager.h"
namespace Ogre
{
namespace v1
{
class _OgreVulkanExport VulkanHardwareBufferCommon
{
private:
VulkanRawBuffer mBuffer;
VulkanDevice *mDevice;
VulkanDiscardBuffer *mDiscardBuffer;
VaoManager *mVaoManager;
StagingBuffer *mStagingBuffer;
uint32 mLastFrameUsed;
uint32 mLastFrameGpuWrote;
public:
VulkanHardwareBufferCommon( size_t sizeBytes, HardwareBuffer::Usage usage, uint16 alignment,
VulkanDiscardBufferManager *discardBufferManager,
VulkanDevice *device );
virtual ~VulkanHardwareBufferCommon();
void _notifyDeviceStalled( void );
/** Returns the actual API buffer, but first sets mLastFrameUsed as we
assume you're calling this function to use the buffer in the GPU.
@param outOffset
Out. Guaranteed to be written. Used by HBU_DISCARDABLE buffers which
need an offset to the internal ring buffer we've allocated.
@return
The MTLBuffer in question.
*/
VkBuffer getBufferName( size_t &outOffset );
VkBuffer getBufferNameForGpuWrite( size_t &outOffset );
/// @see HardwareBuffer.
void *lockImpl( size_t offset, size_t length, HardwareBuffer::LockOptions options,
bool isLocked );
/// @see HardwareBuffer.
void unlockImpl( size_t lockStart, size_t lockSize );
/// @see HardwareBuffer.
void readData( size_t offset, size_t length, void *pDest );
/// @see HardwareBuffer.
void writeData( size_t offset, size_t length, const void *pSource,
bool discardWholeBuffer = false );
/// @see HardwareBuffer.
void copyData( VulkanHardwareBufferCommon *srcBuffer, size_t srcOffset, size_t dstOffset,
size_t length, bool discardWholeBuffer = false );
size_t getSizeBytes( void ) const { return mBuffer.mSize; }
};
}
}
#endif
| [
"dark_sylinc@yahoo.com.ar"
] | dark_sylinc@yahoo.com.ar |
4aeadfa93aaad09b3d9e2317dd585e608736be25 | 8675ec9577e2e2b23d866bb85631989e619a3b55 | /modules/canbus/vehicle/ch/protocol/brake_status__511_test.cc | 86a9878f462267ff15ace5ceeec27cbf9573c340 | [
"Apache-2.0"
] | permissive | AuroAi/apollo | c1e31dca34a7f5a77d8db76a4bd138f0e23ef888 | 9d2b2c76ea2d6448c1e6fead5336b9c273663a84 | refs/heads/master | 2020-07-15T01:34:36.682593 | 2019-08-30T17:47:35 | 2019-08-30T19:24:29 | 205,447,888 | 10 | 4 | Apache-2.0 | 2020-02-13T01:17:01 | 2019-08-30T19:51:27 | C++ | UTF-8 | C++ | false | false | 1,993 | cc | /******************************************************************************
* Copyright 2019 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/canbus/vehicle/ch/protocol/brake_status__511.h"
#include "gtest/gtest.h"
namespace apollo {
namespace canbus {
namespace ch {
class Brakestatus511Test : public ::testing::Test {
public:
virtual void SetUp() {}
};
TEST_F(Brakestatus511Test, General) {
uint8_t data[8] = {0x01, 0x02, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01};
int32_t length = 8;
ChassisDetail cd;
Brakestatus511 brake;
brake.Parse(data, length, &cd);
EXPECT_EQ(data[0], 0b00000001);
EXPECT_EQ(data[1], 0b00000010);
EXPECT_EQ(data[2], 0b00000001);
EXPECT_EQ(data[3], 0b00000000);
EXPECT_EQ(data[4], 0b00000001);
EXPECT_EQ(data[5], 0b00000001);
EXPECT_EQ(data[6], 0b00000000);
EXPECT_EQ(data[7], 0b00000001);
EXPECT_EQ(cd.ch().brake_status__511().brake_pedal_en_sts(), 1);
EXPECT_EQ(cd.ch().brake_status__511().brake_pedal_sts(), 2);
EXPECT_EQ(cd.ch().brake_status__511().brake_err(), 1);
EXPECT_EQ(cd.ch().brake_status__511().emergency_btn_env(), 0);
EXPECT_EQ(cd.ch().brake_status__511().front_bump_env(), 1);
EXPECT_EQ(cd.ch().brake_status__511().back_bump_env(), 1);
EXPECT_EQ(cd.ch().brake_status__511().overspd_env(), 0);
}
} // namespace ch
} // namespace canbus
} // namespace apollo
| [
"qi.stephen.luo@gmail.com"
] | qi.stephen.luo@gmail.com |
6d250c5c5d452005f6a59a10fdad74f56d91a3f9 | 7f098473a0dd401819b4b3d70c83e42433aa10ef | /MSVS/include/GameTextManager.h | 5c12e6135a1f54b0db10b7d1162e6662270b24d4 | [] | no_license | deathmock5/KHE2019 | 90308856ac0b5c7dde00dd05c470ca47769a812b | d437b38494f8915e8b6ceaef24fbcf12eb16c3fc | refs/heads/master | 2020-08-02T16:20:14.517774 | 2019-09-29T13:41:29 | 2019-09-29T13:41:29 | 211,426,523 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 368 | h | #pragma once
#include <string>
//This class retrives and sets text stored in XML files via a key index system.
class GametextManager {
public:
static GametextManager* instance() {
if (!_instance) {
_instance = new GametextManager();
}
return _instance;
}
static std::string getText(const int& index) {
}
private:
static GametextManager* _instance;
}; | [
"deathmock@gmail.com"
] | deathmock@gmail.com |
0c12efb16cd62963baf7e24cfda3ad83ce634519 | 087dbdf976328941ea89f7c6830406dc8e539bb2 | /02 Yellow/Week 03/Lessons/02 Yellow_Week 03_Lesson 04_synonyms.h | 8c980b8ab2f2396648379850ef26a7687874ea2a | [] | no_license | aliaksei-ivanou-by/Coursera_Yandex_c-plus-plus-modern-development | 45ff4e6e02dfa6b9f439174b3a4abf7d55801f6a | f7724dd60fff4c93e12124cfbd5392d8f74006b4 | refs/heads/master | 2023-03-20T10:31:25.555805 | 2021-03-03T18:18:25 | 2021-03-03T18:18:25 | 281,137,199 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 881 | h | // Основы разработки на C++: желтый пояс. Третья неделя
// Заголовочные файлы. Проблема двойного включения
#pragma once
#include <map>
#include <set>
#include <string>
using namespace std;
using Synonyms = map<string, set<string>>;
void AddSynonyms(Synonyms& synonyms, const string& first_word, const string& second_word)
{
// второе слово добавляем в список синонимов первого...
synonyms[second_word].insert(first_word);
// и наоборот
synonyms[first_word].insert(second_word);
}
size_t GetSynonymCount(Synonyms& synonyms, const string& first_word)
{
return synonyms[first_word].size();
}
bool AreSynonyms(Synonyms& synonyms, const string& first_word, const string& second_word)
{
return synonyms[first_word].count(second_word) == 1;
} | [
"aliaksei.ivanou.by@icloud.com"
] | aliaksei.ivanou.by@icloud.com |
4732591f0dc2f1a0324f51f084f0e2c24e19bd75 | 81b759c001522e4823d0e56dfdbc56b221673536 | /main_JSON.cpp | 8358516be64886a0e19d7d815b3995b021e5dfa4 | [] | no_license | elisimmonds/JSON-to-HTML-Parser | f0f27c12a0056d568b34f84aa25a495c1663e52f | b3861d1ad0bebf366adfc9e3ffec674b345bda1c | refs/heads/master | 2016-09-13T15:11:44.965380 | 2016-05-23T21:05:41 | 2016-05-23T21:05:41 | 59,517,883 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,944 | cpp | // Eli Simmonds
// Project 3
// main_JSON.cpp
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <ostream>
#include "JSONDataObject.hpp"
#include "JSONDataItem.hpp"
#include "JSONArray.hpp"
#include "Tracks.hpp"
#include "Artists.hpp"
#include "Albums.hpp"
#include "ArtistImages.hpp"
#include "AlbumImages.hpp"
int main() {
// load the tracks
Tracks *tr = new Tracks();
std::string fileName = "JSON_files/tracks.json";
tr->loadTracksFromFile(fileName);
// load the artists
Artists *ar = new Artists();
std::string artFile = "JSON_files/artists.json";
ar->loadArtistsFromFile(artFile);
// load the albums
Albums *al = new Albums();
std::string albFile = "JSON_files/albums.json";
al->loadAlbumsFromFile(albFile);
al->setTracksForAlbums(tr); // set the tracks for each album
ar->setAlbumsForArtists(al); // set the albums for each artist
al->setAlbumsArtist(ar); // set the artist for each album
// load artist images
ArtistImages *ai = new ArtistImages();
std::string artImFile = "JSON_files/artistImages.json";
ai->loadImagesFromFile(artImFile);
// load album images
AlbumImages *ali = new AlbumImages();
std::string albImFile = "JSON_files/albumImages.json";
ali->loadImagesFromFile(albImFile);
al->setImagesForAlbums(ali); // use all album images to set the images for each album
ar->setImagesForArtists(ai); // set the images for each artist
// ar->print();
std::fstream artistFile ("HTML_templates/artist_template.html"); // open the track file
std::stringstream artBuffer; // create a stream to get the file data
artBuffer << artistFile.rdbuf(); // read the data from the file into the stream
std::string artist_data = artBuffer.str(); // taking data from the stream and making it a string
std::string artist_html = ar->htmlString();
// this creates the artists main page.
int art_idx = artist_data.find("<\% artist_details \%>"); // find the chars track to replace
int title_idx = artist_data.find("<\% artist_name \%>"); // find the chars track to replace
std::string artistOutput = artist_data.replace(art_idx, 20, artist_html); //
std::string artString = "Artists"; // title for the page
artistOutput = artist_data.replace(title_idx, 17, artString); // replace the tempalte info
std::ofstream artistHTML; // create ofstream
artistHTML.open("artists.html"); // open the ofstream with this name
if (!artistHTML.is_open()) // check if open.
std::cout << "error opening artist.html" << std::endl;
artistHTML << artistOutput; // slap the html in there
artistHTML.close(); // close stream
// This section creates the individual album HTML pages.
std::fstream albumFile ("HTML_templates/album_template.html"); // use the template
std::stringstream albBuffer; // create a string stream to find the string
std::ofstream albumHTML; // create ofstream to open a file for html
albBuffer << albumFile.rdbuf(); // read in the template
std::string album_data = albBuffer.str(); // set the data to a string
title_idx = album_data.find("<\% album_name \%>"); // find the chars to replace
int alb_idx = album_data.find("<\% album_details \%>"); // fimd title to replace
for (int i = 0; i < al->numAlbums(); i++) {
std::string albumTitle = al->listOfAlbums()->at(i)->title(); // set current title
std::string album_html = al->listOfAlbums()->at(i)->htmlString(); // set current html
std::string albumOutput = album_data.replace(alb_idx, 20, album_html); //replace with html
albumOutput = album_data.replace(title_idx, 16, albumTitle); // replace with title
std::string fileName = "./html_albums/"; // specify where to drop the file.
fileName += std::to_string(al->listOfAlbums()->at(i)->albumID()); // concatinate with title
fileName += ".html"; // add extrension
albumHTML.open(fileName); // open the new filename
albumHTML << albumOutput; // slap the html in there
albumHTML.close(); // close the stream
album_data = albBuffer.str(); // reset the album data.
}
/* for testing purposes only. Tests the destuctors functionality
std::cout << "trackCount: " << trackRefCount << std::endl;
std::cout << "albumCount: " << albumRefCount << std::endl;
std::cout << "artistCount: " << artRefCount << std::endl;
std::cout << "artistImageCount: " << artImageRefCount << std::endl;
std::cout << "albumImageCount: " << albImageRefCount << std::endl;
std::cout << "Deleting artists" << std::endl;
delete ar;
std::cout << "trackCount: " << trackRefCount << std::endl;
std::cout << "albumCount: " << albumRefCount << std::endl;
std::cout << "artistCount: " << artRefCount << std::endl;
std::cout << "artistImageCount: " << artImageRefCount << std::endl;
std::cout << "albumImageCount: " << albImageRefCount << std::endl;
*/
return 0;
};
| [
"eli.simmonds@gmail.com"
] | eli.simmonds@gmail.com |
419262ca9565d4f1cd9d6e1dbec014e1eee0fada | 679753a2818f33701789453f57240429c62df4ec | /deps/donet/include/bsd/net_bsd.h | be478464664f9f26ebfbe5d70fac303e92c967e7 | [] | no_license | zmyer/Katrina | 39495c38d30d3fe0ce0b926efd4ab97c389e9185 | 4fd5b55a52d2bf8065e1200d97dd3e42f4a824c6 | refs/heads/master | 2021-01-12T03:31:24.392757 | 2017-01-15T14:28:43 | 2017-01-15T14:28:43 | 78,224,205 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 266 | h | //
// Created by StevensChew on 17/1/11.
//
#ifndef KATRINA_NET_BSD_H
#define KATRINA_NET_BSD_H
#include <sys/_types/_int32_t.h>
namespace donet {
typedef int32_t NativeSocket;
typedef struct sockaddr_in NativeSocketAddress;
}
#endif //KATRINA_NET_BSD_H
| [
"zhouwei198732@126.com"
] | zhouwei198732@126.com |
05b5e90dad84c9e14cd1a0f1cc346bccbe84dc34 | e91b16ab1799a614282fb0260ca696ddb6143b16 | /LeetCode/q0032_LongestValidParentheses.cpp | cb88897edd2ffd45906632408fff8470a19b25a4 | [] | no_license | bluesquanium/Algorithm | cde3b561aa05413fcd61fe5ce013fe3e8c122a9c | 9d87cbc4efc5a3382376fc74b82915832659e97b | refs/heads/master | 2022-06-24T10:55:58.011128 | 2022-05-29T09:50:58 | 2022-05-29T09:50:58 | 174,677,803 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,158 | cpp | // '(': 100001, ')': 100002
#define ll int
#define L 100001
#define R 100002
class Solution {
public:
int longestValidParentheses(string s) {
ll ans = 0;
vector<ll> st;
for(ll i =0; i < s.size(); i++) {
if(s[i] == '(') {
st.push_back(L);
}
// ')'
else {
bool check = 0;
ll temp = 0;
while(!st.empty()) {
ll cur = st.back(); st.pop_back();
if(cur == L) {
check= 1;
temp += 2;
break;
} else {
temp += cur;
}
}
ans = max(ans, temp);
if(check) {
if(!st.empty() && st.back() != L) {
temp += st.back();
st.pop_back();
}
st.push_back(temp);
ans = max(ans, temp);
}
}
}
return ans;
}
}; | [
"culater.kwak@samsung.com"
] | culater.kwak@samsung.com |
184baf3ebdc57b4cde5f9249f46ca4c9f0fe3d73 | 4c214a64016cc838700025aebb9fddab1fbacf55 | /Il2Native.Logic/NativeImplementations/System.Private.CoreLib/System/String.cpp | 3405af242b8350e85b7529607c9cff8adb2647be | [
"MIT"
] | permissive | Moxicution/cs2cpp | 73b5fe4a4cdbf1dcec0efcd8cae28ff2d0527664 | d07d3206fb57edb959df8536562909a4d516e359 | refs/heads/master | 2023-07-03T00:57:59.383603 | 2017-08-03T09:05:03 | 2017-08-03T09:05:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,058 | cpp | #include "System.Private.CoreLib.h"
namespace CoreLib { namespace System {
namespace _ = ::CoreLib::System;
// Method : string.String(char*)
void String::_ctor(char16_t* value)
{
throw 3221274624U;
}
// Method : string.String(char*, int, int)
void String::_ctor(char16_t* value, int32_t startIndex, int32_t length)
{
throw 3221274624U;
}
// Method : string.String(sbyte*)
void String::_ctor(int8_t* value)
{
throw 3221274624U;
}
// Method : string.String(sbyte*, int, int)
void String::_ctor(int8_t* value, int32_t startIndex, int32_t length)
{
throw 3221274624U;
}
// Method : string.String(sbyte*, int, int, System.Text.Encoding)
void String::_ctor(int8_t* value, int32_t startIndex, int32_t length, _::Text::Encoding* enc)
{
throw 3221274624U;
}
// Method : string.String(char[], int, int)
void String::_ctor(__array<char16_t>* value, int32_t startIndex, int32_t length)
{
throw 3221274624U;
}
// Method : string.String(char[])
void String::_ctor(__array<char16_t>* value)
{
throw 3221274624U;
}
// Method : string.String(char, int)
void String::_ctor(char16_t c, int32_t count)
{
throw 3221274624U;
}
// Method : string.this[int].get
char16_t String::get_Chars(int32_t index)
{
if (index < 0)
{
throw __new<_::InvalidOperationException>();
}
if (index >= this->m_stringLength)
{
throw __new<_::IndexOutOfRangeException>();
}
return ((char16_t*)&this->_firstChar)[index];
}
// Method : string.Length.get
int32_t String::get_Length()
{
return this->m_stringLength;
}
// Method : string.FastAllocateString(int)
string* String::FastAllocateString(int32_t length)
{
auto size = sizeof(string) + (length + 1) * sizeof(char16_t);
#ifdef NDEBUG
auto str = new ((size_t)size) string;
#else
auto str = new ((size_t)size, __FILE__, __LINE__) string;
#endif
str->m_stringLength = length;
return str;
}
// Method : string.IsFastSort()
bool String::IsFastSort()
{
throw 3221274624U;
}
// Method : string.IsAscii()
bool String::IsAscii()
{
throw 3221274624U;
}
// Method : string.SetTrailByte(byte)
void String::SetTrailByte(uint8_t data)
{
throw 3221274624U;
}
// Method : string.TryGetTrailByte(out byte)
bool String::TryGetTrailByte_Out(uint8_t& data)
{
throw 3221274624U;
}
// Method : string.CompareOrdinalHelper(string, int, int, string, int, int)
int32_t String::CompareOrdinalHelper(string* strA, int32_t indexA, int32_t countA, string* strB, int32_t indexB, int32_t countB)
{
throw 3221274624U;
}
// Method : string.nativeCompareOrdinalIgnoreCaseWC(string, sbyte*)
int32_t String::nativeCompareOrdinalIgnoreCaseWC(string* strA, int8_t* strBBytes)
{
throw 3221274624U;
}
// Method : string.InternalMarvin32HashString(string, int, long)
int32_t String::InternalMarvin32HashString(string* s, int32_t strLen, int64_t additionalEntropy)
{
throw 3221274624U;
}
// Method : string.InternalUseRandomizedHashing()
bool String::InternalUseRandomizedHashing()
{
return false;
}
// Method : string.ReplaceInternal(string, string)
string* String::ReplaceInternal(string* oldValue, string* newValue)
{
throw 3221274624U;
}
// Method : string.IndexOfAny(char[], int, int)
int32_t String::IndexOfAny(__array<char16_t>* anyOf, int32_t startIndex, int32_t count)
{
throw 3221274624U;
}
// Method : string.LastIndexOfAny(char[], int, int)
int32_t String::LastIndexOfAny(__array<char16_t>* anyOf, int32_t startIndex, int32_t count)
{
throw 3221274624U;
}
}}
namespace CoreLib { namespace System {
namespace _ = ::CoreLib::System;
}}
| [
"oleksandr.duzhar@netplaytv.com"
] | oleksandr.duzhar@netplaytv.com |
3336619abb0f5d480f48faea03423e37dfbb1d9e | ee03828b086648064e6ec1f50c3233045b3ea422 | /Win32Project3/fade.cpp | 2f80f1b7981599f7fed8867499cab6e29c881f53 | [] | no_license | MandaiRyuta/StrayForest | d2779881e586b57174e3ff3b618fc9f47d768a40 | b63a71b5d1a882e72e6afaeb05d96e8eeb731d1a | refs/heads/master | 2020-04-19T09:36:39.370475 | 2019-01-29T08:23:54 | 2019-01-29T08:23:54 | 168,116,119 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 4,526 | cpp | #include "fade.h"
void Fade::Init()
{
FadeSet_ = 0;
FadeIn = 255;
FadeOut = 0;
}
void Fade::Uninit()
{
}
void Fade::Draw()
{
switch (FadeSet_)
{
case 0:
BlackFadeIn();
break;
case 1:
BlackFadeOut();
break;
case 2:
WhiteFadeIn();
break;
case 3:
WhiteFadeOut();
break;
case 4:
break;
default:
break;
}
}
void Fade::Update()
{
}
void Fade::BlackFadeIn()
{
LPDIRECT3DDEVICE9 pDevice = GetDevice();
//クリッピング空間ちょうどのサイズでクアッドを作ればいい(スクリーンクアッド)
//透明度を時間と共に増減する
if (FadeIn > 0)
{
FadeIn--;
}
FADE_VERTEX vPoint[] =
{
-1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeIn,0,0,0),//頂点0
1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeIn,0,0,0),//頂点1
-1.0,-1.0,0.0,D3DCOLOR_ARGB(FadeIn,0,0,0),//頂点2
1.0,-1.0,0.0 , D3DCOLOR_ARGB(FadeIn,0,0,0), //頂点3
};
//3D変換は全て無効にしていい(しないとダメ)
D3DXMATRIX mat;
D3DXMatrixIdentity(&mat);
pDevice->SetTransform(D3DTS_WORLD, &mat);
pDevice->SetTransform(D3DTS_VIEW, &mat);
pDevice->SetTransform(D3DTS_PROJECTION, &mat);
//スクリーンクアッド描画
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE);
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vPoint, sizeof(FADE_VERTEX));
}
void Fade::BlackFadeOut()
{
LPDIRECT3DDEVICE9 pDevice = GetDevice();
//クリッピング空間ちょうどのサイズでクアッドを作ればいい(スクリーンクアッド)
//透明度を時間と共に増減する
if (FadeOut < 255)
{
FadeOut++;
}
FADE_VERTEX vPoint[] =
{
-1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeOut,0,0,0),//頂点0
1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeOut,0,0,0),//頂点1
-1.0,-1.0,0.0,D3DCOLOR_ARGB(FadeOut,0,0,0),//頂点2
1.0,-1.0,0.0 , D3DCOLOR_ARGB(FadeOut,0,0,0), //頂点3
};
//3D変換は全て無効にしていい(しないとダメ)
D3DXMATRIX mat;
D3DXMatrixIdentity(&mat);
pDevice->SetTransform(D3DTS_WORLD, &mat);
pDevice->SetTransform(D3DTS_VIEW, &mat);
pDevice->SetTransform(D3DTS_PROJECTION, &mat);
//スクリーンクアッド描画
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE);
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vPoint, sizeof(FADE_VERTEX));
}
void Fade::WhiteFadeIn()
{
LPDIRECT3DDEVICE9 pDevice = GetDevice();
//クリッピング空間ちょうどのサイズでクアッドを作ればいい(スクリーンクアッド)
//透明度を時間と共に増減する
if (FadeIn > 0)
{
FadeIn--;
}
FADE_VERTEX vPoint[] =
{
-1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeIn,255,255,255),//頂点0
1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeIn,255,255,255),//頂点1
-1.0,-1.0,0.0,D3DCOLOR_ARGB(FadeIn,255,255,255),//頂点2
1.0,-1.0,0.0 , D3DCOLOR_ARGB(FadeIn,255,255,255), //頂点3
};
//3D変換は全て無効にしていい(しないとダメ)
D3DXMATRIX mat;
D3DXMatrixIdentity(&mat);
pDevice->SetTransform(D3DTS_WORLD, &mat);
pDevice->SetTransform(D3DTS_VIEW, &mat);
pDevice->SetTransform(D3DTS_PROJECTION, &mat);
//スクリーンクアッド描画
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE);
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vPoint, sizeof(FADE_VERTEX));
}
void Fade::WhiteFadeOut()
{
LPDIRECT3DDEVICE9 pDevice = GetDevice();
//クリッピング空間ちょうどのサイズでクアッドを作ればいい(スクリーンクアッド)
//透明度を時間と共に増減する
if (FadeOut < 255)
{
FadeOut++;
}
FADE_VERTEX vPoint[] =
{
-1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeOut,255,255,255),//頂点0
1.0,1.0,0.0 , D3DCOLOR_ARGB(FadeOut,255,255,255),//頂点1
-1.0,-1.0,0.0,D3DCOLOR_ARGB(FadeOut,255,255,255),//頂点2
1.0,-1.0,0.0 , D3DCOLOR_ARGB(FadeOut,255,255,255), //頂点3
};
//3D変換は全て無効にしていい(しないとダメ)
D3DXMATRIX mat;
D3DXMatrixIdentity(&mat);
pDevice->SetTransform(D3DTS_WORLD, &mat);
pDevice->SetTransform(D3DTS_VIEW, &mat);
pDevice->SetTransform(D3DTS_PROJECTION, &mat);
//スクリーンクアッド描画
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE);
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, vPoint, sizeof(FADE_VERTEX));
}
void Fade::FadeSetNumber(int fade)
{
FadeSet_ = fade;
}
Fade * Fade::Create()
{
Fade* CreateFade = new Fade();
CreateFade->Init();
return CreateFade;
}
| [
"Mandai1990@outlook.jp"
] | Mandai1990@outlook.jp |
249e6eaee0d0ad6264bd92bc5078ec7aa38162d3 | e79cc11c4fa65ae83f9a0a83a88b42307ec0e276 | /Ancien ubuntu/tp7C++/main.cpp | ae769c090d1061eb29443992d046e432cb75815b | [] | no_license | Rob-Mat94/Compilateur-C | 89a1bb482a736a6ddb603ae30839be3d30023c29 | 645512072783ea403f1e37dc00ea6fca982e07ee | refs/heads/master | 2023-05-31T14:51:05.520352 | 2021-07-04T10:24:53 | 2021-07-04T10:24:53 | 382,822,321 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,703 | cpp | #include <stdio.h>
#include <iostream>
#include "Image.hpp"
#include "Ligne.hpp"
#include "Cercle.hpp"
#include "Filtrage.hpp"
void testPoint(void);
void testCercle(void);
void testLigne(void);
void testImage(void);
int main(void)
{
/* testPoint();
testLigne();
testCercle();
testImage();
*/
Filtrage::essai();
return 0;
}
void testPoint(void)
{
Point x;
Point y(10, 20);
cout << x << y << endl;
Point z = x + y;
cout << z << endl;
z += y;
cout << z << endl;
}
void testLigne(void)
{
Ligne l1(Point(10, 20), Point(16, 30));
l1.dessiner();
cout << "Translation(5,8)" << endl;
l1.deplacer(Point(5,8));
l1.dessiner();
}
void testCercle(void)
{
Cercle c1(Point(10, 20), 22);
c1.dessiner();
cout << "Translation(5,8)" << endl;
c1.deplacer(Point(5,8));
c1.dessiner();
}
void testImage(void)
{
Ligne l1(Point(10, 20), Point(16, 30));
Cercle c1 ( Point (10, 20), 22 );
Image i1;
cout << "image no 1 = ligne no 1 + cercle n� 1" << endl;
i1.ajouter(l1);
i1.ajouter(c1);
i1.dessiner();
cout << "Translation(40,50)" << endl;
l1.deplacer(Point(40, 50));
i1.dessiner();
cout << "image no 1 += image no 1" << endl;
i1.ajouter(i1);
i1.dessiner();
cout << "Translation(11,13)" << endl;
c1.deplacer(Point(11, 13));
i1.dessiner();
cout << "Translation(15,40)" << endl;
i1.deplacer(Point(15, 40));
i1.dessiner();
Image i2;
cout << "image no 2 = image no 1 + ligne no 1" << endl;
i2.ajouter(i1);
i2.ajouter(l1);
i2.dessiner();
cout << "Translation(150,400)" << endl;
i2.deplacer(Point(150, 400));
i2.dessiner();
Image i3;
cout << "image no 2 = image no 1 + ligne no 1" << endl;
i3.ajouter(i1);
i3.ajouter(i2);
i3.dessiner();
}
| [
"robin.matheus@etu.u-pec.fr"
] | robin.matheus@etu.u-pec.fr |
7c684c9feecece7a14c74ab76f73d0c164f930b8 | 07a8c4f3e79df3cbf4d10a1338e27068bc3a7e2a | /include/MRDSubEventClass.hh | 14b488c2420d46b0dc78f8b27b1cd80a3324594c | [] | no_license | sjgardiner/MrdTrackLib | 6d75dfcb228fca03f1a4b9a281bc963cdc8341d1 | 97435e4f125550be85ced137175f82fc00509597 | refs/heads/master | 2020-03-12T02:40:06.181531 | 2018-04-20T19:58:53 | 2018-04-20T19:58:53 | 130,408,279 | 0 | 0 | null | 2018-04-20T19:59:28 | 2018-04-20T19:59:28 | null | UTF-8 | C++ | false | false | 5,913 | hh | /* vim:set noexpandtab tabstop=4 wrap */
#ifndef _MRDSubEvent_Class_
#define _MRDSubEvent_Class_
#include "TObject.h"
#include <vector>
class mrdcell;
class cMRDTrack;
class TCanvas;
class TBox;
class TVector3;
class TLorentzVector;
class TText;
class TLine;
class TArrow;
class TColor;
class cMRDSubEvent : public TObject { // TObject inheritance is required to put in TClonesArray
// Private members
// ===============
private:
Int_t mrdsubevent_id; // ID of this track within the trigger
// Raw Info:
std::string wcsimfile; // which wcsim file this was in
Int_t run_id; // which run this file was in FIXME is same as mrdsubevent_id
Int_t event_id; // which event this track was in
Int_t trigger; // which (sub)trigger this track was in FIXME loads -1s/1's, no 0s
std::vector<Int_t> digi_ids; // vector of digi ids: GetCherenkovDigiHits()->At(digi_ids.at(i))
std::vector<Int_t> pmts_hit; // vector of PMT IDs hit
std::vector<Double_t> digi_qs; // vector of digit charges
std::vector<Double_t> digi_ts; // vector of digit times
std::vector<Int_t> digi_numphots; // number of true photons for each digit
std::vector<Double_t> digi_phot_ts; // true hit times of photons in a digit FIXME some up to -2000???
std::vector<Int_t> digi_phot_parents; // wcsim track IDs of parents that provided photons for a digit
// std::vector<WCSimRootCherenkovDigiHit> digits;
// std::vector<WCSimRootTrack> truetracks; // nice but depends on WCSim classes
std::vector<std::pair<TVector3,TVector3>> truetrackvertices; // start and endpoints.
std::vector<Int_t> truetrackpdgs; //
// XXX FIXME XXX we could also use digi_phot_parents to sort hits in a track by their parent for truth comp!
// Calculated/Reconstructed Info
std::vector<cMRDTrack> tracksthissubevent; // tracks created this SubEvent
std::vector<Int_t> layers_hit; // vector of layers hit TODO currently empty
std::vector<Double_t> eDepsInLayers; // fixed len vector of energy deposition in each layer TODO
// Involved in drawing
std::pair<double, double> xupcorner1, xupcorner2, xdowncorner1, xdowncorner2, yupcorner1, yupcorner2, ydowncorner1, ydowncorner2; // TODO remove me, probably can just be defined in makemrdimage.cxx
std::vector<TArrow*> trackfitarrows; //! stores TLines which are associated with track boundaries
std::vector<TArrow*> trackarrows; //! stores TArrows associated with CA reconstructed tracks
std::vector<TArrow*> truetrackarrows; //! stores TArrows associated with true tracks
public:
// SubEvent Level Getters
// ======================
// Locate the subevent in file>run>event>trigger hierarchy
Int_t GetSubEventID();
std::string GetFile();
Int_t GetRunID();
Int_t GetEventID();
Int_t GetTrigger();
// Top level information about the subevent
Int_t GetNumDigits();
Int_t GetNumLayersHit();
Int_t GetNumPMTsHit();
std::vector<Int_t> GetDigitIds();
std::vector<Double_t> GetDigitQs();
std::vector<Double_t> GetDigitTs();
std::vector<Int_t> GetDigiNumPhots();
std::vector<Double_t> GetDigiPhotTs();
std::vector<Int_t> GetDigiPhotParents();
std::vector<Int_t> GetLayersHit();
std::vector<Int_t> GetPMTsHit();
std::vector<std::pair<TVector3,TVector3>> GetTrueTrackVertices();
std::vector<Int_t> GetTrueTrackPdgs();
// Reconstructed Variables
std::vector<cMRDTrack>* GetTracks();
std::vector<Double_t> GetEdeps();
std::vector<TArrow*> GetTrackArrows();
std::vector<TArrow*> GetTrueTrackArrows();
std::vector<TArrow*> GetTrackFitArrows();
void Print(); // print the subevent info.
// Functions to do reconstruction
// ==============================
private:
// Main track reconstruction code. Groups paddles in a line into a MRDTrack
void DoReconstruction(bool printtracks, bool drawcells, bool drawfit);
// Used within DoReconstruction
void LeastSquaresMinimizer(Int_t numdatapoints, Double_t datapointxs[], Double_t datapointys[], Double_t datapointweights[], Double_t errorys[], Double_t &fit_gradient, Double_t &fit_offset, Double_t &chi2);
bool BridgeSearch(const std::vector<mrdcell*> &tracktotest, const std::vector<std::pair<int,int> > &matchedtracks, const std::vector<std::vector<mrdcell*> > &allpaddletracks, const std::string horv);
bool SearchForClusterInTracks(const std::vector<std::pair<int,int> > &matchedtracks, const std::vector<std::vector<mrdcell*> > &allpaddletracks, const std::vector<mrdcell*> tracktotest, const std::string horv);
void FillStaticMembers();
// Default Constructor
// ====================
public:
// Default constructor that initialises all private members required for ROOT classes
cMRDSubEvent();
// destructor
~cMRDSubEvent();
// Actual Constructor
// ==================
cMRDSubEvent(Int_t mrdsubevent_idin, std::string wcsimefilein, Int_t runidin, Int_t eventidin,
Int_t triggerin, std::vector<Int_t> digitidsin, std::vector<Int_t> digittubesin, std::vector<Double_t>
digitqsin, std::vector<Double_t> digittimesin, std::vector<Int_t> digitnumphotsin, std::vector<Double_t>
digitstruetimesin, std::vector<Int_t> digitsparentsin, std::vector<std::pair<TVector3,TVector3>>
truetrackverticesin, std::vector<Int_t> truetrackpdgsin);
// Drawing
// =======
void DrawMrdCanvases();
void DrawTrueTracks();
void DrawTracks();
static Bool_t fillstaticmembers;
static TCanvas* imgcanvas;
static TText* titleleft;
static TText* titleright;
static std::vector<TBox*> paddlepointers;
void ComputePaddleTransformation (const Int_t copyNo, TVector3 &origin, Bool_t &ishpaddle);
static std::vector<Int_t> aspectrumv;
static std::vector<std::string> colorhexes;
static std::vector<EColor> trackcolours;
void RemoveArrows();
// Required by ROOT
// ================
void Clear();
// End class definition
// ====================
ClassDef(cMRDSubEvent,1); // INCREMENT VERSION NUM EVERY TIME CLASS MEMBERS CHANGE
};
#endif
| [
"moflaher@fnal.gov"
] | moflaher@fnal.gov |
2e3cad2c444e161609e9576b7fed792999ed3fd7 | 8a9eee34d495195c6a8d57e1e51fbe06f84eb70e | /Include/dxgi.h | fafb161aa8e523f340fb743a1b5d5d31a5c13d32 | [] | no_license | wirlsawyer/SYWlan | 1558249e14d33c6c33743cc7036d0c094d96ffb9 | 8ba461b5ec19e0158c17ae1090abf6adb2287e08 | refs/heads/master | 2021-05-04T07:04:20.258767 | 2016-10-11T06:26:16 | 2016-10-11T06:26:16 | 70,550,473 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 55,086 | h |
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0499 */
/* Compiler settings for dxgi.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __dxgi_h__
#define __dxgi_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IDXGIObject_FWD_DEFINED__
#define __IDXGIObject_FWD_DEFINED__
typedef interface IDXGIObject IDXGIObject;
#endif /* __IDXGIObject_FWD_DEFINED__ */
#ifndef __IDXGIDeviceSubObject_FWD_DEFINED__
#define __IDXGIDeviceSubObject_FWD_DEFINED__
typedef interface IDXGIDeviceSubObject IDXGIDeviceSubObject;
#endif /* __IDXGIDeviceSubObject_FWD_DEFINED__ */
#ifndef __IDXGIResource_FWD_DEFINED__
#define __IDXGIResource_FWD_DEFINED__
typedef interface IDXGIResource IDXGIResource;
#endif /* __IDXGIResource_FWD_DEFINED__ */
#ifndef __IDXGISurface_FWD_DEFINED__
#define __IDXGISurface_FWD_DEFINED__
typedef interface IDXGISurface IDXGISurface;
#endif /* __IDXGISurface_FWD_DEFINED__ */
#ifndef __IDXGIAdapter_FWD_DEFINED__
#define __IDXGIAdapter_FWD_DEFINED__
typedef interface IDXGIAdapter IDXGIAdapter;
#endif /* __IDXGIAdapter_FWD_DEFINED__ */
#ifndef __IDXGIOutput_FWD_DEFINED__
#define __IDXGIOutput_FWD_DEFINED__
typedef interface IDXGIOutput IDXGIOutput;
#endif /* __IDXGIOutput_FWD_DEFINED__ */
#ifndef __IDXGISwapChain_FWD_DEFINED__
#define __IDXGISwapChain_FWD_DEFINED__
typedef interface IDXGISwapChain IDXGISwapChain;
#endif /* __IDXGISwapChain_FWD_DEFINED__ */
#ifndef __IDXGIFactory_FWD_DEFINED__
#define __IDXGIFactory_FWD_DEFINED__
typedef interface IDXGIFactory IDXGIFactory;
#endif /* __IDXGIFactory_FWD_DEFINED__ */
#ifndef __IDXGIDevice_FWD_DEFINED__
#define __IDXGIDevice_FWD_DEFINED__
typedef interface IDXGIDevice IDXGIDevice;
#endif /* __IDXGIDevice_FWD_DEFINED__ */
/* header files for imported files */
#include "dxgitype.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_dxgi_0000_0000 */
/* [local] */
#define DXGI_CPU_ACCESS_NONE ( 0 )
#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
#define DXGI_CPU_ACCESS_FIELD 15
#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) )
#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) )
#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) )
#define DXGI_USAGE_SHARED ( 1L << (3 + 4) )
#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) )
typedef UINT DXGI_USAGE;
typedef struct DXGI_FRAME_STATISTICS
{
UINT PresentCount;
UINT PresentRefreshCount;
UINT SyncRefreshCount;
LARGE_INTEGER SyncQPCTime;
LARGE_INTEGER SyncGPUTime;
} DXGI_FRAME_STATISTICS;
typedef struct DXGI_MAPPED_RECT
{
INT Pitch;
BYTE *pBits;
} DXGI_MAPPED_RECT;
#ifdef __midl
typedef struct _LUID
{
DWORD LowPart;
LONG HighPart;
} LUID;
typedef struct _LUID *PLUID;
#endif
typedef struct DXGI_ADAPTER_DESC
{
WCHAR Description[ 128 ];
UINT VendorId;
UINT DeviceId;
UINT SubSysId;
UINT Revision;
SIZE_T DedicatedVideoMemory;
SIZE_T DedicatedSystemMemory;
SIZE_T SharedSystemMemory;
LUID AdapterLuid;
} DXGI_ADAPTER_DESC;
#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)
#define HMONITOR_DECLARED
#if 0
typedef HANDLE HMONITOR;
#endif
DECLARE_HANDLE(HMONITOR);
#endif
typedef struct DXGI_OUTPUT_DESC
{
WCHAR DeviceName[ 32 ];
RECT DesktopCoordinates;
BOOL AttachedToDesktop;
DXGI_MODE_ROTATION Rotation;
HMONITOR Monitor;
} DXGI_OUTPUT_DESC;
typedef struct DXGI_SHARED_RESOURCE
{
HANDLE Handle;
} DXGI_SHARED_RESOURCE;
#define DXGI_RESOURCE_PRIORITY_MINIMUM ( 0x28000000 )
#define DXGI_RESOURCE_PRIORITY_LOW ( 0x50000000 )
#define DXGI_RESOURCE_PRIORITY_NORMAL ( 0x78000000 )
#define DXGI_RESOURCE_PRIORITY_HIGH ( 0xa0000000 )
#define DXGI_RESOURCE_PRIORITY_MAXIMUM ( 0xc8000000 )
typedef
enum DXGI_RESIDENCY
{ DXGI_RESIDENCY_FULLY_RESIDENT = 1,
DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
DXGI_RESIDENCY_EVICTED_TO_DISK = 3
} DXGI_RESIDENCY;
typedef struct DXGI_SURFACE_DESC
{
UINT Width;
UINT Height;
DXGI_FORMAT Format;
DXGI_SAMPLE_DESC SampleDesc;
} DXGI_SURFACE_DESC;
typedef
enum DXGI_SWAP_EFFECT
{ DXGI_SWAP_EFFECT_DISCARD = 0,
DXGI_SWAP_EFFECT_SEQUENTIAL = 1
} DXGI_SWAP_EFFECT;
typedef
enum DXGI_SWAP_CHAIN_FLAG
{ DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2
} DXGI_SWAP_CHAIN_FLAG;
typedef struct DXGI_SWAP_CHAIN_DESC
{
DXGI_MODE_DESC BufferDesc;
DXGI_SAMPLE_DESC SampleDesc;
DXGI_USAGE BufferUsage;
UINT BufferCount;
HWND OutputWindow;
BOOL Windowed;
DXGI_SWAP_EFFECT SwapEffect;
UINT Flags;
} DXGI_SWAP_CHAIN_DESC;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0000_v0_0_s_ifspec;
#ifndef __IDXGIObject_INTERFACE_DEFINED__
#define __IDXGIObject_INTERFACE_DEFINED__
/* interface IDXGIObject */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIObject;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("aec22fb8-76f3-4639-9be0-28eb43a67a2e")
IDXGIObject : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE GetParent(
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent) = 0;
};
#else /* C style interface */
typedef struct IDXGIObjectVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIObject * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIObject * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIObject * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIObject * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIObject * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIObject * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIObject * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
END_INTERFACE
} IDXGIObjectVtbl;
interface IDXGIObject
{
CONST_VTBL struct IDXGIObjectVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIObject_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIObject_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIObject_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIObject_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIObject_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIObject_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIObject_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIObject_INTERFACE_DEFINED__ */
#ifndef __IDXGIDeviceSubObject_INTERFACE_DEFINED__
#define __IDXGIDeviceSubObject_INTERFACE_DEFINED__
/* interface IDXGIDeviceSubObject */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIDeviceSubObject;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3d3e0379-f9de-4d58-bb6c-18d62992f1a6")
IDXGIDeviceSubObject : public IDXGIObject
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDevice(
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppDevice) = 0;
};
#else /* C style interface */
typedef struct IDXGIDeviceSubObjectVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIDeviceSubObject * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIDeviceSubObject * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIDeviceSubObject * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIDeviceSubObject * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIDeviceSubObject * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDeviceSubObject * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIDeviceSubObject * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGIDeviceSubObject * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppDevice);
END_INTERFACE
} IDXGIDeviceSubObjectVtbl;
interface IDXGIDeviceSubObject
{
CONST_VTBL struct IDXGIDeviceSubObjectVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIDeviceSubObject_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIDeviceSubObject_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIDeviceSubObject_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIDeviceSubObject_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIDeviceSubObject_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIDeviceSubObject_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIDeviceSubObject_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIDeviceSubObject_GetDevice(This,riid,ppDevice) \
( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIDeviceSubObject_INTERFACE_DEFINED__ */
#ifndef __IDXGIResource_INTERFACE_DEFINED__
#define __IDXGIResource_INTERFACE_DEFINED__
/* interface IDXGIResource */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIResource;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("035f3ab4-482e-4e50-b41f-8a7f8bd8960b")
IDXGIResource : public IDXGIDeviceSubObject
{
public:
virtual HRESULT STDMETHODCALLTYPE GetSharedHandle(
/* [out] */ HANDLE *pSharedHandle) = 0;
virtual HRESULT STDMETHODCALLTYPE GetUsage(
/* [out] */ DXGI_USAGE *pUsage) = 0;
virtual HRESULT STDMETHODCALLTYPE SetEvictionPriority(
/* [in] */ UINT EvictionPriority) = 0;
virtual HRESULT STDMETHODCALLTYPE GetEvictionPriority(
/* [retval][out] */ UINT *pEvictionPriority) = 0;
};
#else /* C style interface */
typedef struct IDXGIResourceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIResource * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIResource * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIResource * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIResource * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIResource * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIResource * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIResource * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGIResource * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetSharedHandle )(
IDXGIResource * This,
/* [out] */ HANDLE *pSharedHandle);
HRESULT ( STDMETHODCALLTYPE *GetUsage )(
IDXGIResource * This,
/* [out] */ DXGI_USAGE *pUsage);
HRESULT ( STDMETHODCALLTYPE *SetEvictionPriority )(
IDXGIResource * This,
/* [in] */ UINT EvictionPriority);
HRESULT ( STDMETHODCALLTYPE *GetEvictionPriority )(
IDXGIResource * This,
/* [retval][out] */ UINT *pEvictionPriority);
END_INTERFACE
} IDXGIResourceVtbl;
interface IDXGIResource
{
CONST_VTBL struct IDXGIResourceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIResource_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIResource_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIResource_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIResource_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIResource_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIResource_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIResource_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIResource_GetDevice(This,riid,ppDevice) \
( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
#define IDXGIResource_GetSharedHandle(This,pSharedHandle) \
( (This)->lpVtbl -> GetSharedHandle(This,pSharedHandle) )
#define IDXGIResource_GetUsage(This,pUsage) \
( (This)->lpVtbl -> GetUsage(This,pUsage) )
#define IDXGIResource_SetEvictionPriority(This,EvictionPriority) \
( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) )
#define IDXGIResource_GetEvictionPriority(This,pEvictionPriority) \
( (This)->lpVtbl -> GetEvictionPriority(This,pEvictionPriority) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIResource_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi_0000_0003 */
/* [local] */
#define DXGI_MAP_READ ( 1UL )
#define DXGI_MAP_WRITE ( 2UL )
#define DXGI_MAP_DISCARD ( 4UL )
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0003_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0003_v0_0_s_ifspec;
#ifndef __IDXGISurface_INTERFACE_DEFINED__
#define __IDXGISurface_INTERFACE_DEFINED__
/* interface IDXGISurface */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGISurface;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("cafcb56c-6ac3-4889-bf47-9e23bbd260ec")
IDXGISurface : public IDXGIDeviceSubObject
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [out] */ DXGI_SURFACE_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE Map(
/* [out] */ DXGI_MAPPED_RECT *pLockedRect,
/* [in] */ UINT MapFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE Unmap( void) = 0;
};
#else /* C style interface */
typedef struct IDXGISurfaceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGISurface * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGISurface * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGISurface * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGISurface * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGISurface * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISurface * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGISurface * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGISurface * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGISurface * This,
/* [out] */ DXGI_SURFACE_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *Map )(
IDXGISurface * This,
/* [out] */ DXGI_MAPPED_RECT *pLockedRect,
/* [in] */ UINT MapFlags);
HRESULT ( STDMETHODCALLTYPE *Unmap )(
IDXGISurface * This);
END_INTERFACE
} IDXGISurfaceVtbl;
interface IDXGISurface
{
CONST_VTBL struct IDXGISurfaceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGISurface_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGISurface_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGISurface_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGISurface_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGISurface_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGISurface_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGISurface_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGISurface_GetDevice(This,riid,ppDevice) \
( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
#define IDXGISurface_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGISurface_Map(This,pLockedRect,MapFlags) \
( (This)->lpVtbl -> Map(This,pLockedRect,MapFlags) )
#define IDXGISurface_Unmap(This) \
( (This)->lpVtbl -> Unmap(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGISurface_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi_0000_0004 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0004_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0004_v0_0_s_ifspec;
#ifndef __IDXGIAdapter_INTERFACE_DEFINED__
#define __IDXGIAdapter_INTERFACE_DEFINED__
/* interface IDXGIAdapter */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIAdapter;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("2411e7e1-12ac-4ccf-bd14-9798e8534dc0")
IDXGIAdapter : public IDXGIObject
{
public:
virtual HRESULT STDMETHODCALLTYPE EnumOutputs(
/* [in] */ UINT Output,
/* [out][in] */ IDXGIOutput **ppOutput) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [out] */ DXGI_ADAPTER_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckInterfaceSupport(
/* [in] */ REFGUID InterfaceName,
/* [out] */ LARGE_INTEGER *pUMDVersion) = 0;
};
#else /* C style interface */
typedef struct IDXGIAdapterVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIAdapter * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIAdapter * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIAdapter * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIAdapter * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIAdapter * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIAdapter * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumOutputs )(
IDXGIAdapter * This,
/* [in] */ UINT Output,
/* [out][in] */ IDXGIOutput **ppOutput);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIAdapter * This,
/* [out] */ DXGI_ADAPTER_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )(
IDXGIAdapter * This,
/* [in] */ REFGUID InterfaceName,
/* [out] */ LARGE_INTEGER *pUMDVersion);
END_INTERFACE
} IDXGIAdapterVtbl;
interface IDXGIAdapter
{
CONST_VTBL struct IDXGIAdapterVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIAdapter_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIAdapter_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIAdapter_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIAdapter_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIAdapter_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIAdapter_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIAdapter_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIAdapter_EnumOutputs(This,Output,ppOutput) \
( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) )
#define IDXGIAdapter_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGIAdapter_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \
( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIAdapter_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi_0000_0005 */
/* [local] */
#define DXGI_ENUM_MODES_INTERLACED ( 1UL )
#define DXGI_ENUM_MODES_SCALING ( 2UL )
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0005_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0005_v0_0_s_ifspec;
#ifndef __IDXGIOutput_INTERFACE_DEFINED__
#define __IDXGIOutput_INTERFACE_DEFINED__
/* interface IDXGIOutput */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIOutput;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ae02eedb-c735-4690-8d52-5a8dc20213aa")
IDXGIOutput : public IDXGIObject
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [out] */ DXGI_OUTPUT_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDisplayModeList(
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [out][in] */ UINT *pNumModes,
/* [out] */ DXGI_MODE_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE FindClosestMatchingMode(
/* [in] */ const DXGI_MODE_DESC *pModeToMatch,
/* [out] */ DXGI_MODE_DESC *pClosestMatch,
/* [in] */ IUnknown *pConcernedDevice) = 0;
virtual HRESULT STDMETHODCALLTYPE WaitForVBlank( void) = 0;
virtual HRESULT STDMETHODCALLTYPE TakeOwnership(
/* [in] */ IUnknown *pDevice,
BOOL Exclusive) = 0;
virtual void STDMETHODCALLTYPE ReleaseOwnership( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetGammaControlCapabilities(
/* [out] */ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) = 0;
virtual HRESULT STDMETHODCALLTYPE SetGammaControl(
/* [in] */ const DXGI_GAMMA_CONTROL *pArray) = 0;
virtual HRESULT STDMETHODCALLTYPE GetGammaControl(
/* [out] */ DXGI_GAMMA_CONTROL *pArray) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDisplaySurface(
/* [in] */ IDXGISurface *pScanoutSurface) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData(
/* [in] */ IDXGISurface *pDestination) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics(
/* [out] */ DXGI_FRAME_STATISTICS *pStats) = 0;
};
#else /* C style interface */
typedef struct IDXGIOutputVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIOutput * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIOutput * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIOutput * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIOutput * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIOutput * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIOutput * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIOutput * This,
/* [out] */ DXGI_OUTPUT_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
IDXGIOutput * This,
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [out][in] */ UINT *pNumModes,
/* [out] */ DXGI_MODE_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
IDXGIOutput * This,
/* [in] */ const DXGI_MODE_DESC *pModeToMatch,
/* [out] */ DXGI_MODE_DESC *pClosestMatch,
/* [in] */ IUnknown *pConcernedDevice);
HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
IDXGIOutput * This);
HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
IDXGIOutput * This,
/* [in] */ IUnknown *pDevice,
BOOL Exclusive);
void ( STDMETHODCALLTYPE *ReleaseOwnership )(
IDXGIOutput * This);
HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
IDXGIOutput * This,
/* [out] */ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
IDXGIOutput * This,
/* [in] */ const DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
IDXGIOutput * This,
/* [out] */ DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
IDXGIOutput * This,
/* [in] */ IDXGISurface *pScanoutSurface);
HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
IDXGIOutput * This,
/* [in] */ IDXGISurface *pDestination);
HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
IDXGIOutput * This,
/* [out] */ DXGI_FRAME_STATISTICS *pStats);
END_INTERFACE
} IDXGIOutputVtbl;
interface IDXGIOutput
{
CONST_VTBL struct IDXGIOutputVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIOutput_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIOutput_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIOutput_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIOutput_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIOutput_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIOutput_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIOutput_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIOutput_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGIOutput_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \
( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) )
#define IDXGIOutput_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
#define IDXGIOutput_WaitForVBlank(This) \
( (This)->lpVtbl -> WaitForVBlank(This) )
#define IDXGIOutput_TakeOwnership(This,pDevice,Exclusive) \
( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) )
#define IDXGIOutput_ReleaseOwnership(This) \
( (This)->lpVtbl -> ReleaseOwnership(This) )
#define IDXGIOutput_GetGammaControlCapabilities(This,pGammaCaps) \
( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) )
#define IDXGIOutput_SetGammaControl(This,pArray) \
( (This)->lpVtbl -> SetGammaControl(This,pArray) )
#define IDXGIOutput_GetGammaControl(This,pArray) \
( (This)->lpVtbl -> GetGammaControl(This,pArray) )
#define IDXGIOutput_SetDisplaySurface(This,pScanoutSurface) \
( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) )
#define IDXGIOutput_GetDisplaySurfaceData(This,pDestination) \
( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) )
#define IDXGIOutput_GetFrameStatistics(This,pStats) \
( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIOutput_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi_0000_0006 */
/* [local] */
#define DXGI_MAX_SWAP_CHAIN_BUFFERS ( 16 )
#define DXGI_PRESENT_TEST 0x00000001UL
#define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002UL
#define DXGI_PRESENT_RESTART 0x00000004UL
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0006_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0006_v0_0_s_ifspec;
#ifndef __IDXGISwapChain_INTERFACE_DEFINED__
#define __IDXGISwapChain_INTERFACE_DEFINED__
/* interface IDXGISwapChain */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGISwapChain;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("310d36a0-d2e7-4c0a-aa04-6a9d23b8886a")
IDXGISwapChain : public IDXGIDeviceSubObject
{
public:
virtual HRESULT STDMETHODCALLTYPE Present(
/* [in] */ UINT SyncInterval,
/* [in] */ UINT Flags) = 0;
virtual HRESULT STDMETHODCALLTYPE GetBuffer(
/* [in] */ UINT Buffer,
/* [in] */ REFIID riid,
/* [out][in] */ void **ppSurface) = 0;
virtual HRESULT STDMETHODCALLTYPE SetFullscreenState(
/* [in] */ BOOL Fullscreen,
/* [in] */ IDXGIOutput *pTarget) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFullscreenState(
/* [out] */ BOOL *pFullscreen,
/* [out] */ IDXGIOutput **ppTarget) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [out] */ DXGI_SWAP_CHAIN_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE ResizeBuffers(
/* [in] */ UINT BufferCount,
/* [in] */ UINT Width,
/* [in] */ UINT Height,
/* [in] */ DXGI_FORMAT NewFormat,
/* [in] */ UINT SwapChainFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE ResizeTarget(
/* [in] */ const DXGI_MODE_DESC *pNewTargetParameters) = 0;
virtual HRESULT STDMETHODCALLTYPE GetContainingOutput(
IDXGIOutput **ppOutput) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics(
/* [out] */ DXGI_FRAME_STATISTICS *pStats) = 0;
virtual HRESULT STDMETHODCALLTYPE GetLastPresentCount(
/* [out] */ UINT *pLastPresentCount) = 0;
};
#else /* C style interface */
typedef struct IDXGISwapChainVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGISwapChain * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGISwapChain * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGISwapChain * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGISwapChain * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGISwapChain * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISwapChain * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGISwapChain * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGISwapChain * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *Present )(
IDXGISwapChain * This,
/* [in] */ UINT SyncInterval,
/* [in] */ UINT Flags);
HRESULT ( STDMETHODCALLTYPE *GetBuffer )(
IDXGISwapChain * This,
/* [in] */ UINT Buffer,
/* [in] */ REFIID riid,
/* [out][in] */ void **ppSurface);
HRESULT ( STDMETHODCALLTYPE *SetFullscreenState )(
IDXGISwapChain * This,
/* [in] */ BOOL Fullscreen,
/* [in] */ IDXGIOutput *pTarget);
HRESULT ( STDMETHODCALLTYPE *GetFullscreenState )(
IDXGISwapChain * This,
/* [out] */ BOOL *pFullscreen,
/* [out] */ IDXGIOutput **ppTarget);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGISwapChain * This,
/* [out] */ DXGI_SWAP_CHAIN_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *ResizeBuffers )(
IDXGISwapChain * This,
/* [in] */ UINT BufferCount,
/* [in] */ UINT Width,
/* [in] */ UINT Height,
/* [in] */ DXGI_FORMAT NewFormat,
/* [in] */ UINT SwapChainFlags);
HRESULT ( STDMETHODCALLTYPE *ResizeTarget )(
IDXGISwapChain * This,
/* [in] */ const DXGI_MODE_DESC *pNewTargetParameters);
HRESULT ( STDMETHODCALLTYPE *GetContainingOutput )(
IDXGISwapChain * This,
IDXGIOutput **ppOutput);
HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
IDXGISwapChain * This,
/* [out] */ DXGI_FRAME_STATISTICS *pStats);
HRESULT ( STDMETHODCALLTYPE *GetLastPresentCount )(
IDXGISwapChain * This,
/* [out] */ UINT *pLastPresentCount);
END_INTERFACE
} IDXGISwapChainVtbl;
interface IDXGISwapChain
{
CONST_VTBL struct IDXGISwapChainVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGISwapChain_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGISwapChain_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGISwapChain_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGISwapChain_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGISwapChain_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGISwapChain_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGISwapChain_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGISwapChain_GetDevice(This,riid,ppDevice) \
( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
#define IDXGISwapChain_Present(This,SyncInterval,Flags) \
( (This)->lpVtbl -> Present(This,SyncInterval,Flags) )
#define IDXGISwapChain_GetBuffer(This,Buffer,riid,ppSurface) \
( (This)->lpVtbl -> GetBuffer(This,Buffer,riid,ppSurface) )
#define IDXGISwapChain_SetFullscreenState(This,Fullscreen,pTarget) \
( (This)->lpVtbl -> SetFullscreenState(This,Fullscreen,pTarget) )
#define IDXGISwapChain_GetFullscreenState(This,pFullscreen,ppTarget) \
( (This)->lpVtbl -> GetFullscreenState(This,pFullscreen,ppTarget) )
#define IDXGISwapChain_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGISwapChain_ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) \
( (This)->lpVtbl -> ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) )
#define IDXGISwapChain_ResizeTarget(This,pNewTargetParameters) \
( (This)->lpVtbl -> ResizeTarget(This,pNewTargetParameters) )
#define IDXGISwapChain_GetContainingOutput(This,ppOutput) \
( (This)->lpVtbl -> GetContainingOutput(This,ppOutput) )
#define IDXGISwapChain_GetFrameStatistics(This,pStats) \
( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
#define IDXGISwapChain_GetLastPresentCount(This,pLastPresentCount) \
( (This)->lpVtbl -> GetLastPresentCount(This,pLastPresentCount) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGISwapChain_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi_0000_0007 */
/* [local] */
#define DXGI_MWA_NO_WINDOW_CHANGES ( 1 << 0 )
#define DXGI_MWA_NO_ALT_ENTER ( 1 << 1 )
#define DXGI_MWA_NO_PRINT_SCREEN ( 1 << 2 )
#define DXGI_MWA_VALID ( 0x7 )
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0007_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0007_v0_0_s_ifspec;
#ifndef __IDXGIFactory_INTERFACE_DEFINED__
#define __IDXGIFactory_INTERFACE_DEFINED__
/* interface IDXGIFactory */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIFactory;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7b7166ec-21c7-44ae-b21a-c9ae321ae369")
IDXGIFactory : public IDXGIObject
{
public:
virtual HRESULT STDMETHODCALLTYPE EnumAdapters(
/* [in] */ UINT Adapter,
/* [out] */ IDXGIAdapter **ppAdapter) = 0;
virtual HRESULT STDMETHODCALLTYPE MakeWindowAssociation(
HWND WindowHandle,
UINT Flags) = 0;
virtual HRESULT STDMETHODCALLTYPE GetWindowAssociation(
HWND *pWindowHandle) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSwapChain(
IUnknown *pDevice,
DXGI_SWAP_CHAIN_DESC *pDesc,
IDXGISwapChain **ppSwapChain) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter(
/* [in] */ HMODULE Module,
/* [out] */ IDXGIAdapter **ppAdapter) = 0;
};
#else /* C style interface */
typedef struct IDXGIFactoryVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIFactory * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIFactory * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIFactory * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIFactory * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIFactory * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIFactory * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumAdapters )(
IDXGIFactory * This,
/* [in] */ UINT Adapter,
/* [out] */ IDXGIAdapter **ppAdapter);
HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )(
IDXGIFactory * This,
HWND WindowHandle,
UINT Flags);
HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )(
IDXGIFactory * This,
HWND *pWindowHandle);
HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )(
IDXGIFactory * This,
IUnknown *pDevice,
DXGI_SWAP_CHAIN_DESC *pDesc,
IDXGISwapChain **ppSwapChain);
HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )(
IDXGIFactory * This,
/* [in] */ HMODULE Module,
/* [out] */ IDXGIAdapter **ppAdapter);
END_INTERFACE
} IDXGIFactoryVtbl;
interface IDXGIFactory
{
CONST_VTBL struct IDXGIFactoryVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIFactory_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIFactory_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIFactory_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIFactory_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIFactory_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIFactory_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIFactory_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIFactory_EnumAdapters(This,Adapter,ppAdapter) \
( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) )
#define IDXGIFactory_MakeWindowAssociation(This,WindowHandle,Flags) \
( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) )
#define IDXGIFactory_GetWindowAssociation(This,pWindowHandle) \
( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) )
#define IDXGIFactory_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \
( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) )
#define IDXGIFactory_CreateSoftwareAdapter(This,Module,ppAdapter) \
( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIFactory_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi_0000_0008 */
/* [local] */
HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **ppFactory);
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_s_ifspec;
#ifndef __IDXGIDevice_INTERFACE_DEFINED__
#define __IDXGIDevice_INTERFACE_DEFINED__
/* interface IDXGIDevice */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIDevice;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("54ec77fa-1377-44e6-8c32-88fd5f44c84c")
IDXGIDevice : public IDXGIObject
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAdapter(
/* [out] */ IDXGIAdapter **pAdapter) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSurface(
/* [in] */ const DXGI_SURFACE_DESC *pDesc,
/* [in] */ UINT NumSurfaces,
/* [in] */ DXGI_USAGE Usage,
/* [in] */ const DXGI_SHARED_RESOURCE *pSharedResource,
/* [out] */ IDXGISurface **ppSurface) = 0;
virtual HRESULT STDMETHODCALLTYPE QueryResourceResidency(
/* [size_is][in] */ IUnknown *const *ppResources,
/* [size_is][out] */ DXGI_RESIDENCY *pResidencyStatus,
/* [in] */ UINT NumResources) = 0;
virtual HRESULT STDMETHODCALLTYPE SetGPUThreadPriority(
/* [in] */ INT Priority) = 0;
virtual HRESULT STDMETHODCALLTYPE GetGPUThreadPriority(
/* [retval][out] */ INT *pPriority) = 0;
};
#else /* C style interface */
typedef struct IDXGIDeviceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIDevice * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIDevice * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIDevice * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIDevice * This,
/* [in] */ REFGUID Name,
/* [in] */ UINT DataSize,
/* [in] */ const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIDevice * This,
/* [in] */ REFGUID Name,
/* [in] */ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDevice * This,
/* [in] */ REFGUID Name,
/* [out][in] */ UINT *pDataSize,
/* [out] */ void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIDevice * This,
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetAdapter )(
IDXGIDevice * This,
/* [out] */ IDXGIAdapter **pAdapter);
HRESULT ( STDMETHODCALLTYPE *CreateSurface )(
IDXGIDevice * This,
/* [in] */ const DXGI_SURFACE_DESC *pDesc,
/* [in] */ UINT NumSurfaces,
/* [in] */ DXGI_USAGE Usage,
/* [in] */ const DXGI_SHARED_RESOURCE *pSharedResource,
/* [out] */ IDXGISurface **ppSurface);
HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )(
IDXGIDevice * This,
/* [size_is][in] */ IUnknown *const *ppResources,
/* [size_is][out] */ DXGI_RESIDENCY *pResidencyStatus,
/* [in] */ UINT NumResources);
HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )(
IDXGIDevice * This,
/* [in] */ INT Priority);
HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )(
IDXGIDevice * This,
/* [retval][out] */ INT *pPriority);
END_INTERFACE
} IDXGIDeviceVtbl;
interface IDXGIDevice
{
CONST_VTBL struct IDXGIDeviceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIDevice_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIDevice_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIDevice_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIDevice_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIDevice_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIDevice_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIDevice_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIDevice_GetAdapter(This,pAdapter) \
( (This)->lpVtbl -> GetAdapter(This,pAdapter) )
#define IDXGIDevice_CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) \
( (This)->lpVtbl -> CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) )
#define IDXGIDevice_QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) \
( (This)->lpVtbl -> QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) )
#define IDXGIDevice_SetGPUThreadPriority(This,Priority) \
( (This)->lpVtbl -> SetGPUThreadPriority(This,Priority) )
#define IDXGIDevice_GetGPUThreadPriority(This,pPriority) \
( (This)->lpVtbl -> GetGPUThreadPriority(This,pPriority) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIDevice_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi_0000_0009 */
/* [local] */
#ifdef __cplusplus
#endif /*__cplusplus*/
DEFINE_GUID(IID_IDXGIObject,0xaec22fb8,0x76f3,0x4639,0x9b,0xe0,0x28,0xeb,0x43,0xa6,0x7a,0x2e);
DEFINE_GUID(IID_IDXGIDeviceSubObject,0x3d3e0379,0xf9de,0x4d58,0xbb,0x6c,0x18,0xd6,0x29,0x92,0xf1,0xa6);
DEFINE_GUID(IID_IDXGIResource,0x035f3ab4,0x482e,0x4e50,0xb4,0x1f,0x8a,0x7f,0x8b,0xd8,0x96,0x0b);
DEFINE_GUID(IID_IDXGISurface,0xcafcb56c,0x6ac3,0x4889,0xbf,0x47,0x9e,0x23,0xbb,0xd2,0x60,0xec);
DEFINE_GUID(IID_IDXGIAdapter,0x2411e7e1,0x12ac,0x4ccf,0xbd,0x14,0x97,0x98,0xe8,0x53,0x4d,0xc0);
DEFINE_GUID(IID_IDXGIOutput,0xae02eedb,0xc735,0x4690,0x8d,0x52,0x5a,0x8d,0xc2,0x02,0x13,0xaa);
DEFINE_GUID(IID_IDXGISwapChain,0x310d36a0,0xd2e7,0x4c0a,0xaa,0x04,0x6a,0x9d,0x23,0xb8,0x88,0x6a);
DEFINE_GUID(IID_IDXGIFactory,0x7b7166ec,0x21c7,0x44ae,0xb2,0x1a,0xc9,0xae,0x32,0x1a,0xe3,0x69);
DEFINE_GUID(IID_IDXGIDevice,0x54ec77fa,0x1377,0x44e6,0x8c,0x32,0x88,0xfd,0x5f,0x44,0xc8,0x4c);
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0009_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0009_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
| [
"wirlsawyer@gmail.com"
] | wirlsawyer@gmail.com |
f9716b2ec4c0a165c0137359c76b200b02ef6dd2 | 50de7f977f3d60fa3ea7df2b908be49d8ca44083 | /C++/C++/templates/template_fun.cpp | d62f2208b076e31dc7a216c7d11a2ef623c66095 | [
"Apache-2.0"
] | permissive | unmeshvrije/C-- | e559b2806af0a5e14ce233bc8ba1c55aadd2659a | 361616849313155b34afc68769f6bb121bafdac0 | refs/heads/master | 2022-12-24T05:54:39.053431 | 2022-12-12T16:20:34 | 2022-12-12T16:20:34 | 12,909,247 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 843 | cpp | #include <iostream>
#include <typeinfo>
#include <cstring>
using namespace std;
template <typename Generic>
Generic Min(Generic a, Generic b)
{
if (
typeid(Generic) == typeid(char*)
)
{
// cout << "typeid pass" << endl;
int iRet = strcmp(a,b);
if(iRet < 0)
return a;
return b;
}
else
{
if (a < b)
return a;
return b;
}
}
int main()
{
int a = 4, b = 6;
float c = 3.34, d = 7.545;
char e = 'E', f = 'F';
char str1[] = "abcd";
char str2[] = "abce";
//This causes template instantiation.
cout << Min<char*>(str1,str2);
cout << endl;
/* cout << "Min of integers = ";
cout << Min<int>(a,b);
cout << endl;
cout << "Min of floats = " << Min<float>(c,d);
cout << endl;
cout << "Min of chars = " << Min<char>(e,f);
cout << endl;*/
return 0;
}
| [
"unmesh@unmesh-laptop.(none)"
] | unmesh@unmesh-laptop.(none) |
61a651b0bd7370e44ec3abfa709c16d359eb7e2b | 82e22dbe26c9c69ba2ef149d0d4554bd36b3aa00 | /test/tests/issue0012.cpp | 626f4cc111e4d50071fa93a16731ad72b9f08027 | [
"BSL-1.0",
"Apache-2.0"
] | permissive | hyeongyukim/outcome | 87f2272198c554cf498df793b9d0dc473dceda08 | 38b9d4f4ab62672221a1d77d51c8bbba8acf8471 | refs/heads/master | 2022-02-11T17:36:06.756960 | 2019-09-25T23:00:32 | 2019-09-25T23:00:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,983 | cpp | /* Unit testing for outcomes
(C) 2013-2019 Niall Douglas <http://www.nedproductions.biz/> (5 commits)
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 in the accompanying file
Licence.txt or 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.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "../../include/outcome/outcome.hpp"
#include "quickcpplib/boost/test/unit_test.hpp"
BOOST_OUTCOME_AUTO_TEST_CASE(issues / 12, "outcome's copy assignment gets instantiated even when type T cannot be copied")
{
using namespace OUTCOME_V2_NAMESPACE;
const char *s = "hi";
struct udt // NOLINT
{
const char *_v{nullptr};
udt() = default;
constexpr explicit udt(const char *v) noexcept : _v(v) {}
constexpr udt(udt &&o) noexcept : _v(o._v) { o._v = nullptr; }
udt(const udt &) = delete;
constexpr udt &operator=(udt &&o) noexcept
{
_v = o._v;
o._v = nullptr;
return *this;
}
udt &operator=(const udt &) = delete;
constexpr const char *operator*() const noexcept { return _v; }
};
static_assert(std::is_move_constructible<outcome<udt>>::value, "expected<udt> is not move constructible!");
static_assert(!std::is_copy_constructible<outcome<udt>>::value, "expected<udt> is copy constructible!");
outcome<udt> p(udt{s}), n(std::error_code(ENOMEM, std::generic_category()));
n = std::error_code(EINVAL, std::generic_category());
BOOST_CHECK(n.error().value() == EINVAL);
}
| [
"spamtrap@nedprod.com"
] | spamtrap@nedprod.com |
07f656832d722eb5862dfbec4c3a8d6d7b79eecc | a8c66e9cb1ab6669bb15cc623e1b54d3e967f035 | /Trabalho-04/teste/periodo.cpp | f892c49763826995870780b07725af78114997c8 | [] | no_license | igorpsantos/programacao-avancada | 1dbf192bafa2fe07f02a3ef12ab7c0aeb45b1e2a | c76d6c35e11a3ed638a527059323a8f8b0fb5838 | refs/heads/master | 2021-02-27T19:22:49.308989 | 2020-06-27T21:09:59 | 2020-06-27T21:09:59 | 245,629,941 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 511 | cpp | #include <iostream>
#include <iterator>
#include "periodo.h"
using namespace std;
Periodo::Periodo(Data inicial, Data final) : _data_inicial(inicial), _data_final(final), _total(0) {
for (int i = 0; i < Registro::_AllRegistros.size(); i++) {
if (Registro::_AllRegistros[i].getData() >= inicial && Registro::_AllRegistros[i].getData() <= final) {
_registros.push_back(Registro::_AllRegistros[i]);
_total += Registro::_AllRegistros[i].getCusto();
}
}
} | [
"noreply@github.com"
] | igorpsantos.noreply@github.com |
81144505bc65dc9def7a6c3429e0eabfa4a6fe77 | fb99c5ca73adb5857a462a98329d5c8753a9cb13 | /open/rts/config.h | c0052123493a7fe104c084837c58df8d4380db59 | [] | no_license | luqui/soylent | f82ff00cdf76b426c2c3580e9c432bcb48715358 | 94bbe25a1b93a30e94e2ab072f792bb273da3b06 | refs/heads/master | 2021-01-22T03:44:15.546888 | 2009-06-24T20:08:55 | 2009-06-24T20:08:55 | 113,045 | 2 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 368 | h | #ifndef __CONFIG_H__
#define __CONFIG_H__
#ifdef WIN32
#include <windows.h>
#endif
#include <list>
typedef double num;
const num DT = 1/30.0;
class Board;
extern Board BOARD;
class SoyInit;
extern SoyInit INIT;
class Dust;
extern Dust DUST;
class Scheduler;
extern Scheduler SCHEDULER;
class Unit;
extern std::list<Unit*> UNITS;
extern num GAMETIME;
#endif
| [
"luqui@94b1653a-ed48-0410-b77d-b6a479af8a11"
] | luqui@94b1653a-ed48-0410-b77d-b6a479af8a11 |
cbd3187247cff06ce235e93d98b563d8596a1465 | 6febd920ced70cbb19695801a163c437e7be44d4 | /cpp/concepts/counter_class.cpp | 43fb2c52b47b99baa07151b6fc87c1ecd55ba6af | [] | no_license | AngryBird3/gotta_code | b0ab47e846b424107dbd3b03e0c0f3afbd239c60 | b9975fef5fa4843bf95d067bea6d064723484289 | refs/heads/master | 2021-01-20T16:47:35.098125 | 2018-03-24T21:31:01 | 2018-03-24T21:31:01 | 53,180,336 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 690 | cpp | #include <iostream>
using namespace std;
// see below for a discussion of why
// this isn't quite right
class Counter {
public:
Counter() { ++count; cout << "Counter constructor\n"; }
Counter(const Counter&) { ++count; cout << "Counter copy constructor\n"; }
~Counter() { --count; }
static size_t howMany()
{ return count; }
private:
static size_t count;
};
// This still goes in an
// implementation file
size_t Counter::count = 0;
// inherit from Counter to count objects
class Widget: public Counter {
public:
Widget() { cout << "Widget constructor\n"; }
};
int main() {
Widget w;
cout << "w count: " << w.howMany() << "\n";
return 0;
}
| [
"dhaaraa.darji@gmail.com"
] | dhaaraa.darji@gmail.com |
18ad09fa0fa33dfce33db2568520d7b6ec82398e | 75a574cc626abb6106d749cc55c7acd28e672594 | /Test2/MRIntegerTest.cpp | 58a3a3c37753d91d6785ad49275a362ce4ae6d9d | [] | no_license | PeterGH/temp | 6b247e0f95ac3984d61459e0648421253d11bdc3 | 0427b6614880e8c596cca0350a02fda08fb28176 | refs/heads/master | 2020-03-31T16:10:30.114748 | 2018-11-19T03:48:53 | 2018-11-19T03:48:53 | 152,365,449 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,022 | cpp | #include "MRIntegerTest.h"
#include "..\Algorithm\MRInteger.h"
#include "..\Algorithm\RadixSort.h"
#include <vector>
void MRIntegerTest::Init(void)
{
Add("Random", [&]() {
unsigned int b[] = {1, 2, 4, 8, 16, 32};
My::MRInteger mri(b, 6);
std::vector<My::MRInteger> numbers;
for (int i = 0; i < 30000; i ++) {
mri.Random();
numbers.push_back(My::MRInteger(mri));
}
sort(numbers.begin(), numbers.end());
// for_each (numbers.begin(), numbers.end(), [](My::MRInteger & it) {
// for (int j = it.Length() - 1; j >= 0; j --) {
// cout << "\t" << it[j];
// }
// cout << endl;
// });
ASSERT1(std::is_sorted(numbers.begin(), numbers.end(), [](const My::MRInteger & second, const My::MRInteger & first) {
if (second < first) {
for (int j = first.Length() - 1; j >= 0; j --) {
cout << "\t" << first[j];
}
cout << endl;
for (int j = second.Length() - 1; j >= 0; j --) {
cout << "\t" << second[j];
}
cout << endl;
return true;
} else {
return false;
}
}));
});
Add("RadixSort", [&]() {
unsigned int b[] = {1, 2, 4, 8, 16, 32};
My::MRInteger mri(b, 6);
std::vector<My::MRInteger> numbers;
for (int i = 0; i < 30000; i ++) {
mri.Random();
numbers.push_back(My::MRInteger(mri));
}
My::RadixSort::Sort(numbers);
for_each (numbers.begin(), numbers.end(), [](My::MRInteger & it) {
for (int j = it.Length() - 1; j >= 0; j --) {
cout << "\t" << it[j];
}
cout << endl;
});
ASSERT1(std::is_sorted(numbers.begin(), numbers.end(), [](const My::MRInteger & second, const My::MRInteger & first) {
if (second < first) {
for (int j = first.Length() - 1; j >= 0; j --) {
cout << "\t" << first[j];
}
cout << endl;
for (int j = second.Length() - 1; j >= 0; j --) {
cout << "\t" << second[j];
}
cout << endl;
return true;
} else {
return false;
}
}));
});
}
| [
"peteryzufl@gmail.com"
] | peteryzufl@gmail.com |
6ce279b7681c7267feeec66549547c043635ea61 | a910c0cc7a93da9725ac31b67b1ecaf95e21b781 | /hw5/src/StudentDemoProject.cpp | b0e995a2452b0efe5e546b8611b1d1a9e838b7ce | [] | no_license | T-Goon/2303-Systems-Programming-Concepts | e04fd214efa394760032b49244ff006f3b958f29 | c57c28ecc96a6bb921055d5f82b05b85ac7605c5 | refs/heads/master | 2023-05-12T04:39:03.595614 | 2021-06-03T21:20:32 | 2021-06-03T21:20:32 | 236,372,302 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,721 | cpp | //============================================================================
// Name : StudentDemoProject.cpp
// Author : Timothy Goon, Patrick Houlihan
// Version : 1
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <vector>
#include <cstdio>
#include "Student.h"
// Finds the students with the GPA < 1
std::vector<Student> find_failing_students(const std::vector<Student> &students) {
std::vector<Student> failing_students;
for(auto student : students){
if(student.gpa() < 1){
failing_students.push_back(student);
}
}
return failing_students;
}
// Prints out the info for all the students in the vector
void print_students(const std::vector<Student> &students){
for(auto student : students){
student.print_info();
}
}
/**
* Allows the user to enter information for multiple students, then
* find those students whose GPA is below 1.0 and prints them to the
* screen.
*/
int main() {
std::string first_name, last_name;
float gpa;
int id;
char repeat;
std::vector<Student> students;
FILE* file = fopen("NewsiesStaff.txt", "r");
int numStudents;
fscanf(file, "%d", &numStudents);
char first[50];
char last[50]; float grade; int ID;
int temp1, temp2, temp3, temp4, temp5, temp6, temp7;
char temp8[50];
for(int i=0; i< numStudents; i++){
fscanf(file, "%s %s %f %d %d %d %d %d %d %d %d %s", first, last, &grade, &ID, &temp1, &temp2, &temp3, &temp4, &temp5, &temp6, &temp7, temp8);
std::string firstS = std::string(first);
std::string lastS = std::string(last);
students.emplace_back(Student(firstS, lastS, grade, ID));
}
fclose(file);
do {
std::cout << "Enter student's first name: ";
std::cin >> first_name;
std::cout << "Enter student's last name: ";
std::cin >> last_name;
gpa = -1;
while (gpa < 0 || gpa > 4) {
std::cout << "Enter student's GPA (0.0-4.0): ";
std::cin >> gpa;
}
std::cout << "Enter student's ID: ";
std::cin >> id;
students.emplace_back(Student(first_name, last_name, gpa, id));
std::cout << "Add another student to database (Y/N)? ";
std::cin >> repeat;
} while (repeat == 'Y' || repeat == 'y');
printf("Students:\n");
print_students(students);
printf("\n");
printf("Failing Students:\n");
std::vector<Student> failing = find_failing_students(students);
print_students(failing);
printf("\n");
return 0;
}
| [
"t.kgoonx@gmail.com"
] | t.kgoonx@gmail.com |
93c6912bd6e14913d8252d4c7d142eb2e3ccd031 | 99acb9c056de6a1ae945a8145eaa451b209266d3 | /GráficasComputacionales/Employee.h | 2cb5f09be95739ebc76436339ac660068c2556aa | [] | no_license | CrzHctr/Graficas_Computacionales | ae374e69085bb4cf5fa604109afed555eeb74e06 | e08710cf9f401bccdb7dedde8f1060e02765d898 | refs/heads/master | 2021-01-21T12:01:00.293979 | 2017-11-27T18:05:22 | 2017-11-27T18:05:22 | 102,018,730 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 448 | h | #pragma once
#include <string>
class Employee {
public:
Employee(int id, std::string firstName, std::string lastName, int salary);
int GetID();
std::string GetFirstName();
std::string GetLastName();
std::string GetName();
int GetSalary();
int GetAnnualSalary();
void SetSalary(int salary);
int RaiseSalary(int percent);
std::string Print();
private:
int _id;
std::string _firstName;
std::string _lastName;
int _salary;
};
| [
"h.cruz.dorantes@gmail.com"
] | h.cruz.dorantes@gmail.com |
cdf102536592fe41b259f2c01f303651c834b440 | 7b7554fc484b2c4aaab1a97c6b4b760ed942a00e | /iSAMApp/NavBase/Scan/src/Icp.cpp | c93fc54f944759198d1fcd7fc10d9841e1df8b6a | [] | no_license | sven-glory/GTSAM-NDT | 90bd50bb6404579dc8b5c7f2011be4b64501d572 | 8c5183de63ba54f3cafb67d193b8dffc3afb4b23 | refs/heads/master | 2023-02-25T18:03:14.497787 | 2021-01-31T05:09:56 | 2021-01-31T05:09:56 | 334,640,405 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 11,428 | cpp | #include "stdafx.h"
#include <math.h>
#include "polar_match.h"
/** @brief Calculate the distance of a point from a line section.
计算一个点P(x3, y3)到一条线段AB的距离(A(x1, y1), B(x2, y2))。如果交点落到线段之外,则返回-1。
同时,P点到AB的垂足点的坐标C(x, y)也被返回。
此函数在ICP中用到。
Calculates the distance of the point (x3,y3) from a line defined by (x1,y1)
and (x2,y2). Returns the distance to the line or -1 if the
projection of (x3,y3) falls outside the line segment defined by (x1,y1)
and (x2,y2). The projection of (x3,y3) onto the line is also returned in x,y.
This function is used in ICP.
@param x1,y1 The start point of the line section.
@param x2,y2 The end point of the line section.
@param x3,y3 The point of which distance it sought.
@param x,y (x3,y3) projected onto the line segment is returned here.
@return The distance from the line or -1 if the projection falls outside of the line segment.
*/
float point_line_distance(float x1, float y1, float x2, float y2,
float x3, float y3, float *x, float *y)
{
float ax, ay, t1, D;
ax = x2 - x1;
ay = y2 - y1;
D = sqrtf(ax * ax + ay * ay);
if (D < 0.0001)
{
ASSERT(FALSE); // unexpected D
return -1;
}
t1 = - ( -ax*x3 + ay*y1 + ax*x1 - ay*y3 ) / ( ax*ax+ay*ay );
if (t1 < 0 || t1 > 1) // Projection falls outside the line segment?
return -1;
*x = x1 + t1 * ax;
*y = y1 + t1 * ay;
return (sqrtf((x3 - *x) * (x3 - *x) + (y3 - *y) * (y3 - *y))); //distance of line to p.
}
/** @brief Matches two laser scans using the iterative closest point method.
Minimizes least square error of points through changing lsa->rx, lsa->ry, lsa->th
by using ICP. It interpolates associated
points. Only the best 80% of points are used in the pose calculation.
Scan projection is done at each iteration.
For maintanence reasons changed scan projection to that of psm.
*/
float pm_icp ( const CPmScan *lsr,CPmScan *lsa )
{
#define INTERPOLATE_ICP //comment out if no interpolation of ref. scan points iS necessary
CPmScan act, ref;//copies of current and reference scans
float rx,ry,rth,ax,ay,ath;//robot pos at ref and current scans
float t13,t23,LASER_Y = PM_LASER_Y;
int new_bad[PM_L_POINTS];//bad flags of the projected current scan range readings
float new_r[PM_L_POINTS];//ranges of current scan projected into ref. frame for occlusion check
float nx[PM_L_POINTS];//current scanpoints in ref coord system
float ny[PM_L_POINTS];//current scanpoints in ref coord system
int index[PM_L_POINTS][2];//match indices current,refernce
float dist[PM_L_POINTS];// distance for the matches
int n = 0;//number of valid points
int iter,i,j,small_corr_cnt=0,k,imax;
int window = PM_SEARCH_WINDOW;//+- width of search for correct orientation
float abs_err=0,dx=0,dy=0,dth=0;//match error, current scan corrections
float co,si;
#ifdef PM_GENERATE_RESULTS
double start_tick, dead_tick,end_tick,end_tick2;
FILE *f;
f = fopen ( PM_TIME_FILE,"w" );
dead_tick = 0;
start_tick =pm_msec();
#endif
act = *lsa;
ref = *lsr;
rx = ref.rx; ry = ref.ry; rth = ref.th;
ax = act.rx; ay = act.ry; ath = act.th;
//transformation of current scan laser scanner coordinates into reference
//laser scanner coordinates
t13 = sinf ( rth-ath ) *LASER_Y+cosf ( rth ) *ax+sinf ( rth ) *ay-sinf ( rth ) *ry-rx*cosf ( rth );
t23 = cosf ( rth-ath ) *LASER_Y-sinf ( rth ) *ax+cosf ( rth ) *ay-cosf ( rth ) *ry+rx*sinf ( rth )-LASER_Y;
ref.rx = 0; ref.ry = 0; ref.th = 0;
act.rx = t13; act.ry = t23; act.th = ath-rth;
ax = act.rx; ay = act.ry; ath = act.th;
//from now on act.rx,.. express the lasers position in the ref frame
//intializing x,y of act and ref
for ( i=0;i<PM_L_POINTS;i++ )
{
ref.x[i] = ref.r[i]*pm_co[i];
ref.y[i] = ref.r[i]*pm_si[i];
act.x[i] = act.r[i]*pm_co[i];
act.y[i] = act.r[i]*pm_si[i];
}//for i
iter = -1;
while ( ++iter<PM_MAX_ITER_ICP && small_corr_cnt<3 ) //have to be a few small corrections before stop
{
if ( ( fabsf ( dx ) +fabsf ( dy ) +fabsf ( dth ) *PM_R2D ) <PM_STOP_COND_ICP )
small_corr_cnt++;
else
small_corr_cnt=0;
#ifdef PM_GENERATE_RESULTS
end_tick =pm_msec();
fprintf ( f,"%i %lf %lf %lf %lf\n",iter,
end_tick-start_tick-dead_tick ,ax,ay,ath*PM_R2D );
end_tick2 =pm_msec();
dead_tick += end_tick2- end_tick;
#endif
#ifdef GR
dr_erase();
dr_circle ( ax,ay,5.0,"green" );
dr_line ( 0,-100,200,-100,"black" );
dr_line ( 0,-200,200,-200,"black" );
#endif
//CScan projection
act.rx = ax;act.ry = ay;act.th = ath;
pm_scan_project(&act, new_r, new_bad);
// transformation the cartesian coordinates of the points:
co = cosf ( ath );
si = sinf ( ath );
for ( i=0;i<PM_L_POINTS;i++ )
{
nx[i] = act.x[i]*co - act.y[i]*si + ax;
ny[i] = act.x[i]*si + act.y[i]*co + ay;
#ifdef GR
if ( ref.bad[i] )
dr_circle ( ref.x[i],ref.y[i],4,"yellow" );
else
dr_circle ( ref.x[i],ref.y[i],4,"black" );
if ( new_bad[i] )
dr_circle ( nx[i],ny[i],4,"green" );
else
dr_circle ( nx[i],ny[i],4,"blue" );
#endif
}
// dr_zoom();
#ifdef GR
cout <<"interpolated ranges. press enter"<<endl;
/* for ( i=0;i<PM_L_POINTS;i++ )
dr_circle ( new_r[i]*pm_co[i],new_r[i]*pm_si[i],6,"red" );*/
dr_zoom();
#endif
//Correspondence search: go through the points of the current
//scan and find the closest point in the reference scan
//lying withing a search interval.
n=0;
float d,min_d;
int min_idx;
for ( i=0;i<PM_L_POINTS;i++ )
{
min_d = 1000000;
min_idx = -1;
if ( !new_bad[i] )
{
int imin,imax;
imin = i-window ;
if ( imin<0 )
imin =0;
imax = i+window ;
if ( imax>PM_L_POINTS )
imax =PM_L_POINTS;
for ( j=imin;j<imax;j++ )
{
if ( !ref.bad[j] )
{
d = SQ ( nx[i]-ref.x[j] ) + SQ ( ny[i]-ref.y[j] );//square distance
if ( d<min_d )
{
min_d = d;
min_idx = j;
}
}
}//for
if ( min_idx>=0 && sqrtf ( min_d ) <PM_MAX_ERROR ) // was there any match closer than 1m?
{
index[n][0] = i;
index[n][1] = min_idx;
dist[n] = sqrtf ( min_d );
n++;
#ifdef GR
dr_line ( nx[i],ny[i],ref.x[min_idx],ref.y[min_idx],"blue" );
#endif
}
}//if
}//for
// dr_zoom();
if ( n<PM_MIN_VALID_POINTS )
{
ASSERT(FALSE); // Not enough points
#ifdef PM_GENERATE_RESULTS
fclose ( f );
#endif
throw 1;
}
//sort the matches with bubble sort
//put the largest 20 percent to the end
imax = ( int ) ( ( double ) n*0.2 );
for ( i=0;i<imax;i++ )
for ( j=1;j< ( n-i );j++ )
{
if ( dist[j]<dist[j-1] ) //are they in the wrong order?
{
//swap them
k = index[j][0];
index[j][0] = index[j-1][0];
index[j-1][0] = k;
k = index[j][1];
index[j][1] = index[j-1][1];
index[j-1][1] = k;
d = dist[j];
dist[j] = dist[j-1];
dist[j-1] = d;
}
}//for j
#ifdef INTERPOLATE_ICP
//------------------------INTERPOLATION---------------------------
//comment out if not necessary
float ix[PM_L_POINTS],iy[PM_L_POINTS];//interp. ref. points.
//replace nx,xy with their interpolated... where suitable
{
float d0,d1,d2;
float minx1,miny1,minx2,miny2;
int max_i = n-imax;
for ( i=0;i<max_i;i++ )
{
//d1 = point_line_distance(1, 2,2,3, 2,2, &minx1, &miny1); //debug
#ifdef GR
dr_circle ( nx[index[i][0]],ny[index[i][0]],1.0,"brown" );
dr_circle ( ref.x[index[i][1]],ref.y[index[i][1]],1.0,"brown" );
dr_circle ( ref.x[index[i][1]-1],ref.y[index[i][1]-1],1.0,"brown" );
dr_circle ( ref.x[index[i][1]+1],ref.y[index[i][1]+1],1.0,"brown" );
#endif
d1=-1;d2=-1;
if ( index[i][1]>0 ) //not associated to the first point?
{
d1 = point_line_distance ( ref.x[index[i][1]-1], ref.y[index[i][1]-1],
ref.x[index[i][1]], ref.y[index[i][1]],
nx[index[i][0]], ny[index[i][0]],
&minx1, &miny1 );
}
if ( index[i][1]< ( PM_L_POINTS-1 ) ) //not associated to the last point?
{
d2 = point_line_distance ( ref.x[index[i][1]], ref.y[index[i][1]],
ref.x[index[i][1]+1],ref.y[index[i][1]+1],
nx[index[i][0]], ny[index[i][0]],
&minx2, &miny2 );
}
ix[index[i][1]] = ref.x[index[i][1]];
iy[index[i][1]] = ref.y[index[i][1]];
d0 = sqrtf ( SQ ( ref.x[index[i][1]]-nx[index[i][0]] ) + SQ ( ref.y[index[i][1]]-ny[index[i][0]] ) );
//is the first point closer?
if ( d1>0 && d1<d0 )
{
ix[index[i][1]] = minx1;
iy[index[i][1]] = miny1;
d0 = d1;
}
//is the second point closer?
if ( d2>0 && d2<d0 )
{
ix[index[i][1]] = minx2;
iy[index[i][1]] = miny2;
}
#ifdef GR
dr_line ( nx[index[i][0]],ny[index[i][0]],ix[index[i][1]],iy[index[i][1]],"green" );
#endif
}//for
}
#endif
//pose estimation
//------------------------------------------translation-------------
// do the weighted linear regression on the linearized ...
// include angle as well
//computation of the new dx1,dy1,dtheta1
float sxx=0,sxy=0,syx=0,syy=0;
float meanpx,meanpy,meanppx,meanppy;
meanpx = 0;meanpy = 0;
meanppx= 0;meanppy= 0;
abs_err=0;
imax = n-imax;
for ( i=0;i<imax;i++ )
{
//weight calculation
// do the cartesian calculations....
meanpx += nx[index[i][0]];
meanpy += ny[index[i][0]];
#ifdef INTERPOLATE_ICP
meanppx += ix[index[i][1]];
meanppy += iy[index[i][1]];
#else
meanppx += ref.x[index[i][1]];
meanppy += ref.y[index[i][1]];
#endif
#ifdef GR
dr_line ( nx[index[i][0]],ny[index[i][0]],ref.x[index[i][1]],ref.y[index[i][1]],"red" );
#endif
}//for
meanpx /= imax;
meanpy /= imax;
meanppx /= imax;
meanppy /= imax;
for ( int i=0;i<imax;i++ )
{
#ifdef INTERPOLATE_ICP
sxx += ( nx[index[i][0]] - meanpx ) * ( ix[index[i][1]] - meanppx );
sxy += ( nx[index[i][0]] - meanpx ) * ( iy[index[i][1]] - meanppy );
syx += ( ny[index[i][0]] - meanpy ) * ( ix[index[i][1]] - meanppx );
syy += ( ny[index[i][0]] - meanpy ) * ( iy[index[i][1]] - meanppy );
#else
sxx += ( nx[index[i][0]] - meanpx ) * ( ref.x[index[i][1]] - meanppx );
sxy += ( nx[index[i][0]] - meanpx ) * ( ref.y[index[i][1]] - meanppy );
syx += ( ny[index[i][0]] - meanpy ) * ( ref.x[index[i][1]] - meanppx );
syy += ( ny[index[i][0]] - meanpy ) * ( ref.y[index[i][1]] - meanppy );
#endif
}
//computation of the resulting translation and rotation
//for method closest point match
dth = atan2f ( sxy-syx,sxx+syy );
dx = meanppx - ax - ( cosf ( dth ) * ( meanpx- ax ) - sinf ( dth ) * ( meanpy - ay ) );
dy = meanppy - ay - ( sinf ( dth ) * ( meanpx- ax ) + cosf ( dth ) * ( meanpy - ay ) );
ax += dx;
ay += dy;
ath+= dth;
ath = norm_a ( ath );
// //for SIMULATION iteration results..
// cout <<iter<<" "<<ax<<" "<<ay<<" "<<ath*PM_R2D<<" ;"<<endl;
#ifdef GR
cout <<"iter "<<iter<<" "<<ax<<" "<<ay<<" "<<ath*PM_R2D<<" "<<dx<<" "<<dy<<endl;
// if(iter==0)
dr_zoom();
usleep ( 10000 );
#endif
}//for iter
//cout <<iter<<endl;
#ifdef PM_GENERATE_RESULTS
end_tick =pm_msec();
fprintf ( f,"%i %lf %lf %lf %lf\n",iter,
end_tick-start_tick-dead_tick ,ax,ay,ath*PM_R2D );
fclose ( f );
#endif
lsa->rx =ax;lsa->ry=ay;lsa->th=ath;
return ( abs_err/n );
}//pm_icp
| [
"sven_glory@163.com"
] | sven_glory@163.com |
2d8d2071e438ce5b997f57d84d256904f33dc095 | 57c1e16107ae27d7a63e0b853d1d0a54c802061c | /Option 1/6.4/6_4.hpp | d74dd2690cf00929f61621a02a340230adcf2b75 | [] | no_license | Avdeenko-Dasha/1-cours | 31384098e524d8fb4726f466ed5f282c156932e0 | cea2fe36d5033dcf77861b2c938dce37b997df61 | refs/heads/main | 2023-08-24T17:05:38.754163 | 2021-10-11T21:14:43 | 2021-10-11T21:14:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 565 | hpp | #pragma once
#include <iostream>
#include <ctime>
#include <iomanip>
using namespace std;
enum WidthValues {
widthNum = 18,
widthSign = 8,
widthOrder = 10,
widthMant = 12,
widthLine = 44,
};
union DoubleUnion {
double num;struct InNumber {
unsigned long long mantissa : 52;
unsigned long long order : 11;
unsigned long long sign : 1;
}numData;
};
void draw_line(int n);
void generateData(DoubleUnion& st);
void output(DoubleUnion& st);
bool compNum(DoubleUnion& number1, DoubleUnion& number2);
| [
"avdeenko.dasha705@gmail.com"
] | avdeenko.dasha705@gmail.com |
48994f22d318a76fdd3a3d048b00faf6c7dfd754 | 1ca99f15544e768da94b3b41467b59ae6d7b4f58 | /sort_window.h | dee7fbb33c0181833b77280f18a6556777ac4ed1 | [] | no_license | napobiao/QT_Graduation | 5287224cfab751be3cd7a5344d5786b759ddc185 | c58d0b2754ec27a0009c8abe5743876672b6f1fe | refs/heads/master | 2021-09-10T01:01:57.208111 | 2018-03-20T12:29:42 | 2018-03-20T12:29:42 | 126,013,215 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 582 | h | #ifndef SORT_WINDOW
#define SORT_WINDOW
#include <QMainWindow>
#include <QDialog>
#include <QPushButton>
class Sort_Window : public QMainWindow
{
Q_OBJECT
public :
Sort_Window(QWidget *parent = 0);
~Sort_Window();
void sleep(unsigned int msec);
void begin_bubble();
void sort_bubble();
void change_bubble();
private:
int x,y,width,height;
int num[10];
QPushButton *num_button[10];
QDialog *d_bubble;
QPushButton *run_bubble;
QPushButton *open_source;
QPushButton *exit_window;
QPushButton *bubble_begin;
QPushButton *push_bubble[10];
};
#endif
| [
"hbchen1995@126.com"
] | hbchen1995@126.com |
a65b9473d6b6737bb5838ac71f3db36f03fc407b | bc5840a9334d654d48291da482acba7acaf8d58e | /source/Skybox.h | f3c1b2870e4c867fb47876d317e31b69c29e61d6 | [] | no_license | sebrussell/Engine | 2d624621631998a3286ce4b7100b9e429584fc2f | f99d734d6caddff4c25482d5c57ea2986d0a9331 | refs/heads/master | 2021-08-27T21:32:21.074662 | 2017-12-10T12:00:50 | 2017-12-10T12:00:50 | 106,965,382 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 832 | h | #ifndef SKYBOX_H
#define SKYBOX_H
class Model;
class Shader;
class MeshManager;
class Transform;
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "stb_image.h"
#include <memory>
#include <vector>
#include <iostream>
class Skybox
{
public:
Skybox() {};
~Skybox() {};
void Awake();
unsigned int loadCubemap();
void SetShader(std::weak_ptr<Shader> _shader);
void SetMeshManager(std::weak_ptr<MeshManager> _manager);
void SetCameraTransform(std::weak_ptr<Transform> _transform);
void Draw();
unsigned int GetSkyboxTexture() { return m_cubemapTexture; }
private:
std::weak_ptr<MeshManager> m_meshManager;
std::weak_ptr<Shader> m_shader;
std::weak_ptr<Model> m_skyboxMesh;
std::vector<std::string> m_faces;
unsigned int m_cubemapTexture;
std::weak_ptr<Transform> m_cameraTransform;
};
#endif | [
"sebrussell42@gmail.com"
] | sebrussell42@gmail.com |
a59360fcf81c53b3316b720901fda7ee24465ddb | 6be1c51c980e8906406762fe3c7b59ca6c09faaf | /SimpleKBot/KBotDrive.cpp | a086b75458bb2ac738955e38cad84771b0f2bb35 | [] | no_license | woodk/SimpleKBot | 4aed0122fa8a8e4b49bff3a966c31af85a6cd87f | 4433bd1ca71c3b39460032279dea4c089aa1eb04 | refs/heads/master | 2021-01-01T18:07:55.574893 | 2011-01-07T19:37:40 | 2011-01-07T19:37:40 | 1,035,746 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,724 | cpp | /*----------------------------------------------------------------------------*/
/* Copyright (c) KBotics 2010. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. */
/*----------------------------------------------------------------------------*/
#include "KBotDrive.h"
#include "GenericHID.h"
KBotDrive::KBotDrive(UINT32 leftMotorChannel, UINT32 rightMotorChannel) : RobotDrive(leftMotorChannel, rightMotorChannel){;}
KBotDrive::KBotDrive(UINT32 frontLeftMotorChannel, UINT32 rearLeftMotorChannel,
UINT32 frontRightMotorChannel, UINT32 rearRightMotorChannel) : RobotDrive(frontLeftMotorChannel, rearLeftMotorChannel, frontRightMotorChannel, rearRightMotorChannel){;}
KBotDrive::KBotDrive(SpeedController *leftMotor, SpeedController *rightMotor) : RobotDrive(leftMotor, rightMotor){;}
KBotDrive::KBotDrive(SpeedController &leftMotor, SpeedController &rightMotor) : RobotDrive(leftMotor, rightMotor){;}
KBotDrive::KBotDrive(SpeedController *frontLeftMotor, SpeedController *rearLeftMotor,
SpeedController *frontRightMotor, SpeedController *rearRightMotor)
: RobotDrive(frontLeftMotor, rearLeftMotor, frontRightMotor, rearRightMotor){;}
KBotDrive::KBotDrive(SpeedController &frontLeftMotor, SpeedController &rearLeftMotor,
SpeedController &frontRightMotor, SpeedController &rearRightMotor)
: RobotDrive(frontLeftMotor, rearLeftMotor, frontRightMotor, rearRightMotor){;}
/**
* Arcade drive implements single stick driving.
* Given a single Joystick, the class assumes the Y axis for the move value and the X axis
* for the rotate value.
* (Should add more information here regarding the way that arcade drive works.)
* @param stick The joystick to use for Arcade single-stick driving. The Y-axis will be selected
* for forwards/backwards and the X-axis will be selected for rotation rate.
* @param squaredInputs If true, the sensitivity will be increased for small values
*/
void KBotDrive::ArcadeDrive(GenericHID *stick, bool squaredInputs)
{
// simply call the full-featured ArcadeDrive with the appropriate values
ArcadeDrive(stick->GetY(), stick->GetX(), stick->GetTrigger());
}
/**
* Arcade drive implements single stick driving.
* Given a single Joystick, the class assumes the Y axis for the move value and the X axis
* for the rotate value.
* (Should add more information here regarding the way that arcade drive works.)
* @param stick The joystick to use for Arcade single-stick driving. The Y-axis will be selected
* for forwards/backwards and the X-axis will be selected for rotation rate.
* @param squaredInputs If true, the sensitivity will be increased for small values
*/
void KBotDrive::ArcadeDrive(GenericHID &stick, bool squaredInputs)
{
// simply call the full-featured ArcadeDrive with the appropriate values
ArcadeDrive(stick.GetY(), stick.GetX(), stick.GetTrigger());
}
/**
* Arcade drive implements single stick driving.
* Given two joystick instances and two axis, compute the values to send to either two
* or four motors.
* @param moveStick The Joystick object that represents the forward/backward direction
* @param moveAxis The axis on the moveStick object to use for fowards/backwards (typically Y_AXIS)
* @param rotateStick The Joystick object that represents the rotation value
* @param rotateAxis The axis on the rotation object to use for the rotate right/left (typically X_AXIS)
* @param squaredInputs Setting this parameter to true increases the sensitivity at lower speeds
*/
void KBotDrive::ArcadeDrive(GenericHID* moveStick, UINT32 moveAxis,
GenericHID* rotateStick, UINT32 rotateAxis,
bool squaredInputs)
{
float moveValue = moveStick->GetRawAxis(moveAxis);
float rotateValue = rotateStick->GetRawAxis(rotateAxis);
ArcadeDrive(moveValue, rotateValue, squaredInputs);
}
/**
* Arcade drive implements single stick driving.
* Given two joystick instances and two axis, compute the values to send to either two
* or four motors.
* @param moveStick The Joystick object that represents the forward/backward direction
* @param moveAxis The axis on the moveStick object to use for fowards/backwards (typically Y_AXIS)
* @param rotateStick The Joystick object that represents the rotation value
* @param rotateAxis The axis on the rotation object to use for the rotate right/left (typically X_AXIS)
* @param squaredInputs Setting this parameter to true increases the sensitivity at lower speeds
*/
void KBotDrive::ArcadeDrive(GenericHID &moveStick, UINT32 moveAxis,
GenericHID &rotateStick, UINT32 rotateAxis,
bool squaredInputs)
{
float moveValue = moveStick.GetRawAxis(moveAxis);
float rotateValue = rotateStick.GetRawAxis(rotateAxis);
ArcadeDrive(moveValue, rotateValue, squaredInputs);
}
/**
* Arcade drive implements single stick driving.
* This function lets you directly provide joystick values from any source.
* @param moveValue The value to use for fowards/backwards
* @param rotateValue The value to use for the rotate right/left
* @param squaredInputs If set, increases the sensitivity at low speeds
*/
void KBotDrive::ArcadeDrive(float moveValue, float rotateValue, bool squaredInputs)
{
// local variables to hold the computed PWM values for the motors
float leftMotorSpeed;
float rightMotorSpeed;
moveValue = Limit(moveValue);
rotateValue = Limit(rotateValue);
if (squaredInputs)
{
// square the inputs (while preserving the sign) to increase fine control while permitting full power
if (moveValue >= 0.0)
{
moveValue = (moveValue * moveValue);
}
else
{
moveValue = -(moveValue * moveValue);
}
if (rotateValue >= 0.0)
{
rotateValue = (rotateValue * rotateValue);
}
else
{
rotateValue = -(rotateValue * rotateValue);
}
}
leftMotorSpeed = moveValue - rotateValue;
rightMotorSpeed = moveValue + rotateValue;
// Modify reverse so that back-left goes back-left and back-right goes back-right
if (moveValue<0) { // Joystick backwards (NOTE: < not > for new robot)
leftMotorSpeed += 2*moveValue*rotateValue;
rightMotorSpeed -= 2*moveValue*rotateValue;
}
if (leftMotorSpeed>0.95)
leftMotorSpeed=1.0;
if (leftMotorSpeed<-0.95)
leftMotorSpeed=-1.0;
if (rightMotorSpeed>0.95)
rightMotorSpeed=1.0;
if (rightMotorSpeed<-0.95)
rightMotorSpeed=-1.0;
SetLeftRightMotorOutputs(leftMotorSpeed, rightMotorSpeed);
m_fLeftSpeed = leftMotorSpeed;
m_fRightSpeed = rightMotorSpeed;
}
| [
"woodk@limestone.on.ca"
] | woodk@limestone.on.ca |
2dbcc32031116ff660d57f939ca214a7d29b8427 | 7a68a9c3473feceb613dbc0b390e4b02a276f460 | /leetcode/medium/1026_maximum_difference_between_node_and_ancestor.cpp | 64c5dd6c0c06ba12b32b9ea9d92ff4a600b002e1 | [] | no_license | pzins/Programming | 88cab57200921c1fd9a44568162463f4f0f5e3ab | 45e1466fcf28933aa8a3c85ee8590430ced90db4 | refs/heads/master | 2023-07-20T09:56:03.379507 | 2023-07-18T15:33:15 | 2023-07-18T15:33:15 | 199,602,171 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 909 | cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
void fct(TreeNode* n, int& maxi, vector<int> others) {
if(n != nullptr)
{
int tmp = 0;
for(int i = 0; i < others.size(); ++i)
{
tmp = max(abs(others[i]-n->val), tmp);
}
maxi = max(tmp, maxi);
others.push_back(n->val);
fct(n->left, maxi, others);
fct(n->right, maxi, others);
}
}
public:
int maxAncestorDiff(TreeNode* root) {
int res = 0;
vector<int> others = {};
fct(root, res, others);
return res;
}
};
| [
"zins.pierre@gmail.com"
] | zins.pierre@gmail.com |
360920b90b0595bb9f9944769ec485134f49ca43 | 045c95bed63c0845d95101c3993926dcac4380a4 | /calculator.cpp | 7f902abc3431954924b01fec173666c45bf57bb3 | [] | no_license | ujikstark/SimpleCalculatorC | 642635ff3abbc2ef49007c567a5afe33661ed637 | 934de23f27dd04ffb6d84c693d894c3156df8710 | refs/heads/main | 2023-07-20T01:56:30.417823 | 2021-08-30T06:58:06 | 2021-08-30T06:58:06 | 401,242,834 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 824 | cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
char op = '+';
int num;
int res = 0;
stack<int> s;
int t = 0;
while (op != '=') {
cin >> num;
if (op == '+') {
res += num;
if (t > 0)
s.push(res - num);
} else if (op == '-') {
res -= num;
if (t > 0)
s.push(res + num);
} else if (op == '*') {
if (s.empty()) {
res *= num;
} else {
int temp = res - s.top();
temp *= num;
res = s.top() + temp;
}
} else if (op == '/') {
if (s.empty()) {
res /= num;
} else {
int temp = res - s.top();
temp /= num;
res = s.top() + temp;
}
} else {
break;
}
cin >> op;
t++;
}
if (res == 0 && t == 1) cout << num;
else
cout << res;
return 0;
}
| [
"ujikbauk@gmail.com"
] | ujikbauk@gmail.com |
6de8c1a5c5a3572a6989281331c6c466a82105bd | 99fe750ffd06ae7b33d13d69bf625a9c36169df3 | /volume004/444 -Encoder and decoder.cpp | 81e43ba66ab5e0363844fc8c6f93950d86324a58 | [] | no_license | ahmrf/UVa | 5edb2edbc912f837a9884584ab42b73c573a3385 | 6b815d4df74f52e30b01d345b1e41cdd34b0f7da | refs/heads/master | 2021-01-21T01:49:33.721538 | 2016-04-06T16:20:51 | 2016-04-06T16:20:51 | 34,123,479 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,415 | cpp | #include<string>
#include<cstring>
#include<iostream>
#include<sstream>
#include<cstdio>
#include<algorithm>
using namespace std;
string to_string(int num)
{
stringstream ss;
string s;
ss << num;
ss >> s;
return s;
}
int main (void)
{
char asci[123], ch = '\0';
for(int i = 0; i<123; i++)
asci[i] = ch + i;
string str;
while(getline(cin, str))
{
int len = str.length();
if(str[0] <= 57 && str[0] >= 48)
{
string s, out;
for(int i = len-1; i >= 0; i--)
{
if(str[i] == '1')
{
int num = (str[i]-'0')*100 + (str[i-1]-'0')*10 + str[i-2] - '0';
out += asci[num];
i-=2;
}
else
{
int num = (str[i]-'0')*10 + str[i-1] - '0';
out += asci[num];
i--;
}
}
cout << out << endl;
}
else
{
string out, s;
for(int i = len-1; i>=0; i--)
{
int num = str[i];
s = to_string(num);
reverse(s.begin(), s.end());
out += s;
}
cout << out << endl;
}
}
return 0;
}
| [
"bsse0621@iit.du.ac.bd"
] | bsse0621@iit.du.ac.bd |
e3024a4b29a0f1891c300e900e6d2d0b81c4ffcf | 0d2c96accaff0a8fa46b947142f1176a58d7c5df | /c++/3_red_belt/4_week/web_server/http_request.h | ddbe904ddd55cbd3d06868e6de5224c4701db264 | [] | no_license | GlebKirsan/coursera | ece415a8c08b60cfc26d0efce95554833ac782c2 | 3c3bc2beaa855e1418459c87046f683e7c419bf1 | refs/heads/master | 2021-09-01T11:11:17.984403 | 2021-08-24T13:15:41 | 2021-08-24T13:15:41 | 144,696,947 | 6 | 0 | null | 2020-01-31T00:01:46 | 2018-08-14T09:14:04 | MATLAB | UTF-8 | C++ | false | false | 130 | h | #pragma once
#include <string_view>
using namespace std;
struct HttpRequest {
string_view method, uri, protocol;
};
| [
"glkv@protonmail.ch"
] | glkv@protonmail.ch |
c8779149159e22946259274d0d309a323b5acc77 | 1b55fa9c97d777be0b84b088cf73fd3f3d8812ae | /7/8.cpp | 221292b8f0d1d59b731b8c6b1e5dfaf9e334a7aa | [] | no_license | arshrapov/abraman_answers | 0e432752ef8e2e924ea2c13f293e52aaf3b8831d | 9cbdf872f9c78f857f9fed9e4b6f955e25c4fada | refs/heads/master | 2022-05-23T14:47:35.601263 | 2020-04-29T16:46:12 | 2020-04-29T16:46:12 | 259,694,937 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 71 | cpp | #include <iostream>
int main () {
using namespace std;
return 0;
}
| [
"ashrapov.rafa@yandex.com"
] | ashrapov.rafa@yandex.com |
cbfb41c9ebec8af5b0c94ff28a6f8877a20967f8 | 6b1e4e7ca1259dd290f149a6ae7e2836c621e1f8 | /EncryptionDecryption/Matrix (2).cpp | fd8858d5fbc8b95977209863e3ab0eba989a54a4 | [] | no_license | Mehraaj/Encryption | 68d4642a433645426688be584369bccfaaa343cf | bef9c885a5c23bd972b4fa055aab4acd997596c2 | refs/heads/master | 2021-01-20T16:04:20.870773 | 2017-06-29T02:56:53 | 2017-06-29T02:56:53 | 95,722,005 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 246 | cpp | #include <iostream>
#include <string>
#include <Windows.h>
#include <ctime>
#include <cstdlib>
#include <iomanip>
using namespace std;
int main()
{
float mat[3][3];
float pt[3][1];
int p1;
int p2;
int p3;
float val;
} | [
"noreply@github.com"
] | Mehraaj.noreply@github.com |
4a4f68411c93039314ed69d21f62c41cca19afeb | 87afd2b9face99ac5553f6dd4cf9595f754c6650 | /definitivo/GetTheBall/GetTheBall/UserPositionUpdating.cpp | 44df68646c98a1a0c326cfa538bed0bc64fb7b86 | [] | no_license | LauraLaureus/PickTheCow | 5ca3f343d9d1ba03712e9d43763bd311cd9e5ba8 | 97f5f95daf24227f24310e60cdaa349ef17c1aed | refs/heads/master | 2021-01-17T19:51:57.935594 | 2016-06-06T17:00:02 | 2016-06-06T17:00:02 | 60,543,688 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,221 | cpp | #include "UserPositionUpdating.h"
#include "Conversion.h"
#include "Coordinates3DCalculation.h"
UserPositionUpdating::UserPositionUpdating(Game& game)
: game(game) {
}
UserPositionUpdating::UserPositionUpdating(const UserPositionUpdating& userPositionUpdating)
: game(userPositionUpdating.game) {
}
UserPositionUpdating& UserPositionUpdating::operator=(const UserPositionUpdating& userPositionUpdating) {
if (this != &userPositionUpdating) {
this->game = userPositionUpdating.game;
}
return *this;
}
UserPositionUpdating::~UserPositionUpdating() {
}
void UserPositionUpdating::updateUserPositionByCell(int rowIndex, int columnIndex) {
Coordinates3D roomPosition = game.getScene().getRoomXY().getPosition();
Coordinates3D relativePosition = Coordinates3DCalculation(rowIndex, columnIndex, game.getGameArea(), roomPosition.getY()).executeByCells();
updateUserPosition(
Coordinates3D(
roomPosition.getX() + relativePosition.getX(),
roomPosition.getY() + relativePosition.getY(),
roomPosition.getZ() + relativePosition.getZ()));
}
void UserPositionUpdating::updateUserPositionBySubCell(int subRowIndex, int subColumnIndex) {
Coordinates3D roomPosition = game.getScene().getRoomXY().getPosition();
Coordinates3D relativePosition = Coordinates3DCalculation(subRowIndex, subColumnIndex, game.getGameArea(), roomPosition.getY()).executeBySubCells();
updateUserPosition(
Coordinates3D(
roomPosition.getX() + relativePosition.getX(),
roomPosition.getY() + relativePosition.getY(),
roomPosition.getZ() + relativePosition.getZ()));
}
void UserPositionUpdating::updateUserPositionByPoint(int x, int y) {
GameArea gameArea = game.getGameArea();
int subRowIndex = gameArea.getSubRowIndexFromRealWorld(y);
int subColumnIndex = gameArea.getSubColumnIndexFromRealWorld(x);
updateUserPositionBySubCell(subRowIndex, subColumnIndex);
}
void UserPositionUpdating::updateUserPosition(Coordinates3D newPosition) {
Scene scene = game.getScene();
User user = scene.getUser();
Object3D& userObject = user.getObject3D();
userObject.setPosition(newPosition);
user.setObject3D(userObject);
scene.setUser(user);
game.setScene(scene);
}
| [
"l4depende@gmail.com"
] | l4depende@gmail.com |
67f0a8d188eddff4251de57c207eaba16b02e9ab | 4503b4ec29e9a30d26c433bac376f2bddaefd9e5 | /RealDWG/2012/x64/Inc/dbDictUtil.h | cca94e63bb53640d5adc683e0bd46cac243d2e9a | [] | no_license | SwunZH/ecocommlibs | 0a872e0bbecbb843a0584fb787cf0c5e8a2a270b | 4cff09ff1e479f5f519f207262a61ee85f543b3a | refs/heads/master | 2021-01-25T12:02:39.067444 | 2018-02-23T07:04:43 | 2018-02-23T07:04:43 | 123,447,012 | 1 | 0 | null | 2018-03-01T14:37:53 | 2018-03-01T14:37:53 | null | UTF-8 | C++ | false | false | 7,749 | h | // $Header: //depot/release/ironman2012/develop/global/inc/dbxsdk/dbDictUtil.h#1 $ $Change: 237375 $ $DateTime: 2011/01/30 18:32:54 $ $Author: integrat $
// $NoKeywords: $
#ifndef AD_DBDICTUTIL_H
#define AD_DBDICTUTIL_H 1
//
// (C) Copyright 1998-2006, 2010 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
// DESCRIPTION:
//
// The following are some dictionary utility functions similar
// to those defined for symbol tables in dbsymutl.h
// NOTE: These utils have the same usage guidelines as the symbol
// table versions. That is; These functions are very handy for
// quick one-time access to the name or id of a dictionary entry.
// On the other hand; if you need to make multiple accesses to
// a given dictionary, then avoid the overhead of these functions
// and open the dictionary directly.
//
// -----------------------
// Get the ID of an item
// -----------------------
// General purpose:
// Acad::ErrorStatus
// AcDbDictUtil::dictionaryGetAt(AcDbObjectId& id, const ACHAR* name, AcDbObjectId ownerDictId);
//
// Specific:
// Acad::ErrorStatus
// AcDbDictUtil::getGroupId(AcDbObjectId& id, const ACHAR* name, AcDbDatabase* pDb);
// also...
// getLayoutId
// getPlotSettingsId
// getPlotStyleNameId
// getMaterialId
// getColorId
// getTableStyleId
//
// -----------------------
// Get the NAME/KEY of an item:
// -----------------------
// General purpose:
// Acad::ErrorStatus
// AcDbDictUtil::dictionaryNameAt(ACHAR*& pName, AcDbObjectId itemId, AcDbObjectId ownerDictId);
// or...
// Acad::ErrorStatus
// AcDbDictUtil::dictionaryNameAt(ACHAR*& pName, AcDbObjectId itemId);
//
// Specific:
// Acad::ErrorStatus
// AcDbDictUtil::getGroupName(ACHAR*& name, AcDbObjectId id);
// also...
// getLayoutName
// getPlotSettingsName
// getPlotStyleNameName
// getMaterialName
// getColorName
// getTableStyleName
//
// NOTE: The "get name" functions allocate the returned string.
// The calling application is responsible for deallocating the memory
// used by the returned string.
//
// -----------------------
// Check for existence
// -----------------------
//
// bool hasGroup(const ACHAR* name, AcDbDatabase* pDb);
// also...
// hasLayout
// hasPlotSettings
// hasPlotStyleName
// hasMaterial
// hasColor
// hasTableStyle
//
#include <assert.h>
#include <stddef.h>
#include "dbdict.h"
#include "AcString.h"
namespace AcDbDictUtil
{
inline Acad::ErrorStatus
dictionaryNameAt(ACHAR*& pName, AcDbObjectId itemId, AcDbObjectId ownerDictId)
{
assert(!itemId.isNull() && !ownerDictId.isNull());
AcDbDictionary* pDict;
Acad::ErrorStatus es = acdbOpenObject(pDict, ownerDictId, AcDb::kForRead);
if (es == Acad::eOk) {
es = pDict->nameAt(itemId, pName);
pDict->close();
}
return es;
}
inline Acad::ErrorStatus
dictionaryNameAt(AcString& name, AcDbObjectId itemId, AcDbObjectId ownerDictId)
{
assert(!itemId.isNull() && !ownerDictId.isNull());
AcDbDictionary* pDict;
Acad::ErrorStatus es = acdbOpenObject(pDict, ownerDictId, AcDb::kForRead);
if (es == Acad::eOk) {
es = pDict->nameAt(itemId, name);
pDict->close();
}
return es;
}
//Note: If you already know the owner of itemId, then call the overloaded
// version above to avoid an extra call to acdbOpenObject.
inline Acad::ErrorStatus
dictionaryNameAt(ACHAR*& pName, AcDbObjectId itemId)
{
assert(!itemId.isNull());
AcDbObject* pObject;
Acad::ErrorStatus es = acdbOpenObject(pObject, itemId, AcDb::kForRead);
if (es != Acad::eOk)
return es;
AcDbObjectId dictId = pObject->ownerId(); //get the owner id
es = pObject->close();
assert(es == Acad::eOk);
return dictionaryNameAt(pName, itemId, dictId);
}
//Note: If you already know the owner of itemId, then call the overloaded
// version above to avoid an extra call to acdbOpenObject.
inline Acad::ErrorStatus
dictionaryNameAt(AcString& name, AcDbObjectId itemId)
{
assert(!itemId.isNull());
AcDbObject* pObject;
Acad::ErrorStatus es = acdbOpenObject(pObject, itemId, AcDb::kForRead);
if (es != Acad::eOk)
return es;
AcDbObjectId dictId = pObject->ownerId(); //get the owner id
es = pObject->close();
assert(es == Acad::eOk);
return dictionaryNameAt(name, itemId, dictId);
}
// Given a dictionary and a key name, retrieve the id for that entry.
inline Acad::ErrorStatus
dictionaryGetAt(AcDbObjectId& id, const ACHAR* name, AcDbObjectId ownerDictId)
{
assert(!ownerDictId.isNull());
AcDbDictionary* pDict;
Acad::ErrorStatus es = acdbOpenObject(pDict, ownerDictId, AcDb::kForRead);
assert(es == Acad::eOk);
if (es == Acad::eOk) {
es = pDict->getAt(name, id);
pDict->close();
}
return es;
}
#define DBDICTUTIL_MAKE_DICTIONARY_UTILS(LOWERNAME, UPPERNAME) \
inline Acad::ErrorStatus \
get##UPPERNAME##Id(AcDbObjectId& id, const ACHAR* name, AcDbDatabase* pDb) \
{ \
assert(pDb != NULL); \
return (pDb != NULL) \
? dictionaryGetAt(id, name, pDb->LOWERNAME##DictionaryId()) \
: Acad::eInvalidInput; \
} \
inline Acad::ErrorStatus \
get##UPPERNAME##Name(ACHAR*& name, AcDbObjectId itemId) \
{ \
AcDbDatabase* pDb = itemId.database(); \
return (pDb != NULL) \
? dictionaryNameAt(name, itemId, pDb->LOWERNAME##DictionaryId()) \
: Acad::eInvalidInput; \
} \
inline Acad::ErrorStatus \
get##UPPERNAME##Name(AcString& name, AcDbObjectId itemId) \
{ \
AcDbDatabase* pDb = itemId.database(); \
return (pDb != NULL) \
? dictionaryNameAt(name, itemId, pDb->LOWERNAME##DictionaryId()) \
: Acad::eInvalidInput; \
} \
inline bool \
has##UPPERNAME(const ACHAR* name, AcDbDatabase* pDb) \
{ \
AcDbObjectId id; \
return (get##UPPERNAME##Id(id, name, pDb) == Acad::eOk); \
}
DBDICTUTIL_MAKE_DICTIONARY_UTILS( mLStyle, MLStyle)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( group, Group)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( layout, Layout)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( plotSettings, PlotSettings)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( plotStyleName, PlotStyleName)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( material, Material)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( color, Color)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( tableStyle, TableStyle)
DBDICTUTIL_MAKE_DICTIONARY_UTILS( visualStyle, VisualStyle)
#undef DBDICTUTIL_MAKE_DICTIONARY_UTILS
} // end AcDbDictUtil namespace
#endif // !AD_DBDICTUTIL_H
| [
"jwMoon@3e9e098e-e079-49b3-9d2b-ee27db7392fb"
] | jwMoon@3e9e098e-e079-49b3-9d2b-ee27db7392fb |
c42e783a7c91f3d89a16303e3eb4f56989694de2 | 00a6118df8a147bddc983e370cbfa96b655b55e2 | /01-basics/binary_fixed_point/cnl/include/cnl/_impl/fixed_point/extras.h | 9486ba32f2a773a29dcade045a0488b938fd98ed | [
"MIT"
] | permissive | initdb/RA-Uebung | ac7ae4d75c7c769c6efc63795093791227efbbe4 | 05eeb315be4cdc56e554596b8204b5a4bd43d06b | refs/heads/master | 2020-05-03T04:49:35.740783 | 2019-03-29T15:48:04 | 2019-03-29T15:48:04 | 178,432,678 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,496 | h |
// Copyright John McFarlane 2015 - 2016.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file ../LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file
/// \brief supplemental definitions related to the `cnl::fixed_point` type;
/// definitions that straddle two homes, e.g. fixed_point and cmath, traits or limits;
/// included from cnl/fixed_point.h - do not include directly!
#if !defined(CNL_FIXED_POINT_EXTRAS_H)
#define CNL_FIXED_POINT_EXTRAS_H 1
#include "to_chars.h"
#include "type.h"
#include "../cmath/abs.h"
#include "../config.h"
#include "../num_traits/fixed_width_scale.h"
#include "../num_traits/unwrap.h"
#include "../unreachable.h"
#include <cmath>
#if defined(CNL_IOSTREAM_ENABLED)
#include <istream>
#include <ostream>
#endif
/// compositional numeric library
namespace cnl {
////////////////////////////////////////////////////////////////////////////////
// cnl::abs
/// \brief absolute value
/// \headerfile cnl/fixed_point.h
///
/// \param x input parameter
///
/// \return `|x|`
///
/// \sa \ref std::vector
template<typename Rep, int Exponent, int Radix>
constexpr auto abs(fixed_point<Rep, Exponent, Radix> const& x) noexcept
-> decltype(-x)
{
return (x>=fixed_point<Rep, Exponent, Radix>{}) ? static_cast<decltype(-x)>(x) : -x;
}
////////////////////////////////////////////////////////////////////////////////
// cnl::sqrt helper functions
namespace _impl {
template<class Rep>
constexpr Rep sqrt_solve3(
Rep n,
Rep bit,
Rep result)
{
return (bit!=Rep{0})
? (n>=result+bit)
? sqrt_solve3<Rep>(
static_cast<Rep>(n-(result+bit)),
static_cast<Rep>(bit >> 2),
static_cast<Rep>((result >> 1)+bit))
: sqrt_solve3<Rep>(
n,
static_cast<Rep>(bit >> 2),
static_cast<Rep>(result >> 1))
: result;
}
template<int Exponent>
struct sqrt_solve1 {
template<class Rep>
constexpr Rep operator()(Rep n) const
{
using widened_rep = _impl::set_width_t<Rep, _impl::width<Rep>::value*2>;
return static_cast<Rep>(sqrt_solve3<widened_rep>(
_impl::fixed_width_scale<-Exponent>(static_cast<widened_rep>(n)),
widened_rep((widened_rep{1}<<((countr_used(n)+1-Exponent)&~1))>>2),
widened_rep{0}));
}
};
}
////////////////////////////////////////////////////////////////////////////////
// cnl::sqrt
/// \brief calculates the square root of a \ref fixed_point value
/// \headerfile cnl/fixed_point.h
///
/// \param x input parameter
///
/// \return square root of x
///
/// \note This function is a placeholder implementation with poor run-time performance characteristics.
///
/// \sa multiply
// https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Binary_numeral_system_.28base_2.29
template<typename Rep, int Exponent, int Radix>
constexpr fixed_point <Rep, Exponent, Radix>
sqrt(fixed_point<Rep, Exponent, Radix> const& x)
{
using type = fixed_point<Rep, Exponent, Radix>;
return _impl::to_rep(x)<0
? _impl::unreachable<type>("negative value passed to cnl::sqrt")
: type{_impl::from_rep<type>(_impl::sqrt_solve1<Exponent>{}(unwrap(x)))};
}
////////////////////////////////////////////////////////////////////////////////
// cnl::floor
template<class Rep, int Exponent, int Radix,
_impl::enable_if_t<(Exponent<0), int> dummy = 0>
constexpr auto floor(fixed_point<Rep, Exponent, Radix> const& x)
-> decltype(_impl::from_rep<fixed_point<Rep, 0, Radix>>(_impl::to_rep(x)>>constant<-Exponent>())) {
static_assert(
Radix==2,
"cnl::floor(fixed_point<Rep, Exponent, Radix>) not implemented for Exponent<0 && Radix!=2");
return _impl::from_rep<fixed_point<Rep, 0, Radix>>(_impl::to_rep(x)>>constant<-Exponent>());
}
template<class Rep, int Exponent, int Radix>
constexpr auto floor(fixed_point<Rep, Exponent, Radix> const& x)
-> _impl::enable_if_t<Exponent>=0, fixed_point<Rep, Exponent, Radix>> {
return x;
}
////////////////////////////////////////////////////////////////////////////////
// fixed_point trig functions
//
// Placeholder implementations fall back on <cmath> functions which is slow
// due to conversion to and from floating-point types; also inconvenient as
// many <cmath> functions are not constexpr.
namespace _impl {
template<int NumBits, class Enable = void>
struct float_of_size;
template<int NumBits>
struct float_of_size<NumBits, enable_if_t<NumBits <= sizeof(float)*CHAR_BIT>> {
using type = float;
};
template<int NumBits>
struct float_of_size<NumBits, enable_if_t<sizeof(float)*CHAR_BIT < NumBits && NumBits <= sizeof(double)*CHAR_BIT>> {
using type = double;
};
template<int NumBits>
struct float_of_size<NumBits, enable_if_t<sizeof(double)*CHAR_BIT < NumBits && NumBits <= sizeof(long double)*CHAR_BIT>> {
using type = long double;
};
template<class T>
using float_of_same_size = typename float_of_size<_impl::width<T>::value>::type;
template<typename Rep, int Exponent, int Radix, _impl::float_of_same_size<Rep>(* F)(
_impl::float_of_same_size<Rep>)>
constexpr fixed_point <Rep, Exponent, Radix>
crib(fixed_point<Rep, Exponent, Radix> const& x) noexcept
{
using floating_point = _impl::float_of_same_size<Rep>;
return static_cast<fixed_point<Rep, Exponent, Radix>>(F(static_cast<floating_point>(x)));
}
}
template<typename Rep, int Exponent, int Radix>
constexpr fixed_point <Rep, Exponent, Radix>
sin(fixed_point<Rep, Exponent, Radix> const& x) noexcept
{
return _impl::crib<Rep, Exponent, Radix, std::sin>(x);
}
template<typename Rep, int Exponent, int Radix>
constexpr fixed_point <Rep, Exponent, Radix>
cos(fixed_point<Rep, Exponent, Radix> const& x) noexcept
{
return _impl::crib<Rep, Exponent, Radix, std::cos>(x);
}
template<typename Rep, int Exponent, int Radix>
constexpr fixed_point <Rep, Exponent, Radix>
exp(fixed_point<Rep, Exponent, Radix> const& x) noexcept
{
return _impl::crib<Rep, Exponent, Radix, std::exp>(x);
}
template<typename Rep, int Exponent, int Radix>
constexpr fixed_point <Rep, Exponent, Radix>
pow(fixed_point<Rep, Exponent, Radix> const& x) noexcept
{
return _impl::crib<Rep, Exponent, Radix, std::pow>(x);
}
////////////////////////////////////////////////////////////////////////////////
// cnl::fixed_point streaming - (placeholder implementation)
template<typename Rep, int Exponent, int Radix>
::std::ostream& operator<<(::std::ostream& out, fixed_point<Rep, Exponent, Radix> const& fp)
{
return out << to_chars(fp).data();
}
template<typename Rep, int Exponent, int Radix>
::std::istream& operator>>(::std::istream& in, fixed_point <Rep, Exponent, Radix>& fp)
{
long double ld;
in >> ld;
fp = ld;
return in;
}
}
namespace cnl {
////////////////////////////////////////////////////////////////////////////////
// std::numeric_limits for cnl::fixed_point
// note: some members are guessed,
// some are temporary (assuming rounding style, traps etc.)
// and some are undefined
template<typename Rep, int Exponent, int Radix>
struct numeric_limits<cnl::fixed_point<Rep, Exponent, Radix>>
: numeric_limits<cnl::_impl::number_base<cnl::fixed_point<Rep, Exponent, Radix>, Rep>> {
// fixed-point-specific helpers
using _value_type = cnl::fixed_point<Rep, Exponent, Radix>;
using _rep = typename _value_type::rep;
using _rep_numeric_limits = numeric_limits<_rep>;
// standard members
static constexpr _value_type min() noexcept
{
return _impl::from_rep<_value_type>(_rep{1});
}
static constexpr _value_type max() noexcept
{
return _impl::from_rep<_value_type>(_rep_numeric_limits::max());
}
static constexpr _value_type lowest() noexcept
{
return _impl::from_rep<_value_type>(_rep_numeric_limits::lowest());
}
static constexpr bool is_integer = false;
static constexpr _value_type epsilon() noexcept
{
return _impl::from_rep<_value_type>(_rep{1});
}
static constexpr _value_type round_error() noexcept
{
return _impl::from_rep<_value_type>(_rep{0});
}
static constexpr _value_type infinity() noexcept
{
return _impl::from_rep<_value_type>(_rep{0});
}
static constexpr _value_type quiet_NaN() noexcept
{
return _impl::from_rep<_value_type>(_rep{0});
}
static constexpr _value_type signaling_NaN() noexcept
{
return _impl::from_rep<_value_type>(_rep{0});
}
static constexpr _value_type denorm_min() noexcept
{
return _impl::from_rep<_value_type>(_rep{1});
}
};
}
namespace std {
////////////////////////////////////////////////////////////////////////////////
// std::numeric_limits specialization for rounding_integer
template<typename Rep, int Exponent, int Radix>
struct numeric_limits<cnl::fixed_point<Rep, Exponent, Radix>>
: cnl::numeric_limits<cnl::fixed_point<Rep, Exponent, Radix>> {
};
template<typename Rep, int Exponent, int Radix>
struct numeric_limits<cnl::fixed_point<Rep, Exponent, Radix> const>
: cnl::numeric_limits<cnl::fixed_point<Rep, Exponent, Radix>> {
};
}
#endif // CNL_FIXED_POINT_EXTRAS_H
| [
"benedict.schwind@live.de"
] | benedict.schwind@live.de |
3a3790db462b05b95d3d2db638c09c26a5508818 | 4b88fe8b782cbedf048ec406d99b50d8e21a9f2c | /src/Geometry/Frustum.cpp | 2d31eddc803b779c20e1ed15774be56db2d5ca74 | [] | no_license | Senryoku/SEngine | d41fa3400b62ee274c760d6c902c2f0734d42c3a | 8235d22d87b5f2967437b2d19b6bc02100f792fa | refs/heads/master | 2021-06-06T10:15:47.880495 | 2021-05-23T00:53:04 | 2021-05-23T00:53:04 | 38,825,325 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,288 | cpp | #include <Frustum.hpp>
Frustum::Frustum(const glm::mat4& projmat)
{
// Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
// Gribb & Hartmann
// http://www8.cs.umu.se/kurser/5DV051/HT12/lab/plane_extraction.pdf
// https://stackoverflow.com/questions/12836967/extracting-view-frustum-planes-hartmann-gribbs-method
std::array<std::array<float, 4>, 6> coeff;
for(int i = 0; i < 4; ++i)
{
coeff[Top][i] = projmat[i][3] - projmat[i][1];
coeff[Bottom][i] = projmat[i][3] + projmat[i][1];
coeff[Left][i] = projmat[i][3] + projmat[i][0];
coeff[Right][i] = projmat[i][3] - projmat[i][0];
coeff[Near][i] = projmat[i][3] + projmat[i][2];
coeff[Far][i] = projmat[i][3] - projmat[i][2];
}
for(int i = 0; i < 6; ++i)
planes[i].setCoefficients(coeff[i]);
}
bool Frustum::isIntersecting(const AABB<glm::vec3>& aabb) const
{
// http://old.cescg.org/CESCG-2002/DSykoraJJelinek/
glm::vec3 m = (aabb.max + aabb.min) / 2.0f;
glm::vec3 d = aabb.max - m;
for(int i = 0; i < 6; ++i)
{
float mf = glm::dot(m, planes[i].getNormal()) + planes[i][3];
float n = glm::dot(d, glm::abs(planes[i].getNormal()));
if(mf + n < 0) return false; // Strictly outside
if(mf - n < 0) return true; // Intersecting
}
return true;
}
| [
"maretverdant@gmail.com"
] | maretverdant@gmail.com |
76eb86720131af1b386a69278c1aedbd004af16c | 8153511d8167c75f3439090f883ed67bfbd3d083 | /Palindrome.cpp | adbbff411a608825cddbfae46996edadd6d6fc0e | [] | no_license | PoorMonk/LeetCode | d0f6aedfc181bc39d928332f8c64225a189bb560 | 0fede9a202fef820fe5bc71d6ea1a56b802baed5 | refs/heads/master | 2021-05-15T05:23:48.513832 | 2018-02-08T05:59:41 | 2018-02-08T05:59:41 | 117,074,541 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 539 | cpp | /*
Determine whether an integer is a palindrome. Do this without extra space.
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
bool isPalindrome(int x)
{
//负数不是回文数
return (0 <= x && x == reverse(x));
}
private:
int reverse(int x)
{
int y = 0;
while (x)
{
y = y * 10 + x % 10;
x = x / 10;
}
return y;
}
};
int main()
{
Solution s;
if (s.isPalindrome(2147447412))
{
cout << "True..." << endl;
}
else
{
cout << "False..." << endl;
}
return 0;
}
| [
"ji.he@3glasses.com"
] | ji.he@3glasses.com |
a8ee240497866b04b62dd536ba44440555ddfbad | 5885fd1418db54cc4b699c809cd44e625f7e23fc | /codeforces/1015/d.cpp | 9a8e21cf95d6b5e8466f0daf59ead83f937c3124 | [] | 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,012 | cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef complex<ld> pt;
typedef vector<pt> pol;
const char nl = '\n';
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9+7;
const ld EPS = 1e-10;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
//#define FILEIO
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
#ifdef FILEIO
freopen("test.in", "r", stdin);
freopen("test.out", "w", stdout);
#endif
ll n, k, s;
cin >> n >> k >> s;
if (k*(n-1) < s || k > s) {
cout << "NO" << nl;
}
else {
cout << "YES" << nl;
ll v = s/k;
ll o = s - k*v;
ll cur = 1;
ll dir = 1;
for (int i = 0; i < k; i++) {
cur += dir*v;
if (o) {
cur += dir;
o--;
}
dir = -dir;
cout << cur << " ";
}
cout << nl;
}
return 0;
}
| [
"henryxia9999@gmail.com"
] | henryxia9999@gmail.com |
d052e5f73356e336a434c2d361ea469926cdd5ab | 38074edb46670f3c53771f63418fbcc9ad5ede68 | /lib/src/StringFrobs.cpp | c8a8f4bbaa9f4241997ff9183311c236d7b52dbd | [
"MIT"
] | permissive | genedelisa/GDMusicKit | e08a725372b3dfae041689b4d365c2ad3d80e04c | d3a3a79ffc6bf000602e5001679351bd5d4a02a6 | refs/heads/master | 2023-04-14T18:59:59.801433 | 2019-08-14T11:05:35 | 2019-08-14T11:05:35 | 193,133,924 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,885 | cpp | /*---------------------------------------------------------------------------------------------
* Copyright (c) Rockhopper Technologies, Inc. All rights reserved.
* Licensed under the MIT License.
* See LICENSE in the project for license information.
*--------------------------------------------------------------------------------------------*/
#include <iomanip>
#include <iostream>
#include <string>
//https://stackoverflow.com/questions/14861018/center-text-in-fixed-width-field-with-stream-manipulators-in-c
template <typename charT, typename traits = std::char_traits<charT>>
class center_helper {
std::basic_string<charT, traits> str_;
public:
center_helper(std::basic_string<charT, traits> str) : str_(str) {}
template <typename a, typename b>
friend std::basic_ostream<a, b>& operator<<(std::basic_ostream<a, b>& s,
const center_helper<a, b>& c);
};
template <typename charT, typename traits = std::char_traits<charT>>
center_helper<charT, traits> centered(std::basic_string<charT, traits> str) {
return center_helper<charT, traits>(str);
}
// redeclare for std::string directly so we can support anything that implicitly
// converts to std::string
center_helper<std::string::value_type, std::string::traits_type>
centered(const std::string& str) {
return center_helper<std::string::value_type, std::string::traits_type>(
str);
}
template <typename charT, typename traits>
std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& s,
const center_helper<charT, traits>& c) {
std::streamsize w = s.width();
if (w > c.str_.length()) {
std::streamsize left = (w + c.str_.length()) / 2;
s.width(left);
s << c.str_;
s.width(w - left);
s << "";
} else {
s << c.str_;
}
return s;
}
| [
"gene@rockhoppertech.com"
] | gene@rockhoppertech.com |
fdbb99cf33c6bc49c31d4f81fcedb6bb7e1d5ae7 | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /components/offline_pages/core/prefetch/prefetch_download_flow_unittest.cc | a97a1216139f343032943eeaf61b51692ee7f490 | [
"BSD-3-Clause"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | C++ | false | false | 8,090 | cc | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/offline_pages/core/prefetch/prefetch_downloader_impl.h"
#include <utility>
#include <vector>
#include "base/test/scoped_feature_list.h"
#include "components/download/public/background_service/test/test_download_service.h"
#include "components/offline_pages/core/client_namespace_constants.h"
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/offline_pages/core/prefetch/prefetch_background_task.h"
#include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h"
#include "components/offline_pages/core/prefetch/prefetch_prefs.h"
#include "components/offline_pages/core/prefetch/prefetch_service.h"
#include "components/offline_pages/core/prefetch/prefetch_service_test_taco.h"
#include "components/offline_pages/core/prefetch/tasks/prefetch_task_test_base.h"
#include "components/offline_pages/core/prefetch/test_download_client.h"
#include "components/offline_pages/core/prefetch/test_prefetch_dispatcher.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace offline_pages {
namespace {
const version_info::Channel kTestChannel = version_info::Channel::UNKNOWN;
const base::FilePath kTestFilePath(FILE_PATH_LITERAL("foo"));
const int64_t kTestFileSize = 88888;
// Tests the interaction between prefetch service and download service to
// validate the whole prefetch download flow regardless which service is up
// first.
class PrefetchDownloadFlowTest : public PrefetchTaskTestBase {
public:
PrefetchDownloadFlowTest() {
feature_list_.InitAndEnableFeature(kPrefetchingOfflinePagesFeature);
}
void SetUp() override {
PrefetchTaskTestBase::SetUp();
prefetch_service_taco_.reset(new PrefetchServiceTestTaco);
prefetch_service_taco_->SetPrefService(std::move(prefs_));
prefetch_prefs::SetEnabledByServer(prefetch_service_taco_->pref_service(),
true);
auto downloader = std::make_unique<PrefetchDownloaderImpl>(
&download_service_, kTestChannel,
prefetch_service_taco_->pref_service());
download_client_ = std::make_unique<TestDownloadClient>(downloader.get());
download_service_.set_client(download_client_.get());
prefetch_service_taco_->SetPrefetchDispatcher(
std::make_unique<PrefetchDispatcherImpl>(
prefetch_service_taco_->pref_service()));
prefetch_service_taco_->SetPrefetchStore(store_util()->ReleaseStore());
prefetch_service_taco_->SetPrefetchDownloader(std::move(downloader));
prefetch_service_taco_->CreatePrefetchService();
prefetch_service_taco_->prefetch_service()->SetCachedGCMToken(
"dummy_gcm_token");
item_generator()->set_client_namespace(kSuggestedArticlesNamespace);
}
void TearDown() override {
prefetch_service_taco_.reset();
PrefetchTaskTestBase::TearDown();
}
void SetDownloadServiceReady() {
SetDownloadServiceReadyWithParams(
std::set<std::string>(),
std::map<std::string, std::pair<base::FilePath, int64_t>>());
}
void SetDownloadServiceReadyWithParams(
const std::set<std::string>& outstanding_download_ids,
const std::map<std::string, std::pair<base::FilePath, int64_t>>&
success_downloads) {
download_service_.SetIsReady(true);
prefetch_downloader()->OnDownloadServiceReady(
std::set<std::string>(),
std::map<std::string, std::pair<base::FilePath, int64_t>>());
RunUntilIdle();
}
void BeginBackgroundTask() {
prefetch_dispatcher()->BeginBackgroundTask(
std::make_unique<PrefetchBackgroundTask>(
prefetch_service_taco_->prefetch_service()));
RunUntilIdle();
}
PrefetchDispatcher* prefetch_dispatcher() const {
return prefetch_service_taco_->prefetch_service()->GetPrefetchDispatcher();
}
PrefetchDownloader* prefetch_downloader() const {
return prefetch_service_taco_->prefetch_service()->GetPrefetchDownloader();
}
private:
base::test::ScopedFeatureList feature_list_;
download::test::TestDownloadService download_service_;
std::unique_ptr<TestDownloadClient> download_client_;
std::unique_ptr<PrefetchServiceTestTaco> prefetch_service_taco_;
};
TEST_F(PrefetchDownloadFlowTest, DownloadServiceReadyAfterPrefetchSystemReady) {
// Create an item ready for download.
PrefetchItem item =
item_generator()->CreateItem(PrefetchItemState::RECEIVED_BUNDLE);
item.archive_body_length = 100;
store_util()->InsertPrefetchItem(item);
RunUntilIdle();
// Start the prefetch processing pipeline.
BeginBackgroundTask();
// The item can still been scheduled for download though the download service
// is not ready.
std::unique_ptr<PrefetchItem> found_item =
store_util()->GetPrefetchItem(item.offline_id);
EXPECT_EQ(PrefetchItemState::DOWNLOADING, found_item->state);
// Now make the download service ready.
SetDownloadServiceReady();
RunUntilIdle();
// The item should finally transit to IMPORTING state.
found_item = store_util()->GetPrefetchItem(item.offline_id);
EXPECT_EQ(PrefetchItemState::IMPORTING, found_item->state);
}
TEST_F(PrefetchDownloadFlowTest,
DownloadServiceReadyBeforePrefetchSystemReady) {
// Download service is ready initially.
SetDownloadServiceReady();
RunUntilIdle();
// Create an item ready for download.
PrefetchItem item =
item_generator()->CreateItem(PrefetchItemState::RECEIVED_BUNDLE);
item.archive_body_length = 100;
store_util()->InsertPrefetchItem(item);
RunUntilIdle();
// Start the prefetch processing pipeline.
BeginBackgroundTask();
// The item should finally transit to IMPORTING state.
std::unique_ptr<PrefetchItem> found_item =
store_util()->GetPrefetchItem(item.offline_id);
EXPECT_EQ(PrefetchItemState::IMPORTING, found_item->state);
}
TEST_F(PrefetchDownloadFlowTest, DownloadServiceUnavailable) {
// Download service is unavailable.
EXPECT_FALSE(prefetch_downloader()->IsDownloadServiceUnavailable());
prefetch_downloader()->OnDownloadServiceUnavailable();
EXPECT_TRUE(prefetch_downloader()->IsDownloadServiceUnavailable());
// Create an item ready for download.
PrefetchItem item =
item_generator()->CreateItem(PrefetchItemState::RECEIVED_BUNDLE);
item.archive_body_length = 100;
store_util()->InsertPrefetchItem(item);
RunUntilIdle();
// Start the prefetch processing pipeline.
BeginBackgroundTask();
// The item should not be changed since download service can't be used.
std::unique_ptr<PrefetchItem> found_item =
store_util()->GetPrefetchItem(item.offline_id);
EXPECT_EQ(item, *found_item);
}
TEST_F(PrefetchDownloadFlowTest, DelayRunningDownloadCleanupTask) {
// Create an item in DOWNLOADING state.
PrefetchItem item =
item_generator()->CreateItem(PrefetchItemState::DOWNLOADING);
item.archive_body_length = 100;
store_util()->InsertPrefetchItem(item);
RunUntilIdle();
// Download service is ready.
std::set<std::string> outgoing_downloads;
std::map<std::string, std::pair<base::FilePath, int64_t>> success_downloads;
success_downloads.emplace(item.guid,
std::make_pair(kTestFilePath, kTestFileSize));
SetDownloadServiceReadyWithParams(outgoing_downloads, success_downloads);
// The item should not be changed because the prefetch processing pipeline has
// not started yet and the download cleanup task will not be created.
std::unique_ptr<PrefetchItem> found_item =
store_util()->GetPrefetchItem(item.offline_id);
EXPECT_EQ(item, *found_item);
// Start the prefetch processing pipeline.
BeginBackgroundTask();
// The download cleanup task should be created and run. The item should
// finally transit to IMPORTING state.
found_item = store_util()->GetPrefetchItem(item.offline_id);
EXPECT_EQ(PrefetchItemState::IMPORTING, found_item->state);
}
} // namespace
} // namespace offline_pages
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
9f035c623f8f4759f2edb6ba1231386098a26dc3 | d3a4d3c93346d572f5a72bcb4ffa930f8d62af6e | /Graphs/Dijkstra/Dijkstra-Implementation-2.cpp | 869f9701a6f035c8dce170d85b578d417fb74e7f | [] | no_license | MuhammadSherifW/Competitive-Programming | 97e1ec41bf5bc7313fe0b390112280ebb4890670 | a72cb7142b0712ef4742fa382daa64d8920c8c13 | refs/heads/main | 2022-12-26T13:58:46.037683 | 2020-10-13T21:28:12 | 2020-10-13T21:28:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,375 | cpp | #include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
#include <string>
#include <queue>
#include <ctime>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <cstdint>
#include <climits>
using namespace std;
class Edge
{
public:
int to;
long long w;
Edge(int to, long long w)
{
this->to = to;
this->w = w;
}
bool operator < (const Edge& e) const
{
return w > e.w;
}
};
const int nodesSize = 100000 + 9;
vector<vector<Edge>> adjList(nodesSize);
priority_queue<Edge> q;
vector<long long > dis(nodesSize, LLONG_MAX);
//vector<int> path (nodesSize); // for constructing paths
void dijkstra(int start)
{
//path[start] = -1;
q.push(Edge(start, 0));
dis[start] = 0;
while (!q.empty())
{
Edge minEdge = q.top();
q.pop();
if (dis[minEdge.to] < minEdge.w)
continue;
for (int i = 0; i < adjList[minEdge.to].size(); i++)
{
Edge edgeToRelx = adjList[minEdge.to][i];
if (edgeToRelx.w + dis[minEdge.to] < dis[edgeToRelx.to])
{
//path[edgeToRelx.to] = minEdge.to;
dis[edgeToRelx.to] = edgeToRelx.w + dis[minEdge.to];
q.push(Edge(edgeToRelx.to, edgeToRelx.w + dis[minEdge.to]));
}
}
}
}
int main()
{
}
| [
"noreply@github.com"
] | MuhammadSherifW.noreply@github.com |
bc34335bc7f15d5fcc1f5382cf823bfa2ff923c9 | 5d6794a2d3af0d84c59783e110f33538d0e9b830 | /contests/JudgeTest202004/b.cpp | 323b9f210623255491c380cbb0013f57d9676129 | [] | no_license | ryotgm0417/AtCoder | e641336365e1c3b4812471ebf86f55e69ee09e2f | a70a0be85beb925a3e488e9e0d8191f0bbf1bcc1 | refs/heads/master | 2020-11-28T21:21:35.171770 | 2020-08-29T13:50:15 | 2020-08-29T13:50:15 | 229,922,379 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,181 | cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using P = pair<ll, ll>;
// chmin, chmax関数
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
if(comp(xmax, x)) {
xmax = x;
return true;
}
return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
if(comp(x, xmin)) {
xmin = x;
return true;
}
return false;
}
// Yes-Noを出力する問題で楽をする
void Ans(bool f){
if(f) cout << "Yes" << endl;
else cout << "No" << endl;
}
//---------------------------
int main(){
ll n; cin >> n;
VL r,b;
rep(i,n){
ll x; char c;
cin >> x >> c;
if(c=='R') r.push_back(x);
else b.push_back(x);
}
sort(r.begin(), r.end());
sort(b.begin(), b.end());
for(auto x: r){
cout << x << endl;
}
for(auto x: b){
cout << x << endl;
}
return 0;
} | [
"ryothailand98@gmail.com"
] | ryothailand98@gmail.com |
1d2247a5330e1f99a0973b78ed2017e2ad146f0f | 4e49f2b456882ba8643907a196f86b3062004243 | /MFCTeeChart/MFCTeeChart/TeeChar/teefunction.h | ed098bf79b0d1b8e52ee4f7e3407f7dc8c4be5f6 | [] | no_license | 772148702/Artificial-Intelligence | d4616acf13a38658fc38e71874091b4a0596f6ac | 3b2c48af7a88adc2d2fab01176db7c811deda1d1 | refs/heads/master | 2018-08-29T19:14:37.293494 | 2018-07-06T15:16:10 | 2018-07-06T15:16:10 | 108,261,921 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,429 | h | // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
// Dispatch interfaces referenced by this interface
class CCurveFittingFunction;
class CExpAvgFunction;
class CMovingAvgFunction;
class CStdDeviationFunction;
class CRSIFunction;
class CBollingerFunction;
class CADXFunction;
class CMACDFunction;
class CRMSFunction;
class CAverageFunction;
class CSmoothingFunction;
class CCustomFunction;
class CCompressFunction;
class CCLVFunction;
class COBVFunction;
class CCCIFunction;
class CPVOFunction;
class CPerformanceFunction;
class CModeFunction;
class CMedianFunction;
class CDownSamplingFunction;
class CTrendFunction;
class CSubsetTeeFunction;
class CExpMovAvgFunction;
class CSARFunction;
class CHistogramFunction;
/////////////////////////////////////////////////////////////////////////////
// CTeeFunction wrapper class
class CTeeFunction : public COleDispatchDriver
{
public:
CTeeFunction() {} // Calls COleDispatchDriver default constructor
CTeeFunction(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
CTeeFunction(const CTeeFunction& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
double GetPeriod();
void SetPeriod(double newValue);
CCurveFittingFunction GetAsCurveFit();
CExpAvgFunction GetAsExpAvg();
CMovingAvgFunction GetAsMovAvg();
long GetPeriodStyle();
void SetPeriodStyle(long nNewValue);
long GetPeriodAlign();
void SetPeriodAlign(long nNewValue);
CStdDeviationFunction GetAsStdDeviation();
void BeginUpdate();
void EndUpdate();
CRSIFunction GetAsRSI();
CBollingerFunction GetAsBollinger();
CADXFunction GetAsADX();
CMACDFunction GetAsMACD();
CRMSFunction GetAsRMS();
CAverageFunction GetAsAverage();
CSmoothingFunction GetAsSmoothing();
CCustomFunction GetAsCustom();
CCompressFunction GetAsCompress();
CCLVFunction GetAsCLV();
COBVFunction GetAsOBV();
CCCIFunction GetAsCCI();
CPVOFunction GetAsPVO();
CPerformanceFunction GetAsPerformance();
CModeFunction GetAsMode();
CMedianFunction GetAsMedian();
void Recalculate();
CDownSamplingFunction GetAsDownSampling();
CTrendFunction GetAsTrend();
CSubsetTeeFunction GetAsSubset();
CExpMovAvgFunction GetAsExpMovAvg();
CSARFunction GetAsSAR();
CHistogramFunction GetAsHistogram();
};
| [
"772148702@qq.com"
] | 772148702@qq.com |
34d9accaec42ec6baddc52682e30aa08ec1da06c | 9627ea6c2d232c55a949064ff7c7c07c4dd7626a | /EASTL/deque.h | 7b239ef096c799d667fd982a1374eec6c1516806 | [] | no_license | picco911/Cheat_BF3 | e2d42785474348adfdfa44274999aa4d0ea68054 | 99888a880eed5410308f03258b35a11ce50d927e | refs/heads/master | 2020-03-27T21:05:14.875678 | 2018-09-02T19:13:16 | 2018-09-02T19:13:16 | 147,114,166 | 0 | 1 | null | 2018-09-02T19:11:31 | 2018-09-02T19:11:31 | null | UTF-8 | C++ | false | false | 3,480 | h | #pragma once
namespace eastl
{
template< typename T, unsigned int A > class DequeIterator
{
public:
T* mpCurrent; //0000
T* mpBegin; //0004
T* mpEnd; //0008
T** mpCurrentArrayPtr; //000C
DequeIterator<T,A> operator ++ ()
{
++mpCurrent;
if( mpCurrent == mpEnd )
{
++mpCurrentArrayPtr;
mpBegin = *mpCurrentArrayPtr;
mpEnd = *mpCurrentArrayPtr + A;
mpCurrent = mpBegin;
}
return (*this);
}
}; //sizeof() == 0x10
template< typename T, unsigned int A > class DequeBase
{
public:
T** mpPtrArray; //0000
int mnPtrArraySize; //0004
DequeIterator< T, A > mItBegin; //0008
DequeIterator< T, A > mItEnd; //0018
unsigned char pad[4]; //0028
}; //sizeof() == 0x2C
template< typename T, unsigned int A > class deque : public DequeBase< T, A >
{
public:
T* operator [] ( unsigned int n )
{
unsigned int m = n + mItBegin.mpCurrent - mItBegin.mpBegin;
unsigned int i = ( ( signed int )( m + 0x1000000 ) ) / A - ( sizeof( T ) * 0x10000 );
unsigned int b = m - A * ( ( signed int )( m + 0x1000000 ) ) / A - ( sizeof( T ) * 0x10000 );
return &this->mItBegin.mpCurrentArrayPtr[i][b];
}
bool empty()
{
return this->mItBegin.mpCurrent == this->mItEnd.mpCurrent;
}
void begin( eastl::DequeIterator< T, A >* result )
{
result->mpCurrent = mItBegin.mpCurrent;
result->mpBegin = mItBegin.mpBegin;
result->mpEnd = mItBegin.mpEnd;
result->mpCurrentArrayPtr = mItBegin.mpCurrentArrayPtr;
}
void end( eastl::DequeIterator< T, A >* result )
{
result->mpCurrent = mItEnd.mpCurrent;
result->mpBegin = mItEnd.mpBegin;
result->mpEnd = mItEnd.mpEnd;
result->mpCurrentArrayPtr = mItEnd.mpCurrentArrayPtr;
}
unsigned int size()
{
return
mItEnd.mpCurrent -
mItEnd.mpBegin +
( ( mItEnd.mpCurrentArrayPtr - mItBegin.mpCurrentArrayPtr ) << 6 ) +
mItBegin.mpEnd -
mItBegin.mpCurrent -
A;
}
T* front()
{
return mItBegin.mpCurrent;
}
void clear()
{
if( mItBegin.mpCurrentArrayPtr != mItEnd.mpCurrentArrayPtr && mItEnd.mpBegin )
{
delete[] mItEnd.mpBegin;
}
for( T** i = ( T** )( mItBegin.mpCurrentArrayPtr + 1 ); i < mItEnd.mpCurrentArrayPtr; ++i )
{
if( *i )
{
delete[] *i;
}
}
mItEnd.mpCurrent = mItBegin.mpCurrent;
mItEnd.mpBegin = mItBegin.mpBegin;
mItEnd.mpEnd = mItBegin.mpEnd;
mItEnd.mpCurrentArrayPtr = mItBegin.mpCurrentArrayPtr;
}
}; //sizeof() == 0x2C
}; | [
"39557080+BlackSickness@users.noreply.github.com"
] | 39557080+BlackSickness@users.noreply.github.com |
4a5dc060fa2c6c747f88f4829d1375f0ee903616 | 787bf540a58938da41c43a38e0f45d3cddfb7abb | /tests/facesim/Public_Library/Arrays/ARRAY.h | 6b27439aa2c17b0127ca9e2b348ed550b18beda0 | [] | no_license | GammaPi/Parsec-2.0 | dfba038d37151883167acee97e675ee2edfe538f | 713367e86d9cc2c28cd2b7f2c7db0ecea82d2905 | refs/heads/main | 2023-05-07T08:49:11.584191 | 2021-05-18T18:05:56 | 2021-05-18T18:05:56 | 368,624,291 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,859 | h | //#####################################################################
// Copyright 2004-2006, Ronald Fedkiw, Eftychios Sifakis.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Class ARRAY
//#####################################################################
#ifndef __ARRAY__
#define __ARRAY__
#include <cstdlib>
#include <assert.h>
#include <stdio.h>
#include <iostream>
#include "../Matrices_And_Vectors/VECTOR_2D.h"
#include "../Math_Tools/exchange.h"
#include "../Math_Tools/max.h"
#include "../Math_Tools/maxabs.h"
#include "../Math_Tools/maxmag.h"
#include "../Math_Tools/min.h"
#include "../Math_Tools/minmag.h"
#include "../Read_Write/READ_WRITE_FUNCTIONS.h"
#include "../Utilities/TYPE_UTILITIES.h"
#include "../Utilities/STATIC_ASSERT.h"
namespace PhysBAM
{
template<class T_ARRAY> class ARRAY_RANGE;
template<class T>
class ARRAY
{
public:
typedef T ELEMENT;
int m; // end of the array
T* base_pointer; // starts at [1], not [0]
ARRAY()
: m (0)
{
Set_Base_Pointer (0);
}
explicit ARRAY (const int m_input, const bool initialize_using_default_constructor = true)
: m (m_input)
{
T* array = new T[m];
Set_Base_Pointer (array);
if (initialize_using_default_constructor) for (int index = 0; index < m; index++) array[index] = T();
}
ARRAY (const ARRAY<T>& array_input, const bool initialize_using_default_constructor = true)
: m (array_input.m)
{
T* array = new T[m];
Set_Base_Pointer (array);
T* old_array = array_input.Get_Array_Pointer();
if (initialize_using_default_constructor) for (int index = 0; index < m; index++) array[index] = old_array[index];
}
ARRAY (std::istream& input_stream)
: m (0)
{
Set_Base_Pointer (0);
Read<T> (input_stream);
}
~ARRAY()
{
Deallocate_Base_Pointer();
}
void Clean_Memory()
{
Resize_Array (0, false, false);
}
void Delete_Pointers_And_Clean_Memory() // only valid if T is a pointer type
{
for (int i = 1; i <= m; i++) delete base_pointer[i];
Clean_Memory();
}
T* Allocate_Base_Pointer (const int m_input)
{
return (new T[m_input]) - 1;
}
void Set_Base_Pointer (T* array)
{
base_pointer = array - 1;
}
T* Get_Array_Pointer() const
{
return base_pointer + 1;
}
void Deallocate_Base_Pointer()
{
//if(!(base_pointer + 1)) {
delete[] (base_pointer + 1);
//}
}
ARRAY<T>& operator= (const ARRAY<T>& source)
{
if (!Equal_Dimensions (*this, source))
{
Deallocate_Base_Pointer();
m = source.m;
base_pointer = Allocate_Base_Pointer (m);
}
T *array = Get_Array_Pointer(), *source_array = source.Get_Array_Pointer();
for (int index = 0; index < m; index++) array[index] = source_array[index];
return *this;
}
T& operator() (const int i)
{
assert (Valid_Index (i));
return base_pointer[i];
}
const T& operator() (const int i) const
{
assert (Valid_Index (i));
return base_pointer[i];
}
ARRAY_RANGE<ARRAY> Range (const VECTOR_2D<int>& range)
{
return ARRAY_RANGE<ARRAY> (*this, range);
}
ARRAY_RANGE<const ARRAY> Range (const VECTOR_2D<int>& range) const
{
return ARRAY_RANGE<const ARRAY> (*this, range);
}
bool Valid_Index (const int i) const
{
return 1 <= i && i <= m;
}
ARRAY<T>& operator+= (const ARRAY<T>& v)
{
assert (Equal_Dimensions (*this, v));
for (int index = 1; index <= m; index++) (*this) (index) += v (index);
return *this;
}
ARRAY<T>& operator+= (const T& a)
{
for (int index = 1; index <= m; index++) (*this) (index) += a;
return *this;
}
ARRAY<T>& operator-= (const ARRAY<T>& v)
{
assert (Equal_Dimensions (*this, v));
for (int index = 1; index <= m; index++) (*this) (index) -= v (index);
return *this;
}
ARRAY<T>& operator-= (const T& a)
{
for (int index = 1; index <= m; index++) (*this) (index) -= a;
return *this;
}
template<class T2>
ARRAY<T>& operator*= (const ARRAY<T2>& v)
{
assert (Equal_Dimensions (*this, v));
for (int index = 1; index <= m; index++) (*this) (index) *= v (index);
return *this;
}
template<class T2>
ARRAY<T>& operator*= (const T2 a)
{
for (int index = 1; index <= m; index++) (*this) (index) *= a;
return *this;
}
template<class T2>
ARRAY<T>& operator/= (const T2 a)
{
T2 one_over_a = 1 / a;
for (int index = 1; index <= m; index++) (*this) (index) *= one_over_a;
return *this;
}
template<class T2>
ARRAY<T>& operator/= (const ARRAY<T2>& a)
{
for (int index = 1; index <= m; index++)
{
assert (a (index) > 0);
(*this) (index) /= a (index);
}
return *this;
}
void Resize_Array (const int m_new, const bool initialize_new_elements = true, const bool copy_existing_elements = true, const T& initialization_value = T())
{
if (Equal_Dimensions (*this, m_new)) return;
T* base_pointer_new = Allocate_Base_Pointer (m_new);
if (copy_existing_elements)
{
int m_end = PhysBAM::min (m, m_new);
for (int index = 1; index <= m_end; index++) base_pointer_new[index] = base_pointer[index];
}
if (initialize_new_elements)
{
int m_end = PhysBAM::min (m, m_new);
for (int index = m_end + 1; index <= m_new; index++) base_pointer_new[index] = initialization_value;
}
Deallocate_Base_Pointer();
m = m_new;
base_pointer = base_pointer_new;
}
void Append_Element (const T& element)
{
assert (&element - &base_pointer[1] < 0 || &element - &base_pointer[1] >= m); // make sure element isn't a reference into the current array
Resize_Array (m + 1);
(*this) (m) = element;
}
void Append_Elements (const ARRAY<T>& append_array)
{
int index = m;
Resize_Array (m + append_array.m);
for (int i = 1; i <= append_array.m; i++)
{
index++;
(*this) (index) = append_array (i);
}
}
void Append_Unique_Element (const T& element)
{
int index;
if (Find (element, index)) return;
Resize_Array (m + 1);
(*this) (m) = element;
}
void Append_Unique_Elements (const ARRAY<T>& append_array)
{
ARRAY<int> append (append_array.m);
int count = 0, j;
for (j = 1; j <= append_array.m; j++)
{
int unique = 1, index;
if (Find (append_array (j), index)) unique = 0;
if (unique && append_array.Find (append_array (j), j + 1, index)) unique = 0; // element occurs duplicated in given array (only copy last instance)
if (unique)
{
count++;
append (j) = 1;
}
}
int index = m + 1;
Resize_Array (m + count);
for (int k = 1; k <= append.m; k++) if (append (k)) (*this) (index++) = append_array (k);
}
void Remove_Index (const int index) // maintains ordering of remaining elements
{
assert (Valid_Index (index));
T* base_pointer_new = Allocate_Base_Pointer (m - 1);
int i, cut = index;
for (i = 1; i < cut; i++) base_pointer_new[i] = base_pointer[i];
for (int j = i + 1; i <= m - 1; i++, j++) base_pointer_new[i] = base_pointer[j];
Deallocate_Base_Pointer();
m--;
base_pointer = base_pointer_new;
}
void Remove_Indices (const ARRAY<int>& index)
{
if (index.m == 0) return;
for (int kk = 1; kk <= index.m - 1; kk++)
{
assert (Valid_Index (index (kk)));
for (int i = index (kk) + 1 - kk; i <= index (kk + 1) - 1 - kk; i++) (*this) (i) = (*this) (i + kk);
}
for (int i = index (index.m) + 1 - index.m; i <= m - index.m; i++) (*this) (i) = (*this) (i + index.m);
Resize_Array (m - index.m);
}
bool Find (const T& element, int& index) const // returns the first occurence of an element in an array
{
return Find (element, 1, index);
}
bool Find (const T& element, const int start_index, int& index) const // returns the first occurence after start_index of an element in an array
{
for (int i = start_index; i <= m; i++) if ( (*this) (i) == element)
{
index = i;
return true;
}
return false;
}
void Insert_Element (const T& element, const int index)
{
Resize_Array (m + 1);
for (int i = m; i > index; i--) (*this) (i) = (*this) (i - 1);
(*this) (index) = element;
}
int Count_Matches (const T& value) const
{
int count = 0;
for (int index = 1; index <= m; index++) if ( (*this) (index) == value) count++;
return count;
}
int Number_True() const
{
return Count_Matches (true);
}
int Number_False() const
{
return Count_Matches (false);
}
template<class T_ARRAY>
static void copy (const T& constant, T_ARRAY& new_copy)
{
STATIC_ASSERT ( (IS_SAME<T, typename T_ARRAY::ELEMENT>::value));
for (int index = 1; index <= new_copy.m; index++) new_copy (index) = constant;
}
template<class T_ARRAY>
static void copy (const T& constant, ARRAY_RANGE<T_ARRAY> new_copy)
{
STATIC_ASSERT ( (IS_SAME<T, typename T_ARRAY::ELEMENT>::value));
for (int index = 1; index <= new_copy.m; index++) new_copy (index) = constant;
}
static void copy (const ARRAY<T>& old_copy, ARRAY<T>& new_copy)
{
assert (Equal_Dimensions (old_copy, new_copy));
for (int index = 1; index <= old_copy.m; index++) new_copy (index) = old_copy (index);
}
static void copy_up_to (const ARRAY<T>& old_copy, ARRAY<T>& new_copy, const int up_to_index)
{
assert (up_to_index <= old_copy.m && up_to_index <= new_copy.m);
for (int index = 1; index <= up_to_index; index++) new_copy (index) = old_copy (index);
}
template<class T2>
static void copy (const T2 constant, const ARRAY<T>& old_copy, ARRAY<T>& new_copy)
{
assert (Equal_Dimensions (old_copy, new_copy));
for (int index = 1; index <= old_copy.m; index++) new_copy (index) = constant * old_copy (index);
}
template<class T2>
static void copy (const T2 c1, const ARRAY<T>& v1, const ARRAY<T>& v2, ARRAY<T>& result)
{
assert (Equal_Dimensions (v1, v2) && Equal_Dimensions (v2, result));
for (int index = 1; index <= result.m; index++) result (index) = c1 * v1 (index) + v2 (index);
}
template<class T2>
static void copy_up_to (const T2 c1, const ARRAY<T>& v1, const ARRAY<T>& v2, ARRAY<T>& result, const int up_to_index)
{
assert (v1.m >= up_to_index && v2.m >= up_to_index && result.m >= up_to_index);
for (int index = 1; index <= up_to_index; index++) result (index) = c1 * v1 (index) + v2 (index);
}
template<class T2>
static void copy (const T2 c1, const ARRAY<T>& v1, const T2 c2, const ARRAY<T>& v2, ARRAY<T>& result)
{
assert (Equal_Dimensions (v1, v2) && Equal_Dimensions (v2, result));
for (int index = 1; index <= result.m; index++) result (index) = c1 * v1 (index) + c2 * v2 (index);
}
template<class T2>
static void copy (const T2 c1, const ARRAY<T>& v1, const T2 c2, const ARRAY<T>& v2, const T2 c3, const ARRAY<T>& v3, ARRAY<T>& result)
{
assert (Equal_Dimensions (v1, v2) && Equal_Dimensions (v2, v3) && Equal_Dimensions (v3, result));
for (int index = 1; index <= result.m; index++) result (index) = c1 * v1 (index) + c2 * v2 (index) + c3 * v3 (index);
}
template<class T2>
static void copy_up_to (const T2 c1, const ARRAY<T>& v1, const T2 c2, const ARRAY<T>& v2, ARRAY<T>& result, const int up_to_index)
{
assert (v1.m >= up_to_index && v2.m >= up_to_index && result.m >= up_to_index);
for (int index = 1; index <= up_to_index; index++) result (index) = c1 * v1 (index) + c2 * v2 (index);
}
static void get (ARRAY<T>& new_copy, const ARRAY<T>& old_copy)
{
ARRAY<T>::put (old_copy, new_copy, new_copy.m);
}
static void put (const ARRAY<T>& old_copy, ARRAY<T>& new_copy)
{
ARRAY<T>::put (old_copy, new_copy, old_copy.m);
}
template<class T2>
static void put (const T2 constant, const ARRAY<T>& old_copy, ARRAY<T>& new_copy)
{
ARRAY<T>::put (constant, old_copy, new_copy, old_copy.m);
}
static void put (const ARRAY<T>& old_copy, ARRAY<T>& new_copy, const int m)
{
assert (m <= old_copy.m);
assert (m <= new_copy.m);
for (int index = 1; index <= m; index++) new_copy (index) = old_copy (index);
}
template<class T2>
static void put (T2 constant, const ARRAY<T>& old_copy, ARRAY<T>& new_copy, const int m)
{
assert (m <= old_copy.m);
assert (m <= new_copy.m);
for (int index = 1; index <= m; index++) new_copy (index) = constant * old_copy (index);
}
static T max (const ARRAY<T>& a)
{
return max (a, a.m);
}
static T max (const ARRAY<T>& a, const int up_to_index)
{
T result = a (1);
for (int index = 2; index <= up_to_index; index++) result = PhysBAM::max (result, a (index));
return result;
}
static T maxabs (const ARRAY<T>& a)
{
return maxabs (a, a.m);
}
static T maxabs (const ARRAY<T>& a, const int up_to_index)
{
T result = (T) fabs (a (1));
for (int index = 2; index <= up_to_index; index++) result = maxabs_incremental (result, a (index));
return result;
}
static T maxmag (const ARRAY<T>& a)
{
return maxmag (a, a.m);
}
static T maxmag (const ARRAY<T>& a, const int up_to_index)
{
T result = a (1);
for (int index = 2; index <= up_to_index; index++) result = PhysBAM::maxmag (result, a (index));
return result;
}
static int argmax (const ARRAY<T>& a)
{
return argmax (a, a.m);
}
static int argmax (const ARRAY<T>& a, const int up_to_index)
{
int result = 1;
for (int index = 2; index <= up_to_index; index++) if (a (index) > a (result)) result = index;
return result;
}
static T min (const ARRAY<T>& a)
{
return min (a, a.m);
}
static T min (const ARRAY<T>& a, const int up_to_index)
{
T result = a (1);
for (int index = 2; index <= up_to_index; index++) result = PhysBAM::min (result, a (index));
return result;
}
static T minmag (ARRAY<T>& a)
{
return minmag (a, a.m);
}
static T minmag (ARRAY<T>& a, const int up_to_index)
{
T result = a (1);
for (int index = 2; index <= up_to_index; index++) result = PhysBAM::minmag (result, a (index));
return result;
}
static int argmin (const ARRAY<T>& a)
{
return argmin (a, a.m);
}
static int argmin (const ARRAY<T>& a, const int up_to_index)
{
int result = 1;
for (int index = 2; index <= up_to_index; index++) if (a (index) < a (result)) result = index;
return result;
}
static T sum (const ARRAY<T>& a)
{
return sum (a, a.m);
}
static T sum (const ARRAY<T>& a, const int up_to_index)
{
T result = T();
for (int index = 1; index <= up_to_index; index++) result += a (index);
return result;
}
static T sumabs (const ARRAY<T>& a)
{
return sumabs (a, a.m);
}
static T sumabs (const ARRAY<T>& a, const int up_to_index)
{
T result = T();
for (int index = 1; index <= up_to_index; index++) result += fabs (a (index));
return result;
}
static T Dot_Product (const ARRAY<T>& a1, const ARRAY<T>& a2)
{
assert (a1.m == a2.m);
T result = T();
for (int index = 1; index <= a1.m; index++) result += a1 (index) * a2 (index);
return result;
}
template<class TS, class T_ARRAY1, class T_ARRAY2>
static TS Vector_Dot_Product (const T_ARRAY1& a1, const T_ARRAY2& a2)
{
STATIC_ASSERT ( (IS_SAME<T, typename T_ARRAY1::ELEMENT>::value && IS_SAME<T, typename T_ARRAY2::ELEMENT>::value));
assert (a1.m == a2.m);
TS result = (TS) 0;
for (int index = 1; index <= a1.m; index++) result += T::Dot_Product (a1 (index), a2 (index));
return result;
}
template<class TS, class T_ARRAY>
static TS Vector_Magnitude_Squared (const T_ARRAY& a)
{
STATIC_ASSERT ( (IS_SAME<T, typename T_ARRAY::ELEMENT>::value));
TS result = (TS) 0;
for (int index = 1; index <= a.m; index++) result += a (index).Magnitude_Squared();
return result;
}
template<class TS, class T_ARRAY>
static TS Vector_Magnitude (const T_ARRAY& a)
{
return sqrt (Vector_Magnitude_Squared (a));
}
template<class TS>
static TS Vector_Distance (const ARRAY<T>& a, const ARRAY<T>& b)
{
assert (a.m == b.m);
TS distance = (TS) 0;
for (int index = 1; index <= a.m; index++) distance += (a (index) - b (index)).Magnitude_Squared();
return sqrt (distance);
}
template<class TS, class T_ARRAY>
static TS Maximum_Vector_Magnitude (const T_ARRAY& a)
{
return Maximum_Vector_Magnitude<TS> (a, a.m);
}
template<class TS, class T_ARRAY>
static TS Maximum_Vector_Magnitude (const T_ARRAY& a, const int up_to_index)
{
STATIC_ASSERT ( (IS_SAME<T, typename T_ARRAY::ELEMENT>::value));
TS result = (TS) 0;
for (int index = 1; index <= up_to_index; index++) result = PhysBAM::max (result, a (index).Magnitude_Squared());
return sqrt (result);
}
template<class TS>
static TS Maximum_Pairwise_Vector_Distance (const ARRAY<T>& a, const ARRAY<T>& b)
{
assert (a.m == b.m);
return Maximum_Pairwise_Vector_Distance<TS> (a, b, a.m);
}
template<class TS>
static TS Maximum_Pairwise_Vector_Distance (const ARRAY<T>& a, const ARRAY<T>& b, const int up_to_index)
{
TS result = (TS) 0;
for (int index = 1; index <= up_to_index; index++) result = PhysBAM::max (result, (a (index) - b (index)).Magnitude_Squared());
return sqrt (result);
}
static void find_common_elements (const ARRAY<T>& a, const ARRAY<T>& b, ARRAY<T>& result)
{
assert (a.base_pointer != result.base_pointer);
assert (b.base_pointer != result.base_pointer);
result.Resize_Array (0);
int j;
for (int i = 1; i <= a.m; i++) if (b.Find (a (i), j)) result.Append_Element (a (i));
}
static void exchange_arrays (ARRAY<T>& a, ARRAY<T>& b)
{
exchange (a.base_pointer, b.base_pointer);
exchange (a.m, b.m);
}
template<class T2>
static bool Equal_Dimensions (const ARRAY<T>& a, const ARRAY<T2>& b)
{
return a.m == b.m;
}
static bool Equal_Dimensions (const ARRAY<T>& a, const int m)
{
return a.m == m;
}
static void heapify (ARRAY<T>& a) // largest on top
{
for (int i = a.m / 2; i >= 1; i--) heapify (a, i, a.m);
}
static void heapify (ARRAY<T>& a, const int max_index) // largest on top, only does from 1 to max_index
{
for (int i = max_index / 2; i >= 1; i--) heapify (a, i, max_index);
}
template<class T2>
static void heapify (ARRAY<T>& a, ARRAY<T2>& aux) // largest on top
{
for (int i = a.m / 2; i >= 1; i--) heapify (a, aux, i, a.m);
}
template<class T2>
static void heapify (ARRAY<T>& a, ARRAY<T2>& aux, const int max_index) // largest on top, only does from 1 to max_index
{
for (int i = max_index / 2; i >= 1; i--) heapify (a, aux, i, max_index);
}
static void heapify (ARRAY<T>& a, int index, const int heap_size) // largest on top, only sorts down from index (not up!)
{
int left, right, index_of_largest;
for (;;)
{
left = 2 * index;
right = 2 * index + 1;
index_of_largest = index;
if (left <= heap_size && a (left) > a (index_of_largest)) index_of_largest = left;
if (right <= heap_size && a (right) > a (index_of_largest)) index_of_largest = right;
if (index_of_largest != index)
{
exchange (a (index), a (index_of_largest));
index = index_of_largest;
}
else return;
}
}
template<class T2>
static void heapify (ARRAY<T>& a, ARRAY<T2>& aux, int index, const int heap_size) // largest on top, only sorts down from index (not up!)
{
int left, right, index_of_largest;
for (;;)
{
left = 2 * index;
right = 2 * index + 1;
index_of_largest = index;
if (left <= heap_size && a (left) > a (index_of_largest)) index_of_largest = left;
if (right <= heap_size && a (right) > a (index_of_largest)) index_of_largest = right;
if (index_of_largest != index)
{
exchange (a (index), a (index_of_largest));
exchange (aux (index), aux (index_of_largest));
index = index_of_largest;
}
else return;
}
}
static void sort (ARRAY<T>& a) // from smallest to largest
{
heapify (a);
for (int i = 1; i < a.m; i++)
{
exchange (a (1), a (a.m - i + 1));
heapify (a, 1, a.m - i);
}
}
static void sort (ARRAY<T>& a, const int max_index) // sort a(1:max_index) from smallest to largest
{
heapify (a, max_index);
for (int i = 1; i < max_index; i++)
{
exchange (a (1), a (max_index - i + 1));
heapify (a, 1, max_index - i);
}
}
template<class T2>
static void sort (ARRAY<T>& a, ARRAY<T2>& aux) // from smallest to largest
{
heapify (a, aux);
for (int i = 1; i < a.m; i++)
{
exchange (a (1), a (a.m + 1 - i));
exchange (aux (1), aux (a.m + 1 - i));
heapify (a, aux, 1, a.m - i);
}
}
template<class T2>
static void sort (ARRAY<T>& a, ARRAY<T2>& aux, const int max_index) // sort a(1:max_index) from smallest to largest
{
heapify (a, aux, max_index);
for (int i = 1; i < max_index; i++)
{
exchange (a (1), a (max_index + 1 - i));
exchange (aux (1), aux (max_index + 1 - i));
heapify (a, aux, 1, max_index - i);
}
}
static void permute (const ARRAY<T>& source, ARRAY<T>& destination, const ARRAY<int>& permutation)
{
for (int i = 1; i <= permutation.m; i++) destination (i) = source (permutation (i));
}
static void unpermute (const ARRAY<T>& source, ARRAY<T>& destination, const ARRAY<int>& permutation)
{
for (int i = 1; i <= permutation.m; i++) destination (permutation (i)) = source (i);
}
template<class T2>
static void Compact_Array_Using_Compaction_Array (ARRAY<T2>& array, ARRAY<int>& compaction_array, ARRAY<T2>* temporary_array = 0)
{
bool temporary_array_defined = temporary_array != 0;
if (!temporary_array_defined) temporary_array = new ARRAY<T2> (compaction_array.m, false);
ARRAY<T2>::exchange_arrays (array, *temporary_array);
for (int i = 1; i <= compaction_array.m; i++) if (compaction_array (i) > 0) array (compaction_array (i)) = (*temporary_array) (i);
if (!temporary_array_defined)
{
delete temporary_array;
temporary_array = 0;
}
}
void Get (const int i, T& element1) const
{
assert (Valid_Index (i));
T* a = base_pointer + i;
element1 = a[0];
}
void Set (const int i, const T& element1)
{
assert (Valid_Index (i));
T* a = base_pointer + i;
a[0] = element1;
}
template<class RW>
void Read (std::istream& input_stream)
{
Deallocate_Base_Pointer();
Read_Binary<RW> (input_stream, m);
assert (m >= 0);
T* array = 0;
if (m > 0)
{
array = new T[m];
Read_Binary_Array<RW> (input_stream, array, m);
}
Set_Base_Pointer (array);
}
template<class RW>
void Write (std::ostream& output_stream) const
{
Write_Prefix<RW> (output_stream, m);
}
template<class RW>
void Write_Prefix (std::ostream& output_stream, const int prefix) const
{
assert (0 <= prefix && prefix <= m);
Write_Binary<RW> (output_stream, prefix);
Write_Binary_Array<RW> (output_stream, Get_Array_Pointer(), prefix);
}
private:
// old forms of functions which should not be called!
ARRAY (const int m_start, const int m_end) {}
void Resize_Array (const int m_start, const int m_end) {}
void Resize_Array (const int m_start, const int m_end, const bool initialize_new_elements) {}
void Resize_Array (const int m_start, const int m_end, const bool initialize_new_elements, const bool copy_existing_elements) {}
//#####################################################################
};
}
#endif
| [
"mrsteventang@outlook.com"
] | mrsteventang@outlook.com |
eb2da70d8dda7c998925266860ffa9868b6e9384 | c8998aa405b5416f6db4d3cbbdb812098d1f7803 | /Core/MMKV_OSX.cpp | bafac4a36f73edc341398edeacb9ac4b7ec2b80d | [
"BSD-3-Clause",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"OpenSSL",
"Zlib",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | fengqieer1988/MMKV | c0010084b3adc1279dcec63c506e028c7eb26f6b | 025829b9a214b5bb53679e7d662095c1b35d817d | refs/heads/master | 2022-04-22T18:27:39.906333 | 2020-04-13T07:18:49 | 2020-04-13T07:18:49 | 255,243,833 | 0 | 0 | NOASSERTION | 2020-04-13T05:57:53 | 2020-04-13T05:57:52 | null | UTF-8 | C++ | false | false | 7,392 | cpp | /*
* Tencent is pleased to support the open source community by making
* MMKV available.
*
* Copyright (C) 2019 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of
* the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "MMKVPredef.h"
#ifdef MMKV_IOS_OR_MAC
# include "CodedInputData.h"
# include "CodedOutputData.h"
# include "InterProcessLock.h"
# include "MMKV.h"
# include "MemoryFile.h"
# include "MiniPBCoder.h"
# include "ScopedLock.hpp"
# include "ThreadLock.h"
# include <sys/utsname.h>
# ifdef MMKV_IOS
# include "Checksum.h"
# include <sys/mman.h>
# endif
# if __has_feature(objc_arc)
# error This file must be compiled with MRC. Use -fno-objc-arc flag.
# endif
using namespace std;
using namespace mmkv;
extern ThreadLock *g_instanceLock;
extern MMKVPath_t g_rootDir;
enum { UnKnown = 0, PowerMac = 1, Mac, iPhone, iPod, iPad, AppleTV, AppleWatch };
static void GetAppleMachineInfo(int &device, int &version);
MMKV_NAMESPACE_BEGIN
extern ThreadOnceToken_t once_control;
extern void initialize();
void MMKV::minimalInit(MMKVPath_t defaultRootDir) {
ThreadLock::ThreadOnce(&once_control, initialize);
// crc32 instruction requires A10 chip, aka iPhone 7 or iPad 6th generation
int device = 0, version = 0;
GetAppleMachineInfo(device, version);
# ifdef __aarch64__
if ((device == iPhone && version >= 9) || (device == iPad && version >= 7)) {
CRC32 = mmkv::armv8_crc32;
}
# endif
MMKVInfo("Apple Device:%d, version:%d", device, version);
g_rootDir = defaultRootDir;
mkPath(g_rootDir);
MMKVInfo("default root dir: " MMKV_PATH_FORMAT, g_rootDir.c_str());
}
# ifdef MMKV_IOS
static bool g_isInBackground = false;
void MMKV::setIsInBackground(bool isInBackground) {
SCOPED_LOCK(g_instanceLock);
g_isInBackground = isInBackground;
MMKVInfo("g_isInBackground:%d", g_isInBackground);
}
// @finally in C++ stype
template <typename F>
struct AtExit {
AtExit(F f) : m_func{f} {}
~AtExit() { m_func(); }
private:
F m_func;
};
bool MMKV::protectFromBackgroundWriting(size_t size, WriteBlock block) {
if (g_isInBackground) {
// calc ptr to be mlock()
auto writePtr = (size_t) m_output->curWritePointer();
auto ptr = (writePtr / DEFAULT_MMAP_SIZE) * DEFAULT_MMAP_SIZE;
size_t lockDownSize = writePtr - ptr + size;
if (mlock((void *) ptr, lockDownSize) != 0) {
MMKVError("fail to mlock [%s], %s", m_mmapID.c_str(), strerror(errno));
// just fail on this condition, otherwise app will crash anyway
//block(m_output);
return false;
} else {
AtExit cleanup([=] { munlock((void *) ptr, lockDownSize); });
try {
block(m_output);
} catch (std::exception &exception) {
MMKVError("%s", exception.what());
return false;
}
}
} else {
block(m_output);
}
return true;
}
# endif // MMKV_IOS
bool MMKV::set(NSObject<NSCoding> *__unsafe_unretained obj, MMKVKey_t key) {
if (isKeyEmpty(key)) {
return false;
}
if (!obj) {
removeValueForKey(key);
return true;
}
MMBuffer data;
if (MiniPBCoder::isCompatibleObject(obj)) {
data = MiniPBCoder::encodeDataWithObject(obj);
} else {
/*if ([object conformsToProtocol:@protocol(NSCoding)])*/ {
auto tmp = [NSKeyedArchiver archivedDataWithRootObject:obj];
if (tmp.length > 0) {
data = MMBuffer(tmp);
}
}
}
return setDataForKey(std::move(data), key);
}
NSObject *MMKV::getObject(MMKVKey_t key, Class cls) {
if (isKeyEmpty(key) || !cls) {
return nil;
}
SCOPED_LOCK(m_lock);
auto &data = getDataForKey(key);
if (data.length() > 0) {
if (MiniPBCoder::isCompatibleClass(cls)) {
try {
auto result = MiniPBCoder::decodeObject(data, cls);
return result;
} catch (std::exception &exception) {
MMKVError("%s", exception.what());
}
} else {
if ([cls conformsToProtocol:@protocol(NSCoding)]) {
auto tmp = [NSData dataWithBytesNoCopy:data.getPtr() length:data.length() freeWhenDone:NO];
return [NSKeyedUnarchiver unarchiveObjectWithData:tmp];
}
}
}
return nil;
}
NSArray *MMKV::allKeys() {
SCOPED_LOCK(m_lock);
checkLoadData();
NSMutableArray *keys = [NSMutableArray array];
for (const auto &pair : m_dic) {
[keys addObject:pair.first];
}
return keys;
}
void MMKV::removeValuesForKeys(NSArray *arrKeys) {
if (arrKeys.count == 0) {
return;
}
if (arrKeys.count == 1) {
return removeValueForKey(arrKeys[0]);
}
SCOPED_LOCK(m_lock);
SCOPED_LOCK(m_exclusiveProcessLock);
checkLoadData();
size_t deleteCount = 0;
for (NSString *key in arrKeys) {
auto itr = m_dic.find(key);
if (itr != m_dic.end()) {
[itr->first release];
m_dic.erase(itr);
deleteCount++;
}
}
if (deleteCount > 0) {
m_hasFullWriteback = false;
fullWriteback();
}
}
void MMKV::enumerateKeys(EnumerateBlock block) {
if (block == nil) {
return;
}
SCOPED_LOCK(m_lock);
checkLoadData();
MMKVInfo("enumerate [%s] begin", m_mmapID.c_str());
for (const auto &pair : m_dic) {
BOOL stop = NO;
block(pair.first, &stop);
if (stop) {
break;
}
}
MMKVInfo("enumerate [%s] finish", m_mmapID.c_str());
}
MMKV_NAMESPACE_END
static void GetAppleMachineInfo(int &device, int &version) {
device = UnKnown;
version = 0;
struct utsname systemInfo = {};
uname(&systemInfo);
std::string machine(systemInfo.machine);
if (machine.find("PowerMac") != std::string::npos || machine.find("Power Macintosh") != std::string::npos) {
device = PowerMac;
} else if (machine.find("Mac") != std::string::npos || machine.find("Macintosh") != std::string::npos) {
device = Mac;
} else if (machine.find("iPhone") != std::string::npos) {
device = iPhone;
} else if (machine.find("iPod") != std::string::npos) {
device = iPod;
} else if (machine.find("iPad") != std::string::npos) {
device = iPad;
} else if (machine.find("AppleTV") != std::string::npos) {
device = AppleTV;
} else if (machine.find("AppleWatch") != std::string::npos) {
device = AppleWatch;
}
auto pos = machine.find_first_of("0123456789");
if (pos != std::string::npos) {
version = std::atoi(machine.substr(pos).c_str());
}
}
#endif // MMKV_IOS_OR_MAC
| [
"guoling@tencent.com"
] | guoling@tencent.com |
6f6a49cfc5d63f9c7f292d5af0489e22a4cbcc6f | 9e6b5ba9259d0fd6a9ad82a1cd89de627477cc86 | /Sources/yocto_bluetoothlink.h | 5369314cd73f2669555d536c9107608020318c66 | [] | no_license | giapdangle/yoctolib_cpp | 82b9ade1e2b1e3d6fa8decb8065b535ba19e145f | fb24a749382b866ca31c32e6acdaccb68b585933 | refs/heads/master | 2021-01-22T12:12:28.361797 | 2015-05-20T16:32:53 | 2015-05-20T16:32:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,793 | h | /*********************************************************************
*
* $Id: yocto_bluetoothlink.h 20326 2015-05-12 15:35:18Z seb $
*
* Declares yFindBluetoothLink(), the high-level API for BluetoothLink functions
*
* - - - - - - - - - License information: - - - - - - - - -
*
* Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
*
* Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
* non-exclusive license to use, modify, copy and integrate this
* file into your software for the sole purpose of interfacing
* with Yoctopuce products.
*
* You may reproduce and distribute copies of this file in
* source or object form, as long as the sole purpose of this
* code is to interface with Yoctopuce products. You must retain
* this notice in the distributed source file.
*
* You should refer to Yoctopuce General Terms and Conditions
* for additional information regarding your rights and
* obligations.
*
* THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT
* WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
* WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
* EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
* COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
* SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
* LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
* CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
* BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
* WARRANTY, OR OTHERWISE.
*
*********************************************************************/
#ifndef YOCTO_BLUETOOTHLINK_H
#define YOCTO_BLUETOOTHLINK_H
#include "yocto_api.h"
#include <cfloat>
#include <cmath>
#include <map>
//--- (YBluetoothLink return codes)
//--- (end of YBluetoothLink return codes)
//--- (YBluetoothLink definitions)
class YBluetoothLink; // forward declaration
typedef void (*YBluetoothLinkValueCallback)(YBluetoothLink *func, const string& functionValue);
#define Y_OWNADDRESS_INVALID (YAPI_INVALID_STRING)
#define Y_PAIRINGPIN_INVALID (YAPI_INVALID_STRING)
#define Y_REMOTEADDRESS_INVALID (YAPI_INVALID_STRING)
#define Y_MESSAGE_INVALID (YAPI_INVALID_STRING)
#define Y_COMMAND_INVALID (YAPI_INVALID_STRING)
//--- (end of YBluetoothLink definitions)
//--- (YBluetoothLink declaration)
/**
* YBluetoothLink Class: BluetoothLink function interface
*
* BluetoothLink function provides control over bluetooth link
* and status for devices that are bluetooth-enabled.
*/
class YOCTO_CLASS_EXPORT YBluetoothLink: public YFunction {
#ifdef __BORLANDC__
#pragma option push -w-8022
#endif
//--- (end of YBluetoothLink declaration)
protected:
//--- (YBluetoothLink attributes)
// Attributes (function value cache)
string _ownAddress;
string _pairingPin;
string _remoteAddress;
string _message;
string _command;
YBluetoothLinkValueCallback _valueCallbackBluetoothLink;
friend YBluetoothLink *yFindBluetoothLink(const string& func);
friend YBluetoothLink *yFirstBluetoothLink(void);
// Function-specific method for parsing of JSON output and caching result
virtual int _parseAttr(yJsonStateMachine& j);
// Constructor is protected, use yFindBluetoothLink factory function to instantiate
YBluetoothLink(const string& func);
//--- (end of YBluetoothLink attributes)
public:
~YBluetoothLink();
//--- (YBluetoothLink accessors declaration)
static const string OWNADDRESS_INVALID;
static const string PAIRINGPIN_INVALID;
static const string REMOTEADDRESS_INVALID;
static const string MESSAGE_INVALID;
static const string COMMAND_INVALID;
/**
* Returns the MAC-48 address of the bluetooth interface, which is unique on the bluetooth network.
*
* @return a string corresponding to the MAC-48 address of the bluetooth interface, which is unique on
* the bluetooth network
*
* On failure, throws an exception or returns Y_OWNADDRESS_INVALID.
*/
string get_ownAddress(void);
inline string ownAddress(void)
{ return this->get_ownAddress(); }
/**
* Returns an opaque string if a PIN code has been configured in the device to access
* the SIM card, or an empty string if none has been configured or if the code provided
* was rejected by the SIM card.
*
* @return a string corresponding to an opaque string if a PIN code has been configured in the device to access
* the SIM card, or an empty string if none has been configured or if the code provided
* was rejected by the SIM card
*
* On failure, throws an exception or returns Y_PAIRINGPIN_INVALID.
*/
string get_pairingPin(void);
inline string pairingPin(void)
{ return this->get_pairingPin(); }
/**
* Changes the PIN code used by the module for bluetooth pairing.
* Remember to call the saveToFlash() method of the module to save the
* new value in the device flash.
*
* @param newval : a string corresponding to the PIN code used by the module for bluetooth pairing
*
* @return YAPI_SUCCESS if the call succeeds.
*
* On failure, throws an exception or returns a negative error code.
*/
int set_pairingPin(const string& newval);
inline int setPairingPin(const string& newval)
{ return this->set_pairingPin(newval); }
/**
* Returns the MAC-48 address of the remote device to connect to.
*
* @return a string corresponding to the MAC-48 address of the remote device to connect to
*
* On failure, throws an exception or returns Y_REMOTEADDRESS_INVALID.
*/
string get_remoteAddress(void);
inline string remoteAddress(void)
{ return this->get_remoteAddress(); }
/**
* Changes the MAC-48 address defining which remote device to connect to.
*
* @param newval : a string corresponding to the MAC-48 address defining which remote device to connect to
*
* @return YAPI_SUCCESS if the call succeeds.
*
* On failure, throws an exception or returns a negative error code.
*/
int set_remoteAddress(const string& newval);
inline int setRemoteAddress(const string& newval)
{ return this->set_remoteAddress(newval); }
/**
* Returns the latest status message from the bluetooth interface.
*
* @return a string corresponding to the latest status message from the bluetooth interface
*
* On failure, throws an exception or returns Y_MESSAGE_INVALID.
*/
string get_message(void);
inline string message(void)
{ return this->get_message(); }
string get_command(void);
inline string command(void)
{ return this->get_command(); }
int set_command(const string& newval);
inline int setCommand(const string& newval)
{ return this->set_command(newval); }
/**
* Retrieves a cellular interface for a given identifier.
* The identifier can be specified using several formats:
* <ul>
* <li>FunctionLogicalName</li>
* <li>ModuleSerialNumber.FunctionIdentifier</li>
* <li>ModuleSerialNumber.FunctionLogicalName</li>
* <li>ModuleLogicalName.FunctionIdentifier</li>
* <li>ModuleLogicalName.FunctionLogicalName</li>
* </ul>
*
* This function does not require that the cellular interface is online at the time
* it is invoked. The returned object is nevertheless valid.
* Use the method YBluetoothLink.isOnline() to test if the cellular interface is
* indeed online at a given time. In case of ambiguity when looking for
* a cellular interface by logical name, no error is notified: the first instance
* found is returned. The search is performed first by hardware name,
* then by logical name.
*
* @param func : a string that uniquely characterizes the cellular interface
*
* @return a YBluetoothLink object allowing you to drive the cellular interface.
*/
static YBluetoothLink* FindBluetoothLink(string func);
/**
* Registers the callback function that is invoked on every change of advertised value.
* The callback is invoked only during the execution of ySleep or yHandleEvents.
* This provides control over the time when the callback is triggered. For good responsiveness, remember to call
* one of these two functions periodically. To unregister a callback, pass a null pointer as argument.
*
* @param callback : the callback function to call, or a null pointer. The callback function should take two
* arguments: the function object of which the value has changed, and the character string describing
* the new advertised value.
* @noreturn
*/
virtual int registerValueCallback(YBluetoothLinkValueCallback callback);
using YFunction::registerValueCallback;
virtual int _invokeValueCallback(string value);
/**
* Attempt to connect to the previously selected remote device.
*
* @return YAPI_SUCCESS when the call succeeds.
*
* On failure, throws an exception or returns a negative error code.
*/
virtual int connect(void);
/**
* Disconnect from the previously selected remote device.
*
* @return YAPI_SUCCESS when the call succeeds.
*
* On failure, throws an exception or returns a negative error code.
*/
virtual int disconnect(void);
inline static YBluetoothLink* Find(string func)
{ return YBluetoothLink::FindBluetoothLink(func); }
/**
* Continues the enumeration of cellular interfaces started using yFirstBluetoothLink().
*
* @return a pointer to a YBluetoothLink object, corresponding to
* a cellular interface currently online, or a null pointer
* if there are no more cellular interfaces to enumerate.
*/
YBluetoothLink *nextBluetoothLink(void);
inline YBluetoothLink *next(void)
{ return this->nextBluetoothLink();}
/**
* Starts the enumeration of cellular interfaces currently accessible.
* Use the method YBluetoothLink.nextBluetoothLink() to iterate on
* next cellular interfaces.
*
* @return a pointer to a YBluetoothLink object, corresponding to
* the first cellular interface currently online, or a null pointer
* if there are none.
*/
static YBluetoothLink* FirstBluetoothLink(void);
inline static YBluetoothLink* First(void)
{ return YBluetoothLink::FirstBluetoothLink();}
#ifdef __BORLANDC__
#pragma option pop
#endif
//--- (end of YBluetoothLink accessors declaration)
};
//--- (BluetoothLink functions declaration)
/**
* Retrieves a cellular interface for a given identifier.
* The identifier can be specified using several formats:
* <ul>
* <li>FunctionLogicalName</li>
* <li>ModuleSerialNumber.FunctionIdentifier</li>
* <li>ModuleSerialNumber.FunctionLogicalName</li>
* <li>ModuleLogicalName.FunctionIdentifier</li>
* <li>ModuleLogicalName.FunctionLogicalName</li>
* </ul>
*
* This function does not require that the cellular interface is online at the time
* it is invoked. The returned object is nevertheless valid.
* Use the method YBluetoothLink.isOnline() to test if the cellular interface is
* indeed online at a given time. In case of ambiguity when looking for
* a cellular interface by logical name, no error is notified: the first instance
* found is returned. The search is performed first by hardware name,
* then by logical name.
*
* @param func : a string that uniquely characterizes the cellular interface
*
* @return a YBluetoothLink object allowing you to drive the cellular interface.
*/
inline YBluetoothLink* yFindBluetoothLink(const string& func)
{ return YBluetoothLink::FindBluetoothLink(func);}
/**
* Starts the enumeration of cellular interfaces currently accessible.
* Use the method YBluetoothLink.nextBluetoothLink() to iterate on
* next cellular interfaces.
*
* @return a pointer to a YBluetoothLink object, corresponding to
* the first cellular interface currently online, or a null pointer
* if there are none.
*/
inline YBluetoothLink* yFirstBluetoothLink(void)
{ return YBluetoothLink::FirstBluetoothLink();}
//--- (end of BluetoothLink functions declaration)
#endif
| [
"dev@yoctopuce.com"
] | dev@yoctopuce.com |
1e68aa7906325ac8f34d250b893df48366df12c3 | 0ef4f71c8ff2f233945ee4effdba893fed3b8fad | /misc_microsoft_gamedev_source_code/misc_microsoft_gamedev_source_code/extlib/Scaleform/GFx SDK 2.1.57/3rdParty/nvtt/src/nvimage/TgaFile.h | cf88f0714d3de62ded0cad8b1829d7561a4f5a8e | [] | no_license | sgzwiz/misc_microsoft_gamedev_source_code | 1f482b2259f413241392832effcbc64c4c3d79ca | 39c200a1642102b484736b51892033cc575b341a | refs/heads/master | 2022-12-22T11:03:53.930024 | 2020-09-28T20:39:56 | 2020-09-28T20:39:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,931 | h | // This code is in the public domain -- castanyo@yahoo.es
#ifndef NV_IMAGE_TGAFILE_H
#define NV_IMAGE_TGAFILE_H
#include <nvcore/Stream.h>
namespace nv
{
// TGA types
enum TGAType {
TGA_TYPE_INDEXED = 1,
TGA_TYPE_RGB = 2,
TGA_TYPE_GREY = 3,
TGA_TYPE_RLE_INDEXED = 9,
TGA_TYPE_RLE_RGB = 10,
TGA_TYPE_RLE_GREY = 11
};
#define TGA_INTERLEAVE_MASK 0xc0
#define TGA_INTERLEAVE_NONE 0x00
#define TGA_INTERLEAVE_2WAY 0x40
#define TGA_INTERLEAVE_4WAY 0x80
#define TGA_ORIGIN_MASK 0x30
#define TGA_ORIGIN_LEFT 0x00
#define TGA_ORIGIN_RIGHT 0x10
#define TGA_ORIGIN_LOWER 0x00
#define TGA_ORIGIN_UPPER 0x20
/// Tga Header.
struct TgaHeader {
uint8 id_length;
uint8 colormap_type;
uint8 image_type;
uint16 colormap_index;
uint16 colormap_length;
uint8 colormap_size;
uint16 x_origin;
uint16 y_origin;
uint16 width;
uint16 height;
uint8 pixel_size;
uint8 flags;
enum { Size = 18 }; //const static int SIZE = 18;
};
/// Tga File.
struct TgaFile {
TgaFile() {
mem = NULL;
}
~TgaFile() {
free();
}
uint size() const {
return head.width * head.height * (head.pixel_size / 8);
}
void allocate() {
nvCheck( mem == NULL );
mem = new uint8[size()];
}
void free() {
delete [] mem;
mem = NULL;
}
TgaHeader head;
uint8 * mem;
};
inline Stream & operator<< (Stream & s, TgaHeader & head)
{
s << head.id_length << head.colormap_type << head.image_type;
s << head.colormap_index << head.colormap_length << head.colormap_size;
s << head.x_origin << head.y_origin << head.width << head.height;
s << head.pixel_size << head.flags;
return s;
}
inline Stream & operator<< (Stream & s, TgaFile & tga)
{
s << tga.head;
if( s.isLoading() ) {
tga.allocate();
}
s.serialize( tga.mem, tga.size() );
return s;
}
} // nv namespace
#endif // NV_IMAGE_TGAFILE_H
| [
"benjamin.barratt@icloud.com"
] | benjamin.barratt@icloud.com |
77db59a3fda5cad58f1281a204efdda01143d7c5 | 32c3c90c4c8e3e47fb5252f97213556bba84f30b | /week13/boj14890/orihehe_14890.cpp | 8778f26360dce4b58f0a0c503d8c9b654c377f0a | [] | no_license | onww1/Soft-Algorithm-Study | 8b4398ca8afcce64ec3e01609b0661044636bd39 | 6b66759a3e542d22b06433ff46aa82a0f883b529 | refs/heads/master | 2020-04-16T17:07:39.029418 | 2019-12-23T23:05:57 | 2019-12-23T23:05:57 | 165,763,614 | 3 | 3 | null | 2019-03-10T07:13:26 | 2019-01-15T01:32:14 | C++ | UTF-8 | C++ | false | false | 1,814 | cpp | /*
BOJ 14890 - 경사로
시간복잡도 : O(N^2)
공간복잡도 : O(N^2)
가로 배열을 늘려 세로부분을 옮겨주어 가로부분만 봐주었습니다.
먼저 ru배열에 같은 값의 연속한 개수를 넣어줍니다.
그리고나서 가로로 한줄씩 보며 현재 위치의 수와 옆의 수가 다른 값일 때
작은 쪽에 L보다 많은 연속한 값이 있으면 그 위치에 경사로를 놓을 수 있다는 뜻이 됩니다.
그 과정에서 연속한 수의 차이가 1이하인지 체크, 경사로를 놓는다면 연속한 개수를 L만큼 줄여줍니다.
*/
#include <cstdio>
using namespace std;
/* 🐣🐥 */
int arr[201][101];
int ru[201][101];
int n, l, num, cnt, lp, ans;
int main() {
scanf("%d %d", &n, &l);
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
scanf("%d", &arr[i][j]);
// 가로부분만 보기위해 옮겨준다.
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
arr[i + n][j] = arr[j][i];
// 연속한 개수 세주기.
for (int i = 0; i < 2*n; i++) {
num = arr[i][0], cnt = 1, lp = 0;
for (int j = 1; j <= n; j++) {
if (num != arr[i][j]) {
while (lp < j) {
ru[i][lp++] = cnt;
}
num = arr[i][j];
cnt = 1;
}
else {
cnt++;
}
}
}
// 가능 여부 체크 부분
for (int i = 0; i < 2*n; i++) {
for (int j = 1; j < n; j++) {
if (arr[i][j - 1] > arr[i][j]) {
if (ru[i][j] < l || arr[i][j-1]>arr[i][j]+1) break;
lp = j;
while (arr[i][lp] == arr[i][j]) {
ru[i][lp++] -= l;
}
}
else if (arr[i][j - 1] < arr[i][j]) {
if (ru[i][j-1] < l || arr[i][j - 1]+1 < arr[i][j]) break;
lp = j - 1;
while (lp >=0 && arr[i][lp] == arr[i][j-1]) {
ru[i][lp--] -= l;
}
}
if (j == n - 1) ans++;
}
}
printf("%d", ans);
return 0;
} | [
"38060133+orihehe@users.noreply.github.com"
] | 38060133+orihehe@users.noreply.github.com |
7544afc7458f72438548ac332e71fd3fc8807941 | 15227fb41af484950b7a89bb45b78489db58869a | /kryne-engine/include/kryne-engine/Core/LogicComponent.h | 596bfff8b4704f9cd01d239e35ed38ad743f5ddc | [] | no_license | Mcgode/kryne-engine | 83c4c1fb2ee9511b687c482afc14d0db07141e95 | 01332d2b17c41d0954c12995713186f86e710233 | refs/heads/main | 2021-12-01T08:48:28.071158 | 2021-05-01T16:51:15 | 2021-05-01T16:51:15 | 182,293,488 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,694 | h | /**
* @file
* @author Max Godefroy
* @date 06/02/2021.
*/
#ifndef KRYNE_ENGINE_LOGICCOMPONENT_H
#define KRYNE_ENGINE_LOGICCOMPONENT_H
#include "Component.h"
/**
* A component to use for game logic.
*/
class LogicComponent: public Component {
public:
/**
* Initializes the logic component
* @param entity The entity this component will be attached to.
*
* @note A component should never be instanciated in a vaccum. Entity::addComponent() should be used instead.
*/
explicit LogicComponent(Entity *entity): Component(entity)
{
this->componentName = "LogicComponent";
}
void transformDidUpdate() override {}
// -----
// Component lifecycle
// -----
public:
/**
* A function for just-in-time initializations.
* This function is called just before its first #onUpdate() call;
*/
virtual void onBegin();
/**
* @return `true` if onBegin has already been called
*/
[[nodiscard]] inline bool hasBegun() const { return this->begun; }
/**
* Function called when the component is attached to an entity
* @warning #onBegin() might not have been called yet
*/
virtual void onAttach() {};
/**
* Update function called once per frame. Use it to run your component logic.
*/
virtual void onUpdate() {};
/**
* Function called when the component is detached from its entity.
* Won't be called if the component is simply destroyed along its attached entity.
* @warning #onBegin() might not have been called yet.
*/
virtual void onDetach() {};
private:
bool begun = false;
};
#endif //KRYNE_ENGINE_LOGICCOMPONENT_H
| [
"max@godefroy.net"
] | max@godefroy.net |
5852beef8a7b9e22d47f271f10b83524129d0971 | 05f55d57b12910b7e6e48e765a22e2e06930797c | /leetcode394.cpp | 0b3bf625c5301b972ea356e988cb5bba81758a3d | [] | no_license | bdsy/leetcode | 677a247e95227ed7bcc5dc5f63ce8964b82af691 | 513d03204f84a126102b3d882fadca95a207c1fc | refs/heads/master | 2020-03-19T07:39:25.948648 | 2018-06-24T14:39:25 | 2018-06-24T14:39:25 | 136,136,497 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,522 | cpp | /*
给定一个经过编码的字符串,返回它解码后的字符串。
编码规则为: k[encoded_string],表示其中方括号内部的 encoded_string 正好重复 k 次。注意 k 保证为正整数。
你可以认为输入字符串总是有效的;输入字符串中没有额外的空格,且输入的方括号总是符合格式要求的。
此外,你可以认为原始数据不包含数字,所有的数字只表示重复的次数 k ,例如不会出现像 3a 或 2[4] 的输入。
*/
class Solution {
public:
string decodeString(string s) {
stack<string> stk;
int n = s.size();
int i,j,k,num;
string temp = "";
string result;
i = 0;
num = 0;
while(i < n){
if(s[i] >= '0' && s[i] <= '9'){
if(temp != ""){
stk.push(temp);
temp = "";
}
num = 10*num + s[i] - '0';
if(s[i+1] == '['){
stk.push(to_string(num));
num = 0;
}
}
else if(s[i] == '['){
if(temp != ""){
stk.push(temp);
}
temp = "";
}
else if(s[i] == ']'){
if(temp != ""){
stk.push(temp);
}
temp = "";
stack<string> temp_save;
while(!isdigit(stk.top()[0])){
temp_save.push(stk.top());
stk.pop();
}
while(!temp_save.empty()){
temp += temp_save.top();
temp_save.pop();
}
string tmp = stk.top();
int duplicate = stoi(tmp);
stk.pop();
j = 1;
string save = temp;
while(j < duplicate){
save += temp;
j += 1;
}
temp = save;
cout<<save<<endl;
}
else{
temp += s[i];
}
i += 1;
}
if(temp != ""){
stk.push(temp);
}
stack<string> reverse;
while(!stk.empty()){
reverse.push(stk.top());
stk.pop();
}
while(!reverse.empty()){
result += reverse.top();
reverse.pop();
}
return(result);
}
};
| [
"2338651194@qq.com"
] | 2338651194@qq.com |
e775b9e8391351c94b1293fa950704270b0d3958 | d84967ba1e6adc72e120f84524c51ad57912df5a | /devel/electron10/files/patch-components_autofill_core_common_autofill__util.cc | d5a5caa19172993f7607fc01d76a74c6e50a2678 | [] | no_license | tagattie/FreeBSD-Electron | f191d03c067d03ad3007e7748de905da06ba67f9 | af26f766e772bb04db5eb95148ee071101301e4e | refs/heads/master | 2023-09-04T10:56:17.446818 | 2023-09-04T09:03:11 | 2023-09-04T09:03:11 | 176,520,396 | 73 | 9 | null | 2023-08-31T03:29:16 | 2019-03-19T13:41:20 | C++ | UTF-8 | C++ | false | false | 455 | cc | --- components/autofill/core/common/autofill_util.cc.orig 2020-09-21 18:39:13 UTC
+++ components/autofill/core/common/autofill_util.cc
@@ -213,7 +213,7 @@ bool SanitizedFieldIsEmpty(const base::string16& value
}
bool ShouldAutoselectFirstSuggestionOnArrowDown() {
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
return true;
#else
return false;
| [
"tagattie@gmail.com"
] | tagattie@gmail.com |
51cba9dfc1efa82f952b1cf03a3a7fda2a406bbd | 52ca17dca8c628bbabb0f04504332c8fdac8e7ea | /boost/phoenix/object/detail/new.hpp | e924de0236e4790f8a08186a0fb7b9ad18f5568d | [] | no_license | qinzuoyan/thirdparty | f610d43fe57133c832579e65ca46e71f1454f5c4 | bba9e68347ad0dbffb6fa350948672babc0fcb50 | refs/heads/master | 2021-01-16T17:47:57.121882 | 2015-04-21T06:59:19 | 2015-04-21T06:59:19 | 33,612,579 | 0 | 0 | null | 2015-04-08T14:39:51 | 2015-04-08T14:39:51 | null | UTF-8 | C++ | false | false | 71 | hpp | #include "thirdparty/boost_1_58_0/boost/phoenix/object/detail/new.hpp"
| [
"qinzuoyan@xiaomi.com"
] | qinzuoyan@xiaomi.com |
deec0cfd9eaef1817a1234067d6ab184a4753f50 | 1461aa6e644e2b4767992c51c0df0dc87b3ad1cc | /baekjoon/2752.cpp | ab6876b30801426cb98c37f8936ad0d175b615ff | [] | no_license | lee-jisung/Algorithm | 30304849d6f1fac9bcabd74bd7893e4eb6caa58f | b2007a5419ddd9304e01796acef3be3f4d165648 | refs/heads/master | 2021-05-15T07:20:36.493660 | 2019-10-08T16:28:24 | 2019-10-08T16:28:24 | 111,793,724 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 446 | cpp | #include <cstdio>
using namespace std;
int N;
int main(void) {
int arr[3];
int index, min, temp;
for (int i = 0; i < 3; i++) {
scanf("%d", &arr[i]);
}
for (int i = 0; i < 3; i++) {
min = 10000001;
for (int j = i; j < 3; j++) {
if (min > arr[j]) {
min = arr[j];
index = j;
}
}
temp = arr[index];
arr[index] = arr[i];
arr[i] = temp;
}
for (int i = 0; i < 3; i++) {
printf("%d ", arr[i]);
}
return 0;
}
| [
"noreply@github.com"
] | lee-jisung.noreply@github.com |
2ffdb19b065c856e53071f7ba4b6984f747f347b | c551fd6f83712f91a1a1f36a511347ffa7bb2eb9 | /Sasha/lesson6/mirror.cpp | 6427336ef848a19cfaab484ad4fc8057f4b30829 | [] | no_license | SashaAvag/group-sudo | 3efc8575dbe33358edc15e9c20556c34f267845d | 54e45705d60aa8e85d6431be3a84575df5ecfcda | refs/heads/master | 2021-04-06T10:22:07.445956 | 2018-06-29T06:46:02 | 2018-06-29T06:46:02 | 124,559,340 | 0 | 0 | null | 2018-03-09T15:39:02 | 2018-03-09T15:39:02 | null | UTF-8 | C++ | false | false | 338 | cpp | #include <iostream>
int mirror (int n) {
if ((n / 10) == 0) {
std::cout<<n;
}else {
std::cout<<(n % 10);
return mirror (n/10);
}
}
int main () {
std::cout<<"Enter number: ";
int n;
std::cin>>n;
std::cout<<n<<" mirror image = ";
mirror(n);
std::cout<<std::endl;
return 0;
}
| [
"Sashakingdoms@gmail.com"
] | Sashakingdoms@gmail.com |
5bf668f9d67d691d73bd19ffb2cf41bc67c0a076 | f792fdb912570862fd04037288bf63d0121b3228 | /inheritance/Derived.hpp | 111b874d0c5fb983895be39ff45d42eec1cec815 | [] | no_license | jbloit/cppCookbook | fcff98cf5b77885c0532d86edf0bafb4beee88e7 | 52e51cdbc12a1cec2f77368ce6fc49421314a0ab | refs/heads/master | 2020-12-05T23:28:23.481974 | 2020-09-30T13:28:09 | 2020-09-30T13:28:09 | 232,276,690 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 466 | hpp | #ifndef DERIVED_H
#define DERIVED_H
#include "Base.hpp"
class Derived : public Base
{
public:
int y;
// default constructor, using the parameterized Base constructor
Derived() : Base(777)
{
cout << "Derived default constructor\n";
}
// parameterized constructor
Derived(int i)
{
y = i;
cout << "Derived parameterized constructor\n";
}
};
#endif | [
"julien.bloit@gmail.com"
] | julien.bloit@gmail.com |
7658065b78fdfac24d7e7111694d72e78a514664 | a8d360d967f06c55f48bfafcc115ab81f8524e6b | /2018/src/Commands/DriveRotate.h | f9d74dfd8512555f288562261d44b87e0b3ab967 | [] | no_license | TeamKoalafied/public | c4670f8bfc7c549f5e0cf1271b014d2990f3228e | ab4994c6beabb40452c05870b94a34194678bcc9 | refs/heads/master | 2023-01-08T18:22:17.291505 | 2023-01-06T01:41:11 | 2023-01-06T01:41:11 | 231,504,251 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,637 | h | //==============================================================================
// DriveRotate.h
//==============================================================================
#ifndef DriveRotate_H
#define DriveRotate_H
#include <Timer.h>
#include <Commands/Command.h>
// Command for rotating given angle on the spot
class DriveRotate : public frc::Command {
public:
//==========================================================================
// Construction
// Constructor
//
// turn_angle_degrees - Angle to turn through in degrees
DriveRotate(double turn_angle_degrees);
//==========================================================================
// Function Overrides from frc::Command
void Initialize() override;
void Execute() override;
bool IsFinished() override;
void End() override;
void Interrupted() override;
//==========================================================================
// Set the turn angle
//
// turn_angle_degrees - Angle to turn through in degrees
void SetTurnAngle(double turn_angle_degrees) { m_turn_angle_degrees = turn_angle_degrees; }
private:
//==========================================================================
// Member Variables
double m_turn_angle_degrees; // Angle to turn through in degrees
double m_target_heading_degrees; // Heading angle to turn to for the current execution in degrees
int m_finish_counter; // Counter for detecting if the command is complete
int state; // State for controlling rotation
frc::Timer m_timer; // Timer for measuring total command duration
};
#endif // DriveRotate_H
| [
"smithomaster@gmail.com"
] | smithomaster@gmail.com |
a8c979d5612f357a90c6f213b6c1e5171edfe0bc | c36e4f8d7ffc781b34b4413e5abb1e9a94cb90fe | /C_Study/EE Project/EE_Project_2W_1.cpp | 549cbc4f140b984e74cfc0064fc53035db23703e | [
"MIT"
] | permissive | AnJinHyeok/C_Study | bbd9f29cec5e207165643db5702fe6fd0ac659e9 | e5ad0543e7cdc2d25c8a5717fd9578d33cbca509 | refs/heads/main | 2023-06-05T15:11:52.922695 | 2021-06-30T16:36:43 | 2021-06-30T16:36:43 | 347,581,398 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 310 | cpp | #include <stdio.h>
#include <string.h>
int count(char str[]) {
int num = 0, i = 0;
for (i = 0; i < strlen(str); i++) str[i] == ' ' ? num++ : NULL;
//while (str[i++] != '\0') str[i] == ' ' ? num++ : NULL;
return num;
}
int main() {
char str[1001];
gets_s(str);
printf("%d", count(str));
} | [
"noreply@github.com"
] | AnJinHyeok.noreply@github.com |
47ee0ed5f95421f9bfaab0495da63b5abcb95257 | 46dabcc32698c30a7fb1cc6bc5db3ad5fc5d8b03 | /src/system/context/appcontext.cpp | 026d7a8aa6ad2bc12165649f729fdb7a0646e987 | [] | no_license | bbsctor/NHNAPP | 44237c8e7d84d7581ddbf6f7b64fb1d5dc6a8123 | 32d65e67b7efd6e93ef8388d36af13c8a6655b94 | refs/heads/master | 2020-03-16T15:12:07.968505 | 2018-04-19T09:52:50 | 2018-04-19T09:52:50 | 132,732,638 | 4 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 3,827 | cpp | #include "appcontext.h"
#include "../controller/meansure/meansurecontroller.h"
#include "../controller/setting/systemsettingcontroller.h"
#include "../controller/setting/periodsettingcontroller.h"
#include "../controller/maintain/systemmaintaincontroller.h"
#include "../controller/maintain/functiontestcontroller.h"
#include "../controller/home/runninginfocontroller.h"
#include "../controller/home/currentvaluecontroller.h"
#include "../controller/setting/bcljzjsettingonecontroller.h"
#include "../controller/maintain/maintaindatacontroller.h"
#include "../controller/home/homecontroller.h"
#include "../dataModel/meansurecontroldatamodel.h"
#include "../dataModel/setting/systemsettingdatamodel.h"
#include "../dataModel/setting/periodsettingdatamodel.h"
#include "../dataModel/home/runninginfodatamodel.h"
#include "../dataModel/home/currentvaluedatamodel.h"
#include "../dataModel/setting/bcljzjsettingdatamodelone.h"
#include "../dataModel/maintain/calibrationcoefdatamodel.h"
#include "../database/historydatadbhelper.h"
#include "../database/appdbmanager.h"
#include "../authority/userstate.h"
#include"../dataModel/warning/warningdatamodel.h"
#include"../controller/warning/warningcontroller.h"
#include"../controller/setting/parametersettingcontroller.h"
#include"../dataModel/setting/parametersettingdatamodel.h"
#include"../dataModel/setting/periodsettingdatamodel.h"
#include"../controller/setting/periodsettingcontroller.h"
#include"../dataModel/setting/systemsettingdatamodel.h"
#include"../controller/setting/systemsettingcontroller.h"
#include"../dataModel/setting/settingdefaultinformationdatamodel.h"
#include "../dataModel/status/executestatusdatamodel.h"
QMap<QString, void*> AppContext::map;
AppContext::AppContext(QObject *parent) : QObject(parent)
{
}
bool AppContext::set(QString name, void* obj)
{
map.insert(name, obj);
return true;
}
void* AppContext::get(QString name)
{
return map.value(name);
}
bool AppContext::initDataModel()
{
set("systemSettingDataModel", new SystemSettingDataModel());
set("periodSettingDataModel", new PeriodSettingDataModel());
set("runningInfoDataModel", new RunningInfoDataModel());
set("currentValueDataModel", new CurrentValueDataModel());
set("bcljzjSettingDataModelOne", new BCLJZJSettingDataModelOne());
set("parameterSettingDataModel",new ParameterSettingDataModel());
set("periodSettingDataModel",new PeriodSettingDataModel());
set("maintainDataDataModel", new MaintainDataDataModel());
set("systemSettingDataModel",new SystemSettingDataModel());
set("meansureControlDataModel", new MeansureControlDataModel());
set("warningDataModel",new WarningDataModel());
set("settingdefaultinformationdatamodel",new SettingDefaultInformationDataModel());
set("executeResultDataModel",new ExecuteStatusDataModel());
}
bool AppContext::initController()
{
set("appDBManager", new AppDBManager());
set("systemSettingController", new SystemSettingController());
set("periodSettingController", new PeriodSettingController());
set("systemMaintainController", new SystemMaintainController());
set("functionTestController", new FunctionTestController());
set("runningInfoController", new RunningInfoController());
set("homeController", new HomeController());
set("currentValueController", new CurrentValueController());
set("bcljzjSettingOneController", new BCLJZJSettingOneController());
set("parameterSettingController",new ParameterSettingController());
set("periodSettingController",new PeriodSettingController());
set("maintainDataController", new MaintainDataController());
set("systemSettingController",new SystemSettingController());
set("meansureController", new MeansureController());
set("warningController",new WarningController());
}
| [
"bbsctor@126.com"
] | bbsctor@126.com |
9ff17d686914075a6ab4de203389a19d15a1d29b | dd63f4e78f5c3e27a6172696140ec07b62f3fb0b | /src/xf/core/customevent.cpp | 1e944aaa7983524b3231e633471375d197c33694 | [] | no_license | MartinMeyer1/RealTimeOscilloscope | 20e3e241b73f7a2f1acc3d016b0a968cb6182a94 | 5e676c6bd7f20c206c043d00de81448876268d99 | refs/heads/master | 2022-06-11T14:53:40.973831 | 2020-04-27T15:28:45 | 2020-04-27T15:28:45 | 257,309,869 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 185 | cpp | #include "xf/customevent.h"
XFCustomEvent::XFCustomEvent(int id, interface::XFReactive * pBehavior)
: XFEvent(XFEvent::Event, id, pBehavior),
_bDeleteAfterConsume(true)
{
}
| [
"meyer.mart@outlook.com"
] | meyer.mart@outlook.com |
407acc84fc1e334f2b446914e0e05d09752cd3ae | b00c54389a95d81a22e361fa9f8bdf5a2edc93e3 | /vendor/intel/hardware/PRIVATE/audiocomms/audio-hal/hardware_device/test/StreamMock.hpp | 3dc4eda4ba66b8b3dda672f45d16c6c74b4090b1 | [] | no_license | mirek190/x86-android-5.0 | 9d1756fa7ff2f423887aa22694bd737eb634ef23 | eb1029956682072bb7404192a80214189f0dc73b | refs/heads/master | 2020-05-27T01:09:51.830208 | 2015-10-07T22:47:36 | 2015-10-07T22:47:36 | 41,942,802 | 15 | 20 | null | 2020-03-09T00:21:03 | 2015-09-05T00:11:19 | null | UTF-8 | C++ | false | false | 5,038 | hpp | /*
* INTEL CONFIDENTIAL
* Copyright (c) 2014 Intel
* Corporation All Rights Reserved.
*
* The source code contained or described herein and all documents related to
* the source code ("Material") are owned by Intel Corporation or its suppliers
* or licensors. Title to the Material remains with Intel Corporation or its
* suppliers and licensors. The Material contains trade secrets and proprietary
* and confidential information of Intel or its suppliers and licensors. The
* Material is protected by worldwide copyright and trade secret laws and
* treaty provisions. No part of the Material may be used, copied, reproduced,
* modified, published, uploaded, posted, transmitted, distributed, or
* disclosed in any way without Intel's prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by Intel in writing.
*/
#pragma once
#include <StreamInterface.hpp>
#include <gmock/gmock.h>
namespace intel_audio
{
class StreamOutMock : public StreamOutInterface
{
public:
MOCK_CONST_METHOD0(getSampleRate,
uint32_t());
MOCK_METHOD1(setSampleRate,
android::status_t(uint32_t rate));
MOCK_CONST_METHOD0(getBufferSize,
size_t());
MOCK_CONST_METHOD0(getChannels,
audio_channel_mask_t());
MOCK_CONST_METHOD0(getFormat,
audio_format_t());
MOCK_METHOD1(setFormat,
android::status_t(audio_format_t format));
MOCK_METHOD0(standby,
android::status_t());
MOCK_CONST_METHOD1(dump,
android::status_t(int fd));
MOCK_CONST_METHOD0(getDevice,
audio_devices_t());
MOCK_METHOD1(setDevice,
android::status_t(audio_devices_t device));
MOCK_CONST_METHOD1(getParameters,
std::string(const std::string &keys));
MOCK_METHOD1(setParameters,
android::status_t(const std::string &keyValuePairs));
MOCK_METHOD1(addAudioEffect,
android::status_t(effect_handle_t effect));
MOCK_METHOD1(removeAudioEffect,
android::status_t(effect_handle_t effect));
MOCK_METHOD0(getLatency,
uint32_t());
MOCK_METHOD2(setVolume,
android::status_t(float left, float right));
MOCK_METHOD2(write,
android::status_t(const void *buffer, size_t &bytes));
MOCK_CONST_METHOD1(getRenderPosition,
android::status_t(uint32_t &dspFrames));
MOCK_CONST_METHOD1(getNextWriteTimestamp,
android::status_t(int64_t ×tamp));
MOCK_METHOD0(flush,
android::status_t());
MOCK_METHOD2(setCallback,
android::status_t(stream_callback_t callback, void *cookie));
MOCK_METHOD0(pause,
android::status_t());
MOCK_METHOD0(resume,
android::status_t());
MOCK_METHOD1(drain,
android::status_t(audio_drain_type_t type));
MOCK_CONST_METHOD2(getPresentationPosition,
android::status_t(uint64_t &frames, struct timespec ×tamp));
};
class StreamInMock : public StreamInInterface
{
public:
StreamInMock() {}
virtual ~StreamInMock() {}
MOCK_CONST_METHOD0(getSampleRate,
uint32_t());
MOCK_METHOD1(setSampleRate,
android::status_t(uint32_t rate));
MOCK_CONST_METHOD0(getBufferSize,
size_t());
MOCK_CONST_METHOD0(getChannels,
audio_channel_mask_t());
MOCK_CONST_METHOD0(getFormat,
audio_format_t());
MOCK_METHOD1(setFormat,
android::status_t(audio_format_t format));
MOCK_METHOD0(standby,
android::status_t());
MOCK_CONST_METHOD1(dump,
android::status_t(int fd));
MOCK_CONST_METHOD0(getDevice,
audio_devices_t());
MOCK_METHOD1(setDevice,
android::status_t(audio_devices_t device));
MOCK_CONST_METHOD1(getParameters,
std::string(const std::string &keys));
MOCK_METHOD1(setParameters,
android::status_t(const std::string &keyValuePairs));
MOCK_METHOD1(addAudioEffect,
android::status_t(effect_handle_t effect));
MOCK_METHOD1(removeAudioEffect,
android::status_t(effect_handle_t effect));
MOCK_METHOD1(setGain,
android::status_t(float gain));
MOCK_METHOD2(read,
android::status_t(void *buffer, size_t &bytes));
MOCK_CONST_METHOD0(getInputFramesLost,
uint32_t());
};
} // namespace intel_audio
| [
"mirek190@gmail.com"
] | mirek190@gmail.com |
89947b262e0f36bc54e0e07887a7b517758d788f | 1c330e9395fbc8bb35dd4c837dea010d29e6e7ff | /dsl/intv_multimap.cpp | 68cb6da81c6e13c85e8b29c5014da4dc5e2d2a4c | [] | no_license | luk036/lineda | 4e613cb8e3d9f4b18cb073a10663c9bc0f27103e | 905cb898e5af4222f25299ea030136cc3d2be428 | refs/heads/master | 2021-01-17T05:19:32.255858 | 2019-10-04T05:02:42 | 2019-10-04T05:02:42 | 3,990,632 | 0 | 0 | null | 2019-10-04T05:02:43 | 2012-04-11T05:54:33 | C++ | UTF-8 | C++ | false | false | 138 | cpp | #include "intv_multimap.hpp"
#include <iostream>
using namespace std;
void dummy_multimap() { std::intv_multimap<int, std::string> S; }
| [
"luk036@gmail.com"
] | luk036@gmail.com |
940bfc0a893c7cf46ac2b77fc26b2b5090b66eaf | ad715f9713dc5c6c570a5ac51a18b11932edf548 | /tensorflow/core/profiler/rpc/profiler_service_impl.cc | 6dd69120f763afde920e4e4e1bbbfdb02e1c2594 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | rockzhuang/tensorflow | f1f31bc8edfa402b748c500efb97473c001bac95 | cb40c060b36c6a75edfefbc4e5fc7ee720273e13 | refs/heads/master | 2022-11-08T20:41:36.735747 | 2022-10-21T01:45:52 | 2022-10-21T01:45:52 | 161,580,587 | 27 | 11 | Apache-2.0 | 2019-01-23T11:00:44 | 2018-12-13T03:47:28 | C++ | UTF-8 | C++ | false | false | 4,798 | cc | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/core/profiler/rpc/profiler_service_impl.h"
#include <memory>
#include "grpcpp/support/status.h"
#include "absl/container/flat_hash_map.h"
#include "absl/strings/str_replace.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/env_time.h"
#include "tensorflow/core/platform/errors.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/status.h"
#include "tensorflow/core/profiler/lib/profiler_session.h"
#include "tensorflow/core/profiler/profiler_service.grpc.pb.h"
#include "tensorflow/core/profiler/profiler_service.pb.h"
#include "tensorflow/core/profiler/protobuf/xplane.pb.h"
#include "tensorflow/core/profiler/rpc/client/save_profile.h"
#include "tensorflow/core/profiler/utils/file_system_utils.h"
#include "tensorflow/core/profiler/utils/math_utils.h"
#include "tensorflow/core/profiler/utils/time_utils.h"
#include "tensorflow/core/profiler/utils/xplane_utils.h"
namespace tensorflow {
namespace profiler {
namespace {
// Collects data in XSpace format. The data is saved to a repository
// unconditionally.
Status CollectDataToRepository(const ProfileRequest& request,
ProfilerSession* profiler,
ProfileResponse* response) {
response->set_empty_trace(true);
// Read the profile data into xspace.
XSpace xspace;
TF_RETURN_IF_ERROR(profiler->CollectData(&xspace));
VLOG(3) << "Collected XSpace to repository.";
response->set_empty_trace(IsEmpty(xspace));
return SaveXSpace(request.repository_root(), request.session_id(),
request.host_name(), xspace);
}
class ProfilerServiceImpl : public grpc::ProfilerService::Service {
public:
::grpc::Status Monitor(::grpc::ServerContext* ctx, const MonitorRequest* req,
MonitorResponse* response) override {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "unimplemented.");
}
::grpc::Status Profile(::grpc::ServerContext* ctx, const ProfileRequest* req,
ProfileResponse* response) override {
VLOG(1) << "Received a profile request: " << req->DebugString();
std::unique_ptr<ProfilerSession> profiler =
ProfilerSession::Create(req->opts());
Status status = profiler->Status();
if (!status.ok()) {
return ::grpc::Status(::grpc::StatusCode::INTERNAL,
status.error_message());
}
Env* env = Env::Default();
uint64 duration_ns = MilliToNano(req->opts().duration_ms());
uint64 deadline = GetCurrentTimeNanos() + duration_ns;
while (GetCurrentTimeNanos() < deadline) {
env->SleepForMicroseconds(EnvTime::kMillisToMicros);
if (ctx->IsCancelled()) {
return ::grpc::Status::CANCELLED;
}
if (TF_PREDICT_FALSE(IsStopped(req->session_id()))) {
mutex_lock lock(mutex_);
stop_signals_per_session_.erase(req->session_id());
break;
}
}
status = CollectDataToRepository(*req, profiler.get(), response);
if (!status.ok()) {
return ::grpc::Status(::grpc::StatusCode::INTERNAL,
status.error_message());
}
return ::grpc::Status::OK;
}
::grpc::Status Terminate(::grpc::ServerContext* ctx,
const TerminateRequest* req,
TerminateResponse* response) override {
mutex_lock lock(mutex_);
stop_signals_per_session_[req->session_id()] = true;
return ::grpc::Status::OK;
}
private:
bool IsStopped(const std::string& session_id) {
mutex_lock lock(mutex_);
auto it = stop_signals_per_session_.find(session_id);
return it != stop_signals_per_session_.end() && it->second;
}
mutex mutex_;
absl::flat_hash_map<std::string, bool> stop_signals_per_session_
ABSL_GUARDED_BY(mutex_);
};
} // namespace
std::unique_ptr<grpc::ProfilerService::Service> CreateProfilerService() {
return std::make_unique<ProfilerServiceImpl>();
}
} // namespace profiler
} // namespace tensorflow
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
fcde2c19a24cb1daada3f1467fa997eb2e80d962 | 5c2416618597a42f275bf46366fa76a6ffb773b3 | /src/share/imem.h | 6b72d69ab26c7ea0de4a43a47cfff1d4e5a1c4e9 | [] | no_license | cnfntrvlnss/24209 | 7ea7f277af2c912eccb09957251c81dcf4b632b6 | eec707cbfc4c340ecd8f3143323658d86e1c1be4 | refs/heads/master | 2021-01-20T08:02:50.813475 | 2017-08-11T11:20:16 | 2017-08-11T11:20:16 | 90,090,105 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,500 | h | /*****************************************************************************/
/*M*
// THINKIT INTERNATIONAL PROPRIETARY INFORMATION
// This software is supplied under the terms of the license agreement
// or nondisclosure agreement with Thinkit International and may not be copied
// or disclosed except in accordance with the terms of that agreement.
// Copyright (c) 2002 ~ 2008 Thinkit International. All Rights Reserved.
// VSS:
// $Workfile:: imem.h $
// $Author:: Jjwang $
// $Revision:: 1 $
// $Modtime:: 11/09/13 20:39 $
// $NoKeywords: $
//
//
// Memory Management Head File
//
M*/
#ifndef aaaiMEMORY_MANAGEMENTaaa
#define aaaiMEMORY_MANAGEMENTaaa
#include <malloc.h>
#include "mem.h"
#include "isdtexception.h"
static const uint hSize=100*1024;
struct Link
{
Link* next;
};
struct aMemId
{
enum {size=hSize};
aMemId *next;
char mem[size];
};
struct IHeap
{
int size; /* size */
Link* head;
aMemId *pHeap;
};
/**
class ISDTAPI Memory
{
public:
static IHeap *CreateHeap(int sz=0);
static void DeleteHeap(IHeap *id);
static void *New(IHeap *id, int len, const bool clear=false);
static void *New(IHeap *id, const bool clear=false);
static void Delete(IHeap *id, void *ptr);
};
*/
#endif
| [
"zhengshurui@live.com"
] | zhengshurui@live.com |
0a73264dca6d7541b38a5ab88e333ec8f87746e2 | 84f76ce90c2b4a60e8db1bd23c4abe5b33a167bb | /fw/include/test_queue.hpp | 239d00f47207d3f7276d5699c1e55fc82958adbb | [
"MIT"
] | permissive | cednik/one-wire_sniffer | 1b28a75842e855917e87e5dbf10ca3deb407c58d | bfa8e38e6310c8a20ac48eaa711be53b3454806b | refs/heads/master | 2022-12-15T22:11:58.968852 | 2020-09-15T15:05:29 | 2020-09-15T15:05:29 | 287,253,428 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 592 | hpp | #pragma once
#include <cstdint>
#include <cstddef>
#include <esp_attr.h>
#include <FreeRTOS.h>
class testQueue {
public:
static void init(size_t capacity = 128);
template<typename... Args>
static void send(Args&&... args);
template<typename... Args>
static void INTR_ATTR sendFromISR(Args&&... args);
static void print();
private:
uint64_t _status;
uint8_t _cpu;
testQueue();
~testQueue();
void _print();
void INTR_ATTR _init(uint8_t cpu, uint64_t status);
static QueueHandle_t s_handle;
static volatile uint32_t s_index;
};
| [
"kuba.streit@gmail.com"
] | kuba.streit@gmail.com |
53749e31a54ba593b6bb5ab5cd4e8bf196395242 | 8ca1e6e17919693b35ab0ba787da0e6c8834cbb3 | /Seminar/Seminar 4/OpenMP demo/OpenMP demo.cpp | 19c200489383d87c83bcb96b42a90fb81f84ff5d | [] | no_license | haja-fgabriel/ppd | 43d46c2a0cc3f0f36b08e4f0c9804e680dd2b64a | da4d473dfd0de6c0d062a7bcaa49699856861430 | refs/heads/master | 2023-03-19T15:02:29.255755 | 2021-03-01T19:44:50 | 2021-03-01T19:44:50 | 299,298,087 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,237 | cpp | #include <iostream>
#include <omp.h>
using namespace std;
int main()
{
int i;
int a[10] = { 1,2,3,4,5,6,7,8,9,10 };
int b[10] = { 1,2,3,4,5,6,7,8,9,10 };
int result[10];
omp_set_num_threads(4);
for (int i = 0; i < 10; i++) {
result[i] = a[i] + b[i];
}
for (int i = 0; i < 10; i++) {
cout << result[i] << ' ';
}
cout << endl;
#pragma omp parallel private(i) num_threads(3)
{
/*#pragma omp for private(i) schedule(static, 1)
for (int i = 0; i < 10; i++) {
cout << omp_get_thread_num() << " - " << i << endl;
result[i] = a[i] + b[i];
}
cout << "end for1 for thread " << omp_get_thread_num() << endl;
#pragma omp for nowait
for (int i = 0; i < 10; i++) {
cout << result[i] << ' ';
}
cout << endl;
cout << "end for2 for thread " << omp_get_thread_num() << endl;*/
#pragma omp sections
{
#pragma omp section
{
}
#pragma omp section
{
}
#pragma omp section
{
}
}
}
} | [
"haja.fgabriel@gmail.com"
] | haja.fgabriel@gmail.com |
c13d721ef6008a40a936075280e1122e47bfa0e1 | 066a82ed63425419c36cd8b56492a5125c961732 | /Arduino/getTime.ino | 1d2c5897a530a7ee71b0e0f4a3a1ddd994b9b180 | [] | no_license | phawit/temp-humid | 072402a175bc062400032f2c155bf5d89bb3b4e3 | 225dbebf1d7d8c04abfc030e6a1d8aa3e8542317 | refs/heads/master | 2020-03-17T21:16:21.932158 | 2018-08-13T01:43:08 | 2018-08-13T01:43:08 | 133,951,789 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 829 | ino |
#include <ESP8266WiFi.h>
#include <time.h>
const char* ssid = "MyWifi";
const char* password = "abcd1234";
int timezone = 7;
int dst = 0;
void setup() {
Serial.begin(115200);
Serial.setDebugOutput(true);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.println("\nConnecting to WiFi");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(1000);
}
configTime(timezone * 3600, 0, "pool.ntp.org", "time.nist.gov");
Serial.println("\nWaiting for time");
while (!time(nullptr)) {
Serial.print(".");
delay(1000);
}
Serial.println("");
}
void loop() {
time_t newtime = time(nullptr);
//Serial.println(ctime(&now));
delay(1000);
int h = int(newtime->tm_hour);
int mm = int(newtime->tm_min);
int ss = int(newtime->tm_sec);
Serial.println(h);
}
| [
"noreply@github.com"
] | phawit.noreply@github.com |
cab86e66268ffb2cb154a899fbed92ea4ef7f4c7 | ae09f81e751fa75ba4cb8f1688ecf9ad00c2d82e | /Beginning Programming with C++/ConcateNString/main.cpp | ec31ede5e82bc059526e9fe0cb8d209ea393d4fb | [] | no_license | YChuan1115/cAndC- | c205cf325be73de3ff868c50240fbea1146b7fcc | 78d96b3063095406b5dcb200c922620ed67b5f2b | refs/heads/master | 2020-05-27T06:03:10.995160 | 2016-07-06T03:00:12 | 2016-07-06T03:00:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,100 | cpp | //
// ConcatenateNString - similar to ConcatenateString
// except this version makes sure to not
// write beyond the end of the target
// array.
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
// concatenateString - concatenate one string onto the
// end of another (don't write beyond
// nTargetSize)
void concatenateString(char szTarget[],
int nTargetSize,
const char szSource[])
{
// first find the end of the target string
int nT;
for(nT = 0; szTarget[nT] != '\0'; nT++)
{
}
// now copy the contents of the source string into
// the target string, beginning at 'nT' but don't
// write beyond the nTargetSize'th element (- 1 to
// leave room for the terminating NULL)
for(int nS = 0;
nT < (nTargetSize - 1) && szSource[nS] != '\0';
nT++, nS++)
{
szTarget[nT] = szSource[nS];
}
// add the terminator to szTarget
szTarget[nT] = '\0';
}
int main(int nNumberofArgs, char* pszArgs[])
{
// Prompt user
cout << "This program accepts two strings\n"
<< "from the keyboard and outputs them\n"
<< "concatenated together.\n" << endl;
// input two strings
cout << "Enter first string: ";
char szString1[256];
cin.getline(szString1, 256);
cout << "Enter the second string: ";
char szString2[256];
cin.getline(szString2, 256);
// now concatenate one onto the end of the other
cout << "Concatentate first string onto the second"
<< endl;
concatenateString(szString1, 256, szString2);
// and display the result
cout << "Result: <"
<< szString1
<< ">" << endl;
// wait until user is ready before terminating program
// to allow the user to see the program results
cout << "Press Enter to continue..." << endl;
cin.ignore(10, '\n');
cin.get();
return 0;
}
| [
"roberthsu@roberthsude-MacBook.local"
] | roberthsu@roberthsude-MacBook.local |
5c2f5340c76cc14a3c887d2e7dc3a411b0298d04 | fae6d83d66f83dc225784771fcb005272e346d72 | /src/main/cpp/http/HttpServer.h | f05e53336abe2cb33944ce7682f9ba561238d607 | [] | no_license | Axure/BoostServer | 5f4d8028dfbfb182830cd025685b7ce07cc5ecff | 1dd605d0b0092469ba65c0c6d3ec0810b51a7846 | refs/heads/master | 2021-01-22T12:03:05.452236 | 2015-09-15T00:21:00 | 2015-09-15T00:21:00 | 42,462,424 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 270 | h | //
// Created by 郑虎 on 2015-09-15.
//
#ifndef BOOSTSERVER_HTTPSERVER_H
#define BOOSTSERVER_HTTPSERVER_H
namespace boost_server {
namespace http {
class HttpServer {
public:
HttpServer();
~HttpServer();
private:
};
}
}
#endif //BOOSTSERVER_HTTPSERVER_H
| [
"axurez@vip.qq.com"
] | axurez@vip.qq.com |
99b1460aae3715c9b446ddc67c0d51dcd6cd6ea6 | 38177e8ea1f87a877c16d2ca8bbf207ccf198dc1 | /YoloDetectionHoloLensUnity/app/Il2CppOutputProject/Source/il2cppOutput/Bulk_UnityEngine.TextRenderingModule_0.cpp | 88a43d18f6a7af97a898b6025a31f3a8542c5268 | [
"MIT"
] | permissive | atolegen/YoloDetect | eaeee5ac5626591205b90f7fef70da09c336e604 | 30f230508d28859225bc9c199d69f7e723d12c0f | refs/heads/master | 2022-12-22T00:19:23.551996 | 2020-08-28T17:13:41 | 2020-08-28T17:13:41 | 287,201,278 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 222,848 | 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"
struct VirtActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
struct GenericVirtActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
struct InterfaceActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
struct GenericInterfaceActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
// System.Action`1<System.Object>
struct Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0;
// System.Action`1<UnityEngine.Font>
struct Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C;
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4;
// System.Byte[]
struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821;
// System.Char[]
struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2;
// System.Collections.Generic.IList`1<UnityEngine.UICharInfo>
struct IList_1_t32D1BB5985FCCAC1B6B14D4E41B3E3315FD87B3E;
// System.Collections.Generic.IList`1<UnityEngine.UILineInfo>
struct IList_1_t6F2A098B6071B1699E7DC325A6F16089FE563544;
// System.Collections.Generic.IList`1<UnityEngine.UIVertex>
struct IList_1_t45C308B7C2BC6D4379698668EE5E126FF141A995;
// System.Collections.Generic.List`1<UnityEngine.UICharInfo>
struct List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E;
// System.Collections.Generic.List`1<UnityEngine.UILineInfo>
struct List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0;
// System.Collections.Generic.List`1<UnityEngine.UIVertex>
struct List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554;
// System.Delegate
struct Delegate_t;
// System.DelegateData
struct DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE;
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
// System.IAsyncResult
struct IAsyncResult_t8E194308510B375B42432981AE5E7488C458D598;
// System.Object[]
struct ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A;
// System.Reflection.MethodInfo
struct MethodInfo_t;
// System.String
struct String_t;
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017;
// UnityEngine.Font
struct Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26;
// UnityEngine.Font/FontTextureRebuildCallback
struct FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C;
// UnityEngine.GameObject
struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F;
// UnityEngine.Material
struct Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598;
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0;
// UnityEngine.TextGenerationSettings
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68;
// UnityEngine.TextGenerator
struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8;
// UnityEngine.TextMesh
struct TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A;
// UnityEngine.UICharInfo[]
struct UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482;
// UnityEngine.UILineInfo[]
struct UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC;
// UnityEngine.UIVertex[]
struct UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A;
extern RuntimeClass* Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C_il2cpp_TypeInfo_var;
extern RuntimeClass* Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var;
extern RuntimeClass* Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var;
extern RuntimeClass* IDisposable_t7218B22548186B208D65EA5B7870503810A2D15A_il2cpp_TypeInfo_var;
extern RuntimeClass* IntPtr_t_il2cpp_TypeInfo_var;
extern RuntimeClass* List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_il2cpp_TypeInfo_var;
extern RuntimeClass* List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_il2cpp_TypeInfo_var;
extern RuntimeClass* List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_il2cpp_TypeInfo_var;
extern RuntimeClass* Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var;
extern RuntimeClass* ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var;
extern RuntimeClass* Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var;
extern RuntimeClass* UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var;
extern RuntimeClass* Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_il2cpp_TypeInfo_var;
extern RuntimeClass* Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_il2cpp_TypeInfo_var;
extern String_t* _stringLiteral277905A8757DB70EAE0C8B996E4FCF857783BB03;
extern String_t* _stringLiteral2C79056F1CBD7CDBD214C0C0421FFC46A2BD5CBD;
extern String_t* _stringLiteral6F5E75D22C09C82C4D03E8E6E9ADE44476FEE514;
extern String_t* _stringLiteral8D03707CEE3275C377839D6BF944BCECDF26A00B;
extern const RuntimeMethod* Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB_RuntimeMethod_var;
extern const RuntimeMethod* List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_RuntimeMethod_var;
extern const RuntimeMethod* List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_RuntimeMethod_var;
extern const RuntimeMethod* List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_RuntimeMethod_var;
extern const uint32_t Font_InvokeTextureRebuilt_Internal_m2D4C9D99B6137EF380A19EC72D6EE8CBFF7B4062_MetadataUsageId;
extern const uint32_t Font_add_textureRebuilt_m031EFCD3B164273920B133A8689C18ED87C9B18F_MetadataUsageId;
extern const uint32_t Font_remove_textureRebuilt_mBEF163DAE27CA126D400646E850AAEE4AE8DAAB4_MetadataUsageId;
extern const uint32_t TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66_MetadataUsageId;
extern const uint32_t TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C_MetadataUsageId;
extern const uint32_t TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D_MetadataUsageId;
extern const uint32_t TextGenerator_Finalize_m6E9076F61F7B4DD5E56207F39E8F5FD85F188D8A_MetadataUsageId;
extern const uint32_t TextGenerator_PopulateWithErrors_m1F1851B3C2B2EBEFD81C83DC124FB376C926B933_MetadataUsageId;
extern const uint32_t TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B_MetadataUsageId;
extern const uint32_t TextGenerator_System_IDisposable_Dispose_m9D3291DC086282AF57A115B39D3C17BD0074FA3D_MetadataUsageId;
extern const uint32_t TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3_MetadataUsageId;
extern const uint32_t TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE_MetadataUsageId;
extern const uint32_t UIVertex__cctor_m86F60F5BB996D3C59B19B80C4BFB5770802BFB30_MetadataUsageId;
struct Delegate_t_marshaled_com;
struct Delegate_t_marshaled_pinvoke;
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68;;
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com;
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com;;
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke;
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke;;
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
struct ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A;
#ifndef U3CMODULEU3E_TDBB8B8FDA571F608D819B1D5558C135A3972639B_H
#define U3CMODULEU3E_TDBB8B8FDA571F608D819B1D5558C135A3972639B_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// <Module>
struct U3CModuleU3E_tDBB8B8FDA571F608D819B1D5558C135A3972639B
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // U3CMODULEU3E_TDBB8B8FDA571F608D819B1D5558C135A3972639B_H
#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
struct Il2CppArrayBounds;
#ifndef RUNTIMEARRAY_H
#define RUNTIMEARRAY_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Array
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RUNTIMEARRAY_H
#ifndef LIST_1_TD850FBA632A52824016AAA9B3748BA38F51E087E_H
#define LIST_1_TD850FBA632A52824016AAA9B3748BA38F51E087E_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.List`1<UnityEngine.UICharInfo>
struct List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E : public RuntimeObject
{
public:
// T[] System.Collections.Generic.List`1::_items
UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* ____items_1;
// System.Int32 System.Collections.Generic.List`1::_size
int32_t ____size_2;
// System.Int32 System.Collections.Generic.List`1::_version
int32_t ____version_3;
// System.Object System.Collections.Generic.List`1::_syncRoot
RuntimeObject * ____syncRoot_4;
public:
inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____items_1)); }
inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* get__items_1() const { return ____items_1; }
inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482** get_address_of__items_1() { return &____items_1; }
inline void set__items_1(UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* value)
{
____items_1 = value;
Il2CppCodeGenWriteBarrier((&____items_1), value);
}
inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____size_2)); }
inline int32_t get__size_2() const { return ____size_2; }
inline int32_t* get_address_of__size_2() { return &____size_2; }
inline void set__size_2(int32_t value)
{
____size_2 = value;
}
inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____version_3)); }
inline int32_t get__version_3() const { return ____version_3; }
inline int32_t* get_address_of__version_3() { return &____version_3; }
inline void set__version_3(int32_t value)
{
____version_3 = value;
}
inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E, ____syncRoot_4)); }
inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; }
inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; }
inline void set__syncRoot_4(RuntimeObject * value)
{
____syncRoot_4 = value;
Il2CppCodeGenWriteBarrier((&____syncRoot_4), value);
}
};
struct List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_StaticFields
{
public:
// T[] System.Collections.Generic.List`1::_emptyArray
UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* ____emptyArray_5;
public:
inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_StaticFields, ____emptyArray_5)); }
inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* get__emptyArray_5() const { return ____emptyArray_5; }
inline UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482** get_address_of__emptyArray_5() { return &____emptyArray_5; }
inline void set__emptyArray_5(UICharInfoU5BU5D_t8C4FF69B643D49D3881FCB7A8525C5C5A9367482* value)
{
____emptyArray_5 = value;
Il2CppCodeGenWriteBarrier((&____emptyArray_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LIST_1_TD850FBA632A52824016AAA9B3748BA38F51E087E_H
#ifndef LIST_1_T7687D8368357F4437252DC75BFCE9DE76F3143A0_H
#define LIST_1_T7687D8368357F4437252DC75BFCE9DE76F3143A0_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.List`1<UnityEngine.UILineInfo>
struct List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 : public RuntimeObject
{
public:
// T[] System.Collections.Generic.List`1::_items
UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* ____items_1;
// System.Int32 System.Collections.Generic.List`1::_size
int32_t ____size_2;
// System.Int32 System.Collections.Generic.List`1::_version
int32_t ____version_3;
// System.Object System.Collections.Generic.List`1::_syncRoot
RuntimeObject * ____syncRoot_4;
public:
inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____items_1)); }
inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* get__items_1() const { return ____items_1; }
inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC** get_address_of__items_1() { return &____items_1; }
inline void set__items_1(UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* value)
{
____items_1 = value;
Il2CppCodeGenWriteBarrier((&____items_1), value);
}
inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____size_2)); }
inline int32_t get__size_2() const { return ____size_2; }
inline int32_t* get_address_of__size_2() { return &____size_2; }
inline void set__size_2(int32_t value)
{
____size_2 = value;
}
inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____version_3)); }
inline int32_t get__version_3() const { return ____version_3; }
inline int32_t* get_address_of__version_3() { return &____version_3; }
inline void set__version_3(int32_t value)
{
____version_3 = value;
}
inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0, ____syncRoot_4)); }
inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; }
inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; }
inline void set__syncRoot_4(RuntimeObject * value)
{
____syncRoot_4 = value;
Il2CppCodeGenWriteBarrier((&____syncRoot_4), value);
}
};
struct List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_StaticFields
{
public:
// T[] System.Collections.Generic.List`1::_emptyArray
UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* ____emptyArray_5;
public:
inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_StaticFields, ____emptyArray_5)); }
inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* get__emptyArray_5() const { return ____emptyArray_5; }
inline UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC** get_address_of__emptyArray_5() { return &____emptyArray_5; }
inline void set__emptyArray_5(UILineInfoU5BU5D_t923CC56F4D67E9FA97CC73992DF16268B6A54FAC* value)
{
____emptyArray_5 = value;
Il2CppCodeGenWriteBarrier((&____emptyArray_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LIST_1_T7687D8368357F4437252DC75BFCE9DE76F3143A0_H
#ifndef LIST_1_T4CE16E1B496C9FE941554BB47727DFDD7C3D9554_H
#define LIST_1_T4CE16E1B496C9FE941554BB47727DFDD7C3D9554_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.List`1<UnityEngine.UIVertex>
struct List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 : public RuntimeObject
{
public:
// T[] System.Collections.Generic.List`1::_items
UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* ____items_1;
// System.Int32 System.Collections.Generic.List`1::_size
int32_t ____size_2;
// System.Int32 System.Collections.Generic.List`1::_version
int32_t ____version_3;
// System.Object System.Collections.Generic.List`1::_syncRoot
RuntimeObject * ____syncRoot_4;
public:
inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____items_1)); }
inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* get__items_1() const { return ____items_1; }
inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A** get_address_of__items_1() { return &____items_1; }
inline void set__items_1(UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* value)
{
____items_1 = value;
Il2CppCodeGenWriteBarrier((&____items_1), value);
}
inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____size_2)); }
inline int32_t get__size_2() const { return ____size_2; }
inline int32_t* get_address_of__size_2() { return &____size_2; }
inline void set__size_2(int32_t value)
{
____size_2 = value;
}
inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____version_3)); }
inline int32_t get__version_3() const { return ____version_3; }
inline int32_t* get_address_of__version_3() { return &____version_3; }
inline void set__version_3(int32_t value)
{
____version_3 = value;
}
inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554, ____syncRoot_4)); }
inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; }
inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; }
inline void set__syncRoot_4(RuntimeObject * value)
{
____syncRoot_4 = value;
Il2CppCodeGenWriteBarrier((&____syncRoot_4), value);
}
};
struct List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_StaticFields
{
public:
// T[] System.Collections.Generic.List`1::_emptyArray
UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* ____emptyArray_5;
public:
inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_StaticFields, ____emptyArray_5)); }
inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* get__emptyArray_5() const { return ____emptyArray_5; }
inline UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A** get_address_of__emptyArray_5() { return &____emptyArray_5; }
inline void set__emptyArray_5(UIVertexU5BU5D_tB560F9F9269864891FCE1677971F603A08AA857A* value)
{
____emptyArray_5 = value;
Il2CppCodeGenWriteBarrier((&____emptyArray_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // LIST_1_T4CE16E1B496C9FE941554BB47727DFDD7C3D9554_H
#ifndef STRING_T_H
#define STRING_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.String
struct String_t : public RuntimeObject
{
public:
// System.Int32 System.String::m_stringLength
int32_t ___m_stringLength_0;
// System.Char System.String::m_firstChar
Il2CppChar ___m_firstChar_1;
public:
inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); }
inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; }
inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; }
inline void set_m_stringLength_0(int32_t value)
{
___m_stringLength_0 = value;
}
inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); }
inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; }
inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; }
inline void set_m_firstChar_1(Il2CppChar value)
{
___m_firstChar_1 = value;
}
};
struct String_t_StaticFields
{
public:
// System.String System.String::Empty
String_t* ___Empty_5;
public:
inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); }
inline String_t* get_Empty_5() const { return ___Empty_5; }
inline String_t** get_address_of_Empty_5() { return &___Empty_5; }
inline void set_Empty_5(String_t* value)
{
___Empty_5 = value;
Il2CppCodeGenWriteBarrier((&___Empty_5), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // STRING_T_H
#ifndef VALUETYPE_T4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_H
#define VALUETYPE_T4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com
{
};
#endif // VALUETYPE_T4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_H
#ifndef BOOLEAN_TB53F6830F670160873277339AA58F15CAED4399C_H
#define BOOLEAN_TB53F6830F670160873277339AA58F15CAED4399C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Boolean
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C
{
public:
// System.Boolean System.Boolean::m_value
bool ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); }
inline bool get_m_value_0() const { return ___m_value_0; }
inline bool* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(bool value)
{
___m_value_0 = value;
}
};
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields
{
public:
// System.String System.Boolean::TrueString
String_t* ___TrueString_5;
// System.String System.Boolean::FalseString
String_t* ___FalseString_6;
public:
inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); }
inline String_t* get_TrueString_5() const { return ___TrueString_5; }
inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; }
inline void set_TrueString_5(String_t* value)
{
___TrueString_5 = value;
Il2CppCodeGenWriteBarrier((&___TrueString_5), value);
}
inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); }
inline String_t* get_FalseString_6() const { return ___FalseString_6; }
inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; }
inline void set_FalseString_6(String_t* value)
{
___FalseString_6 = value;
Il2CppCodeGenWriteBarrier((&___FalseString_6), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // BOOLEAN_TB53F6830F670160873277339AA58F15CAED4399C_H
#ifndef BYTE_TF87C579059BD4633E6840EBBBEEF899C6E33EF07_H
#define BYTE_TF87C579059BD4633E6840EBBBEEF899C6E33EF07_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Byte
struct Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07
{
public:
// System.Byte System.Byte::m_value
uint8_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07, ___m_value_0)); }
inline uint8_t get_m_value_0() const { return ___m_value_0; }
inline uint8_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(uint8_t value)
{
___m_value_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // BYTE_TF87C579059BD4633E6840EBBBEEF899C6E33EF07_H
#ifndef CHAR_TBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_H
#define CHAR_TBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Char
struct Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9
{
public:
// System.Char System.Char::m_value
Il2CppChar ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9, ___m_value_0)); }
inline Il2CppChar get_m_value_0() const { return ___m_value_0; }
inline Il2CppChar* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(Il2CppChar value)
{
___m_value_0 = value;
}
};
struct Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_StaticFields
{
public:
// System.Byte[] System.Char::categoryForLatin1
ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___categoryForLatin1_3;
public:
inline static int32_t get_offset_of_categoryForLatin1_3() { return static_cast<int32_t>(offsetof(Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_StaticFields, ___categoryForLatin1_3)); }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* get_categoryForLatin1_3() const { return ___categoryForLatin1_3; }
inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821** get_address_of_categoryForLatin1_3() { return &___categoryForLatin1_3; }
inline void set_categoryForLatin1_3(ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* value)
{
___categoryForLatin1_3 = value;
Il2CppCodeGenWriteBarrier((&___categoryForLatin1_3), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // CHAR_TBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_H
#ifndef ENUM_T2AF27C02B8653AE29442467390005ABC74D8F521_H
#define ENUM_T2AF27C02B8653AE29442467390005ABC74D8F521_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521 : public ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF
{
public:
public:
};
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields
{
public:
// System.Char[] System.Enum::enumSeperatorCharArray
CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___enumSeperatorCharArray_0;
public:
inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields, ___enumSeperatorCharArray_0)); }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; }
inline void set_enumSeperatorCharArray_0(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value)
{
___enumSeperatorCharArray_0 = value;
Il2CppCodeGenWriteBarrier((&___enumSeperatorCharArray_0), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_com
{
};
#endif // ENUM_T2AF27C02B8653AE29442467390005ABC74D8F521_H
#ifndef INT32_T585191389E07734F19F3156FF88FB3EF4800D102_H
#define INT32_T585191389E07734F19F3156FF88FB3EF4800D102_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Int32
struct Int32_t585191389E07734F19F3156FF88FB3EF4800D102
{
public:
// System.Int32 System.Int32::m_value
int32_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t585191389E07734F19F3156FF88FB3EF4800D102, ___m_value_0)); }
inline int32_t get_m_value_0() const { return ___m_value_0; }
inline int32_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(int32_t value)
{
___m_value_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // INT32_T585191389E07734F19F3156FF88FB3EF4800D102_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 SINGLE_TDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1_H
#define SINGLE_TDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Single
struct Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1
{
public:
// System.Single System.Single::m_value
float ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1, ___m_value_0)); }
inline float get_m_value_0() const { return ___m_value_0; }
inline float* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(float value)
{
___m_value_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // SINGLE_TDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1_H
#ifndef UINT32_T4980FA09003AFAAB5A6E361BA2748EA9A005709B_H
#define UINT32_T4980FA09003AFAAB5A6E361BA2748EA9A005709B_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.UInt32
struct UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B
{
public:
// System.UInt32 System.UInt32::m_value
uint32_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B, ___m_value_0)); }
inline uint32_t get_m_value_0() const { return ___m_value_0; }
inline uint32_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(uint32_t value)
{
___m_value_0 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UINT32_T4980FA09003AFAAB5A6E361BA2748EA9A005709B_H
#ifndef VOID_T22962CB4C05B1D89B55A6E1139F0E87A90987017_H
#define VOID_T22962CB4C05B1D89B55A6E1139F0E87A90987017_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017
{
public:
union
{
struct
{
};
uint8_t Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017__padding[1];
};
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VOID_T22962CB4C05B1D89B55A6E1139F0E87A90987017_H
#ifndef COLOR_T119BCA590009762C7223FDD3AF9706653AC84ED2_H
#define COLOR_T119BCA590009762C7223FDD3AF9706653AC84ED2_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Color
struct Color_t119BCA590009762C7223FDD3AF9706653AC84ED2
{
public:
// System.Single UnityEngine.Color::r
float ___r_0;
// System.Single UnityEngine.Color::g
float ___g_1;
// System.Single UnityEngine.Color::b
float ___b_2;
// System.Single UnityEngine.Color::a
float ___a_3;
public:
inline static int32_t get_offset_of_r_0() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___r_0)); }
inline float get_r_0() const { return ___r_0; }
inline float* get_address_of_r_0() { return &___r_0; }
inline void set_r_0(float value)
{
___r_0 = value;
}
inline static int32_t get_offset_of_g_1() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___g_1)); }
inline float get_g_1() const { return ___g_1; }
inline float* get_address_of_g_1() { return &___g_1; }
inline void set_g_1(float value)
{
___g_1 = value;
}
inline static int32_t get_offset_of_b_2() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___b_2)); }
inline float get_b_2() const { return ___b_2; }
inline float* get_address_of_b_2() { return &___b_2; }
inline void set_b_2(float value)
{
___b_2 = value;
}
inline static int32_t get_offset_of_a_3() { return static_cast<int32_t>(offsetof(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2, ___a_3)); }
inline float get_a_3() const { return ___a_3; }
inline float* get_address_of_a_3() { return &___a_3; }
inline void set_a_3(float value)
{
___a_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COLOR_T119BCA590009762C7223FDD3AF9706653AC84ED2_H
#ifndef COLOR32_T23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23_H
#define COLOR32_T23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Color32
struct Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23
{
public:
union
{
#pragma pack(push, tp, 1)
struct
{
// System.Int32 UnityEngine.Color32::rgba
int32_t ___rgba_0;
};
#pragma pack(pop, tp)
struct
{
int32_t ___rgba_0_forAlignmentOnly;
};
#pragma pack(push, tp, 1)
struct
{
// System.Byte UnityEngine.Color32::r
uint8_t ___r_1;
};
#pragma pack(pop, tp)
struct
{
uint8_t ___r_1_forAlignmentOnly;
};
#pragma pack(push, tp, 1)
struct
{
char ___g_2_OffsetPadding[1];
// System.Byte UnityEngine.Color32::g
uint8_t ___g_2;
};
#pragma pack(pop, tp)
struct
{
char ___g_2_OffsetPadding_forAlignmentOnly[1];
uint8_t ___g_2_forAlignmentOnly;
};
#pragma pack(push, tp, 1)
struct
{
char ___b_3_OffsetPadding[2];
// System.Byte UnityEngine.Color32::b
uint8_t ___b_3;
};
#pragma pack(pop, tp)
struct
{
char ___b_3_OffsetPadding_forAlignmentOnly[2];
uint8_t ___b_3_forAlignmentOnly;
};
#pragma pack(push, tp, 1)
struct
{
char ___a_4_OffsetPadding[3];
// System.Byte UnityEngine.Color32::a
uint8_t ___a_4;
};
#pragma pack(pop, tp)
struct
{
char ___a_4_OffsetPadding_forAlignmentOnly[3];
uint8_t ___a_4_forAlignmentOnly;
};
};
public:
inline static int32_t get_offset_of_rgba_0() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___rgba_0)); }
inline int32_t get_rgba_0() const { return ___rgba_0; }
inline int32_t* get_address_of_rgba_0() { return &___rgba_0; }
inline void set_rgba_0(int32_t value)
{
___rgba_0 = value;
}
inline static int32_t get_offset_of_r_1() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___r_1)); }
inline uint8_t get_r_1() const { return ___r_1; }
inline uint8_t* get_address_of_r_1() { return &___r_1; }
inline void set_r_1(uint8_t value)
{
___r_1 = value;
}
inline static int32_t get_offset_of_g_2() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___g_2)); }
inline uint8_t get_g_2() const { return ___g_2; }
inline uint8_t* get_address_of_g_2() { return &___g_2; }
inline void set_g_2(uint8_t value)
{
___g_2 = value;
}
inline static int32_t get_offset_of_b_3() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___b_3)); }
inline uint8_t get_b_3() const { return ___b_3; }
inline uint8_t* get_address_of_b_3() { return &___b_3; }
inline void set_b_3(uint8_t value)
{
___b_3 = value;
}
inline static int32_t get_offset_of_a_4() { return static_cast<int32_t>(offsetof(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23, ___a_4)); }
inline uint8_t get_a_4() const { return ___a_4; }
inline uint8_t* get_address_of_a_4() { return &___a_4; }
inline void set_a_4(uint8_t value)
{
___a_4 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COLOR32_T23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23_H
#ifndef RECT_T35B976DE901B5423C11705E156938EA27AB402CE_H
#define RECT_T35B976DE901B5423C11705E156938EA27AB402CE_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Rect
struct Rect_t35B976DE901B5423C11705E156938EA27AB402CE
{
public:
// System.Single UnityEngine.Rect::m_XMin
float ___m_XMin_0;
// System.Single UnityEngine.Rect::m_YMin
float ___m_YMin_1;
// System.Single UnityEngine.Rect::m_Width
float ___m_Width_2;
// System.Single UnityEngine.Rect::m_Height
float ___m_Height_3;
public:
inline static int32_t get_offset_of_m_XMin_0() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_XMin_0)); }
inline float get_m_XMin_0() const { return ___m_XMin_0; }
inline float* get_address_of_m_XMin_0() { return &___m_XMin_0; }
inline void set_m_XMin_0(float value)
{
___m_XMin_0 = value;
}
inline static int32_t get_offset_of_m_YMin_1() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_YMin_1)); }
inline float get_m_YMin_1() const { return ___m_YMin_1; }
inline float* get_address_of_m_YMin_1() { return &___m_YMin_1; }
inline void set_m_YMin_1(float value)
{
___m_YMin_1 = value;
}
inline static int32_t get_offset_of_m_Width_2() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_Width_2)); }
inline float get_m_Width_2() const { return ___m_Width_2; }
inline float* get_address_of_m_Width_2() { return &___m_Width_2; }
inline void set_m_Width_2(float value)
{
___m_Width_2 = value;
}
inline static int32_t get_offset_of_m_Height_3() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_Height_3)); }
inline float get_m_Height_3() const { return ___m_Height_3; }
inline float* get_address_of_m_Height_3() { return &___m_Height_3; }
inline void set_m_Height_3(float value)
{
___m_Height_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // RECT_T35B976DE901B5423C11705E156938EA27AB402CE_H
#ifndef UILINEINFO_T0AF27251CA07CEE2BC0C1FEF752245596B8033E6_H
#define UILINEINFO_T0AF27251CA07CEE2BC0C1FEF752245596B8033E6_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.UILineInfo
struct UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6
{
public:
// System.Int32 UnityEngine.UILineInfo::startCharIdx
int32_t ___startCharIdx_0;
// System.Int32 UnityEngine.UILineInfo::height
int32_t ___height_1;
// System.Single UnityEngine.UILineInfo::topY
float ___topY_2;
// System.Single UnityEngine.UILineInfo::leading
float ___leading_3;
public:
inline static int32_t get_offset_of_startCharIdx_0() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___startCharIdx_0)); }
inline int32_t get_startCharIdx_0() const { return ___startCharIdx_0; }
inline int32_t* get_address_of_startCharIdx_0() { return &___startCharIdx_0; }
inline void set_startCharIdx_0(int32_t value)
{
___startCharIdx_0 = value;
}
inline static int32_t get_offset_of_height_1() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___height_1)); }
inline int32_t get_height_1() const { return ___height_1; }
inline int32_t* get_address_of_height_1() { return &___height_1; }
inline void set_height_1(int32_t value)
{
___height_1 = value;
}
inline static int32_t get_offset_of_topY_2() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___topY_2)); }
inline float get_topY_2() const { return ___topY_2; }
inline float* get_address_of_topY_2() { return &___topY_2; }
inline void set_topY_2(float value)
{
___topY_2 = value;
}
inline static int32_t get_offset_of_leading_3() { return static_cast<int32_t>(offsetof(UILineInfo_t0AF27251CA07CEE2BC0C1FEF752245596B8033E6, ___leading_3)); }
inline float get_leading_3() const { return ___leading_3; }
inline float* get_address_of_leading_3() { return &___leading_3; }
inline void set_leading_3(float value)
{
___leading_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UILINEINFO_T0AF27251CA07CEE2BC0C1FEF752245596B8033E6_H
#ifndef VECTOR2_TA85D2DD88578276CA8A8796756458277E72D073D_H
#define VECTOR2_TA85D2DD88578276CA8A8796756458277E72D073D_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Vector2
struct Vector2_tA85D2DD88578276CA8A8796756458277E72D073D
{
public:
// System.Single UnityEngine.Vector2::x
float ___x_0;
// System.Single UnityEngine.Vector2::y
float ___y_1;
public:
inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D, ___x_0)); }
inline float get_x_0() const { return ___x_0; }
inline float* get_address_of_x_0() { return &___x_0; }
inline void set_x_0(float value)
{
___x_0 = value;
}
inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D, ___y_1)); }
inline float get_y_1() const { return ___y_1; }
inline float* get_address_of_y_1() { return &___y_1; }
inline void set_y_1(float value)
{
___y_1 = value;
}
};
struct Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields
{
public:
// UnityEngine.Vector2 UnityEngine.Vector2::zeroVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___zeroVector_2;
// UnityEngine.Vector2 UnityEngine.Vector2::oneVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___oneVector_3;
// UnityEngine.Vector2 UnityEngine.Vector2::upVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___upVector_4;
// UnityEngine.Vector2 UnityEngine.Vector2::downVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___downVector_5;
// UnityEngine.Vector2 UnityEngine.Vector2::leftVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___leftVector_6;
// UnityEngine.Vector2 UnityEngine.Vector2::rightVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___rightVector_7;
// UnityEngine.Vector2 UnityEngine.Vector2::positiveInfinityVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___positiveInfinityVector_8;
// UnityEngine.Vector2 UnityEngine.Vector2::negativeInfinityVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___negativeInfinityVector_9;
public:
inline static int32_t get_offset_of_zeroVector_2() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___zeroVector_2)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_zeroVector_2() const { return ___zeroVector_2; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_zeroVector_2() { return &___zeroVector_2; }
inline void set_zeroVector_2(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___zeroVector_2 = value;
}
inline static int32_t get_offset_of_oneVector_3() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___oneVector_3)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_oneVector_3() const { return ___oneVector_3; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_oneVector_3() { return &___oneVector_3; }
inline void set_oneVector_3(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___oneVector_3 = value;
}
inline static int32_t get_offset_of_upVector_4() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___upVector_4)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_upVector_4() const { return ___upVector_4; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_upVector_4() { return &___upVector_4; }
inline void set_upVector_4(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___upVector_4 = value;
}
inline static int32_t get_offset_of_downVector_5() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___downVector_5)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_downVector_5() const { return ___downVector_5; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_downVector_5() { return &___downVector_5; }
inline void set_downVector_5(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___downVector_5 = value;
}
inline static int32_t get_offset_of_leftVector_6() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___leftVector_6)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_leftVector_6() const { return ___leftVector_6; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_leftVector_6() { return &___leftVector_6; }
inline void set_leftVector_6(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___leftVector_6 = value;
}
inline static int32_t get_offset_of_rightVector_7() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___rightVector_7)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_rightVector_7() const { return ___rightVector_7; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_rightVector_7() { return &___rightVector_7; }
inline void set_rightVector_7(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___rightVector_7 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_8() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___positiveInfinityVector_8)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_positiveInfinityVector_8() const { return ___positiveInfinityVector_8; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_positiveInfinityVector_8() { return &___positiveInfinityVector_8; }
inline void set_positiveInfinityVector_8(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___positiveInfinityVector_8 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_9() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___negativeInfinityVector_9)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_negativeInfinityVector_9() const { return ___negativeInfinityVector_9; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_negativeInfinityVector_9() { return &___negativeInfinityVector_9; }
inline void set_negativeInfinityVector_9(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___negativeInfinityVector_9 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTOR2_TA85D2DD88578276CA8A8796756458277E72D073D_H
#ifndef VECTOR3_TDCF05E21F632FE2BA260C06E0D10CA81513E6720_H
#define VECTOR3_TDCF05E21F632FE2BA260C06E0D10CA81513E6720_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Vector3
struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720
{
public:
// System.Single UnityEngine.Vector3::x
float ___x_2;
// System.Single UnityEngine.Vector3::y
float ___y_3;
// System.Single UnityEngine.Vector3::z
float ___z_4;
public:
inline static int32_t get_offset_of_x_2() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___x_2)); }
inline float get_x_2() const { return ___x_2; }
inline float* get_address_of_x_2() { return &___x_2; }
inline void set_x_2(float value)
{
___x_2 = value;
}
inline static int32_t get_offset_of_y_3() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___y_3)); }
inline float get_y_3() const { return ___y_3; }
inline float* get_address_of_y_3() { return &___y_3; }
inline void set_y_3(float value)
{
___y_3 = value;
}
inline static int32_t get_offset_of_z_4() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___z_4)); }
inline float get_z_4() const { return ___z_4; }
inline float* get_address_of_z_4() { return &___z_4; }
inline void set_z_4(float value)
{
___z_4 = value;
}
};
struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields
{
public:
// UnityEngine.Vector3 UnityEngine.Vector3::zeroVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___zeroVector_5;
// UnityEngine.Vector3 UnityEngine.Vector3::oneVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___oneVector_6;
// UnityEngine.Vector3 UnityEngine.Vector3::upVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___upVector_7;
// UnityEngine.Vector3 UnityEngine.Vector3::downVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___downVector_8;
// UnityEngine.Vector3 UnityEngine.Vector3::leftVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___leftVector_9;
// UnityEngine.Vector3 UnityEngine.Vector3::rightVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___rightVector_10;
// UnityEngine.Vector3 UnityEngine.Vector3::forwardVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___forwardVector_11;
// UnityEngine.Vector3 UnityEngine.Vector3::backVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___backVector_12;
// UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___positiveInfinityVector_13;
// UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___negativeInfinityVector_14;
public:
inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___zeroVector_5)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_zeroVector_5() const { return ___zeroVector_5; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_zeroVector_5() { return &___zeroVector_5; }
inline void set_zeroVector_5(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___zeroVector_5 = value;
}
inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___oneVector_6)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_oneVector_6() const { return ___oneVector_6; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_oneVector_6() { return &___oneVector_6; }
inline void set_oneVector_6(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___oneVector_6 = value;
}
inline static int32_t get_offset_of_upVector_7() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___upVector_7)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_upVector_7() const { return ___upVector_7; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_upVector_7() { return &___upVector_7; }
inline void set_upVector_7(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___upVector_7 = value;
}
inline static int32_t get_offset_of_downVector_8() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___downVector_8)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_downVector_8() const { return ___downVector_8; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_downVector_8() { return &___downVector_8; }
inline void set_downVector_8(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___downVector_8 = value;
}
inline static int32_t get_offset_of_leftVector_9() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___leftVector_9)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_leftVector_9() const { return ___leftVector_9; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_leftVector_9() { return &___leftVector_9; }
inline void set_leftVector_9(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___leftVector_9 = value;
}
inline static int32_t get_offset_of_rightVector_10() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___rightVector_10)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_rightVector_10() const { return ___rightVector_10; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_rightVector_10() { return &___rightVector_10; }
inline void set_rightVector_10(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___rightVector_10 = value;
}
inline static int32_t get_offset_of_forwardVector_11() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___forwardVector_11)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_forwardVector_11() const { return ___forwardVector_11; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_forwardVector_11() { return &___forwardVector_11; }
inline void set_forwardVector_11(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___forwardVector_11 = value;
}
inline static int32_t get_offset_of_backVector_12() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___backVector_12)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_backVector_12() const { return ___backVector_12; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_backVector_12() { return &___backVector_12; }
inline void set_backVector_12(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___backVector_12 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___positiveInfinityVector_13)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_positiveInfinityVector_13() const { return ___positiveInfinityVector_13; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_positiveInfinityVector_13() { return &___positiveInfinityVector_13; }
inline void set_positiveInfinityVector_13(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___positiveInfinityVector_13 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_14() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___negativeInfinityVector_14)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_negativeInfinityVector_14() const { return ___negativeInfinityVector_14; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_negativeInfinityVector_14() { return &___negativeInfinityVector_14; }
inline void set_negativeInfinityVector_14(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___negativeInfinityVector_14 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTOR3_TDCF05E21F632FE2BA260C06E0D10CA81513E6720_H
#ifndef VECTOR4_TD148D6428C3F8FF6CD998F82090113C2B490B76E_H
#define VECTOR4_TD148D6428C3F8FF6CD998F82090113C2B490B76E_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Vector4
struct Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E
{
public:
// System.Single UnityEngine.Vector4::x
float ___x_1;
// System.Single UnityEngine.Vector4::y
float ___y_2;
// System.Single UnityEngine.Vector4::z
float ___z_3;
// System.Single UnityEngine.Vector4::w
float ___w_4;
public:
inline static int32_t get_offset_of_x_1() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___x_1)); }
inline float get_x_1() const { return ___x_1; }
inline float* get_address_of_x_1() { return &___x_1; }
inline void set_x_1(float value)
{
___x_1 = value;
}
inline static int32_t get_offset_of_y_2() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___y_2)); }
inline float get_y_2() const { return ___y_2; }
inline float* get_address_of_y_2() { return &___y_2; }
inline void set_y_2(float value)
{
___y_2 = value;
}
inline static int32_t get_offset_of_z_3() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___z_3)); }
inline float get_z_3() const { return ___z_3; }
inline float* get_address_of_z_3() { return &___z_3; }
inline void set_z_3(float value)
{
___z_3 = value;
}
inline static int32_t get_offset_of_w_4() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E, ___w_4)); }
inline float get_w_4() const { return ___w_4; }
inline float* get_address_of_w_4() { return &___w_4; }
inline void set_w_4(float value)
{
___w_4 = value;
}
};
struct Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields
{
public:
// UnityEngine.Vector4 UnityEngine.Vector4::zeroVector
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___zeroVector_5;
// UnityEngine.Vector4 UnityEngine.Vector4::oneVector
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___oneVector_6;
// UnityEngine.Vector4 UnityEngine.Vector4::positiveInfinityVector
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___positiveInfinityVector_7;
// UnityEngine.Vector4 UnityEngine.Vector4::negativeInfinityVector
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___negativeInfinityVector_8;
public:
inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___zeroVector_5)); }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_zeroVector_5() const { return ___zeroVector_5; }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_zeroVector_5() { return &___zeroVector_5; }
inline void set_zeroVector_5(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value)
{
___zeroVector_5 = value;
}
inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___oneVector_6)); }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_oneVector_6() const { return ___oneVector_6; }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_oneVector_6() { return &___oneVector_6; }
inline void set_oneVector_6(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value)
{
___oneVector_6 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_7() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___positiveInfinityVector_7)); }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_positiveInfinityVector_7() const { return ___positiveInfinityVector_7; }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_positiveInfinityVector_7() { return &___positiveInfinityVector_7; }
inline void set_positiveInfinityVector_7(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value)
{
___positiveInfinityVector_7 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_8() { return static_cast<int32_t>(offsetof(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E_StaticFields, ___negativeInfinityVector_8)); }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_negativeInfinityVector_8() const { return ___negativeInfinityVector_8; }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_negativeInfinityVector_8() { return &___negativeInfinityVector_8; }
inline void set_negativeInfinityVector_8(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value)
{
___negativeInfinityVector_8 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VECTOR4_TD148D6428C3F8FF6CD998F82090113C2B490B76E_H
#ifndef DELEGATE_T_H
#define DELEGATE_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Delegate
struct Delegate_t : public RuntimeObject
{
public:
// System.IntPtr System.Delegate::method_ptr
Il2CppMethodPointer ___method_ptr_0;
// System.IntPtr System.Delegate::invoke_impl
intptr_t ___invoke_impl_1;
// System.Object System.Delegate::m_target
RuntimeObject * ___m_target_2;
// System.IntPtr System.Delegate::method
intptr_t ___method_3;
// System.IntPtr System.Delegate::delegate_trampoline
intptr_t ___delegate_trampoline_4;
// System.IntPtr System.Delegate::extra_arg
intptr_t ___extra_arg_5;
// System.IntPtr System.Delegate::method_code
intptr_t ___method_code_6;
// System.Reflection.MethodInfo System.Delegate::method_info
MethodInfo_t * ___method_info_7;
// System.Reflection.MethodInfo System.Delegate::original_method_info
MethodInfo_t * ___original_method_info_8;
// System.DelegateData System.Delegate::data
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
// System.Boolean System.Delegate::method_is_virtual
bool ___method_is_virtual_10;
public:
inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_ptr_0)); }
inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; }
inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; }
inline void set_method_ptr_0(Il2CppMethodPointer value)
{
___method_ptr_0 = value;
}
inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t, ___invoke_impl_1)); }
inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; }
inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; }
inline void set_invoke_impl_1(intptr_t value)
{
___invoke_impl_1 = value;
}
inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t, ___m_target_2)); }
inline RuntimeObject * get_m_target_2() const { return ___m_target_2; }
inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; }
inline void set_m_target_2(RuntimeObject * value)
{
___m_target_2 = value;
Il2CppCodeGenWriteBarrier((&___m_target_2), value);
}
inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_3)); }
inline intptr_t get_method_3() const { return ___method_3; }
inline intptr_t* get_address_of_method_3() { return &___method_3; }
inline void set_method_3(intptr_t value)
{
___method_3 = value;
}
inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t, ___delegate_trampoline_4)); }
inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; }
inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; }
inline void set_delegate_trampoline_4(intptr_t value)
{
___delegate_trampoline_4 = value;
}
inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t, ___extra_arg_5)); }
inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; }
inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; }
inline void set_extra_arg_5(intptr_t value)
{
___extra_arg_5 = value;
}
inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_code_6)); }
inline intptr_t get_method_code_6() const { return ___method_code_6; }
inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; }
inline void set_method_code_6(intptr_t value)
{
___method_code_6 = value;
}
inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_info_7)); }
inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; }
inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; }
inline void set_method_info_7(MethodInfo_t * value)
{
___method_info_7 = value;
Il2CppCodeGenWriteBarrier((&___method_info_7), value);
}
inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t, ___original_method_info_8)); }
inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; }
inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; }
inline void set_original_method_info_8(MethodInfo_t * value)
{
___original_method_info_8 = value;
Il2CppCodeGenWriteBarrier((&___original_method_info_8), value);
}
inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t, ___data_9)); }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * get_data_9() const { return ___data_9; }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE ** get_address_of_data_9() { return &___data_9; }
inline void set_data_9(DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * value)
{
___data_9 = value;
Il2CppCodeGenWriteBarrier((&___data_9), value);
}
inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_is_virtual_10)); }
inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; }
inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; }
inline void set_method_is_virtual_10(bool value)
{
___method_is_virtual_10 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.Delegate
struct Delegate_t_marshaled_pinvoke
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// Native definition for COM marshalling of System.Delegate
struct Delegate_t_marshaled_com
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
#endif // DELEGATE_T_H
#ifndef FONTSTYLE_T273973EBB1F40C2381F6D60AB957149DE5720CF3_H
#define FONTSTYLE_T273973EBB1F40C2381F6D60AB957149DE5720CF3_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.FontStyle
struct FontStyle_t273973EBB1F40C2381F6D60AB957149DE5720CF3
{
public:
// System.Int32 UnityEngine.FontStyle::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(FontStyle_t273973EBB1F40C2381F6D60AB957149DE5720CF3, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FONTSTYLE_T273973EBB1F40C2381F6D60AB957149DE5720CF3_H
#ifndef HORIZONTALWRAPMODE_T56D876281F814EC1AF0C21A34E20BBF4BEEA302C_H
#define HORIZONTALWRAPMODE_T56D876281F814EC1AF0C21A34E20BBF4BEEA302C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.HorizontalWrapMode
struct HorizontalWrapMode_t56D876281F814EC1AF0C21A34E20BBF4BEEA302C
{
public:
// System.Int32 UnityEngine.HorizontalWrapMode::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(HorizontalWrapMode_t56D876281F814EC1AF0C21A34E20BBF4BEEA302C, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // HORIZONTALWRAPMODE_T56D876281F814EC1AF0C21A34E20BBF4BEEA302C_H
#ifndef OBJECT_TAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_H
#define OBJECT_TAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.Object::m_CachedPtr
intptr_t ___m_CachedPtr_0;
public:
inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0, ___m_CachedPtr_0)); }
inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; }
inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; }
inline void set_m_CachedPtr_0(intptr_t value)
{
___m_CachedPtr_0 = value;
}
};
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields
{
public:
// System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject
int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1;
public:
inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); }
inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value)
{
___OffsetOfInstanceIDInCPlusPlusObject_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke
{
intptr_t ___m_CachedPtr_0;
};
// Native definition for COM marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com
{
intptr_t ___m_CachedPtr_0;
};
#endif // OBJECT_TAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_H
#ifndef TEXTANCHOR_TEC19034D476659A5E05366C63564F34DD30E7C57_H
#define TEXTANCHOR_TEC19034D476659A5E05366C63564F34DD30E7C57_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.TextAnchor
struct TextAnchor_tEC19034D476659A5E05366C63564F34DD30E7C57
{
public:
// System.Int32 UnityEngine.TextAnchor::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TextAnchor_tEC19034D476659A5E05366C63564F34DD30E7C57, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TEXTANCHOR_TEC19034D476659A5E05366C63564F34DD30E7C57_H
#ifndef TEXTGENERATIONERROR_T7D5BA12E3120623131293E20A1120847377A2524_H
#define TEXTGENERATIONERROR_T7D5BA12E3120623131293E20A1120847377A2524_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.TextGenerationError
struct TextGenerationError_t7D5BA12E3120623131293E20A1120847377A2524
{
public:
// System.Int32 UnityEngine.TextGenerationError::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TextGenerationError_t7D5BA12E3120623131293E20A1120847377A2524, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TEXTGENERATIONERROR_T7D5BA12E3120623131293E20A1120847377A2524_H
#ifndef UICHARINFO_TB4C92043A686A600D36A92E3108F173C499E318A_H
#define UICHARINFO_TB4C92043A686A600D36A92E3108F173C499E318A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.UICharInfo
struct UICharInfo_tB4C92043A686A600D36A92E3108F173C499E318A
{
public:
// UnityEngine.Vector2 UnityEngine.UICharInfo::cursorPos
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___cursorPos_0;
// System.Single UnityEngine.UICharInfo::charWidth
float ___charWidth_1;
public:
inline static int32_t get_offset_of_cursorPos_0() { return static_cast<int32_t>(offsetof(UICharInfo_tB4C92043A686A600D36A92E3108F173C499E318A, ___cursorPos_0)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_cursorPos_0() const { return ___cursorPos_0; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_cursorPos_0() { return &___cursorPos_0; }
inline void set_cursorPos_0(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___cursorPos_0 = value;
}
inline static int32_t get_offset_of_charWidth_1() { return static_cast<int32_t>(offsetof(UICharInfo_tB4C92043A686A600D36A92E3108F173C499E318A, ___charWidth_1)); }
inline float get_charWidth_1() const { return ___charWidth_1; }
inline float* get_address_of_charWidth_1() { return &___charWidth_1; }
inline void set_charWidth_1(float value)
{
___charWidth_1 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UICHARINFO_TB4C92043A686A600D36A92E3108F173C499E318A_H
#ifndef UIVERTEX_T0583C35B730B218B542E80203F5F4BC6F1E9E577_H
#define UIVERTEX_T0583C35B730B218B542E80203F5F4BC6F1E9E577_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.UIVertex
struct UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577
{
public:
// UnityEngine.Vector3 UnityEngine.UIVertex::position
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___position_0;
// UnityEngine.Vector3 UnityEngine.UIVertex::normal
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___normal_1;
// UnityEngine.Vector4 UnityEngine.UIVertex::tangent
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___tangent_2;
// UnityEngine.Color32 UnityEngine.UIVertex::color
Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 ___color_3;
// UnityEngine.Vector2 UnityEngine.UIVertex::uv0
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv0_4;
// UnityEngine.Vector2 UnityEngine.UIVertex::uv1
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv1_5;
// UnityEngine.Vector2 UnityEngine.UIVertex::uv2
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv2_6;
// UnityEngine.Vector2 UnityEngine.UIVertex::uv3
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___uv3_7;
public:
inline static int32_t get_offset_of_position_0() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___position_0)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_position_0() const { return ___position_0; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_position_0() { return &___position_0; }
inline void set_position_0(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___position_0 = value;
}
inline static int32_t get_offset_of_normal_1() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___normal_1)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_normal_1() const { return ___normal_1; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_normal_1() { return &___normal_1; }
inline void set_normal_1(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___normal_1 = value;
}
inline static int32_t get_offset_of_tangent_2() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___tangent_2)); }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_tangent_2() const { return ___tangent_2; }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_tangent_2() { return &___tangent_2; }
inline void set_tangent_2(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value)
{
___tangent_2 = value;
}
inline static int32_t get_offset_of_color_3() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___color_3)); }
inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 get_color_3() const { return ___color_3; }
inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 * get_address_of_color_3() { return &___color_3; }
inline void set_color_3(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 value)
{
___color_3 = value;
}
inline static int32_t get_offset_of_uv0_4() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv0_4)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv0_4() const { return ___uv0_4; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv0_4() { return &___uv0_4; }
inline void set_uv0_4(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___uv0_4 = value;
}
inline static int32_t get_offset_of_uv1_5() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv1_5)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv1_5() const { return ___uv1_5; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv1_5() { return &___uv1_5; }
inline void set_uv1_5(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___uv1_5 = value;
}
inline static int32_t get_offset_of_uv2_6() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv2_6)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv2_6() const { return ___uv2_6; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv2_6() { return &___uv2_6; }
inline void set_uv2_6(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___uv2_6 = value;
}
inline static int32_t get_offset_of_uv3_7() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577, ___uv3_7)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_uv3_7() const { return ___uv3_7; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_uv3_7() { return &___uv3_7; }
inline void set_uv3_7(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___uv3_7 = value;
}
};
struct UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields
{
public:
// UnityEngine.Color32 UnityEngine.UIVertex::s_DefaultColor
Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 ___s_DefaultColor_8;
// UnityEngine.Vector4 UnityEngine.UIVertex::s_DefaultTangent
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E ___s_DefaultTangent_9;
// UnityEngine.UIVertex UnityEngine.UIVertex::simpleVert
UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 ___simpleVert_10;
public:
inline static int32_t get_offset_of_s_DefaultColor_8() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields, ___s_DefaultColor_8)); }
inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 get_s_DefaultColor_8() const { return ___s_DefaultColor_8; }
inline Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 * get_address_of_s_DefaultColor_8() { return &___s_DefaultColor_8; }
inline void set_s_DefaultColor_8(Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 value)
{
___s_DefaultColor_8 = value;
}
inline static int32_t get_offset_of_s_DefaultTangent_9() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields, ___s_DefaultTangent_9)); }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E get_s_DefaultTangent_9() const { return ___s_DefaultTangent_9; }
inline Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * get_address_of_s_DefaultTangent_9() { return &___s_DefaultTangent_9; }
inline void set_s_DefaultTangent_9(Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E value)
{
___s_DefaultTangent_9 = value;
}
inline static int32_t get_offset_of_simpleVert_10() { return static_cast<int32_t>(offsetof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields, ___simpleVert_10)); }
inline UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 get_simpleVert_10() const { return ___simpleVert_10; }
inline UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 * get_address_of_simpleVert_10() { return &___simpleVert_10; }
inline void set_simpleVert_10(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 value)
{
___simpleVert_10 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // UIVERTEX_T0583C35B730B218B542E80203F5F4BC6F1E9E577_H
#ifndef VERTICALWRAPMODE_TD909C5B2F6A25AE3797BC71373196D850FC845E9_H
#define VERTICALWRAPMODE_TD909C5B2F6A25AE3797BC71373196D850FC845E9_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.VerticalWrapMode
struct VerticalWrapMode_tD909C5B2F6A25AE3797BC71373196D850FC845E9
{
public:
// System.Int32 UnityEngine.VerticalWrapMode::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(VerticalWrapMode_tD909C5B2F6A25AE3797BC71373196D850FC845E9, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // VERTICALWRAPMODE_TD909C5B2F6A25AE3797BC71373196D850FC845E9_H
#ifndef MULTICASTDELEGATE_T_H
#define MULTICASTDELEGATE_T_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.MulticastDelegate
struct MulticastDelegate_t : public Delegate_t
{
public:
// System.Delegate[] System.MulticastDelegate::delegates
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11;
public:
inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* get_delegates_11() const { return ___delegates_11; }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86** get_address_of_delegates_11() { return &___delegates_11; }
inline void set_delegates_11(DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* value)
{
___delegates_11 = value;
Il2CppCodeGenWriteBarrier((&___delegates_11), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t_marshaled_pinvoke
{
Delegate_t_marshaled_pinvoke** ___delegates_11;
};
// Native definition for COM marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_com : public Delegate_t_marshaled_com
{
Delegate_t_marshaled_com** ___delegates_11;
};
#endif // MULTICASTDELEGATE_T_H
#ifndef COMPONENT_T05064EF382ABCAF4B8C94F8A350EA85184C26621_H
#define COMPONENT_T05064EF382ABCAF4B8C94F8A350EA85184C26621_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Component
struct Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // COMPONENT_T05064EF382ABCAF4B8C94F8A350EA85184C26621_H
#ifndef FONT_T1EDE54AF557272BE314EB4B40EFA50CEB353CA26_H
#define FONT_T1EDE54AF557272BE314EB4B40EFA50CEB353CA26_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Font
struct Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
// UnityEngine.Font_FontTextureRebuildCallback UnityEngine.Font::m_FontTextureRebuildCallback
FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * ___m_FontTextureRebuildCallback_5;
public:
inline static int32_t get_offset_of_m_FontTextureRebuildCallback_5() { return static_cast<int32_t>(offsetof(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26, ___m_FontTextureRebuildCallback_5)); }
inline FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * get_m_FontTextureRebuildCallback_5() const { return ___m_FontTextureRebuildCallback_5; }
inline FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C ** get_address_of_m_FontTextureRebuildCallback_5() { return &___m_FontTextureRebuildCallback_5; }
inline void set_m_FontTextureRebuildCallback_5(FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * value)
{
___m_FontTextureRebuildCallback_5 = value;
Il2CppCodeGenWriteBarrier((&___m_FontTextureRebuildCallback_5), value);
}
};
struct Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields
{
public:
// System.Action`1<UnityEngine.Font> UnityEngine.Font::textureRebuilt
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * ___textureRebuilt_4;
public:
inline static int32_t get_offset_of_textureRebuilt_4() { return static_cast<int32_t>(offsetof(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields, ___textureRebuilt_4)); }
inline Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * get_textureRebuilt_4() const { return ___textureRebuilt_4; }
inline Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C ** get_address_of_textureRebuilt_4() { return &___textureRebuilt_4; }
inline void set_textureRebuilt_4(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * value)
{
___textureRebuilt_4 = value;
Il2CppCodeGenWriteBarrier((&___textureRebuilt_4), value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FONT_T1EDE54AF557272BE314EB4B40EFA50CEB353CA26_H
#ifndef GAMEOBJECT_TBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F_H
#define GAMEOBJECT_TBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.GameObject
struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // GAMEOBJECT_TBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F_H
#ifndef MATERIAL_TF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598_H
#define MATERIAL_TF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Material
struct Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // MATERIAL_TF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598_H
#ifndef TEXTGENERATIONSETTINGS_T37703542535A1638D2A08F41DB629A483616AF68_H
#define TEXTGENERATIONSETTINGS_T37703542535A1638D2A08F41DB629A483616AF68_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.TextGenerationSettings
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68
{
public:
// UnityEngine.Font UnityEngine.TextGenerationSettings::font
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font_0;
// UnityEngine.Color UnityEngine.TextGenerationSettings::color
Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color_1;
// System.Int32 UnityEngine.TextGenerationSettings::fontSize
int32_t ___fontSize_2;
// System.Single UnityEngine.TextGenerationSettings::lineSpacing
float ___lineSpacing_3;
// System.Boolean UnityEngine.TextGenerationSettings::richText
bool ___richText_4;
// System.Single UnityEngine.TextGenerationSettings::scaleFactor
float ___scaleFactor_5;
// UnityEngine.FontStyle UnityEngine.TextGenerationSettings::fontStyle
int32_t ___fontStyle_6;
// UnityEngine.TextAnchor UnityEngine.TextGenerationSettings::textAnchor
int32_t ___textAnchor_7;
// System.Boolean UnityEngine.TextGenerationSettings::alignByGeometry
bool ___alignByGeometry_8;
// System.Boolean UnityEngine.TextGenerationSettings::resizeTextForBestFit
bool ___resizeTextForBestFit_9;
// System.Int32 UnityEngine.TextGenerationSettings::resizeTextMinSize
int32_t ___resizeTextMinSize_10;
// System.Int32 UnityEngine.TextGenerationSettings::resizeTextMaxSize
int32_t ___resizeTextMaxSize_11;
// System.Boolean UnityEngine.TextGenerationSettings::updateBounds
bool ___updateBounds_12;
// UnityEngine.VerticalWrapMode UnityEngine.TextGenerationSettings::verticalOverflow
int32_t ___verticalOverflow_13;
// UnityEngine.HorizontalWrapMode UnityEngine.TextGenerationSettings::horizontalOverflow
int32_t ___horizontalOverflow_14;
// UnityEngine.Vector2 UnityEngine.TextGenerationSettings::generationExtents
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___generationExtents_15;
// UnityEngine.Vector2 UnityEngine.TextGenerationSettings::pivot
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot_16;
// System.Boolean UnityEngine.TextGenerationSettings::generateOutOfBounds
bool ___generateOutOfBounds_17;
public:
inline static int32_t get_offset_of_font_0() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___font_0)); }
inline Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * get_font_0() const { return ___font_0; }
inline Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 ** get_address_of_font_0() { return &___font_0; }
inline void set_font_0(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * value)
{
___font_0 = value;
Il2CppCodeGenWriteBarrier((&___font_0), value);
}
inline static int32_t get_offset_of_color_1() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___color_1)); }
inline Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 get_color_1() const { return ___color_1; }
inline Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * get_address_of_color_1() { return &___color_1; }
inline void set_color_1(Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 value)
{
___color_1 = value;
}
inline static int32_t get_offset_of_fontSize_2() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___fontSize_2)); }
inline int32_t get_fontSize_2() const { return ___fontSize_2; }
inline int32_t* get_address_of_fontSize_2() { return &___fontSize_2; }
inline void set_fontSize_2(int32_t value)
{
___fontSize_2 = value;
}
inline static int32_t get_offset_of_lineSpacing_3() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___lineSpacing_3)); }
inline float get_lineSpacing_3() const { return ___lineSpacing_3; }
inline float* get_address_of_lineSpacing_3() { return &___lineSpacing_3; }
inline void set_lineSpacing_3(float value)
{
___lineSpacing_3 = value;
}
inline static int32_t get_offset_of_richText_4() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___richText_4)); }
inline bool get_richText_4() const { return ___richText_4; }
inline bool* get_address_of_richText_4() { return &___richText_4; }
inline void set_richText_4(bool value)
{
___richText_4 = value;
}
inline static int32_t get_offset_of_scaleFactor_5() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___scaleFactor_5)); }
inline float get_scaleFactor_5() const { return ___scaleFactor_5; }
inline float* get_address_of_scaleFactor_5() { return &___scaleFactor_5; }
inline void set_scaleFactor_5(float value)
{
___scaleFactor_5 = value;
}
inline static int32_t get_offset_of_fontStyle_6() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___fontStyle_6)); }
inline int32_t get_fontStyle_6() const { return ___fontStyle_6; }
inline int32_t* get_address_of_fontStyle_6() { return &___fontStyle_6; }
inline void set_fontStyle_6(int32_t value)
{
___fontStyle_6 = value;
}
inline static int32_t get_offset_of_textAnchor_7() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___textAnchor_7)); }
inline int32_t get_textAnchor_7() const { return ___textAnchor_7; }
inline int32_t* get_address_of_textAnchor_7() { return &___textAnchor_7; }
inline void set_textAnchor_7(int32_t value)
{
___textAnchor_7 = value;
}
inline static int32_t get_offset_of_alignByGeometry_8() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___alignByGeometry_8)); }
inline bool get_alignByGeometry_8() const { return ___alignByGeometry_8; }
inline bool* get_address_of_alignByGeometry_8() { return &___alignByGeometry_8; }
inline void set_alignByGeometry_8(bool value)
{
___alignByGeometry_8 = value;
}
inline static int32_t get_offset_of_resizeTextForBestFit_9() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___resizeTextForBestFit_9)); }
inline bool get_resizeTextForBestFit_9() const { return ___resizeTextForBestFit_9; }
inline bool* get_address_of_resizeTextForBestFit_9() { return &___resizeTextForBestFit_9; }
inline void set_resizeTextForBestFit_9(bool value)
{
___resizeTextForBestFit_9 = value;
}
inline static int32_t get_offset_of_resizeTextMinSize_10() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___resizeTextMinSize_10)); }
inline int32_t get_resizeTextMinSize_10() const { return ___resizeTextMinSize_10; }
inline int32_t* get_address_of_resizeTextMinSize_10() { return &___resizeTextMinSize_10; }
inline void set_resizeTextMinSize_10(int32_t value)
{
___resizeTextMinSize_10 = value;
}
inline static int32_t get_offset_of_resizeTextMaxSize_11() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___resizeTextMaxSize_11)); }
inline int32_t get_resizeTextMaxSize_11() const { return ___resizeTextMaxSize_11; }
inline int32_t* get_address_of_resizeTextMaxSize_11() { return &___resizeTextMaxSize_11; }
inline void set_resizeTextMaxSize_11(int32_t value)
{
___resizeTextMaxSize_11 = value;
}
inline static int32_t get_offset_of_updateBounds_12() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___updateBounds_12)); }
inline bool get_updateBounds_12() const { return ___updateBounds_12; }
inline bool* get_address_of_updateBounds_12() { return &___updateBounds_12; }
inline void set_updateBounds_12(bool value)
{
___updateBounds_12 = value;
}
inline static int32_t get_offset_of_verticalOverflow_13() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___verticalOverflow_13)); }
inline int32_t get_verticalOverflow_13() const { return ___verticalOverflow_13; }
inline int32_t* get_address_of_verticalOverflow_13() { return &___verticalOverflow_13; }
inline void set_verticalOverflow_13(int32_t value)
{
___verticalOverflow_13 = value;
}
inline static int32_t get_offset_of_horizontalOverflow_14() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___horizontalOverflow_14)); }
inline int32_t get_horizontalOverflow_14() const { return ___horizontalOverflow_14; }
inline int32_t* get_address_of_horizontalOverflow_14() { return &___horizontalOverflow_14; }
inline void set_horizontalOverflow_14(int32_t value)
{
___horizontalOverflow_14 = value;
}
inline static int32_t get_offset_of_generationExtents_15() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___generationExtents_15)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_generationExtents_15() const { return ___generationExtents_15; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_generationExtents_15() { return &___generationExtents_15; }
inline void set_generationExtents_15(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___generationExtents_15 = value;
}
inline static int32_t get_offset_of_pivot_16() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___pivot_16)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_pivot_16() const { return ___pivot_16; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_pivot_16() { return &___pivot_16; }
inline void set_pivot_16(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___pivot_16 = value;
}
inline static int32_t get_offset_of_generateOutOfBounds_17() { return static_cast<int32_t>(offsetof(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68, ___generateOutOfBounds_17)); }
inline bool get_generateOutOfBounds_17() const { return ___generateOutOfBounds_17; }
inline bool* get_address_of_generateOutOfBounds_17() { return &___generateOutOfBounds_17; }
inline void set_generateOutOfBounds_17(bool value)
{
___generateOutOfBounds_17 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of UnityEngine.TextGenerationSettings
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font_0;
Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color_1;
int32_t ___fontSize_2;
float ___lineSpacing_3;
int32_t ___richText_4;
float ___scaleFactor_5;
int32_t ___fontStyle_6;
int32_t ___textAnchor_7;
int32_t ___alignByGeometry_8;
int32_t ___resizeTextForBestFit_9;
int32_t ___resizeTextMinSize_10;
int32_t ___resizeTextMaxSize_11;
int32_t ___updateBounds_12;
int32_t ___verticalOverflow_13;
int32_t ___horizontalOverflow_14;
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___generationExtents_15;
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot_16;
int32_t ___generateOutOfBounds_17;
};
// Native definition for COM marshalling of UnityEngine.TextGenerationSettings
struct TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font_0;
Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color_1;
int32_t ___fontSize_2;
float ___lineSpacing_3;
int32_t ___richText_4;
float ___scaleFactor_5;
int32_t ___fontStyle_6;
int32_t ___textAnchor_7;
int32_t ___alignByGeometry_8;
int32_t ___resizeTextForBestFit_9;
int32_t ___resizeTextMinSize_10;
int32_t ___resizeTextMaxSize_11;
int32_t ___updateBounds_12;
int32_t ___verticalOverflow_13;
int32_t ___horizontalOverflow_14;
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___generationExtents_15;
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot_16;
int32_t ___generateOutOfBounds_17;
};
#endif // TEXTGENERATIONSETTINGS_T37703542535A1638D2A08F41DB629A483616AF68_H
#ifndef ACTION_1_T795662E553415ECF2DD0F8EEB9BA170C3670F37C_H
#define ACTION_1_T795662E553415ECF2DD0F8EEB9BA170C3670F37C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Action`1<UnityEngine.Font>
struct Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C : public MulticastDelegate_t
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ACTION_1_T795662E553415ECF2DD0F8EEB9BA170C3670F37C_H
#ifndef ASYNCCALLBACK_T3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4_H
#define ASYNCCALLBACK_T3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 : public MulticastDelegate_t
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // ASYNCCALLBACK_T3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4_H
#ifndef FONTTEXTUREREBUILDCALLBACK_TD700C63BB1A449E3A0464C81701E981677D3021C_H
#define FONTTEXTUREREBUILDCALLBACK_TD700C63BB1A449E3A0464C81701E981677D3021C_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Font_FontTextureRebuildCallback
struct FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C : public MulticastDelegate_t
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // FONTTEXTUREREBUILDCALLBACK_TD700C63BB1A449E3A0464C81701E981677D3021C_H
#ifndef TEXTGENERATOR_TD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_H
#define TEXTGENERATOR_TD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.TextGenerator
struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.TextGenerator::m_Ptr
intptr_t ___m_Ptr_0;
// System.String UnityEngine.TextGenerator::m_LastString
String_t* ___m_LastString_1;
// UnityEngine.TextGenerationSettings UnityEngine.TextGenerator::m_LastSettings
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___m_LastSettings_2;
// System.Boolean UnityEngine.TextGenerator::m_HasGenerated
bool ___m_HasGenerated_3;
// UnityEngine.TextGenerationError UnityEngine.TextGenerator::m_LastValid
int32_t ___m_LastValid_4;
// System.Collections.Generic.List`1<UnityEngine.UIVertex> UnityEngine.TextGenerator::m_Verts
List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___m_Verts_5;
// System.Collections.Generic.List`1<UnityEngine.UICharInfo> UnityEngine.TextGenerator::m_Characters
List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___m_Characters_6;
// System.Collections.Generic.List`1<UnityEngine.UILineInfo> UnityEngine.TextGenerator::m_Lines
List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___m_Lines_7;
// System.Boolean UnityEngine.TextGenerator::m_CachedVerts
bool ___m_CachedVerts_8;
// System.Boolean UnityEngine.TextGenerator::m_CachedCharacters
bool ___m_CachedCharacters_9;
// System.Boolean UnityEngine.TextGenerator::m_CachedLines
bool ___m_CachedLines_10;
public:
inline static int32_t get_offset_of_m_Ptr_0() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Ptr_0)); }
inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; }
inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; }
inline void set_m_Ptr_0(intptr_t value)
{
___m_Ptr_0 = value;
}
inline static int32_t get_offset_of_m_LastString_1() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_LastString_1)); }
inline String_t* get_m_LastString_1() const { return ___m_LastString_1; }
inline String_t** get_address_of_m_LastString_1() { return &___m_LastString_1; }
inline void set_m_LastString_1(String_t* value)
{
___m_LastString_1 = value;
Il2CppCodeGenWriteBarrier((&___m_LastString_1), value);
}
inline static int32_t get_offset_of_m_LastSettings_2() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_LastSettings_2)); }
inline TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 get_m_LastSettings_2() const { return ___m_LastSettings_2; }
inline TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * get_address_of_m_LastSettings_2() { return &___m_LastSettings_2; }
inline void set_m_LastSettings_2(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 value)
{
___m_LastSettings_2 = value;
}
inline static int32_t get_offset_of_m_HasGenerated_3() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_HasGenerated_3)); }
inline bool get_m_HasGenerated_3() const { return ___m_HasGenerated_3; }
inline bool* get_address_of_m_HasGenerated_3() { return &___m_HasGenerated_3; }
inline void set_m_HasGenerated_3(bool value)
{
___m_HasGenerated_3 = value;
}
inline static int32_t get_offset_of_m_LastValid_4() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_LastValid_4)); }
inline int32_t get_m_LastValid_4() const { return ___m_LastValid_4; }
inline int32_t* get_address_of_m_LastValid_4() { return &___m_LastValid_4; }
inline void set_m_LastValid_4(int32_t value)
{
___m_LastValid_4 = value;
}
inline static int32_t get_offset_of_m_Verts_5() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Verts_5)); }
inline List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * get_m_Verts_5() const { return ___m_Verts_5; }
inline List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 ** get_address_of_m_Verts_5() { return &___m_Verts_5; }
inline void set_m_Verts_5(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * value)
{
___m_Verts_5 = value;
Il2CppCodeGenWriteBarrier((&___m_Verts_5), value);
}
inline static int32_t get_offset_of_m_Characters_6() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Characters_6)); }
inline List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * get_m_Characters_6() const { return ___m_Characters_6; }
inline List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E ** get_address_of_m_Characters_6() { return &___m_Characters_6; }
inline void set_m_Characters_6(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * value)
{
___m_Characters_6 = value;
Il2CppCodeGenWriteBarrier((&___m_Characters_6), value);
}
inline static int32_t get_offset_of_m_Lines_7() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_Lines_7)); }
inline List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * get_m_Lines_7() const { return ___m_Lines_7; }
inline List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 ** get_address_of_m_Lines_7() { return &___m_Lines_7; }
inline void set_m_Lines_7(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * value)
{
___m_Lines_7 = value;
Il2CppCodeGenWriteBarrier((&___m_Lines_7), value);
}
inline static int32_t get_offset_of_m_CachedVerts_8() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_CachedVerts_8)); }
inline bool get_m_CachedVerts_8() const { return ___m_CachedVerts_8; }
inline bool* get_address_of_m_CachedVerts_8() { return &___m_CachedVerts_8; }
inline void set_m_CachedVerts_8(bool value)
{
___m_CachedVerts_8 = value;
}
inline static int32_t get_offset_of_m_CachedCharacters_9() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_CachedCharacters_9)); }
inline bool get_m_CachedCharacters_9() const { return ___m_CachedCharacters_9; }
inline bool* get_address_of_m_CachedCharacters_9() { return &___m_CachedCharacters_9; }
inline void set_m_CachedCharacters_9(bool value)
{
___m_CachedCharacters_9 = value;
}
inline static int32_t get_offset_of_m_CachedLines_10() { return static_cast<int32_t>(offsetof(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8, ___m_CachedLines_10)); }
inline bool get_m_CachedLines_10() const { return ___m_CachedLines_10; }
inline bool* get_address_of_m_CachedLines_10() { return &___m_CachedLines_10; }
inline void set_m_CachedLines_10(bool value)
{
___m_CachedLines_10 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for P/Invoke marshalling of UnityEngine.TextGenerator
struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke
{
intptr_t ___m_Ptr_0;
char* ___m_LastString_1;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke ___m_LastSettings_2;
int32_t ___m_HasGenerated_3;
int32_t ___m_LastValid_4;
List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___m_Verts_5;
List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___m_Characters_6;
List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___m_Lines_7;
int32_t ___m_CachedVerts_8;
int32_t ___m_CachedCharacters_9;
int32_t ___m_CachedLines_10;
};
// Native definition for COM marshalling of UnityEngine.TextGenerator
struct TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com
{
intptr_t ___m_Ptr_0;
Il2CppChar* ___m_LastString_1;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com ___m_LastSettings_2;
int32_t ___m_HasGenerated_3;
int32_t ___m_LastValid_4;
List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___m_Verts_5;
List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___m_Characters_6;
List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___m_Lines_7;
int32_t ___m_CachedVerts_8;
int32_t ___m_CachedCharacters_9;
int32_t ___m_CachedLines_10;
};
#endif // TEXTGENERATOR_TD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_H
#ifndef TEXTMESH_T327D0DAFEF431170D8C2882083D442AF4D4A0E4A_H
#define TEXTMESH_T327D0DAFEF431170D8C2882083D442AF4D4A0E4A_H
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.TextMesh
struct TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A : public Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // TEXTMESH_T327D0DAFEF431170D8C2882083D442AF4D4A0E4A_H
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86 : public RuntimeArray
{
public:
ALIGN_FIELD (8) Delegate_t * m_Items[1];
public:
inline Delegate_t * GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline Delegate_t ** GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, Delegate_t * value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier(m_Items + index, value);
}
inline Delegate_t * GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline Delegate_t ** GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, Delegate_t * value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier(m_Items + index, value);
}
};
// System.Object[]
struct ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A : public RuntimeArray
{
public:
ALIGN_FIELD (8) RuntimeObject * m_Items[1];
public:
inline RuntimeObject * GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline RuntimeObject ** GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, RuntimeObject * value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier(m_Items + index, value);
}
inline RuntimeObject * GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline RuntimeObject ** GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, RuntimeObject * value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier(m_Items + index, value);
}
};
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled);
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled);
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled);
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled);
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled);
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled);
// System.Void System.Action`1<System.Object>::Invoke(!0)
extern "C" IL2CPP_METHOD_ATTR void Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared (Action_1_t551A279CEADCF6EEAE8FA2B1E1E757D0D15290D0 * __this, RuntimeObject * p0, const RuntimeMethod* method);
// System.Void System.Collections.Generic.List`1<UnityEngine.UIVertex>::.ctor(System.Int32)
extern "C" IL2CPP_METHOD_ATTR void List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_gshared (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * __this, int32_t p0, const RuntimeMethod* method);
// System.Void System.Collections.Generic.List`1<UnityEngine.UICharInfo>::.ctor(System.Int32)
extern "C" IL2CPP_METHOD_ATTR void List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_gshared (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * __this, int32_t p0, const RuntimeMethod* method);
// System.Void System.Collections.Generic.List`1<UnityEngine.UILineInfo>::.ctor(System.Int32)
extern "C" IL2CPP_METHOD_ATTR void List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_gshared (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * __this, int32_t p0, const RuntimeMethod* method);
// System.Delegate System.Delegate::Combine(System.Delegate,System.Delegate)
extern "C" IL2CPP_METHOD_ATTR Delegate_t * Delegate_Combine_mC25D2F7DECAFBA6D9A2F9EBA8A77063F0658ECF1 (Delegate_t * p0, Delegate_t * p1, const RuntimeMethod* method);
// System.Delegate System.Delegate::Remove(System.Delegate,System.Delegate)
extern "C" IL2CPP_METHOD_ATTR Delegate_t * Delegate_Remove_m0B0DB7D1B3AF96B71AFAA72BA0EFE32FBBC2932D (Delegate_t * p0, Delegate_t * p1, const RuntimeMethod* method);
// System.Void System.Action`1<UnityEngine.Font>::Invoke(!0)
inline void Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * __this, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * p0, const RuntimeMethod* method)
{
(( void (*) (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, const RuntimeMethod*))Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared)(__this, p0, method);
}
// System.Void UnityEngine.Font/FontTextureRebuildCallback::Invoke()
extern "C" IL2CPP_METHOD_ATTR void FontTextureRebuildCallback_Invoke_m4E6CFDE11932BA7F129C9A2C4CAE294562B07480 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Font::HasCharacter(System.Int32)
extern "C" IL2CPP_METHOD_ATTR bool Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, int32_t ___c0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Mathf::Approximately(System.Single,System.Single)
extern "C" IL2CPP_METHOD_ATTR bool Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E (float p0, float p1, const RuntimeMethod* method);
// System.Boolean UnityEngine.TextGenerationSettings::CompareColors(UnityEngine.Color,UnityEngine.Color)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66 (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___left0, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___right1, const RuntimeMethod* method);
// System.Boolean UnityEngine.TextGenerationSettings::CompareVector2(UnityEngine.Vector2,UnityEngine.Vector2)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___left0, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___right1, const RuntimeMethod* method);
// System.Boolean UnityEngine.Object::op_Equality(UnityEngine.Object,UnityEngine.Object)
extern "C" IL2CPP_METHOD_ATTR bool Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p1, const RuntimeMethod* method);
// System.Boolean UnityEngine.TextGenerationSettings::Equals(UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___other0, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::.ctor(System.Int32)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, int32_t ___initialCapacity0, const RuntimeMethod* method);
// System.Void System.Object::.ctor()
extern "C" IL2CPP_METHOD_ATTR void Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0 (RuntimeObject * __this, const RuntimeMethod* method);
// System.IntPtr UnityEngine.TextGenerator::Internal_Create()
extern "C" IL2CPP_METHOD_ATTR intptr_t TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994 (const RuntimeMethod* method);
// System.Void System.Collections.Generic.List`1<UnityEngine.UIVertex>::.ctor(System.Int32)
inline void List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8 (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * __this, int32_t p0, const RuntimeMethod* method)
{
(( void (*) (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 *, int32_t, const RuntimeMethod*))List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_gshared)(__this, p0, method);
}
// System.Void System.Collections.Generic.List`1<UnityEngine.UICharInfo>::.ctor(System.Int32)
inline void List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71 (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * __this, int32_t p0, const RuntimeMethod* method)
{
(( void (*) (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E *, int32_t, const RuntimeMethod*))List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_gshared)(__this, p0, method);
}
// System.Void System.Collections.Generic.List`1<UnityEngine.UILineInfo>::.ctor(System.Int32)
inline void List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * __this, int32_t p0, const RuntimeMethod* method)
{
(( void (*) (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 *, int32_t, const RuntimeMethod*))List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_gshared)(__this, p0, method);
}
// System.Void System.Object::Finalize()
extern "C" IL2CPP_METHOD_ATTR void Object_Finalize_m4015B7D3A44DE125C5FE34D7276CD4697C06F380 (RuntimeObject * __this, const RuntimeMethod* method);
// System.Boolean System.IntPtr::op_Inequality(System.IntPtr,System.IntPtr)
extern "C" IL2CPP_METHOD_ATTR bool IntPtr_op_Inequality_mB4886A806009EA825EFCC60CD2A7F6EB8E273A61 (intptr_t p0, intptr_t p1, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::Internal_Destroy(System.IntPtr)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5 (intptr_t ___ptr0, const RuntimeMethod* method);
// System.Int32 UnityEngine.TextGenerator::get_characterCount()
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Object::op_Inequality(UnityEngine.Object,UnityEngine.Object)
extern "C" IL2CPP_METHOD_ATTR bool Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p1, const RuntimeMethod* method);
// System.Boolean UnityEngine.Font::get_dynamic()
extern "C" IL2CPP_METHOD_ATTR bool Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method);
// System.String UnityEngine.Object::get_name()
extern "C" IL2CPP_METHOD_ATTR String_t* Object_get_name_mA2D400141CB3C991C87A2556429781DE961A83CE (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Debug::LogWarningFormat(UnityEngine.Object,System.String,System.Object[])
extern "C" IL2CPP_METHOD_ATTR void Debug_LogWarningFormat_m4A02CCF91F3A9392F4AA93576DCE2222267E5945 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p0, String_t* p1, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* p2, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::GetCharactersInternal(System.Object)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___characters0, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::GetLinesInternal(System.Object)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___lines0, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::GetVerticesInternal(System.Object)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___vertices0, const RuntimeMethod* method);
// System.Boolean UnityEngine.TextGenerator::Populate(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method);
// UnityEngine.Rect UnityEngine.TextGenerator::get_rectExtents()
extern "C" IL2CPP_METHOD_ATTR Rect_t35B976DE901B5423C11705E156938EA27AB402CE TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method);
// System.Single UnityEngine.Rect::get_width()
extern "C" IL2CPP_METHOD_ATTR float Rect_get_width_m54FF69FC2C086E2DC349ED091FD0D6576BFB1484 (Rect_t35B976DE901B5423C11705E156938EA27AB402CE * __this, const RuntimeMethod* method);
// System.Single UnityEngine.Rect::get_height()
extern "C" IL2CPP_METHOD_ATTR float Rect_get_height_m088C36990E0A255C5D7DCE36575DCE23ABB364B5 (Rect_t35B976DE901B5423C11705E156938EA27AB402CE * __this, const RuntimeMethod* method);
// UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateWithError(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method);
// System.Void UnityEngine.Debug::LogErrorFormat(UnityEngine.Object,System.String,System.Object[])
extern "C" IL2CPP_METHOD_ATTR void Debug_LogErrorFormat_m994E4759C25BF0E9DD4179C10E3979558137CCF0 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p0, String_t* p1, ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* p2, const RuntimeMethod* method);
// System.Boolean System.String::op_Equality(System.String,System.String)
extern "C" IL2CPP_METHOD_ATTR bool String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE (String_t* p0, String_t* p1, const RuntimeMethod* method);
// UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateAlways(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateAlways_m8DCF389A51877975F29FAB9B6E800DFDC1E0B8DF (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method);
// UnityEngine.TextGenerationSettings UnityEngine.TextGenerator::ValidatedSettings(UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings0, const RuntimeMethod* method);
// System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,UnityEngine.VerticalWrapMode,UnityEngine.HorizontalWrapMode,System.Boolean,UnityEngine.TextAnchor,UnityEngine.Vector2,UnityEngine.Vector2,System.Boolean,System.Boolean,UnityEngine.TextGenerationError&)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___extents15, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot16, bool ___generateOutOfBounds17, bool ___alignByGeometry18, int32_t* ___error19, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::GetVertices(System.Collections.Generic.List`1<UnityEngine.UIVertex>)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetVertices_m6FA34586541514ED7396990542BDAC536C10A4F2 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___vertices0, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::GetCharacters(System.Collections.Generic.List`1<UnityEngine.UICharInfo>)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetCharacters_mBB7980F2FE8BE65A906A39B5559EC54B1CEF4131 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___characters0, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::GetLines(System.Collections.Generic.List`1<UnityEngine.UILineInfo>)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetLines_mC31F7918A9159908EA914D01B2E32644B046E2B5 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___lines0, const RuntimeMethod* method);
// System.Void UnityEngine.TextGenerator::get_rectExtents_Injected(UnityEngine.Rect&)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, Rect_t35B976DE901B5423C11705E156938EA27AB402CE * ___ret0, const RuntimeMethod* method);
// System.Boolean UnityEngine.TextGenerator::Populate_Internal_Injected(System.String,UnityEngine.Font,UnityEngine.Color&,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method);
// System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_mCA54081A0855AED6EC6345265603409FE330985C (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method);
// System.Void UnityEngine.TextMesh::set_color_Injected(UnityEngine.Color&)
extern "C" IL2CPP_METHOD_ATTR void TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___value0, const RuntimeMethod* method);
// System.Void UnityEngine.Color32::.ctor(System.Byte,System.Byte,System.Byte,System.Byte)
extern "C" IL2CPP_METHOD_ATTR void Color32__ctor_m1AEF46FBBBE4B522E6984D081A3D158198E10AA2 (Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 * __this, uint8_t p0, uint8_t p1, uint8_t p2, uint8_t p3, const RuntimeMethod* method);
// System.Void UnityEngine.Vector4::.ctor(System.Single,System.Single,System.Single,System.Single)
extern "C" IL2CPP_METHOD_ATTR void Vector4__ctor_m545458525879607A5392A10B175D0C19B2BC715D (Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E * __this, float p0, float p1, float p2, float p3, const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.Vector3::get_zero()
extern "C" IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Vector3_get_zero_m3CDDCAE94581DF3BB16C4B40A100E28E9C6649C2 (const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.Vector3::get_back()
extern "C" IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Vector3_get_back_mE7EF8625637E6F8B9E6B42A6AE140777C51E02F7 (const RuntimeMethod* method);
// UnityEngine.Vector2 UnityEngine.Vector2::get_zero()
extern "C" IL2CPP_METHOD_ATTR Vector2_tA85D2DD88578276CA8A8796756458277E72D073D Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8 (const RuntimeMethod* method);
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Font::add_textureRebuilt(System.Action`1<UnityEngine.Font>)
extern "C" IL2CPP_METHOD_ATTR void Font_add_textureRebuilt_m031EFCD3B164273920B133A8689C18ED87C9B18F (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * ___value0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (Font_add_textureRebuilt_m031EFCD3B164273920B133A8689C18ED87C9B18F_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_0 = NULL;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_1 = NULL;
{
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_0 = ((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_textureRebuilt_4();
V_0 = L_0;
}
IL_0006:
{
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_1 = V_0;
V_1 = L_1;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_2 = V_1;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_3 = ___value0;
Delegate_t * L_4 = Delegate_Combine_mC25D2F7DECAFBA6D9A2F9EBA8A77063F0658ECF1(L_2, L_3, /*hidden argument*/NULL);
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_5 = V_0;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_6 = InterlockedCompareExchangeImpl<Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *>((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C **)(((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_address_of_textureRebuilt_4()), ((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)CastclassSealed((RuntimeObject*)L_4, Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C_il2cpp_TypeInfo_var)), L_5);
V_0 = L_6;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_7 = V_0;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_8 = V_1;
if ((!(((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_7) == ((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_8))))
{
goto IL_0006;
}
}
{
return;
}
}
// System.Void UnityEngine.Font::remove_textureRebuilt(System.Action`1<UnityEngine.Font>)
extern "C" IL2CPP_METHOD_ATTR void Font_remove_textureRebuilt_mBEF163DAE27CA126D400646E850AAEE4AE8DAAB4 (Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * ___value0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (Font_remove_textureRebuilt_mBEF163DAE27CA126D400646E850AAEE4AE8DAAB4_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_0 = NULL;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * V_1 = NULL;
{
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_0 = ((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_textureRebuilt_4();
V_0 = L_0;
}
IL_0006:
{
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_1 = V_0;
V_1 = L_1;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_2 = V_1;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_3 = ___value0;
Delegate_t * L_4 = Delegate_Remove_m0B0DB7D1B3AF96B71AFAA72BA0EFE32FBBC2932D(L_2, L_3, /*hidden argument*/NULL);
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_5 = V_0;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_6 = InterlockedCompareExchangeImpl<Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *>((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C **)(((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_address_of_textureRebuilt_4()), ((Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)CastclassSealed((RuntimeObject*)L_4, Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C_il2cpp_TypeInfo_var)), L_5);
V_0 = L_6;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_7 = V_0;
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_8 = V_1;
if ((!(((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_7) == ((RuntimeObject*)(Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C *)L_8))))
{
goto IL_0006;
}
}
{
return;
}
}
// UnityEngine.Material UnityEngine.Font::get_material()
extern "C" IL2CPP_METHOD_ATTR Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 * Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method)
{
typedef Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 * (*Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *);
static Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Font_get_material_m92A995029540A5FACAEA3A2FE792FFDAC294827D_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::get_material()");
Material_tF7DB3BF0C24DEC2FE0CB51E5DF5053D5223C8598 * retVal = _il2cpp_icall_func(__this);
return retVal;
}
// System.Boolean UnityEngine.Font::get_dynamic()
extern "C" IL2CPP_METHOD_ATTR bool Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method)
{
typedef bool (*Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *);
static Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::get_dynamic()");
bool retVal = _il2cpp_icall_func(__this);
return retVal;
}
// System.Int32 UnityEngine.Font::get_fontSize()
extern "C" IL2CPP_METHOD_ATTR int32_t Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, const RuntimeMethod* method)
{
typedef int32_t (*Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *);
static Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Font_get_fontSize_m75A71EFC3D6483AD1A8C6F38133648BDFF1618A5_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::get_fontSize()");
int32_t retVal = _il2cpp_icall_func(__this);
return retVal;
}
// System.Void UnityEngine.Font::InvokeTextureRebuilt_Internal(UnityEngine.Font)
extern "C" IL2CPP_METHOD_ATTR void Font_InvokeTextureRebuilt_Internal_m2D4C9D99B6137EF380A19EC72D6EE8CBFF7B4062 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (Font_InvokeTextureRebuilt_Internal_m2D4C9D99B6137EF380A19EC72D6EE8CBFF7B4062_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * G_B5_0 = NULL;
FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * G_B4_0 = NULL;
{
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_0 = ((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_textureRebuilt_4();
if (L_0)
{
goto IL_000d;
}
}
{
goto IL_0018;
}
IL_000d:
{
Action_1_t795662E553415ECF2DD0F8EEB9BA170C3670F37C * L_1 = ((Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_StaticFields*)il2cpp_codegen_static_fields_for(Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26_il2cpp_TypeInfo_var))->get_textureRebuilt_4();
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_2 = ___font0;
NullCheck(L_1);
Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB(L_1, L_2, /*hidden argument*/Action_1_Invoke_mC307FDDD4FEA6818EE9A27D962C2C512B835DAEB_RuntimeMethod_var);
}
IL_0018:
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_3 = ___font0;
NullCheck(L_3);
FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * L_4 = L_3->get_m_FontTextureRebuildCallback_5();
FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * L_5 = L_4;
G_B4_0 = L_5;
if (L_5)
{
G_B5_0 = L_5;
goto IL_0027;
}
}
{
goto IL_002c;
}
IL_0027:
{
NullCheck(G_B5_0);
FontTextureRebuildCallback_Invoke_m4E6CFDE11932BA7F129C9A2C4CAE294562B07480(G_B5_0, /*hidden argument*/NULL);
}
IL_002c:
{
return;
}
}
// System.Boolean UnityEngine.Font::HasCharacter(System.Char)
extern "C" IL2CPP_METHOD_ATTR bool Font_HasCharacter_m23CC7E1E37BCA115DC130B841CF3207212E2802E (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, Il2CppChar ___c0, const RuntimeMethod* method)
{
bool V_0 = false;
{
Il2CppChar L_0 = ___c0;
bool L_1 = Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51(__this, L_0, /*hidden argument*/NULL);
V_0 = L_1;
goto IL_000e;
}
IL_000e:
{
bool L_2 = V_0;
return L_2;
}
}
// System.Boolean UnityEngine.Font::HasCharacter(System.Int32)
extern "C" IL2CPP_METHOD_ATTR bool Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51 (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * __this, int32_t ___c0, const RuntimeMethod* method)
{
typedef bool (*Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51_ftn) (Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, int32_t);
static Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Font_HasCharacter_m59FF574F1E4A2F9807CCF0C5D56C29E68D514D51_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Font::HasCharacter(System.Int32)");
bool retVal = _il2cpp_icall_func(__this, ___c0);
return retVal;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
extern "C" void DelegatePInvokeWrapper_FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, const RuntimeMethod* method)
{
typedef void (DEFAULT_CALL *PInvokeFunc)();
PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method));
// Native function invocation
il2cppPInvokeFunc();
}
// System.Void UnityEngine.Font_FontTextureRebuildCallback::.ctor(System.Object,System.IntPtr)
extern "C" IL2CPP_METHOD_ATTR void FontTextureRebuildCallback__ctor_m83BD4ACFF1FDA3D203ABA140B0CA2B4B0064A3A3 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
__this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1));
__this->set_method_3(___method1);
__this->set_m_target_2(___object0);
}
// System.Void UnityEngine.Font_FontTextureRebuildCallback::Invoke()
extern "C" IL2CPP_METHOD_ATTR void FontTextureRebuildCallback_Invoke_m4E6CFDE11932BA7F129C9A2C4CAE294562B07480 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, const RuntimeMethod* method)
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegatesToInvoke = __this->get_delegates_11();
if (delegatesToInvoke != NULL)
{
il2cpp_array_size_t length = delegatesToInvoke->max_length;
for (il2cpp_array_size_t i = 0; i < length; i++)
{
Delegate_t* currentDelegate = (delegatesToInvoke)->GetAtUnchecked(static_cast<il2cpp_array_size_t>(i));
Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0();
RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3());
RuntimeObject* targetThis = currentDelegate->get_m_target_2();
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 0)
{
// open
typedef void (*FunctionPointerType) (const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker0::Invoke(targetMethod, targetThis);
else
GenericVirtActionInvoker0::Invoke(targetMethod, targetThis);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis);
else
VirtActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis);
}
}
}
else
{
typedef void (*FunctionPointerType) (void*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod);
}
}
}
}
else
{
Il2CppMethodPointer targetMethodPointer = __this->get_method_ptr_0();
RuntimeMethod* targetMethod = (RuntimeMethod*)(__this->get_method_3());
RuntimeObject* targetThis = __this->get_m_target_2();
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 0)
{
// open
typedef void (*FunctionPointerType) (const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker0::Invoke(targetMethod, targetThis);
else
GenericVirtActionInvoker0::Invoke(targetMethod, targetThis);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis);
else
VirtActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis);
}
}
}
else
{
typedef void (*FunctionPointerType) (void*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, targetMethod);
}
}
}
}
// System.IAsyncResult UnityEngine.Font_FontTextureRebuildCallback::BeginInvoke(System.AsyncCallback,System.Object)
extern "C" IL2CPP_METHOD_ATTR RuntimeObject* FontTextureRebuildCallback_BeginInvoke_m53EF837EFEA71B83AEA6706E2EB8F83062E43880 (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback0, RuntimeObject * ___object1, const RuntimeMethod* method)
{
void *__d_args[1] = {0};
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback0, (RuntimeObject*)___object1);
}
// System.Void UnityEngine.Font_FontTextureRebuildCallback::EndInvoke(System.IAsyncResult)
extern "C" IL2CPP_METHOD_ATTR void FontTextureRebuildCallback_EndInvoke_m8EEDB9652F6D2358523057E1164740820D2AE93C (FontTextureRebuildCallback_tD700C63BB1A449E3A0464C81701E981677D3021C * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: UnityEngine.TextGenerationSettings
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled)
{
Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL, NULL);
}
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled)
{
Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.TextGenerationSettings
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_pinvoke_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_pinvoke& marshaled)
{
}
// Conversion methods for marshalling of: UnityEngine.TextGenerationSettings
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled)
{
Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL, NULL);
}
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_back(const TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68& unmarshaled)
{
Exception_t* ___font_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'font' of type 'TextGenerationSettings': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___font_0Exception, NULL, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.TextGenerationSettings
extern "C" void TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshal_com_cleanup(TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68_marshaled_com& marshaled)
{
}
// System.Boolean UnityEngine.TextGenerationSettings::CompareColors(UnityEngine.Color,UnityEngine.Color)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66 (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___left0, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___right1, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
int32_t G_B5_0 = 0;
{
float L_0 = (&___left0)->get_r_0();
float L_1 = (&___right1)->get_r_0();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_2 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_0, L_1, /*hidden argument*/NULL);
if (!L_2)
{
goto IL_005e;
}
}
{
float L_3 = (&___left0)->get_g_1();
float L_4 = (&___right1)->get_g_1();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_5 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_3, L_4, /*hidden argument*/NULL);
if (!L_5)
{
goto IL_005e;
}
}
{
float L_6 = (&___left0)->get_b_2();
float L_7 = (&___right1)->get_b_2();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_8 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_6, L_7, /*hidden argument*/NULL);
if (!L_8)
{
goto IL_005e;
}
}
{
float L_9 = (&___left0)->get_a_3();
float L_10 = (&___right1)->get_a_3();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_11 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_9, L_10, /*hidden argument*/NULL);
G_B5_0 = ((int32_t)(L_11));
goto IL_005f;
}
IL_005e:
{
G_B5_0 = 0;
}
IL_005f:
{
V_0 = (bool)G_B5_0;
goto IL_0065;
}
IL_0065:
{
bool L_12 = V_0;
return L_12;
}
}
extern "C" bool TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66_AdjustorThunk (RuntimeObject * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___left0, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___right1, const RuntimeMethod* method)
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * _thisAdjusted = reinterpret_cast<TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *>(__this + 1);
return TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66(_thisAdjusted, ___left0, ___right1, method);
}
// System.Boolean UnityEngine.TextGenerationSettings::CompareVector2(UnityEngine.Vector2,UnityEngine.Vector2)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___left0, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___right1, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
int32_t G_B3_0 = 0;
{
float L_0 = (&___left0)->get_x_0();
float L_1 = (&___right1)->get_x_0();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_2 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_0, L_1, /*hidden argument*/NULL);
if (!L_2)
{
goto IL_002e;
}
}
{
float L_3 = (&___left0)->get_y_1();
float L_4 = (&___right1)->get_y_1();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_5 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_3, L_4, /*hidden argument*/NULL);
G_B3_0 = ((int32_t)(L_5));
goto IL_002f;
}
IL_002e:
{
G_B3_0 = 0;
}
IL_002f:
{
V_0 = (bool)G_B3_0;
goto IL_0035;
}
IL_0035:
{
bool L_6 = V_0;
return L_6;
}
}
extern "C" bool TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C_AdjustorThunk (RuntimeObject * __this, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___left0, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___right1, const RuntimeMethod* method)
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * _thisAdjusted = reinterpret_cast<TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *>(__this + 1);
return TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C(_thisAdjusted, ___left0, ___right1, method);
}
// System.Boolean UnityEngine.TextGenerationSettings::Equals(UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D (TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
int32_t G_B21_0 = 0;
{
Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_0 = __this->get_color_1();
Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_1 = (&___other0)->get_color_1();
bool L_2 = TextGenerationSettings_CompareColors_m41313F2A332F5780C5BD6F8134EBB14473CC5C66((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)__this, L_0, L_1, /*hidden argument*/NULL);
if (!L_2)
{
goto IL_0187;
}
}
{
int32_t L_3 = __this->get_fontSize_2();
int32_t L_4 = (&___other0)->get_fontSize_2();
if ((!(((uint32_t)L_3) == ((uint32_t)L_4))))
{
goto IL_0187;
}
}
{
float L_5 = __this->get_scaleFactor_5();
float L_6 = (&___other0)->get_scaleFactor_5();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_7 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_5, L_6, /*hidden argument*/NULL);
if (!L_7)
{
goto IL_0187;
}
}
{
int32_t L_8 = __this->get_resizeTextMinSize_10();
int32_t L_9 = (&___other0)->get_resizeTextMinSize_10();
if ((!(((uint32_t)L_8) == ((uint32_t)L_9))))
{
goto IL_0187;
}
}
{
int32_t L_10 = __this->get_resizeTextMaxSize_11();
int32_t L_11 = (&___other0)->get_resizeTextMaxSize_11();
if ((!(((uint32_t)L_10) == ((uint32_t)L_11))))
{
goto IL_0187;
}
}
{
float L_12 = __this->get_lineSpacing_3();
float L_13 = (&___other0)->get_lineSpacing_3();
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_14 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E(L_12, L_13, /*hidden argument*/NULL);
if (!L_14)
{
goto IL_0187;
}
}
{
int32_t L_15 = __this->get_fontStyle_6();
int32_t L_16 = (&___other0)->get_fontStyle_6();
if ((!(((uint32_t)L_15) == ((uint32_t)L_16))))
{
goto IL_0187;
}
}
{
bool L_17 = __this->get_richText_4();
bool L_18 = (&___other0)->get_richText_4();
if ((!(((uint32_t)L_17) == ((uint32_t)L_18))))
{
goto IL_0187;
}
}
{
int32_t L_19 = __this->get_textAnchor_7();
int32_t L_20 = (&___other0)->get_textAnchor_7();
if ((!(((uint32_t)L_19) == ((uint32_t)L_20))))
{
goto IL_0187;
}
}
{
bool L_21 = __this->get_alignByGeometry_8();
bool L_22 = (&___other0)->get_alignByGeometry_8();
if ((!(((uint32_t)L_21) == ((uint32_t)L_22))))
{
goto IL_0187;
}
}
{
bool L_23 = __this->get_resizeTextForBestFit_9();
bool L_24 = (&___other0)->get_resizeTextForBestFit_9();
if ((!(((uint32_t)L_23) == ((uint32_t)L_24))))
{
goto IL_0187;
}
}
{
int32_t L_25 = __this->get_resizeTextMinSize_10();
int32_t L_26 = (&___other0)->get_resizeTextMinSize_10();
if ((!(((uint32_t)L_25) == ((uint32_t)L_26))))
{
goto IL_0187;
}
}
{
int32_t L_27 = __this->get_resizeTextMaxSize_11();
int32_t L_28 = (&___other0)->get_resizeTextMaxSize_11();
if ((!(((uint32_t)L_27) == ((uint32_t)L_28))))
{
goto IL_0187;
}
}
{
bool L_29 = __this->get_resizeTextForBestFit_9();
bool L_30 = (&___other0)->get_resizeTextForBestFit_9();
if ((!(((uint32_t)L_29) == ((uint32_t)L_30))))
{
goto IL_0187;
}
}
{
bool L_31 = __this->get_updateBounds_12();
bool L_32 = (&___other0)->get_updateBounds_12();
if ((!(((uint32_t)L_31) == ((uint32_t)L_32))))
{
goto IL_0187;
}
}
{
int32_t L_33 = __this->get_horizontalOverflow_14();
int32_t L_34 = (&___other0)->get_horizontalOverflow_14();
if ((!(((uint32_t)L_33) == ((uint32_t)L_34))))
{
goto IL_0187;
}
}
{
int32_t L_35 = __this->get_verticalOverflow_13();
int32_t L_36 = (&___other0)->get_verticalOverflow_13();
if ((!(((uint32_t)L_35) == ((uint32_t)L_36))))
{
goto IL_0187;
}
}
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_37 = __this->get_generationExtents_15();
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_38 = (&___other0)->get_generationExtents_15();
bool L_39 = TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)__this, L_37, L_38, /*hidden argument*/NULL);
if (!L_39)
{
goto IL_0187;
}
}
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_40 = __this->get_pivot_16();
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_41 = (&___other0)->get_pivot_16();
bool L_42 = TextGenerationSettings_CompareVector2_m27AE82F513B8E6D4A529A02B1A3806A85E710F1C((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)__this, L_40, L_41, /*hidden argument*/NULL);
if (!L_42)
{
goto IL_0187;
}
}
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_43 = __this->get_font_0();
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_44 = (&___other0)->get_font_0();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_45 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_43, L_44, /*hidden argument*/NULL);
G_B21_0 = ((int32_t)(L_45));
goto IL_0188;
}
IL_0187:
{
G_B21_0 = 0;
}
IL_0188:
{
V_0 = (bool)G_B21_0;
goto IL_018e;
}
IL_018e:
{
bool L_46 = V_0;
return L_46;
}
}
extern "C" bool TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D_AdjustorThunk (RuntimeObject * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___other0, const RuntimeMethod* method)
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 * _thisAdjusted = reinterpret_cast<TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *>(__this + 1);
return TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D(_thisAdjusted, ___other0, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: UnityEngine.TextGenerator
extern "C" void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_pinvoke(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke& marshaled)
{
Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL, NULL);
}
extern "C" void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_pinvoke_back(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke& marshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled)
{
Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.TextGenerator
extern "C" void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_pinvoke_cleanup(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_pinvoke& marshaled)
{
}
// Conversion methods for marshalling of: UnityEngine.TextGenerator
extern "C" void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_com(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com& marshaled)
{
Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL, NULL);
}
extern "C" void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_com_back(const TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com& marshaled, TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8& unmarshaled)
{
Exception_t* ___m_LastSettings_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_LastSettings' of type 'TextGenerator'.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___m_LastSettings_2Exception, NULL, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.TextGenerator
extern "C" void TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshal_com_cleanup(TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8_marshaled_com& marshaled)
{
}
// System.Void UnityEngine.TextGenerator::.ctor()
extern "C" IL2CPP_METHOD_ATTR void TextGenerator__ctor_mD3956FF7D10DC470522A6363E7D6EC243415098A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
{
TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE(__this, ((int32_t)50), /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.TextGenerator::.ctor(System.Int32)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, int32_t ___initialCapacity0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerator__ctor_m86E01E7BB9DC1B28F04961E482ED4D7065062BCE_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
Object__ctor_m925ECA5E85CA100E3FB86A4F9E15C120E9A184C0(__this, /*hidden argument*/NULL);
intptr_t L_0 = TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994(/*hidden argument*/NULL);
__this->set_m_Ptr_0((intptr_t)L_0);
int32_t L_1 = ___initialCapacity0;
List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_2 = (List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 *)il2cpp_codegen_object_new(List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554_il2cpp_TypeInfo_var);
List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8(L_2, ((int32_t)il2cpp_codegen_multiply((int32_t)((int32_t)il2cpp_codegen_add((int32_t)L_1, (int32_t)1)), (int32_t)4)), /*hidden argument*/List_1__ctor_m4B9E13C91ADA643CE531D7FE21CBC0BD4B8CFAC8_RuntimeMethod_var);
__this->set_m_Verts_5(L_2);
int32_t L_3 = ___initialCapacity0;
List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_4 = (List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E *)il2cpp_codegen_object_new(List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E_il2cpp_TypeInfo_var);
List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71(L_4, ((int32_t)il2cpp_codegen_add((int32_t)L_3, (int32_t)1)), /*hidden argument*/List_1__ctor_m31FA26D4722DE7042587E4FDA499FF5B35A5BE71_RuntimeMethod_var);
__this->set_m_Characters_6(L_4);
List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_5 = (List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 *)il2cpp_codegen_object_new(List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0_il2cpp_TypeInfo_var);
List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD(L_5, ((int32_t)20), /*hidden argument*/List_1__ctor_m9616B19521FA2ACBD7DAB484CA3DFA1283D8C9DD_RuntimeMethod_var);
__this->set_m_Lines_7(L_5);
return;
}
}
// System.Void UnityEngine.TextGenerator::Finalize()
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_Finalize_m6E9076F61F7B4DD5E56207F39E8F5FD85F188D8A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerator_Finalize_m6E9076F61F7B4DD5E56207F39E8F5FD85F188D8A_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
Exception_t * __last_unhandled_exception = 0;
NO_UNUSED_WARNING (__last_unhandled_exception);
Exception_t * __exception_local = 0;
NO_UNUSED_WARNING (__exception_local);
void* __leave_targets_storage = alloca(sizeof(int32_t) * 1);
il2cpp::utils::LeaveTargetStack __leave_targets(__leave_targets_storage);
NO_UNUSED_WARNING (__leave_targets);
{
}
IL_0001:
try
{ // begin try (depth: 1)
InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t7218B22548186B208D65EA5B7870503810A2D15A_il2cpp_TypeInfo_var, __this);
IL2CPP_LEAVE(0x13, FINALLY_000c);
} // end try (depth: 1)
catch(Il2CppExceptionWrapper& e)
{
__last_unhandled_exception = (Exception_t *)e.ex;
goto FINALLY_000c;
}
FINALLY_000c:
{ // begin finally (depth: 1)
Object_Finalize_m4015B7D3A44DE125C5FE34D7276CD4697C06F380(__this, /*hidden argument*/NULL);
IL2CPP_END_FINALLY(12)
} // end finally (depth: 1)
IL2CPP_CLEANUP(12)
{
IL2CPP_JUMP_TBL(0x13, IL_0013)
IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *)
}
IL_0013:
{
return;
}
}
// System.Void UnityEngine.TextGenerator::System.IDisposable.Dispose()
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_System_IDisposable_Dispose_m9D3291DC086282AF57A115B39D3C17BD0074FA3D (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerator_System_IDisposable_Dispose_m9D3291DC086282AF57A115B39D3C17BD0074FA3D_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
intptr_t L_0 = __this->get_m_Ptr_0();
bool L_1 = IntPtr_op_Inequality_mB4886A806009EA825EFCC60CD2A7F6EB8E273A61((intptr_t)L_0, (intptr_t)(0), /*hidden argument*/NULL);
if (!L_1)
{
goto IL_002e;
}
}
{
intptr_t L_2 = __this->get_m_Ptr_0();
TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5((intptr_t)L_2, /*hidden argument*/NULL);
__this->set_m_Ptr_0((intptr_t)(0));
}
IL_002e:
{
return;
}
}
// System.Int32 UnityEngine.TextGenerator::get_characterCountVisible()
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_get_characterCountVisible_mD0E9AA8120947F5AED58F512C0978C2E82ED1182 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
int32_t V_0 = 0;
{
int32_t L_0 = TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7(__this, /*hidden argument*/NULL);
V_0 = ((int32_t)il2cpp_codegen_subtract((int32_t)L_0, (int32_t)1));
goto IL_000e;
}
IL_000e:
{
int32_t L_1 = V_0;
return L_1;
}
}
// UnityEngine.TextGenerationSettings UnityEngine.TextGenerator::ValidatedSettings(UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 V_0;
memset(&V_0, 0, sizeof(V_0));
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_0 = (&___settings0)->get_font_0();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_1 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_0, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
if (!L_1)
{
goto IL_002b;
}
}
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_2 = (&___settings0)->get_font_0();
NullCheck(L_2);
bool L_3 = Font_get_dynamic_m14C7E59606E317C5952A69F05CC44BF399CFFE2E(L_2, /*hidden argument*/NULL);
if (!L_3)
{
goto IL_002b;
}
}
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_4 = ___settings0;
V_0 = L_4;
goto IL_00e2;
}
IL_002b:
{
int32_t L_5 = (&___settings0)->get_fontSize_2();
if (L_5)
{
goto IL_0043;
}
}
{
int32_t L_6 = (&___settings0)->get_fontStyle_6();
if (!L_6)
{
goto IL_008d;
}
}
IL_0043:
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_7 = (&___settings0)->get_font_0();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_8 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_7, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
if (!L_8)
{
goto IL_007c;
}
}
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_9 = (&___settings0)->get_font_0();
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_10 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1);
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_11 = L_10;
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_12 = (&___settings0)->get_font_0();
NullCheck(L_12);
String_t* L_13 = Object_get_name_mA2D400141CB3C991C87A2556429781DE961A83CE(L_12, /*hidden argument*/NULL);
NullCheck(L_11);
ArrayElementTypeCheck (L_11, L_13);
(L_11)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_13);
IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var);
Debug_LogWarningFormat_m4A02CCF91F3A9392F4AA93576DCE2222267E5945(L_9, _stringLiteral2C79056F1CBD7CDBD214C0C0421FFC46A2BD5CBD, L_11, /*hidden argument*/NULL);
}
IL_007c:
{
(&___settings0)->set_fontSize_2(0);
(&___settings0)->set_fontStyle_6(0);
}
IL_008d:
{
bool L_14 = (&___settings0)->get_resizeTextForBestFit_9();
if (!L_14)
{
goto IL_00db;
}
}
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_15 = (&___settings0)->get_font_0();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_16 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_15, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
if (!L_16)
{
goto IL_00d2;
}
}
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_17 = (&___settings0)->get_font_0();
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_18 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1);
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_19 = L_18;
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_20 = (&___settings0)->get_font_0();
NullCheck(L_20);
String_t* L_21 = Object_get_name_mA2D400141CB3C991C87A2556429781DE961A83CE(L_20, /*hidden argument*/NULL);
NullCheck(L_19);
ArrayElementTypeCheck (L_19, L_21);
(L_19)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_21);
IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var);
Debug_LogWarningFormat_m4A02CCF91F3A9392F4AA93576DCE2222267E5945(L_17, _stringLiteral277905A8757DB70EAE0C8B996E4FCF857783BB03, L_19, /*hidden argument*/NULL);
}
IL_00d2:
{
(&___settings0)->set_resizeTextForBestFit_9((bool)0);
}
IL_00db:
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_22 = ___settings0;
V_0 = L_22;
goto IL_00e2;
}
IL_00e2:
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_23 = V_0;
return L_23;
}
}
// System.Void UnityEngine.TextGenerator::Invalidate()
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_Invalidate_m5C360AB470CB728BAA03B34BE33C75CBB55B673E (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
{
__this->set_m_HasGenerated_3((bool)0);
return;
}
}
// System.Void UnityEngine.TextGenerator::GetCharacters(System.Collections.Generic.List`1<UnityEngine.UICharInfo>)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetCharacters_mBB7980F2FE8BE65A906A39B5559EC54B1CEF4131 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * ___characters0, const RuntimeMethod* method)
{
{
List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_0 = ___characters0;
TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967(__this, L_0, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.TextGenerator::GetLines(System.Collections.Generic.List`1<UnityEngine.UILineInfo>)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetLines_mC31F7918A9159908EA914D01B2E32644B046E2B5 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * ___lines0, const RuntimeMethod* method)
{
{
List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_0 = ___lines0;
TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD(__this, L_0, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.TextGenerator::GetVertices(System.Collections.Generic.List`1<UnityEngine.UIVertex>)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetVertices_m6FA34586541514ED7396990542BDAC536C10A4F2 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * ___vertices0, const RuntimeMethod* method)
{
{
List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_0 = ___vertices0;
TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A(__this, L_0, /*hidden argument*/NULL);
return;
}
}
// System.Single UnityEngine.TextGenerator::GetPreferredWidth(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR float TextGenerator_GetPreferredWidth_mBF228094564195BBB66669F4ECC6EE1B0B05BAAA (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method)
{
Rect_t35B976DE901B5423C11705E156938EA27AB402CE V_0;
memset(&V_0, 0, sizeof(V_0));
float V_1 = 0.0f;
{
(&___settings1)->set_horizontalOverflow_14(1);
(&___settings1)->set_verticalOverflow_13(1);
(&___settings1)->set_updateBounds_12((bool)1);
String_t* L_0 = ___str0;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1;
TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04(__this, L_0, L_1, /*hidden argument*/NULL);
Rect_t35B976DE901B5423C11705E156938EA27AB402CE L_2 = TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1(__this, /*hidden argument*/NULL);
V_0 = L_2;
float L_3 = Rect_get_width_m54FF69FC2C086E2DC349ED091FD0D6576BFB1484((Rect_t35B976DE901B5423C11705E156938EA27AB402CE *)(&V_0), /*hidden argument*/NULL);
V_1 = L_3;
goto IL_0036;
}
IL_0036:
{
float L_4 = V_1;
return L_4;
}
}
// System.Single UnityEngine.TextGenerator::GetPreferredHeight(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR float TextGenerator_GetPreferredHeight_mC2F191D9E9CF2365545D0A3F1EBD0F105DB27963 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method)
{
Rect_t35B976DE901B5423C11705E156938EA27AB402CE V_0;
memset(&V_0, 0, sizeof(V_0));
float V_1 = 0.0f;
{
(&___settings1)->set_verticalOverflow_13(1);
(&___settings1)->set_updateBounds_12((bool)1);
String_t* L_0 = ___str0;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1;
TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04(__this, L_0, L_1, /*hidden argument*/NULL);
Rect_t35B976DE901B5423C11705E156938EA27AB402CE L_2 = TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1(__this, /*hidden argument*/NULL);
V_0 = L_2;
float L_3 = Rect_get_height_m088C36990E0A255C5D7DCE36575DCE23ABB364B5((Rect_t35B976DE901B5423C11705E156938EA27AB402CE *)(&V_0), /*hidden argument*/NULL);
V_1 = L_3;
goto IL_002e;
}
IL_002e:
{
float L_4 = V_1;
return L_4;
}
}
// System.Boolean UnityEngine.TextGenerator::PopulateWithErrors(System.String,UnityEngine.TextGenerationSettings,UnityEngine.GameObject)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_PopulateWithErrors_m1F1851B3C2B2EBEFD81C83DC124FB376C926B933 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * ___context2, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerator_PopulateWithErrors_m1F1851B3C2B2EBEFD81C83DC124FB376C926B933_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
int32_t V_0 = 0;
bool V_1 = false;
{
String_t* L_0 = ___str0;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1;
int32_t L_2 = TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D(__this, L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
int32_t L_3 = V_0;
if (L_3)
{
goto IL_0017;
}
}
{
V_1 = (bool)1;
goto IL_0064;
}
IL_0017:
{
int32_t L_4 = V_0;
if (!((int32_t)((int32_t)L_4&(int32_t)1)))
{
goto IL_003a;
}
}
{
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_5 = ___context2;
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_6 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1);
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_7 = L_6;
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_8 = (&___settings1)->get_font_0();
NullCheck(L_7);
ArrayElementTypeCheck (L_7, L_8);
(L_7)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_8);
IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var);
Debug_LogErrorFormat_m994E4759C25BF0E9DD4179C10E3979558137CCF0(L_5, _stringLiteral6F5E75D22C09C82C4D03E8E6E9ADE44476FEE514, L_7, /*hidden argument*/NULL);
}
IL_003a:
{
int32_t L_9 = V_0;
if (!((int32_t)((int32_t)L_9&(int32_t)2)))
{
goto IL_005d;
}
}
{
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_10 = ___context2;
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_11 = (ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A*)SZArrayNew(ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A_il2cpp_TypeInfo_var, (uint32_t)1);
ObjectU5BU5D_t3C9242B5C88A48B2A5BD9FDA6CD0024E792AF08A* L_12 = L_11;
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_13 = (&___settings1)->get_font_0();
NullCheck(L_12);
ArrayElementTypeCheck (L_12, L_13);
(L_12)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_13);
IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var);
Debug_LogErrorFormat_m994E4759C25BF0E9DD4179C10E3979558137CCF0(L_10, _stringLiteral8D03707CEE3275C377839D6BF944BCECDF26A00B, L_12, /*hidden argument*/NULL);
}
IL_005d:
{
V_1 = (bool)0;
goto IL_0064;
}
IL_0064:
{
bool L_14 = V_1;
return L_14;
}
}
// System.Boolean UnityEngine.TextGenerator::Populate(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_m15553808C8FA017AA1AC23D2818C30DAFD654A04 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method)
{
int32_t V_0 = 0;
bool V_1 = false;
{
String_t* L_0 = ___str0;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1;
int32_t L_2 = TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D(__this, L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
int32_t L_3 = V_0;
V_1 = (bool)((((int32_t)L_3) == ((int32_t)0))? 1 : 0);
goto IL_0014;
}
IL_0014:
{
bool L_4 = V_1;
return L_4;
}
}
// UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateWithError(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateWithError_m24D1DA75F0563582E228C6F4982D0913C58E1D7D (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method)
{
int32_t V_0 = 0;
{
bool L_0 = __this->get_m_HasGenerated_3();
if (!L_0)
{
goto IL_003b;
}
}
{
String_t* L_1 = ___str0;
String_t* L_2 = __this->get_m_LastString_1();
bool L_3 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_1, L_2, /*hidden argument*/NULL);
if (!L_3)
{
goto IL_003b;
}
}
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_4 = __this->get_m_LastSettings_2();
bool L_5 = TextGenerationSettings_Equals_m39912D195B0384AADC5C274659324EC8720C4F7D((TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 *)(&___settings1), L_4, /*hidden argument*/NULL);
if (!L_5)
{
goto IL_003b;
}
}
{
int32_t L_6 = __this->get_m_LastValid_4();
V_0 = L_6;
goto IL_0055;
}
IL_003b:
{
String_t* L_7 = ___str0;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_8 = ___settings1;
int32_t L_9 = TextGenerator_PopulateAlways_m8DCF389A51877975F29FAB9B6E800DFDC1E0B8DF(__this, L_7, L_8, /*hidden argument*/NULL);
__this->set_m_LastValid_4(L_9);
int32_t L_10 = __this->get_m_LastValid_4();
V_0 = L_10;
goto IL_0055;
}
IL_0055:
{
int32_t L_11 = V_0;
return L_11;
}
}
// UnityEngine.TextGenerationError UnityEngine.TextGenerator::PopulateAlways(System.String,UnityEngine.TextGenerationSettings)
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_PopulateAlways_m8DCF389A51877975F29FAB9B6E800DFDC1E0B8DF (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 ___settings1, const RuntimeMethod* method)
{
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 V_0;
memset(&V_0, 0, sizeof(V_0));
int32_t V_1 = 0;
int32_t V_2 = 0;
{
String_t* L_0 = ___str0;
__this->set_m_LastString_1(L_0);
__this->set_m_HasGenerated_3((bool)1);
__this->set_m_CachedVerts_8((bool)0);
__this->set_m_CachedCharacters_9((bool)0);
__this->set_m_CachedLines_10((bool)0);
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_1 = ___settings1;
__this->set_m_LastSettings_2(L_1);
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_2 = ___settings1;
TextGenerationSettings_t37703542535A1638D2A08F41DB629A483616AF68 L_3 = TextGenerator_ValidatedSettings_m167131680BB6CD53B929EF189520F9FCF71FB1D3(__this, L_2, /*hidden argument*/NULL);
V_0 = L_3;
String_t* L_4 = ___str0;
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_5 = (&V_0)->get_font_0();
Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_6 = (&V_0)->get_color_1();
int32_t L_7 = (&V_0)->get_fontSize_2();
float L_8 = (&V_0)->get_scaleFactor_5();
float L_9 = (&V_0)->get_lineSpacing_3();
int32_t L_10 = (&V_0)->get_fontStyle_6();
bool L_11 = (&V_0)->get_richText_4();
bool L_12 = (&V_0)->get_resizeTextForBestFit_9();
int32_t L_13 = (&V_0)->get_resizeTextMinSize_10();
int32_t L_14 = (&V_0)->get_resizeTextMaxSize_11();
int32_t L_15 = (&V_0)->get_verticalOverflow_13();
int32_t L_16 = (&V_0)->get_horizontalOverflow_14();
bool L_17 = (&V_0)->get_updateBounds_12();
int32_t L_18 = (&V_0)->get_textAnchor_7();
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_19 = (&V_0)->get_generationExtents_15();
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_20 = (&V_0)->get_pivot_16();
bool L_21 = (&V_0)->get_generateOutOfBounds_17();
bool L_22 = (&V_0)->get_alignByGeometry_8();
TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B(__this, L_4, L_5, L_6, L_7, L_8, L_9, L_10, L_11, L_12, L_13, L_14, L_15, L_16, L_17, L_18, L_19, L_20, L_21, L_22, (int32_t*)(&V_1), /*hidden argument*/NULL);
int32_t L_23 = V_1;
__this->set_m_LastValid_4(L_23);
int32_t L_24 = V_1;
V_2 = L_24;
goto IL_00c9;
}
IL_00c9:
{
int32_t L_25 = V_2;
return L_25;
}
}
// System.Collections.Generic.IList`1<UnityEngine.UIVertex> UnityEngine.TextGenerator::get_verts()
extern "C" IL2CPP_METHOD_ATTR RuntimeObject* TextGenerator_get_verts_mD0B3D877BE872CDE4BE3791685B8B5EF0AAC6120 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
RuntimeObject* V_0 = NULL;
{
bool L_0 = __this->get_m_CachedVerts_8();
if (L_0)
{
goto IL_0021;
}
}
{
List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_1 = __this->get_m_Verts_5();
TextGenerator_GetVertices_m6FA34586541514ED7396990542BDAC536C10A4F2(__this, L_1, /*hidden argument*/NULL);
__this->set_m_CachedVerts_8((bool)1);
}
IL_0021:
{
List_1_t4CE16E1B496C9FE941554BB47727DFDD7C3D9554 * L_2 = __this->get_m_Verts_5();
V_0 = (RuntimeObject*)L_2;
goto IL_002d;
}
IL_002d:
{
RuntimeObject* L_3 = V_0;
return L_3;
}
}
// System.Collections.Generic.IList`1<UnityEngine.UICharInfo> UnityEngine.TextGenerator::get_characters()
extern "C" IL2CPP_METHOD_ATTR RuntimeObject* TextGenerator_get_characters_m716FE1EF0738A1E6B3FBF4A1DBC46244B9594C7B (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
RuntimeObject* V_0 = NULL;
{
bool L_0 = __this->get_m_CachedCharacters_9();
if (L_0)
{
goto IL_0021;
}
}
{
List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_1 = __this->get_m_Characters_6();
TextGenerator_GetCharacters_mBB7980F2FE8BE65A906A39B5559EC54B1CEF4131(__this, L_1, /*hidden argument*/NULL);
__this->set_m_CachedCharacters_9((bool)1);
}
IL_0021:
{
List_1_tD850FBA632A52824016AAA9B3748BA38F51E087E * L_2 = __this->get_m_Characters_6();
V_0 = (RuntimeObject*)L_2;
goto IL_002d;
}
IL_002d:
{
RuntimeObject* L_3 = V_0;
return L_3;
}
}
// System.Collections.Generic.IList`1<UnityEngine.UILineInfo> UnityEngine.TextGenerator::get_lines()
extern "C" IL2CPP_METHOD_ATTR RuntimeObject* TextGenerator_get_lines_m40303E6BF9508DD46E04A21B5F5510F0FB9437CD (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
RuntimeObject* V_0 = NULL;
{
bool L_0 = __this->get_m_CachedLines_10();
if (L_0)
{
goto IL_0021;
}
}
{
List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_1 = __this->get_m_Lines_7();
TextGenerator_GetLines_mC31F7918A9159908EA914D01B2E32644B046E2B5(__this, L_1, /*hidden argument*/NULL);
__this->set_m_CachedLines_10((bool)1);
}
IL_0021:
{
List_1_t7687D8368357F4437252DC75BFCE9DE76F3143A0 * L_2 = __this->get_m_Lines_7();
V_0 = (RuntimeObject*)L_2;
goto IL_002d;
}
IL_002d:
{
RuntimeObject* L_3 = V_0;
return L_3;
}
}
// UnityEngine.Rect UnityEngine.TextGenerator::get_rectExtents()
extern "C" IL2CPP_METHOD_ATTR Rect_t35B976DE901B5423C11705E156938EA27AB402CE TextGenerator_get_rectExtents_m55F6A6727406C54BEFB7628751555B7C58BEC9B1 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
Rect_t35B976DE901B5423C11705E156938EA27AB402CE V_0;
memset(&V_0, 0, sizeof(V_0));
{
TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0(__this, (Rect_t35B976DE901B5423C11705E156938EA27AB402CE *)(&V_0), /*hidden argument*/NULL);
Rect_t35B976DE901B5423C11705E156938EA27AB402CE L_0 = V_0;
return L_0;
}
}
// System.Int32 UnityEngine.TextGenerator::get_characterCount()
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
typedef int32_t (*TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *);
static TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_get_characterCount_m2A8F9764A7BD2AD1287D3721638FB6114D6BDDC7_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::get_characterCount()");
int32_t retVal = _il2cpp_icall_func(__this);
return retVal;
}
// System.Int32 UnityEngine.TextGenerator::get_lineCount()
extern "C" IL2CPP_METHOD_ATTR int32_t TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, const RuntimeMethod* method)
{
typedef int32_t (*TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *);
static TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_get_lineCount_m7A3CC9D67099CDC4723A683716BE5FBC623EE9C4_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::get_lineCount()");
int32_t retVal = _il2cpp_icall_func(__this);
return retVal;
}
// System.IntPtr UnityEngine.TextGenerator::Internal_Create()
extern "C" IL2CPP_METHOD_ATTR intptr_t TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994 (const RuntimeMethod* method)
{
typedef intptr_t (*TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994_ftn) ();
static TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_Internal_Create_m127DBEDE47D3028812950FD9184A18C9F3A5E994_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::Internal_Create()");
intptr_t retVal = _il2cpp_icall_func();
return retVal;
}
// System.Void UnityEngine.TextGenerator::Internal_Destroy(System.IntPtr)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5 (intptr_t ___ptr0, const RuntimeMethod* method)
{
typedef void (*TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5_ftn) (intptr_t);
static TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_Internal_Destroy_mB7FE56C2FAAE16938DE8BC7256EB44643E1845A5_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::Internal_Destroy(System.IntPtr)");
_il2cpp_icall_func(___ptr0);
}
// System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32U26)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_mCA54081A0855AED6EC6345265603409FE330985C (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method)
{
{
String_t* L_0 = ___str0;
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_1 = ___font1;
int32_t L_2 = ___fontSize3;
float L_3 = ___scaleFactor4;
float L_4 = ___lineSpacing5;
int32_t L_5 = ___style6;
bool L_6 = ___richText7;
bool L_7 = ___resizeTextForBestFit8;
int32_t L_8 = ___resizeTextMinSize9;
int32_t L_9 = ___resizeTextMaxSize10;
int32_t L_10 = ___verticalOverFlow11;
int32_t L_11 = ___horizontalOverflow12;
bool L_12 = ___updateBounds13;
int32_t L_13 = ___anchor14;
float L_14 = ___extentsX15;
float L_15 = ___extentsY16;
float L_16 = ___pivotX17;
float L_17 = ___pivotY18;
bool L_18 = ___generateOutOfBounds19;
bool L_19 = ___alignByGeometry20;
uint32_t* L_20 = ___error21;
bool L_21 = TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE(__this, L_0, L_1, (Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *)(&___color2), L_2, L_3, L_4, L_5, L_6, L_7, L_8, L_9, L_10, L_11, L_12, L_13, L_14, L_15, L_16, L_17, L_18, L_19, (uint32_t*)L_20, /*hidden argument*/NULL);
return L_21;
}
}
// System.Boolean UnityEngine.TextGenerator::Populate_Internal(System.String,UnityEngine.Font,UnityEngine.Color,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,UnityEngine.VerticalWrapMode,UnityEngine.HorizontalWrapMode,System.Boolean,UnityEngine.TextAnchor,UnityEngine.Vector2,UnityEngine.Vector2,System.Boolean,System.Boolean,UnityEngine.TextGenerationErrorU26)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___extents15, Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___pivot16, bool ___generateOutOfBounds17, bool ___alignByGeometry18, int32_t* ___error19, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (TextGenerator_Populate_Internal_m42F7FED165D62BFD9C006D19A0FCE5B70C1EF92B_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
uint32_t V_1 = 0;
bool V_2 = false;
{
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_0 = ___font1;
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_1 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_0, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
if (!L_1)
{
goto IL_0019;
}
}
{
int32_t* L_2 = ___error19;
*((int32_t*)L_2) = (int32_t)4;
V_0 = (bool)0;
goto IL_006a;
}
IL_0019:
{
V_1 = 0;
String_t* L_3 = ___str0;
Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * L_4 = ___font1;
Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 L_5 = ___color2;
int32_t L_6 = ___fontSize3;
float L_7 = ___scaleFactor4;
float L_8 = ___lineSpacing5;
int32_t L_9 = ___style6;
bool L_10 = ___richText7;
bool L_11 = ___resizeTextForBestFit8;
int32_t L_12 = ___resizeTextMinSize9;
int32_t L_13 = ___resizeTextMaxSize10;
int32_t L_14 = ___verticalOverFlow11;
int32_t L_15 = ___horizontalOverflow12;
bool L_16 = ___updateBounds13;
int32_t L_17 = ___anchor14;
float L_18 = (&___extents15)->get_x_0();
float L_19 = (&___extents15)->get_y_1();
float L_20 = (&___pivot16)->get_x_0();
float L_21 = (&___pivot16)->get_y_1();
bool L_22 = ___generateOutOfBounds17;
bool L_23 = ___alignByGeometry18;
bool L_24 = TextGenerator_Populate_Internal_mCA54081A0855AED6EC6345265603409FE330985C(__this, L_3, L_4, L_5, L_6, L_7, L_8, L_9, L_10, L_11, L_12, L_13, L_14, L_15, L_16, L_17, L_18, L_19, L_20, L_21, L_22, L_23, (uint32_t*)(&V_1), /*hidden argument*/NULL);
V_2 = L_24;
int32_t* L_25 = ___error19;
uint32_t L_26 = V_1;
*((int32_t*)L_25) = (int32_t)L_26;
bool L_27 = V_2;
V_0 = L_27;
goto IL_006a;
}
IL_006a:
{
bool L_28 = V_0;
return L_28;
}
}
// System.Void UnityEngine.TextGenerator::GetVerticesInternal(System.Object)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___vertices0, const RuntimeMethod* method)
{
typedef void (*TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, RuntimeObject *);
static TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_GetVerticesInternal_mB794B94982BA35D2CDB8F3AA77880B33AEB42B9A_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::GetVerticesInternal(System.Object)");
_il2cpp_icall_func(__this, ___vertices0);
}
// System.Void UnityEngine.TextGenerator::GetCharactersInternal(System.Object)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___characters0, const RuntimeMethod* method)
{
typedef void (*TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, RuntimeObject *);
static TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_GetCharactersInternal_m4383B9A162CF10430636BFD248DDBDDB4D64E967_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::GetCharactersInternal(System.Object)");
_il2cpp_icall_func(__this, ___characters0);
}
// System.Void UnityEngine.TextGenerator::GetLinesInternal(System.Object)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, RuntimeObject * ___lines0, const RuntimeMethod* method)
{
typedef void (*TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, RuntimeObject *);
static TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_GetLinesInternal_mA54A05D512EE1CED958F73E0024FB913E648EDAD_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::GetLinesInternal(System.Object)");
_il2cpp_icall_func(__this, ___lines0);
}
// System.Void UnityEngine.TextGenerator::get_rectExtents_Injected(UnityEngine.RectU26)
extern "C" IL2CPP_METHOD_ATTR void TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0 (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, Rect_t35B976DE901B5423C11705E156938EA27AB402CE * ___ret0, const RuntimeMethod* method)
{
typedef void (*TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, Rect_t35B976DE901B5423C11705E156938EA27AB402CE *);
static TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_get_rectExtents_Injected_mD8FC9E47642590C7AC78DA83B583E5F4271842D0_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::get_rectExtents_Injected(UnityEngine.Rect&)");
_il2cpp_icall_func(__this, ___ret0);
}
// System.Boolean UnityEngine.TextGenerator::Populate_Internal_Injected(System.String,UnityEngine.Font,UnityEngine.ColorU26,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32U26)
extern "C" IL2CPP_METHOD_ATTR bool TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 * __this, String_t* ___str0, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 * ___font1, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___color2, int32_t ___fontSize3, float ___scaleFactor4, float ___lineSpacing5, int32_t ___style6, bool ___richText7, bool ___resizeTextForBestFit8, int32_t ___resizeTextMinSize9, int32_t ___resizeTextMaxSize10, int32_t ___verticalOverFlow11, int32_t ___horizontalOverflow12, bool ___updateBounds13, int32_t ___anchor14, float ___extentsX15, float ___extentsY16, float ___pivotX17, float ___pivotY18, bool ___generateOutOfBounds19, bool ___alignByGeometry20, uint32_t* ___error21, const RuntimeMethod* method)
{
typedef bool (*TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE_ftn) (TextGenerator_tD455BE18A64C7DDF854F6DB3CCEBF705121C58A8 *, String_t*, Font_t1EDE54AF557272BE314EB4B40EFA50CEB353CA26 *, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *, int32_t, float, float, int32_t, bool, bool, int32_t, int32_t, int32_t, int32_t, bool, int32_t, float, float, float, float, bool, bool, uint32_t*);
static TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextGenerator_Populate_Internal_Injected_mC1D6A0A0A9E0BFDB146EA921DA459D83FF33DEDE_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextGenerator::Populate_Internal_Injected(System.String,UnityEngine.Font,UnityEngine.Color&,System.Int32,System.Single,System.Single,UnityEngine.FontStyle,System.Boolean,System.Boolean,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean,UnityEngine.TextAnchor,System.Single,System.Single,System.Single,System.Single,System.Boolean,System.Boolean,System.UInt32&)");
bool retVal = _il2cpp_icall_func(__this, ___str0, ___font1, ___color2, ___fontSize3, ___scaleFactor4, ___lineSpacing5, ___style6, ___richText7, ___resizeTextForBestFit8, ___resizeTextMinSize9, ___resizeTextMaxSize10, ___verticalOverFlow11, ___horizontalOverflow12, ___updateBounds13, ___anchor14, ___extentsX15, ___extentsY16, ___pivotX17, ___pivotY18, ___generateOutOfBounds19, ___alignByGeometry20, ___error21);
return retVal;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.TextMesh::set_text(System.String)
extern "C" IL2CPP_METHOD_ATTR void TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, String_t* ___value0, const RuntimeMethod* method)
{
typedef void (*TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, String_t*);
static TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextMesh_set_text_m64242AB987CF285F432E7AED38F24FF855E9B220_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_text(System.String)");
_il2cpp_icall_func(__this, ___value0);
}
// System.Void UnityEngine.TextMesh::set_color(UnityEngine.Color)
extern "C" IL2CPP_METHOD_ATTR void TextMesh_set_color_mF86B9E8CD0F9FD387AF7D543337B5C14DFE67AF0 (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 ___value0, const RuntimeMethod* method)
{
{
TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA(__this, (Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *)(&___value0), /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.TextMesh::set_color_Injected(UnityEngine.ColorU26)
extern "C" IL2CPP_METHOD_ATTR void TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A * __this, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 * ___value0, const RuntimeMethod* method)
{
typedef void (*TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA_ftn) (TextMesh_t327D0DAFEF431170D8C2882083D442AF4D4A0E4A *, Color_t119BCA590009762C7223FDD3AF9706653AC84ED2 *);
static TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TextMesh_set_color_Injected_mF49AFC2EAF7A66132B87F41576FFAE0722E179AA_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TextMesh::set_color_Injected(UnityEngine.Color&)");
_il2cpp_icall_func(__this, ___value0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.UIVertex::.cctor()
extern "C" IL2CPP_METHOD_ATTR void UIVertex__cctor_m86F60F5BB996D3C59B19B80C4BFB5770802BFB30 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (UIVertex__cctor_m86F60F5BB996D3C59B19B80C4BFB5770802BFB30_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 V_0;
memset(&V_0, 0, sizeof(V_0));
{
Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 L_0;
memset(&L_0, 0, sizeof(L_0));
Color32__ctor_m1AEF46FBBBE4B522E6984D081A3D158198E10AA2((&L_0), (uint8_t)((int32_t)255), (uint8_t)((int32_t)255), (uint8_t)((int32_t)255), (uint8_t)((int32_t)255), /*hidden argument*/NULL);
((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->set_s_DefaultColor_8(L_0);
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E L_1;
memset(&L_1, 0, sizeof(L_1));
Vector4__ctor_m545458525879607A5392A10B175D0C19B2BC715D((&L_1), (1.0f), (0.0f), (0.0f), (-1.0f), /*hidden argument*/NULL);
((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->set_s_DefaultTangent_9(L_1);
il2cpp_codegen_initobj((&V_0), sizeof(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 ));
IL2CPP_RUNTIME_CLASS_INIT(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_il2cpp_TypeInfo_var);
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_2 = Vector3_get_zero_m3CDDCAE94581DF3BB16C4B40A100E28E9C6649C2(/*hidden argument*/NULL);
(&V_0)->set_position_0(L_2);
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_3 = Vector3_get_back_mE7EF8625637E6F8B9E6B42A6AE140777C51E02F7(/*hidden argument*/NULL);
(&V_0)->set_normal_1(L_3);
Vector4_tD148D6428C3F8FF6CD998F82090113C2B490B76E L_4 = ((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->get_s_DefaultTangent_9();
(&V_0)->set_tangent_2(L_4);
Color32_t23ABC4AE0E0BDFD2E22EE1FA0DA3904FFE5F6E23 L_5 = ((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->get_s_DefaultColor_8();
(&V_0)->set_color_3(L_5);
IL2CPP_RUNTIME_CLASS_INIT(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_il2cpp_TypeInfo_var);
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_6 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL);
(&V_0)->set_uv0_4(L_6);
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_7 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL);
(&V_0)->set_uv1_5(L_7);
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_8 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL);
(&V_0)->set_uv2_6(L_8);
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_9 = Vector2_get_zero_mFE0C3213BB698130D6C5247AB4B887A59074D0A8(/*hidden argument*/NULL);
(&V_0)->set_uv3_7(L_9);
UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577 L_10 = V_0;
((UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_StaticFields*)il2cpp_codegen_static_fields_for(UIVertex_t0583C35B730B218B542E80203F5F4BC6F1E9E577_il2cpp_TypeInfo_var))->set_simpleVert_10(L_10);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"tolegen.akhmetov@nu.edu.kz"
] | tolegen.akhmetov@nu.edu.kz |
81ce946814b199cc0140cdb7bc6cff791d4275a4 | b1c317e8aeef0ce6ea5b49c590a0d640f0488bf9 | /Book/Chapter 7 /Points and Lines: CP 7.1, 7.2.1, 7.2.2/UVa 587 - There's treasure everywhere!.cpp | da0537ef5595f3b1daa68f31fe8deec03b97d4aa | [] | no_license | akramsameer/Problems | e94ee6b49f8333c98f0cc60282a88f475f8a04f6 | 8df3ca030c9c1381388902759b6f391e25463cdf | refs/heads/master | 2021-01-01T15:47:31.497082 | 2018-06-04T18:38:58 | 2018-06-04T18:38:58 | 97,703,981 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,854 | cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long int
#define EPS 1e-9
using namespace std;
#define clr(v , d) memset(v , d , sizeof v)
#define sz(v) ((int)(v).size())
const int VISITED = 1;
const int UNVISITED = -1;
const long long OO = 1e12;
const int OOI = 1e9;
const double PI = acos(-1.0);
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
int xdir[] = { 1, -1, 0, 0 };
int ydir[] = { 0, 0, -1, 1 };
void file() {
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif
}
string str;
map<string, pair<double, double> > mp;
struct point {
double x, y;
point() {
x = y = 0.0;
}
point(double _x, double _y) :
x(_x), y(_y) {
}
;
};
int tc = 1;
double dist(point p1, point p2) {
return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p2.y - p1.y) * (p2.y - p1.y));
}
int main() {
file();
mp["N"] = make_pair(0, 1), mp["S"] = make_pair(0, -1), mp["E"] = make_pair(
1, 0), mp["W"] = make_pair(-1, 0);
mp["NE"] = make_pair(1 / sqrt(2),1/ sqrt(2)), mp["NW"] = make_pair(-1/sqrt(2), 1/sqrt(2)), mp["SW"] =
make_pair(-1/sqrt(2), -1/sqrt(2)), mp["SE"] = make_pair(1/sqrt(2), -1/sqrt(2));
while (getline(cin, str)) {
if (str[0] == 'E' && str[1] == 'N' and str[2] == 'D')
break;
int steps = 0;
point s = point();
string key = "";
for (int i = 0; i < sz(str); i++) {
if (str[i] == ',' || str[i] == '.') {
pair<double, double> cur = mp[key];
s.x += steps * cur.first;
s.y += steps * cur.second;
key = "";
steps = 0;
} else if (isdigit(str[i]))
steps = (steps * 10) + (str[i] - '0');
else {
key.push_back(str[i]);
}
}
printf("Map #%d\n", tc++);
printf("The treasure is located at (%.3lf,%.3lf).\n", s.x, s.y);
printf("The distance to the treasure is %.3lf.\n\n", dist(point(), s));
}
return 0;
}
| [
"akram.sameer99@gmail.com"
] | akram.sameer99@gmail.com |
065c92d48c1aff9760b1210ef8f6e66f2e95674a | 80c18f56f65b60b72b723815654a251dbecd4125 | /app/src/main/cpp/MyPlayerStatus.h | ced5da2641a415bd7d13455203c63a8388357339 | [] | no_license | tck8888/MyPlayer | 4f1e00c63e027ba6919f2b0b59b52dbd65cb8e79 | d7f35ed4dce2d74b0ebb354754d65d6c6df4d1be | refs/heads/main | 2023-01-20T15:51:30.489560 | 2020-12-02T11:06:08 | 2020-12-02T11:06:08 | 315,661,823 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 316 | h | //
// Created by tck on 2020/11/27.
//
#ifndef MYMUSICPLAYER_MYPLAYERSTATUS_H
#define MYMUSICPLAYER_MYPLAYERSTATUS_H
class MyPlayerStatus {
public:
bool exit= false;
bool load= true;
bool seek = false;
public:
MyPlayerStatus();
~MyPlayerStatus();
};
#endif //MYMUSICPLAYER_MYPLAYERSTATUS_H
| [
"tck@dra100.com"
] | tck@dra100.com |
ca1f4e4598ecc85cbaa6033eef5b50bfaad7525e | 63e3790fdea6838baf8451281baa21e47cd5c4e4 | /OpenGL4/OpenGL4/Source/System/Timer.cpp | ccd1e1029c340ce18c4b40324ea81ba53a11ca3a | [] | no_license | Velktri/ModernGLFun | eb2356111fab6bd4e1707db4e8267a95c2956dd1 | 0772b4f4d7a397c04f46862868b476b82e9b6500 | refs/heads/master | 2021-01-13T16:40:32.310784 | 2017-12-24T10:35:01 | 2017-12-24T10:35:01 | 78,192,959 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 734 | cpp | #include "Timer.h"
Timer::Timer() {
bIsClockRunning = false;
DeltaTime = 0.0f;
LastFrame = 0.0f;
}
Timer::~Timer() {
}
void Timer::Start() {
if (!bIsClockRunning) {
TimeStart = std::chrono::high_resolution_clock::now();
bIsClockRunning = true;
}
}
void Timer::Stop() {
if (bIsClockRunning) {
bIsClockRunning = false;
}
DeltaTime = 0;
LastFrame = 0;
}
void Timer::Update() {
if (bIsClockRunning) {
TimeNow = std::chrono::high_resolution_clock::now();
float time = std::chrono::duration_cast<std::chrono::duration<float>>(TimeNow - TimeStart).count();
DeltaTime = time - LastFrame;
LastFrame = time;
}
}
GLfloat Timer::GetDeltaTime() {
return DeltaTime;
}
GLfloat Timer::GetTime() {
return LastFrame;
} | [
"murrayg2@gmail.com"
] | murrayg2@gmail.com |
02e5bb2b4c498eac68e2cee60ab7aef9b7db0c43 | f9ceb2540a6899d401d72ca4db628bf39ada5401 | /aten/src/ATen/mps/MPSAllocator.h | 72c0024807255e4fa27c628495c882584d3ce7d3 | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"BSL-1.0",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | zhuangh/pytorch | 4d03fdb822071d4e85f7d2008079aeb834143554 | f11cce309bf290151a21b2ac8e79bf2a24dcf2f3 | refs/heads/master | 2023-03-15T11:42:05.827978 | 2022-06-25T12:40:52 | 2022-06-25T12:40:52 | 507,397,273 | 0 | 0 | NOASSERTION | 2022-06-25T19:13:38 | 2022-06-25T19:13:37 | null | UTF-8 | C++ | false | false | 10,231 | h | // Copyright © 2022 Apple Inc.
#include <ATen/Tensor.h>
#include <ATen/ATen.h>
#include <ATen/Utils.h>
#include <torch/library.h>
#include <c10/util/flat_hash_map.h>
#include <ATen/mps/MPSDevice.h>
#include <cstdio>
#include <mutex>
#include <set>
#include <utility>
#include <mach/vm_page_size.h>
#ifdef __OBJC__
#include <Foundation/Foundation.h>
#include <Metal/Metal.h>
#include <Metal/MTLHeap.h>
#include <MetalPerformanceShaders/MetalPerformanceShaders.h>
#endif
// this implementation is based on CUDACachingAllocator.
// It utilizes Metal Heaps to improve the performance with buffer allocation.
// TODO: Unify the logic with CUDACachingAllocator and remove redundant code.
namespace at {
namespace mps {
class IMpsAllocatorCallback {
public:
enum class EventType {
ALLOCATED, // buffer got allocated to be used immediately
RECYCLED, // buffer pulled from free list to be reused
FREED, // buffer put to free list for future recycling
RELEASED, // buffer memory released
};
virtual ~IMpsAllocatorCallback() = default;
virtual void executeMPSAllocatorCallback(void* ptr, EventType event) = 0;
};
// MPS allocator will execute every registered callback when a block of memory is freed.
C10_DECLARE_REGISTRY(MPSAllocatorCallbacksRegistry, IMpsAllocatorCallback);
#define REGISTER_MPS_ALLOCATOR_CALLBACK(name, ...) \
C10_REGISTER_CLASS(MPSAllocatorCallbacksRegistry, name, __VA_ARGS__);
namespace HeapAllocator {
#define MB(x) round_page(x * 1048576UL)
static const size_t kMaxSmallAlloc = MB(1); // largest "small" allocation is 1 MiB
static const size_t kMinLargeAlloc = MB(10); // allocations between 1 and 10 MiB may use kLargeHeap
static const size_t kSmallHeap = MB(8); // "small" allocations are packed in 8 MiB heaps
static const size_t kLargeHeap = MB(32); // "large" allocations may be packed in 32 MiB heaps
static const size_t kRoundLarge = MB(2); // round up large allocations to 2 MiB
// TODO: check the caching performance of write-combined mode
constexpr MTLResourceOptions kCPUCacheMode = MTLResourceOptionCPUCacheModeDefault;
constexpr MTLResourceOptions kPrivateResourceOptions = kCPUCacheMode | MTLResourceStorageModePrivate;
constexpr MTLResourceOptions kSharedResourceOptions = kCPUCacheMode | MTLResourceStorageModeShared;
struct HeapBlock;
struct BufferBlock
{
id<MTLBuffer> buffer;
size_t size;
bool in_use;
HeapBlock* heap;
id_t buf_id;
BufferBlock(size_t Size, const id<MTLBuffer> Buffer = nullptr, HeapBlock* Heap = nullptr, id_t BufID = 0) :
buffer(Buffer), size(Size), in_use(false), heap(Heap), buf_id(BufID) { }
static bool Comparator(const BufferBlock* a, const BufferBlock* b) {
return (a->size != b->size) ? a->size < b->size : (uintptr_t)a->buffer < (uintptr_t)b->buffer;
}
static size_t alignUp(size_t Size, size_t Alignment) {
assert(((Alignment - 1) & Alignment) == 0);
return ((Size + Alignment - 1) & ~(Alignment - 1));
}
};
typedef bool (*BufferComparison)(const BufferBlock*, const BufferBlock*);
struct BufferPool;
struct HeapBlock
{
id<MTLHeap> heap;
struct { size_t total, available; } size;
BufferPool* pool;
unsigned int n_buffers;
HeapBlock(size_t Size, const id<MTLHeap> Heap = nullptr, BufferPool *Pool = nullptr) :
heap(Heap), size({.total = Size, .available = Size}), pool(Pool), n_buffers(0) { }
static MTLResourceOptions getOptions(bool SharedStorage = false) { return SharedStorage ? kSharedResourceOptions : kPrivateResourceOptions; }
static id<MTLHeap> createMTLHeap(id<MTLDevice> device, size_t size, bool is_shared) {
id<MTLHeap> heap = nil;
MTLHeapDescriptor *d = [MTLHeapDescriptor new];
if (d) {
if (size <= kMaxSmallAlloc) {
d.size = kSmallHeap;
} else if (size < kMinLargeAlloc) {
d.size = kLargeHeap;
} else {
d.size = kRoundLarge * ((size + kRoundLarge - 1) / kRoundLarge);
}
d.storageMode = is_shared ? MTLStorageModeShared : MTLStorageModePrivate;
d.cpuCacheMode = MTLCPUCacheModeDefaultCache;
// this automatically handles Metal buffer access synchronizations at the
// cost of slightly lower performance.
d.hazardTrackingMode = MTLHazardTrackingModeTracked;
d.resourceOptions = getOptions(is_shared) | (MTLHazardTrackingModeTracked << MTLResourceHazardTrackingModeShift);
d.type = MTLHeapTypeAutomatic;
heap = [device newHeapWithDescriptor: d];
if (heap) {
[heap setPurgeableState:MTLPurgeableStateNonVolatile];
}
[d release];
}
return heap;
}
static bool Comparator(const HeapBlock* a, const HeapBlock* b) {
return a->size.available < b->size.available;
}
static NSUInteger heapAvailableSize(id<MTLHeap> heap, size_t Alignment = vm_page_size) {
return [heap maxAvailableSizeWithAlignment:Alignment];
}
id<MTLBuffer> newMTLBuffer(size_t length, bool is_shared) {
id<MTLBuffer> buf = [heap newBufferWithLength:length options:getOptions(is_shared)];
if (buf) {
size.available = heapAvailableSize(heap);
n_buffers++;
}
return buf;
}
void releaseMTLBuffer(id<MTLBuffer> buffer) {
[buffer release];
size.available = heapAvailableSize(heap);
n_buffers--;
}
void releaseMTLHeap() {
TORCH_INTERNAL_ASSERT(!n_buffers); // assert if heap isn't empty
[heap release];
size.available = 0;
}
};
typedef bool (*HeapComparison)(const HeapBlock*, const HeapBlock*);
struct BufferPool
{
BufferPool(const id<MTLDevice> Device, bool Small, bool Shared) :
device(Device), is_small(Small), is_shared(Shared),
heaps(HeapBlock::Comparator), buffers(BufferBlock::Comparator) { }
const id<MTLDevice> device;
// small heaps have sizes of kSmallHeap, and large ones kLargeHeap
const bool is_small;
// private pools allocated on device memory; otherwise, shared between host/device
const bool is_shared;
// list of heaps ordered by their "available" (not total) memory size
std::set<HeapBlock*, HeapComparison> heaps;
// list of only "available" buffers in the pool (i.e., buffers not in-use)
std::set<BufferBlock*, BufferComparison> buffers;
};
struct AllocParams
{
AllocParams(size_t Alloc_Size, size_t Requested_Size, BufferPool* Pool) :
search_key(Alloc_Size), pool(Pool),
buffer_block(nullptr), requested_size(Requested_Size) {}
size_t size() const { return search_key.size; }
BufferBlock search_key;
BufferPool* pool;
BufferBlock* buffer_block;
size_t requested_size;
};
class MPSHeapAllocatorImpl
{
public:
explicit MPSHeapAllocatorImpl() :
m_device(at::mps::MPSDevice::getInstance()->device()),
m_large_pool_shared(m_device, false, true), m_large_pool_private(m_device, false, false),
m_small_pool_shared(m_device, true , true), m_small_pool_private(m_device, true , false),
m_total_allocated_memory(0), m_max_buffer_size([m_device maxBufferLength]),
m_set_fraction(false), m_enable_debug_info(false) { }
// interface exposed to at::Allocator
id<MTLBuffer> Malloc(size_t size, bool sharedStorage);
void Free(void* ptr);
void EmptyCache();
bool isSharedBuffer(void* ptr);
inline id<MTLDevice> Device() const { return m_device; }
void enable_debug_info() { m_enable_debug_info = true; }
bool debug_info_enabled() const { return m_enable_debug_info; }
void set_shared_storage_mode(bool useSharedStorage);
private:
const id<MTLDevice> m_device;
std::mutex m_mutex;
// allocated buffers by device pointer
ska::flat_hash_map<void*, BufferBlock*> m_allocated_buffers;
// unallocated cached buffers larger than 1 MB
BufferPool m_large_pool_shared, m_large_pool_private;
// unallocated cached buffers 1 MB or smaller
BufferPool m_small_pool_shared, m_small_pool_private;
// total memory allocated by HeapAllocator
size_t m_total_allocated_memory;
// max buffer size allowed by Metal
size_t m_max_buffer_size;
// sets a soft upper bound to limit the total allocations
bool m_set_fraction;
// use "PYTORCH_DEBUG_MPS_ALLOCATOR" env-var to enable debug info
bool m_enable_debug_info;
HeapBlock* get_free_heap(AllocParams& p);
bool get_free_buffer(AllocParams& p);
BufferBlock* get_allocated_buffer_block(void* ptr);
bool alloc_buffer(AllocParams& p);
void free_buffer(BufferBlock* buffer_block);
void release_buffer(BufferBlock* buffer_block, bool remove_empty_heap = true);
void release_buffers(BufferPool& pool);
bool release_available_cached_buffers(const AllocParams& p);
bool release_cached_buffers();
void trigger_memory_callbacks(BufferBlock* buffer_block, IMpsAllocatorCallback::EventType event);
BufferPool& get_pool(size_t Size, bool useShared) {
return Size <= kMaxSmallAlloc ? (useShared ? m_small_pool_shared : m_small_pool_private) :
(useShared ? m_large_pool_shared : m_large_pool_private);
}
size_t get_allocation_size(size_t Length, bool useShared) {
MTLSizeAndAlign sizeAlign = [m_device heapBufferSizeAndAlignWithLength:Length
options:HeapBlock::getOptions(useShared)];
return BufferBlock::alignUp(sizeAlign.size, sizeAlign.align);
}
// TODO: make this configurable
static size_t max_split_size() { return std::numeric_limits<size_t>::max(); }
// maximum size of device memory available for allocation in current process
size_t max_available_size() const { return [m_device recommendedMaxWorkingSetSize] - [m_device currentAllocatedSize]; }
// TODO: make a common function to do size unit conversions in PyTorch.
static std::string format_size(uint64_t size) {
std::ostringstream os;
os.precision(2);
os << std::fixed;
if (size <= 1024UL) { os << size << " bytes"; }
else if (size <= 1048576UL) { os << ((float) size / 1024.0) << " KB"; }
else if (size <= 1073741824UL) { os << ((float) size / 1048576.0) << " MB"; }
else { os << ((float) size / 1073741824.0) << " GB"; }
return os.str();
}
};
} // namespace HeapAllocator
} // namespace mps
} // namespace at
| [
"pytorchmergebot@users.noreply.github.com"
] | pytorchmergebot@users.noreply.github.com |
912582a2fefcfa1dc34c28211254762f5181679c | cfcdc526fef660f71cdb84e12e20efbeee623584 | /src/simulator.cpp | 6eb4f12f233e711c7e5e52f8d493dd52702af438 | [] | no_license | dragon12/simulator | b770aec8a45d18df7b2488797309249ddca9b0fb | 601424ebe6281a6bca02529f3e6d5814b13fe86b | refs/heads/master | 2020-05-17T06:49:59.986247 | 2014-07-23T05:46:23 | 2014-07-23T05:46:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 447 | cpp | //============================================================================
// Name : feedhandler.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
| [
"gerard0sweeney@gmail.com"
] | gerard0sweeney@gmail.com |
560786e3b49988ce07ff94e8ebf7b4d4381d9f9f | 73602f288599dd105b544b3ea7b4af02cf161623 | /deps/lld/COFF/Writer.h | 21be1be6e92a5a0018318d5cb5e14909a75e8749 | [
"MIT",
"NCSA",
"LicenseRef-scancode-free-unknown"
] | permissive | mdsteele/zig | 530795a84d3495c8d8a5810672049c6379186b53 | 53b18b079189cce355767ce4fde4fc586f0d3248 | refs/heads/master | 2020-03-24T19:55:18.174466 | 2018-08-18T00:15:39 | 2018-08-18T00:15:39 | 142,950,461 | 0 | 0 | MIT | 2018-08-04T18:38:52 | 2018-07-31T02:13:53 | C++ | UTF-8 | C++ | false | false | 2,401 | h | //===- Writer.h -------------------------------------------------*- C++ -*-===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLD_COFF_WRITER_H
#define LLD_COFF_WRITER_H
#include "Chunks.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Object/COFF.h"
#include <cstdint>
#include <vector>
namespace lld {
namespace coff {
static const int PageSize = 4096;
void writeResult();
// OutputSection represents a section in an output file. It's a
// container of chunks. OutputSection and Chunk are 1:N relationship.
// Chunks cannot belong to more than one OutputSections. The writer
// creates multiple OutputSections and assign them unique,
// non-overlapping file offsets and RVAs.
class OutputSection {
public:
OutputSection(llvm::StringRef N) : Name(N), Header({}) {}
void setRVA(uint64_t);
void setFileOffset(uint64_t);
void addChunk(Chunk *C);
llvm::StringRef getName() { return Name; }
ArrayRef<Chunk *> getChunks() { return Chunks; }
void addPermissions(uint32_t C);
void setPermissions(uint32_t C);
uint32_t getPermissions() { return Header.Characteristics & PermMask; }
uint32_t getCharacteristics() { return Header.Characteristics; }
uint64_t getRVA() { return Header.VirtualAddress; }
uint64_t getFileOff() { return Header.PointerToRawData; }
void writeHeaderTo(uint8_t *Buf);
// Returns the size of this section in an executable memory image.
// This may be smaller than the raw size (the raw size is multiple
// of disk sector size, so there may be padding at end), or may be
// larger (if that's the case, the loader reserves spaces after end
// of raw data).
uint64_t getVirtualSize() { return Header.VirtualSize; }
// Returns the size of the section in the output file.
uint64_t getRawSize() { return Header.SizeOfRawData; }
// Set offset into the string table storing this section name.
// Used only when the name is longer than 8 bytes.
void setStringTableOff(uint32_t V) { StringTableOff = V; }
// N.B. The section index is one based.
uint32_t SectionIndex = 0;
private:
llvm::StringRef Name;
llvm::object::coff_section Header;
uint32_t StringTableOff = 0;
std::vector<Chunk *> Chunks;
};
}
}
#endif
| [
"superjoe30@gmail.com"
] | superjoe30@gmail.com |
fe676462f002bb7ab4176dfc45dcff9483cb0867 | 41e7251063f265b98df8d612473068bec2465997 | /include/framework/log/SMFILogAppender.h | 09977a1f583da20aaa3239589a91250085d1ece8 | [] | no_license | inbei/smf | fefd47a96559483aa396861fd23aca9e29e49d04 | 702f6a296d4db28bfeed88718d4da6d2f801023a | refs/heads/main | 2023-03-16T06:38:27.542161 | 2020-12-17T06:09:17 | 2020-12-17T06:09:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 672 | h | #ifndef SMF_ILOG_APPENDER_H
#define SMF_ILOG_APPENDER_H
#include "SMFLogPrerequisites.h"
namespace surveon
{
namespace mf
{
namespace log
{
class IAppender
{
public:
virtual ~IAppender(void) {}
//virtual const String& getName(void) const = 0;
virtual AppenderContext* getContext(void) = 0;
};
class IFileAppender : public IAppender
{
public:
virtual ~IFileAppender(void) {}
//virtual const String& getFilename(void) const = 0;
};
class IRollingFileAppender : public IFileAppender
{
public:
virtual ~IRollingFileAppender(void) {}
};
} // namespace log
} // namespace mf
} // namespace surveon
#endif // SMF_ILOG_APPENDER_H
| [
"younianhuang@gmail.com"
] | younianhuang@gmail.com |
6a84c073af18771f82e81c86e00116c7cd53faa3 | 6d54a7b26d0eb82152a549a6a9dfde656687752c | /src/lib/dnssd/tests/TestServiceNaming.cpp | 646a51e39f4806038aebbe402cb9e7685b2302a3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | project-chip/connectedhomeip | 81a123d675cf527773f70047d1ed1c43be5ffe6d | ea3970a7f11cd227ac55917edaa835a2a9bc4fc8 | refs/heads/master | 2023-09-01T11:43:37.546040 | 2023-09-01T08:01:32 | 2023-09-01T08:01:32 | 244,694,174 | 6,409 | 1,789 | Apache-2.0 | 2023-09-14T20:56:31 | 2020-03-03T17:05:10 | C++ | UTF-8 | C++ | false | false | 13,755 | cpp | /*
*
* Copyright (c) 2021 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <lib/dnssd/ServiceNaming.h>
#include <string.h>
#include <lib/support/UnitTestRegistration.h>
#include <nlunit-test.h>
using namespace chip;
using namespace chip::Dnssd;
namespace {
void TestMakeInstanceName(nlTestSuite * inSuite, void * inContext)
{
char buffer[128];
NL_TEST_ASSERT(inSuite,
MakeInstanceName(buffer, sizeof(buffer), PeerId().SetCompressedFabricId(0x1234).SetNodeId(0x5678)) ==
CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "0000000000001234-0000000000005678") == 0);
NL_TEST_ASSERT(inSuite,
MakeInstanceName(buffer, sizeof(buffer),
PeerId().SetCompressedFabricId(0x1122334455667788ULL).SetNodeId(0x123456789abcdefULL)) ==
CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "1122334455667788-0123456789ABCDEF") == 0);
// insufficient buffer size:
// buffer needs at least space for hex encoding + separator + 0 terminator
constexpr size_t kMinBufferSize = 2 * 16 + 1 + 1;
for (size_t shortSize = 0; shortSize < kMinBufferSize; shortSize++)
{
NL_TEST_ASSERT(inSuite, MakeInstanceName(buffer, shortSize, PeerId()) != CHIP_NO_ERROR);
}
NL_TEST_ASSERT(inSuite, MakeInstanceName(buffer, kMinBufferSize, PeerId()) == CHIP_NO_ERROR);
}
void TestExtractIdFromInstanceName(nlTestSuite * inSuite, void * inContext)
{
PeerId peerId;
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName(nullptr, nullptr) == CHIP_ERROR_INVALID_ARGUMENT);
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("ACDEF1234567890-1234567890ABCDEF", nullptr) == CHIP_ERROR_INVALID_ARGUMENT);
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName(nullptr, &peerId) == CHIP_ERROR_INVALID_ARGUMENT);
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("ABCDEF1234567890-1234567890ABCDEF", &peerId) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, peerId == PeerId().SetCompressedFabricId(0xABCDEF1234567890ULL).SetNodeId(0x1234567890ABCDEFULL));
// ending in period (partial name) is acceptable
NL_TEST_ASSERT(inSuite,
ExtractIdFromInstanceName("1122334455667788-AABBCCDDEEFF1122.some.suffix.here", &peerId) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, peerId == PeerId().SetCompressedFabricId(0x1122334455667788ULL).SetNodeId(0xaabbccddeeff1122ULL));
// Invalid: non hex character
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1x22334455667788-AABBCCDDEEDD1122", &peerId) != CHIP_NO_ERROR);
// Invalid: missing node id part (no - separator)
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1122334455667788x2233445566778899", &peerId) != CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1122334455667788x2233445566778899.12-33.4455", &peerId) != CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1122334455667788x2233445566778899.4455", &peerId) != CHIP_NO_ERROR);
// Invalid: missing part
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("-1234567890ABCDEF", &peerId) != CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1234567890ABCDEF-", &peerId) != CHIP_NO_ERROR);
// Invalid: separator in wrong place
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("112233445566778-8AABBCCDDEEFF1122", &peerId) != CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1122334455667788A-ABBCCDDEEFF1122", &peerId) != CHIP_NO_ERROR);
// Invalid: fabric part too short
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("11223344556677-AABBCCDDEEFF1122", &peerId) != CHIP_NO_ERROR);
// Invalid: fabric part too long
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("112233445566778899-AABBCCDDEEFF1122", &peerId) != CHIP_NO_ERROR);
// Invalid: node part too short
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1122334455667788-AABBCCDDEEFF11", &peerId) != CHIP_NO_ERROR);
// Invalid: node part too long
NL_TEST_ASSERT(inSuite, ExtractIdFromInstanceName("1122334455667788-AABBCCDDEEFF112233", &peerId) != CHIP_NO_ERROR);
}
void TestMakeServiceNameSubtype(nlTestSuite * inSuite, void * inContext)
{
constexpr size_t kSize = 19;
char buffer[kSize];
DiscoveryFilter filter;
// Long tests
filter.type = DiscoveryFilterType::kLongDiscriminator;
filter.code = 3;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_L3") == 0);
filter.code = (1 << 12) - 1;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_L4095") == 0);
filter.code = 1 << 12;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) != CHIP_NO_ERROR);
// Short tests
filter.type = DiscoveryFilterType::kShortDiscriminator;
filter.code = 3;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_S3") == 0);
filter.code = (1 << 4) - 1;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_S15") == 0);
filter.code = 1 << 4;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) != CHIP_NO_ERROR);
// Vendor tests
filter.type = DiscoveryFilterType::kVendorId;
filter.code = 3;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_V3") == 0);
filter.code = 0xFFFF;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_V65535") == 0);
filter.code = 1 << 16;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) != CHIP_NO_ERROR);
// Device Type tests
filter.type = DiscoveryFilterType::kDeviceType;
filter.code = 3;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_T3") == 0);
// TODO: Add tests for longer device types once spec issue #3226 is closed.
// Commissioning mode tests
filter.type = DiscoveryFilterType::kCommissioningMode;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_CM") == 0);
// Compressed fabric ID tests.
filter.type = DiscoveryFilterType::kCompressedFabricId;
filter.code = 0xABCD12341111BBBB;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_IABCD12341111BBBB") == 0);
// None tests.
filter.type = DiscoveryFilterType::kNone;
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "") == 0);
// instance name - "1234567890123456._matterc"
filter.type = DiscoveryFilterType::kInstanceName;
filter.instanceName = (char *) "1234567890123456";
NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "1234567890123456") == 0);
}
void TestMakeServiceTypeName(nlTestSuite * inSuite, void * inContext)
{
// TODO(cecille): These need to be changed to remove leading zeros
constexpr size_t kSize = 128;
char buffer[kSize];
DiscoveryFilter filter;
// Long tests
filter.type = DiscoveryFilterType::kLongDiscriminator;
filter.code = 3;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_L3._sub._matterc") == 0);
filter.code = (1 << 12) - 1;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_L4095._sub._matterc") == 0);
filter.code = 1 << 12;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) != CHIP_NO_ERROR);
// Short tests
filter.type = DiscoveryFilterType::kShortDiscriminator;
filter.code = 3;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_S3._sub._matterc") == 0);
filter.code = (1 << 4) - 1;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_S15._sub._matterc") == 0);
filter.code = 1 << 4;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) != CHIP_NO_ERROR);
// Vendor tests
filter.type = DiscoveryFilterType::kVendorId;
filter.code = 3;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_V3._sub._matterc") == 0);
filter.code = (1 << 16) - 1;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_V65535._sub._matterc") == 0);
filter.code = 1 << 16;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) != CHIP_NO_ERROR);
// Device Type tests
filter.type = DiscoveryFilterType::kDeviceType;
filter.code = 3;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_T3._sub._matterc") == 0);
// Commissioning mode tests
filter.type = DiscoveryFilterType::kCommissioningMode;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_CM._sub._matterc") == 0);
// Compressed fabric ID tests
filter.type = DiscoveryFilterType::kCompressedFabricId;
filter.code = 0x1234ABCD0000AAAA;
NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kOperational) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_I1234ABCD0000AAAA._sub._matter") == 0);
// None tests
filter.type = DiscoveryFilterType::kNone;
NL_TEST_ASSERT(inSuite,
MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_matterc") == 0);
filter.type = DiscoveryFilterType::kNone;
NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionerNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_matterd") == 0);
// Test buffer just under the right size - "_matterc" = 8 + nullchar = 9
filter.type = DiscoveryFilterType::kNone;
NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, 8, filter, DiscoveryType::kCommissionableNode) == CHIP_ERROR_NO_MEMORY);
// Test buffer exactly the right size - "_matterc" = 8 + nullchar = 9
filter.type = DiscoveryFilterType::kNone;
NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, 9, filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_matterc") == 0);
// Test buffer exactly the right size for subtype - "_CM._sub._matterc" = 17 + nullchar = 18
filter.type = DiscoveryFilterType::kCommissioningMode;
NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, 18, filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, strcmp(buffer, "_CM._sub._matterc") == 0);
}
const nlTest sTests[] = {
NL_TEST_DEF("MakeInstanceName", TestMakeInstanceName), //
NL_TEST_DEF("ExtractIdFromInstandceName", TestExtractIdFromInstanceName), //
NL_TEST_DEF("TestMakeServiceNameSubtype", TestMakeServiceNameSubtype), //
NL_TEST_DEF("TestMakeCommisisonableNodeServiceTypeName", TestMakeServiceTypeName), //
NL_TEST_SENTINEL() //
};
} // namespace
int TestCHIPServiceNaming()
{
nlTestSuite theSuite = { "ServiceNaming", &sTests[0], nullptr, nullptr };
nlTestRunner(&theSuite, nullptr);
return nlTestRunnerStats(&theSuite);
}
CHIP_REGISTER_TEST_SUITE(TestCHIPServiceNaming)
| [
"noreply@github.com"
] | project-chip.noreply@github.com |
f2062253dd1418f83c9f95962fdc3e95570ed582 | 187ce9d4df99208c3db0e44f3db6a3df4ce34717 | /C++/209.minimum-size-subarray-sum.cpp | e89bfdef6ac55d5062ead2115068f34cc184a1c7 | [] | no_license | zhoujf620/LeetCode-Practice | 5098359fbebe07ffa0d13fe40236cecf80c12507 | 8babc83cefc6722b9845f61ef5d15edc99648cb6 | refs/heads/master | 2022-09-26T21:49:59.248276 | 2022-09-21T14:33:03 | 2022-09-21T14:33:03 | 222,195,315 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,130 | cpp | /*
* @lc app=leetcode id=209 lang=cpp
*
* [209] Minimum Size Subarray Sum
*
* https://leetcode.com/problems/minimum-size-subarray-sum/description/
*
* algorithms
* Medium (36.50%)
* Likes: 1656
* Dislikes: 91
* Total Accepted: 222.6K
* Total Submissions: 609.5K
* Testcase Example: '7\n[2,3,1,2,4,3]'
*
* Given an array of n positive integers and a positive integer s, find the
* minimal length of a contiguous subarray of which the sum ≥ s. If there isn't
* one, return 0 instead.
*
* Example:
*
*
* Input: s = 7, nums = [2,3,1,2,4,3]
* Output: 2
* Explanation: the subarray [4,3] has the minimal length under the problem
* constraint.
*
* Follow up:
*
* If you have figured out the O(n) solution, try coding another solution of
* which the time complexity is O(n log n).
*
*/
#include<vector>
#include<numeric>
using namespace std;
// @lc code=start
class Solution {
public:
// int minSubArrayLen(int s, vector<int>& nums) {
// int left=0, right=nums.size();
// while (left<right) {
// int mid = left + (right-left)/2;
// if (!isLarge(nums, s, mid))
// left = mid+1;
// else
// right = mid;
// }
// if (left==nums.size() && accumulate(nums.begin(), nums.end(), 0)<s)
// return 0;
// return left;
// }
// bool isLarge(vector<int>& nums, int s, int k) {
// int sum = 0;
// for (int i=0; i<k; ++i)
// sum += nums[i];
// int ans = sum;
// for (int i=k; i<nums.size(); ++i) {
// sum += nums[i] - nums[i-k];
// ans = max(ans ,sum);
// }
// return ans >= s;
// }
int minSubArrayLen(int s, vector<int>& nums) {
int sum=0, len=INT_MAX;
int left=0, right=0;
while (right < nums.size()) {
sum += nums[right++];
while (sum>=s) {
len = min(len, right-left);
sum -= nums[left++];
}
}
return len == INT_MAX ? 0 : len;
}
};
// @lc code=end
| [
"zhoujf620@zju.edu.cn"
] | zhoujf620@zju.edu.cn |
2d58e519f37def3d866a61f6c910fdc407dec79b | 22da562485e22d0daf62a61610fe529535d4ef87 | /frameworks/js-bindings/bindings/auto/jsb_cocos2dx_3d_auto.hpp | 08d6b225d865ef8432272901cf81379bffd045dc | [] | no_license | Ginayxy/SmogHero1 | bcb2592453bb6275f6f78dd91bccfbda91cc4f1a | ef53751b7e9b2082dd6c1484961dc02958faa602 | refs/heads/master | 2021-01-10T19:14:03.402357 | 2015-05-17T00:36:11 | 2015-05-17T00:36:11 | 34,706,068 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 11,478 | hpp | #ifndef __cocos2dx_3d_h__
#define __cocos2dx_3d_h__
#include "jsapi.h"
#include "jsfriendapi.h"
extern JSClass *jsb_cocos2d_Skeleton3D_class;
extern JSObject *jsb_cocos2d_Skeleton3D_prototype;
bool js_cocos2dx_3d_Skeleton3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_Skeleton3D_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_Skeleton3D(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_Skeleton3D_removeAllBones(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_addBone(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_getBoneByName(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_getRootBone(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_updateBoneMatrix(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_getBoneByIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_getRootCount(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_getBoneIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_getBoneCount(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Skeleton3D_Skeleton3D(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_Sprite3D_class;
extern JSObject *jsb_cocos2d_Sprite3D_prototype;
bool js_cocos2dx_3d_Sprite3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_Sprite3D_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_Sprite3D(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_Sprite3D_setCullFaceEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_setTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getLightMask(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_createAttachSprite3DNode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_loadFromFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_setCullFace(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_addMesh(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_removeAllAttachNode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_genGLProgramState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getMesh(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_createSprite3DNode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getMeshCount(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_onAABBDirty(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getMeshByIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_createNode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_isForceDepthWrite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getMeshIndexData(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_removeAttachNode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_setLightMask(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_afterAsyncLoad(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_loadFromCache(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_initFrom(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getAttachNode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_initWithFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getSkeleton(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_setForceDepthWrite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_getMeshByName(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3D_Sprite3D(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_Sprite3DCache_class;
extern JSObject *jsb_cocos2d_Sprite3DCache_prototype;
bool js_cocos2dx_3d_Sprite3DCache_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_Sprite3DCache_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_Sprite3DCache(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_Sprite3DCache_removeSprite3DData(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3DCache_removeAllSprite3DData(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3DCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Sprite3DCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_Mesh_class;
extern JSObject *jsb_cocos2d_Mesh_prototype;
bool js_cocos2dx_3d_Mesh_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_Mesh_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_Mesh_setTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getSkin(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getVertexSizeInBytes(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getName(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getIndexFormat(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getGLProgramState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getVertexBuffer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_calculateAABB(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_hasVertexAttrib(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getMeshIndexData(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_setName(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_isVisible(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getIndexCount(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_bindMeshCommand(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_setMeshIndexData(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getMeshVertexAttribCount(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getPrimitiveType(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_setSkin(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_getIndexBuffer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_setGLProgramState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_setVisible(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Mesh_Mesh(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_Animation3D_class;
extern JSObject *jsb_cocos2d_Animation3D_prototype;
bool js_cocos2dx_3d_Animation3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_Animation3D_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_Animation3D(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_Animation3D_initWithFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animation3D_init(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animation3D_getBoneCurveByName(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animation3D_getDuration(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animation3D_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animation3D_Animation3D(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_Animate3D_class;
extern JSObject *jsb_cocos2d_Animate3D_prototype;
bool js_cocos2dx_3d_Animate3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_Animate3D_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_Animate3D(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_Animate3D_getSpeed(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_removeFromMap(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_setWeight(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_initWithFrames(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_getOriginInterval(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_setSpeed(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_init(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_setOriginInterval(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_getWeight(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_getTransitionTime(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_setTransitionTime(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_Animate3D(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_AttachNode_class;
extern JSObject *jsb_cocos2d_AttachNode_prototype;
bool js_cocos2dx_3d_AttachNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_AttachNode_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_AttachNode(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_AttachNode_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_AttachNode_AttachNode(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_BillBoard_class;
extern JSObject *jsb_cocos2d_BillBoard_prototype;
bool js_cocos2dx_3d_BillBoard_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_3d_BillBoard_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_BillBoard(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_BillBoard_getMode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_BillBoard_setMode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_BillBoard_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_BillBoard_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_BillBoard_BillBoard(JSContext *cx, uint32_t argc, jsval *vp);
#endif
| [
"ginayxy@163.com"
] | ginayxy@163.com |
2cb9f7bf3b9aa7686ed6e88ade3f08cc762398e2 | 575731c1155e321e7b22d8373ad5876b292b0b2f | /examples/native/ios/Pods/boost-for-react-native/boost/units/base_units/metric/fermi.hpp | b2e30a0cb4c18f9ebc49b01268f4161cbc0c4222 | [
"BSL-1.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Nozbe/zacs | 802a84ffd47413a1687a573edda519156ca317c7 | c3d455426bc7dfb83e09fdf20781c2632a205c04 | refs/heads/master | 2023-06-12T20:53:31.482746 | 2023-06-07T07:06:49 | 2023-06-07T07:06:49 | 201,777,469 | 432 | 10 | MIT | 2023-01-24T13:29:34 | 2019-08-11T14:47:50 | JavaScript | UTF-8 | C++ | false | false | 1,090 | hpp | // Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
#define BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/si/meter.hpp>
namespace boost {
namespace units {
namespace metric {
typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-15> > > fermi_base_unit;
}
template<>
struct base_unit_info<metric::fermi_base_unit> {
static const char* name() { return("fermi"); }
static const char* symbol() { return("fm"); }
};
}
}
#endif // BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
| [
"radexpl@gmail.com"
] | radexpl@gmail.com |
f239ee75e64150e23d3ac01362f2ceff0f795da6 | c11f910ea76b37cf1af8af9dccd70b70fc904896 | /Wifimanager.ino | 115c895a63a43d97d43c079003c365fb2dd11166 | [] | no_license | acuariojose2020/1_Temperatura_acuario | 84cc98b4fe8e02507d7e34fb6af8829a889c14bb | 881595901138a34d2a3b849103edff18d89246bb | refs/heads/master | 2022-11-10T18:04:08.344476 | 2020-06-21T12:53:03 | 2020-06-21T12:53:03 | 265,219,092 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,140 | ino | //###############################################################################################
// callback notifying us of the need to save config
//
//###############################################################################################
void saveConfigCallback () {
shouldSaveConfig = true;
}
//###############################################################################################
// Start WiFi
//
//###############################################################################################
void StartWiFi() {
//read configuration from FS json
//----------------------------------------------------------------------
if (SPIFFS.begin()) {
if (SPIFFS.exists("/config.json")) {
//file exists, reading and loading
File configFile = SPIFFS.open("/config.json", "r");
if (configFile) {
size_t size = configFile.size();
// Allocate a buffer to store contents of the file.
std::unique_ptr<char[]> buf(new char[size]);
configFile.readBytes(buf.get(), size);
//DynamicJsonBuffer jsonBuffer;
DynamicJsonDocument json(1024);
// JsonObject& json = jsonBuffer.parseObject(buf.get());
serializeJson(json, Serial);
// json.printTo(Serial);
//if (json.success()) {
//strcpy(mqtt_server, json["mqtt_server"]);
//strcpy(mqtt_port, json["mqtt_port"]);
//strcpy(blynk_token, json["blynk_token"]);
// if(json["ip"]) {
// strcpy(static_ip, json["ip"]);
// strcpy(static_gw, json["gateway"]);
// strcpy(static_sn, json["subnet"]);
// }
}
}
}
// The extra parameters to be configured (can be either global or just in the setup)
// After connecting, parameter.getValue() will get you the configured value
// id/name placeholder/prompt default length
//----------------------------------------------------------------------
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
//----------------------------------------------------------------------
WiFiManager wifiManager;
//set config save notify callback
//----------------------------------------------------------------------
wifiManager.setSaveConfigCallback(saveConfigCallback);
//set static ip
//----------------------------------------------------------------------
// IPAddress _ip,_gw,_sn;
// _ip.fromString(static_ip);
// _gw.fromString(static_gw);
// _sn.fromString(static_sn);
// wifiManager.setSTAStaticIPConfig(_ip, _gw, _sn);
//reset settings
//----------------------------------------------------------------------
if (ResetWiFi == true) {
wifiManager.resetSettings();
ResetWiFi == false;
}
//set minimum quality of signal so it ignores AP's under that quality
//defaults to 8%
//----------------------------------------------------------------------
wifiManager.setMinimumSignalQuality();
//sets timeout until configuration portal gets turned off
//useful to make it all retry or go to sleep in seconds
//----------------------------------------------------------------------
wifiManager.setTimeout(120);
//fetches ssid and pass and tries to connect
//if it does not connect it starts an access point with the specified name
//here "IoT Timer", password = password
//and goes into a blocking loop awaiting configuration
//----------------------------------------------------------------------
if (!wifiManager.autoConnect(DefaultName)) {
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.reset();
delay(5000);
}
//save the custom parameters to FS
//----------------------------------------------------------------------
if (shouldSaveConfig) {
//DynamicJsonBuffer jsonBuffer;
DynamicJsonDocument doc(1024);
//JsonObject& json = jsonBuffer.createObject();
doc["ip"] = WiFi.localIP().toString();
doc["gateway"] = WiFi.gatewayIP().toString();
doc["subnet"] = WiFi.subnetMask().toString();
File configFile = SPIFFS.open("/config.json", "w");
serializeJson(doc, Serial);
serializeJson(doc, configFile);
//json.prettyPrintTo(Serial);
//json.printTo(configFile);
configFile.close();
//end save
}
//if you get here you have connected to the WiFi
// Read settings from EEPROM
//----------------------------------------------------------------------
Serial.println("local ip");
Serial.println(WiFi.localIP());
// Print the IP address
Serial.print("Use this URL to connect: ");
Serial.print("http://");
Serial.print(WiFi.localIP());
Serial.println("/");
EEPROM.begin(512);
// Setup NTP time requests
//----------------------------------------------------------------------
Udp.begin(localPort);
setSyncProvider(getNtpTime);
setSyncInterval(NTPfastReq);
// Begin IoT server
//----------------------------------------------------------------------
server.begin();
}
| [
"noreply@github.com"
] | acuariojose2020.noreply@github.com |
33cf6ba0f68deb1fea417d00320b49d0c2521a89 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /c++/TileDB/2016/4/c_api.cc | b5bcd8d8cfc6937c36b7aa76117e29e07e5bc655 | [] | 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 | 35,844 | cc | /**
* @file c_api.cc
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2016 MIT and Intel Corp.
*
* 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 the C API of TileDB.
*/
#include "c_api.h"
#include "array_schema_c.h"
#include "storage_manager.h"
#include <cassert>
#include <cstring>
#include <iostream>
/* ****************************** */
/* MACROS */
/* ****************************** */
#if VERBOSE == 1
# define PRINT_ERROR(x) std::cerr << "[TileDB] Error: " << x << ".\n"
#elif VERBOSE == 2
# define PRINT_ERROR(x) std::cerr << "[TileDB::c_api] Error: " << x << ".\n"
#else
# define PRINT_ERROR(x) do { } while(0)
#endif
/* ****************************** */
/* CONTEXT */
/* ****************************** */
typedef struct TileDB_CTX {
StorageManager* storage_manager_;
} TileDB_CTX;
int tiledb_ctx_init(TileDB_CTX** tiledb_ctx, const char* config_filename) {
// Check config filename length
if(config_filename != NULL) {
if(strlen(config_filename) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid filename length");
return TILEDB_ERR;
}
}
// Initialize context
*tiledb_ctx = (TileDB_CTX*) malloc(sizeof(struct TileDB_CTX));
if(*tiledb_ctx == NULL) {
PRINT_ERROR("Cannot initialize TileDB context; Failed to allocate memory "
"space for the context");
return TILEDB_ERR;
}
// Create storage manager
(*tiledb_ctx)->storage_manager_ = new StorageManager();
if((*tiledb_ctx)->storage_manager_->init(config_filename) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_ctx_finalize(TileDB_CTX* tiledb_ctx) {
// Trivial case
if(tiledb_ctx == NULL)
return TILEDB_OK;
// Finalize storage manager
int rc = TILEDB_OK;
if(tiledb_ctx->storage_manager_ != NULL)
rc = tiledb_ctx->storage_manager_->finalize();
// Clean up
delete tiledb_ctx->storage_manager_;
free(tiledb_ctx);
// Return
if(rc == TILEDB_SM_OK)
return TILEDB_OK;
else
return TILEDB_ERR;
}
/* ****************************** */
/* SANITY CHECKS */
/* ****************************** */
bool sanity_check(const TileDB_CTX* tiledb_ctx) {
if(tiledb_ctx == NULL || tiledb_ctx->storage_manager_ == NULL) {
PRINT_ERROR("Invalid TileDB context");
return false;
} else {
return true;
}
}
bool sanity_check(const TileDB_Array* tiledb_array) {
if(tiledb_array == NULL) {
PRINT_ERROR("Invalid TileDB array");
return false;
} else {
return true;
}
}
bool sanity_check(const TileDB_ArrayIterator* tiledb_array_it) {
if(tiledb_array_it == NULL) {
PRINT_ERROR("Invalid TileDB array iterator");
return false;
} else {
return true;
}
}
bool sanity_check(const TileDB_Metadata* tiledb_metadata) {
if(tiledb_metadata == NULL) {
PRINT_ERROR("Invalid TileDB metadata");
return false;
} else {
return true;
}
}
bool sanity_check(const TileDB_MetadataIterator* tiledb_metadata_it) {
if(tiledb_metadata_it == NULL) {
PRINT_ERROR("Invalid TileDB metadata iterator");
return false;
} else {
return true;
}
}
/* ****************************** */
/* WORKSPACE */
/* ****************************** */
int tiledb_workspace_create(
const TileDB_CTX* tiledb_ctx,
const char* workspace) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check workspace name length
if(workspace == NULL || strlen(workspace) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid workspace name length");
return TILEDB_ERR;
}
// Create the workspace
if(tiledb_ctx->storage_manager_->workspace_create(workspace) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
/* ****************************** */
/* GROUP */
/* ****************************** */
int tiledb_group_create(
const TileDB_CTX* tiledb_ctx,
const char* group) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check group name length
if(group == NULL || strlen(group) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid group name length");
return TILEDB_ERR;
}
// Create the group
if(tiledb_ctx->storage_manager_->group_create(group) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
/* ****************************** */
/* ARRAY */
/* ****************************** */
typedef struct TileDB_Array {
Array* array_;
const TileDB_CTX* tiledb_ctx_;
} TileDB_Array;
int tiledb_array_set_schema(
TileDB_ArraySchema* tiledb_array_schema,
const char* array_name,
const char** attributes,
int attribute_num,
int64_t capacity,
int cell_order,
const int* cell_val_num,
const int* compression,
int dense,
const char** dimensions,
int dim_num,
const void* domain,
size_t domain_len,
const void* tile_extents,
size_t tile_extents_len,
int tile_order,
const int* types) {
// Sanity check
if(tiledb_array_schema == NULL) {
PRINT_ERROR("Invalid array schema pointer");
return TILEDB_ERR;
}
// Set array name
size_t array_name_len = strlen(array_name);
if(array_name == NULL || array_name_len > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid array name length");
return TILEDB_ERR;
}
tiledb_array_schema->array_name_ = (char*) malloc(array_name_len+1);
strcpy(tiledb_array_schema->array_name_, array_name);
// Set attributes and number of attributes
tiledb_array_schema->attribute_num_ = attribute_num;
tiledb_array_schema->attributes_ =
(char**) malloc(attribute_num*sizeof(char*));
for(int i=0; i<attribute_num; ++i) {
size_t attribute_len = strlen(attributes[i]);
if(attributes[i] == NULL || attribute_len > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid attribute name length");
return TILEDB_ERR;
}
tiledb_array_schema->attributes_[i] = (char*) malloc(attribute_len+1);
strcpy(tiledb_array_schema->attributes_[i], attributes[i]);
}
// Set dimensions
tiledb_array_schema->dim_num_ = dim_num;
tiledb_array_schema->dimensions_ = (char**) malloc(dim_num*sizeof(char*));
for(int i=0; i<dim_num; ++i) {
size_t dimension_len = strlen(dimensions[i]);
if(dimensions[i] == NULL || dimension_len > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid attribute name length");
return TILEDB_ERR;
}
tiledb_array_schema->dimensions_[i] = (char*) malloc(dimension_len+1);
strcpy(tiledb_array_schema->dimensions_[i], dimensions[i]);
}
// Set dense
tiledb_array_schema->dense_ = dense;
// Set domain
tiledb_array_schema->domain_ = malloc(domain_len);
memcpy(tiledb_array_schema->domain_, domain, domain_len);
// Set tile extents
if(tile_extents == NULL) {
tiledb_array_schema->tile_extents_ = NULL;
} else {
tiledb_array_schema->tile_extents_ = malloc(tile_extents_len);
memcpy(tiledb_array_schema->tile_extents_, tile_extents, tile_extents_len);
}
// Set types
tiledb_array_schema->types_ = (int*) malloc((attribute_num+1)*sizeof(int));
for(int i=0; i<attribute_num+1; ++i)
tiledb_array_schema->types_[i] = types[i];
// Set cell val num
if(cell_val_num == NULL) {
tiledb_array_schema->cell_val_num_ = NULL;
} else {
tiledb_array_schema->cell_val_num_ =
(int*) malloc((attribute_num)*sizeof(int));
for(int i=0; i<attribute_num; ++i) {
tiledb_array_schema->cell_val_num_[i] = cell_val_num[i];
}
}
// Set cell and tile order
tiledb_array_schema->cell_order_ = cell_order;
tiledb_array_schema->tile_order_ = tile_order;
// Set capacity
tiledb_array_schema->capacity_ = capacity;
// Set compression
if(compression == NULL) {
tiledb_array_schema->compression_ = NULL;
} else {
tiledb_array_schema->compression_ =
(int*) malloc((attribute_num+1)*sizeof(int));
for(int i=0; i<attribute_num+1; ++i)
tiledb_array_schema->compression_[i] = compression[i];
}
// Success
return TILEDB_OK;
}
int tiledb_array_create(
const TileDB_CTX* tiledb_ctx,
const TileDB_ArraySchema* array_schema) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Copy array schema to a C struct
ArraySchemaC array_schema_c;
array_schema_c.array_name_ = array_schema->array_name_;
array_schema_c.attributes_ = array_schema->attributes_;
array_schema_c.attribute_num_ = array_schema->attribute_num_;
array_schema_c.capacity_ = array_schema->capacity_;
array_schema_c.cell_order_ = array_schema->cell_order_;
array_schema_c.cell_val_num_ = array_schema->cell_val_num_;
array_schema_c.compression_ = array_schema->compression_;
array_schema_c.dense_ = array_schema->dense_;
array_schema_c.dimensions_ = array_schema->dimensions_;
array_schema_c.dim_num_ = array_schema->dim_num_;
array_schema_c.domain_ = array_schema->domain_;
array_schema_c.tile_extents_ = array_schema->tile_extents_;
array_schema_c.tile_order_ = array_schema->tile_order_;
array_schema_c.types_ = array_schema->types_;
// Create the array
if(tiledb_ctx->storage_manager_->array_create(&array_schema_c) !=
TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_init(
const TileDB_CTX* tiledb_ctx,
TileDB_Array** tiledb_array,
const char* array,
int mode,
const void* subarray,
const char** attributes,
int attribute_num) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check array name length
if(array == NULL || strlen(array) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid array name length");
return TILEDB_ERR;
}
// Allocate memory for the array struct
*tiledb_array = (TileDB_Array*) malloc(sizeof(struct TileDB_Array));
// Set TileDB context
(*tiledb_array)->tiledb_ctx_ = tiledb_ctx;
// Init the array
int rc = tiledb_ctx->storage_manager_->array_init(
(*tiledb_array)->array_,
array,
mode,
subarray,
attributes,
attribute_num);
// Return
if(rc != TILEDB_SM_OK) {
free(*tiledb_array);
return TILEDB_ERR;
} else {
return TILEDB_OK;
}
}
int tiledb_array_reset_subarray(
const TileDB_Array* tiledb_array,
const void* subarray) {
// Sanity check
if(!sanity_check(tiledb_array))
return TILEDB_ERR;
// Reset subarray
if(tiledb_array->array_->reset_subarray(subarray) != TILEDB_AR_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_reset_attributes(
const TileDB_Array* tiledb_array,
const char** attributes,
int attribute_num) {
// Sanity check
if(!sanity_check(tiledb_array))
return TILEDB_ERR;
// Re-Init the array
if(tiledb_array->array_->reset_attributes(attributes, attribute_num) !=
TILEDB_AR_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_get_schema(
const TileDB_Array* tiledb_array,
TileDB_ArraySchema* tiledb_array_schema) {
// Sanity check
if(!sanity_check(tiledb_array))
return TILEDB_ERR;
// Get the array schema
ArraySchemaC array_schema_c;
tiledb_array->array_->array_schema()->array_schema_export(&array_schema_c);
// Copy the array schema C struct to the output
tiledb_array_schema->array_name_ = array_schema_c.array_name_;
tiledb_array_schema->attributes_ = array_schema_c.attributes_;
tiledb_array_schema->attribute_num_ = array_schema_c.attribute_num_;
tiledb_array_schema->capacity_ = array_schema_c.capacity_;
tiledb_array_schema->cell_order_ = array_schema_c.cell_order_;
tiledb_array_schema->cell_val_num_ = array_schema_c.cell_val_num_;
tiledb_array_schema->compression_ = array_schema_c.compression_;
tiledb_array_schema->dense_ = array_schema_c.dense_;
tiledb_array_schema->dimensions_ = array_schema_c.dimensions_;
tiledb_array_schema->dim_num_ = array_schema_c.dim_num_;
tiledb_array_schema->domain_ = array_schema_c.domain_;
tiledb_array_schema->tile_extents_ = array_schema_c.tile_extents_;
tiledb_array_schema->tile_order_ = array_schema_c.tile_order_;
tiledb_array_schema->types_ = array_schema_c.types_;
// Success
return TILEDB_OK;
}
int tiledb_array_load_schema(
const TileDB_CTX* tiledb_ctx,
const char* array,
TileDB_ArraySchema* tiledb_array_schema) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check array name length
if(array == NULL || strlen(array) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid array name length");
return TILEDB_ERR;
}
// Get the array schema
ArraySchema* array_schema;
if(tiledb_ctx->storage_manager_->array_load_schema(array, array_schema) !=
TILEDB_SM_OK)
return TILEDB_ERR;
ArraySchemaC array_schema_c;
array_schema->array_schema_export(&array_schema_c);
// Copy the array schema C struct to the output
tiledb_array_schema->array_name_ = array_schema_c.array_name_;
tiledb_array_schema->attributes_ = array_schema_c.attributes_;
tiledb_array_schema->attribute_num_ = array_schema_c.attribute_num_;
tiledb_array_schema->capacity_ = array_schema_c.capacity_;
tiledb_array_schema->cell_order_ = array_schema_c.cell_order_;
tiledb_array_schema->cell_val_num_ = array_schema_c.cell_val_num_;
tiledb_array_schema->compression_ = array_schema_c.compression_;
tiledb_array_schema->dense_ = array_schema_c.dense_;
tiledb_array_schema->dimensions_ = array_schema_c.dimensions_;
tiledb_array_schema->dim_num_ = array_schema_c.dim_num_;
tiledb_array_schema->domain_ = array_schema_c.domain_;
tiledb_array_schema->tile_extents_ = array_schema_c.tile_extents_;
tiledb_array_schema->tile_order_ = array_schema_c.tile_order_;
tiledb_array_schema->types_ = array_schema_c.types_;
// Clean up
delete array_schema;
// Success
return TILEDB_OK;
}
int tiledb_array_free_schema(
TileDB_ArraySchema* tiledb_array_schema) {
// Trivial case
if(tiledb_array_schema == NULL)
return TILEDB_OK;
// Free array name
if(tiledb_array_schema->array_name_ != NULL)
free(tiledb_array_schema->array_name_);
// Free attributes
if(tiledb_array_schema->attributes_ != NULL) {
for(int i=0; i<tiledb_array_schema->attribute_num_; ++i)
if(tiledb_array_schema->attributes_[i] != NULL)
free(tiledb_array_schema->attributes_[i]);
free(tiledb_array_schema->attributes_);
}
// Free dimensions
if(tiledb_array_schema->dimensions_ != NULL) {
for(int i=0; i<tiledb_array_schema->dim_num_; ++i)
if(tiledb_array_schema->dimensions_[i] != NULL)
free(tiledb_array_schema->dimensions_[i]);
free(tiledb_array_schema->dimensions_);
}
// Free domain
if(tiledb_array_schema->domain_ != NULL)
free(tiledb_array_schema->domain_);
// Free tile extents
if(tiledb_array_schema->tile_extents_ != NULL)
free(tiledb_array_schema->tile_extents_);
// Free types
if(tiledb_array_schema->types_ != NULL)
free(tiledb_array_schema->types_);
// Free compression
if(tiledb_array_schema->compression_ != NULL)
free(tiledb_array_schema->compression_);
// Free cell val num
if(tiledb_array_schema->cell_val_num_ != NULL);
free(tiledb_array_schema->cell_val_num_);
// Success
return TILEDB_OK;
}
int tiledb_array_write(
const TileDB_Array* tiledb_array,
const void** buffers,
const size_t* buffer_sizes) {
// Sanity check
if(!sanity_check(tiledb_array))
return TILEDB_ERR;
// Write
if(tiledb_array->array_->write(buffers, buffer_sizes) != TILEDB_AR_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_read(
const TileDB_Array* tiledb_array,
void** buffers,
size_t* buffer_sizes) {
// Sanity check
if(!sanity_check(tiledb_array))
return TILEDB_ERR;
// Read
if(tiledb_array->array_->read(buffers, buffer_sizes) != TILEDB_AR_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_overflow(
const TileDB_Array* tiledb_array,
int attribute_id) {
// Sanity check
if(!sanity_check(tiledb_array))
return TILEDB_ERR;
// Check overflow
return (int) tiledb_array->array_->overflow(attribute_id);
}
int tiledb_array_consolidate(
const TileDB_CTX* tiledb_ctx,
const char* array) {
// Check array name length
if(array == NULL || strlen(array) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid array name length");
return TILEDB_ERR;
}
// Consolidate
if(tiledb_ctx->storage_manager_->array_consolidate(array) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_finalize(TileDB_Array* tiledb_array) {
// Sanity check
if(!sanity_check(tiledb_array) ||
!sanity_check(tiledb_array->tiledb_ctx_))
return TILEDB_ERR;
// Finalize array
int rc = tiledb_array->tiledb_ctx_->storage_manager_->array_finalize(
tiledb_array->array_);
free(tiledb_array);
// Return
if(rc == TILEDB_SM_OK)
return TILEDB_OK;
else
return TILEDB_ERR;
}
typedef struct TileDB_ArrayIterator {
ArrayIterator* array_it_;
const TileDB_CTX* tiledb_ctx_;
} TileDB_ArrayIterator;
int tiledb_array_iterator_init(
const TileDB_CTX* tiledb_ctx,
TileDB_ArrayIterator** tiledb_array_it,
const char* array,
const void* subarray,
const char** attributes,
int attribute_num,
void** buffers,
size_t* buffer_sizes) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Allocate memory for the array iterator struct
*tiledb_array_it =
(TileDB_ArrayIterator*) malloc(sizeof(struct TileDB_ArrayIterator));
// Set TileDB context
(*tiledb_array_it)->tiledb_ctx_ = tiledb_ctx;
// Initialize the array iterator
int rc = tiledb_ctx->storage_manager_->array_iterator_init(
(*tiledb_array_it)->array_it_,
array,
subarray,
attributes,
attribute_num,
buffers,
buffer_sizes);
// Return
if(rc == TILEDB_SM_OK) {
return TILEDB_OK;
} else {
free(*tiledb_array_it);
return TILEDB_ERR;
}
}
int tiledb_array_iterator_get_value(
TileDB_ArrayIterator* tiledb_array_it,
int attribute_id,
const void** value,
size_t* value_size) {
// Sanity check
if(!sanity_check(tiledb_array_it))
return TILEDB_ERR;
// Get value
if(tiledb_array_it->array_it_->get_value(
attribute_id,
value,
value_size) != TILEDB_AIT_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_iterator_next(
TileDB_ArrayIterator* tiledb_array_it) {
// Sanity check
if(!sanity_check(tiledb_array_it))
return TILEDB_ERR;
// Advance iterator
if(tiledb_array_it->array_it_->next() != TILEDB_AIT_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_array_iterator_end(
TileDB_ArrayIterator* tiledb_array_it) {
// Sanity check
if(!sanity_check(tiledb_array_it))
return TILEDB_ERR;
// Check if the iterator reached the end
return (int) tiledb_array_it->array_it_->end();
}
int tiledb_array_iterator_finalize(
TileDB_ArrayIterator* tiledb_array_it) {
// Sanity check
if(!sanity_check(tiledb_array_it))
return TILEDB_ERR;
// Finalize array
int rc = tiledb_array_it->tiledb_ctx_->
storage_manager_->array_iterator_finalize(
tiledb_array_it->array_it_);
free(tiledb_array_it);
// Return
if(rc == TILEDB_SM_OK)
return TILEDB_OK;
else
return TILEDB_ERR;
}
/* ****************************** */
/* METADATA */
/* ****************************** */
typedef struct TileDB_Metadata {
Metadata* metadata_;
const TileDB_CTX* tiledb_ctx_;
} TileDB_Metadata;
int tiledb_metadata_set_schema(
TileDB_MetadataSchema* tiledb_metadata_schema,
const char* metadata_name,
const char** attributes,
int attribute_num,
int64_t capacity,
const int* cell_val_num,
const int* compression,
const int* types) {
// Sanity check
if(tiledb_metadata_schema == NULL) {
PRINT_ERROR("Invalid metadata schema pointer");
return TILEDB_ERR;
}
// Set metadata name
size_t metadata_name_len = strlen(metadata_name);
if(metadata_name == NULL || metadata_name_len > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid metadata name length");
return TILEDB_ERR;
}
tiledb_metadata_schema->metadata_name_ = (char*) malloc(metadata_name_len+1);
strcpy(tiledb_metadata_schema->metadata_name_, metadata_name);
/* Set attributes and number of attributes. */
tiledb_metadata_schema->attribute_num_ = attribute_num;
tiledb_metadata_schema->attributes_ =
(char**) malloc(attribute_num*sizeof(char*));
for(int i=0; i<attribute_num; ++i) {
size_t attribute_len = strlen(attributes[i]);
if(attributes[i] == NULL || attribute_len > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid attribute name length");
return TILEDB_ERR;
}
tiledb_metadata_schema->attributes_[i] = (char*) malloc(attribute_len+1);
strcpy(tiledb_metadata_schema->attributes_[i], attributes[i]);
}
// Set types
tiledb_metadata_schema->types_ = (int*) malloc((attribute_num+1)*sizeof(int));
for(int i=0; i<attribute_num+1; ++i)
tiledb_metadata_schema->types_[i] = types[i];
// Set cell val num
if(cell_val_num == NULL) {
tiledb_metadata_schema->cell_val_num_ = NULL;
} else {
tiledb_metadata_schema->cell_val_num_ =
(int*) malloc((attribute_num)*sizeof(int));
for(int i=0; i<attribute_num; ++i) {
tiledb_metadata_schema->cell_val_num_[i] = cell_val_num[i];
}
}
// Set capacity
tiledb_metadata_schema->capacity_ = capacity;
// Set compression
if(compression == NULL) {
tiledb_metadata_schema->compression_ = NULL;
} else {
tiledb_metadata_schema->compression_ =
(int*) malloc((attribute_num+1)*sizeof(int));
for(int i=0; i<attribute_num+1; ++i)
tiledb_metadata_schema->compression_[i] = compression[i];
}
// Return
return TILEDB_OK;
}
int tiledb_metadata_create(
const TileDB_CTX* tiledb_ctx,
const TileDB_MetadataSchema* metadata_schema) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Copy metadata schema to the proper struct
MetadataSchemaC metadata_schema_c;
metadata_schema_c.metadata_name_ = metadata_schema->metadata_name_;
metadata_schema_c.attributes_ = metadata_schema->attributes_;
metadata_schema_c.attribute_num_ = metadata_schema->attribute_num_;
metadata_schema_c.capacity_ = metadata_schema->capacity_;
metadata_schema_c.cell_val_num_ = metadata_schema->cell_val_num_;
metadata_schema_c.compression_ = metadata_schema->compression_;
metadata_schema_c.types_ = metadata_schema->types_;
// Create the metadata
if(tiledb_ctx->storage_manager_->metadata_create(&metadata_schema_c) !=
TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_metadata_init(
const TileDB_CTX* tiledb_ctx,
TileDB_Metadata** tiledb_metadata,
const char* metadata,
int mode,
const char** attributes,
int attribute_num) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Allocate memory for the array struct
*tiledb_metadata = (TileDB_Metadata*) malloc(sizeof(struct TileDB_Metadata));
// Set TileDB context
(*tiledb_metadata)->tiledb_ctx_ = tiledb_ctx;
// Init the metadata
if(tiledb_ctx->storage_manager_->metadata_init(
(*tiledb_metadata)->metadata_,
metadata,
mode,
attributes,
attribute_num) != TILEDB_SM_OK) {
free(*tiledb_metadata);
return TILEDB_ERR;
} else {
return TILEDB_OK;
}
}
int tiledb_metadata_reset_attributes(
const TileDB_Metadata* tiledb_metadata,
const char** attributes,
int attribute_num) {
// Sanity check
if(!sanity_check(tiledb_metadata))
return TILEDB_ERR;
// Reset attributes
if(tiledb_metadata->metadata_->reset_attributes(
attributes,
attribute_num) != TILEDB_MT_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_metadata_get_schema(
const TileDB_Metadata* tiledb_metadata,
TileDB_MetadataSchema* tiledb_metadata_schema) {
// Sanity check
if(!sanity_check(tiledb_metadata))
return TILEDB_ERR;
// Get the metadata schema
MetadataSchemaC metadata_schema_c;
tiledb_metadata->metadata_->array_schema()->array_schema_export(
&metadata_schema_c);
// Copy the metadata schema C struct to the output
tiledb_metadata_schema->metadata_name_ = metadata_schema_c.metadata_name_;
tiledb_metadata_schema->attributes_ = metadata_schema_c.attributes_;
tiledb_metadata_schema->attribute_num_ = metadata_schema_c.attribute_num_;
tiledb_metadata_schema->capacity_ = metadata_schema_c.capacity_;
tiledb_metadata_schema->cell_val_num_ = metadata_schema_c.cell_val_num_;
tiledb_metadata_schema->compression_ = metadata_schema_c.compression_;
tiledb_metadata_schema->types_ = metadata_schema_c.types_;
// Success
return TILEDB_OK;
}
int tiledb_metadata_load_schema(
const TileDB_CTX* tiledb_ctx,
const char* metadata,
TileDB_MetadataSchema* tiledb_metadata_schema) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check metadata name length
if(metadata == NULL || strlen(metadata) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid metadata name length");
return TILEDB_ERR;
}
// Get the array schema
ArraySchema* array_schema;
if(tiledb_ctx->storage_manager_->metadata_load_schema(
metadata,
array_schema) != TILEDB_SM_OK)
return TILEDB_ERR;
MetadataSchemaC metadata_schema_c;
array_schema->array_schema_export(&metadata_schema_c);
// Copy the metadata schema C struct to the output
tiledb_metadata_schema->metadata_name_ = metadata_schema_c.metadata_name_;
tiledb_metadata_schema->attributes_ = metadata_schema_c.attributes_;
tiledb_metadata_schema->attribute_num_ = metadata_schema_c.attribute_num_;
tiledb_metadata_schema->capacity_ = metadata_schema_c.capacity_;
tiledb_metadata_schema->cell_val_num_ = metadata_schema_c.cell_val_num_;
tiledb_metadata_schema->compression_ = metadata_schema_c.compression_;
tiledb_metadata_schema->types_ = metadata_schema_c.types_;
// Clean up
delete array_schema;
// Success
return TILEDB_OK;
}
int tiledb_metadata_free_schema(
TileDB_MetadataSchema* tiledb_metadata_schema) {
// Trivial case
if(tiledb_metadata_schema == NULL)
return TILEDB_OK;
// Free name
if(tiledb_metadata_schema->metadata_name_ != NULL)
free(tiledb_metadata_schema->metadata_name_);
// Free attributes
if(tiledb_metadata_schema->attributes_ != NULL) {
for(int i=0; i<tiledb_metadata_schema->attribute_num_; ++i)
if(tiledb_metadata_schema->attributes_[i] != NULL)
free(tiledb_metadata_schema->attributes_[i]);
free(tiledb_metadata_schema->attributes_);
}
// Free types
if(tiledb_metadata_schema->types_ != NULL)
free(tiledb_metadata_schema->types_);
// Free compression
if(tiledb_metadata_schema->compression_ != NULL)
free(tiledb_metadata_schema->compression_);
// Free cell val num
if(tiledb_metadata_schema->cell_val_num_ != NULL)
free(tiledb_metadata_schema->cell_val_num_);
// Success
return TILEDB_OK;
}
int tiledb_metadata_write(
const TileDB_Metadata* tiledb_metadata,
const char* keys,
size_t keys_size,
const void** buffers,
const size_t* buffer_sizes) {
// Sanity check
if(!sanity_check(tiledb_metadata))
return TILEDB_ERR;
// Write
if(tiledb_metadata->metadata_->write(
keys,
keys_size,
buffers,
buffer_sizes) != TILEDB_MT_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_metadata_read(
const TileDB_Metadata* tiledb_metadata,
const char* key,
void** buffers,
size_t* buffer_sizes) {
// Sanity check
if(!sanity_check(tiledb_metadata))
return TILEDB_ERR;
// Read
if(tiledb_metadata->metadata_->read(
key,
buffers,
buffer_sizes) != TILEDB_MT_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_metadata_overflow(
const TileDB_Metadata* tiledb_metadata,
int attribute_id) {
// Sanity check
if(!sanity_check(tiledb_metadata))
return TILEDB_ERR;
return (int) tiledb_metadata->metadata_->overflow(attribute_id);
}
int tiledb_metadata_consolidate(
const TileDB_CTX* tiledb_ctx,
const char* metadata) {
// Check metadata name length
if(metadata == NULL || strlen(metadata) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid metadata name length");
return TILEDB_ERR;
}
// Consolidate
if(tiledb_ctx->storage_manager_->metadata_consolidate(metadata) !=
TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_metadata_finalize(TileDB_Metadata* tiledb_metadata) {
// Sanity check
if(!sanity_check(tiledb_metadata))
return TILEDB_ERR;
// Finalize metadata
int rc = tiledb_metadata->tiledb_ctx_->storage_manager_->metadata_finalize(
tiledb_metadata->metadata_);
free(tiledb_metadata);
// Return
if(rc == TILEDB_SM_OK)
return TILEDB_OK;
else
return TILEDB_ERR;
}
typedef struct TileDB_MetadataIterator {
MetadataIterator* metadata_it_;
const TileDB_CTX* tiledb_ctx_;
} TileDB_MetadataIterator;
int tiledb_metadata_iterator_init(
const TileDB_CTX* tiledb_ctx,
TileDB_MetadataIterator** tiledb_metadata_it,
const char* metadata,
const char** attributes,
int attribute_num,
void** buffers,
size_t* buffer_sizes) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Allocate memory for the metadata struct
*tiledb_metadata_it =
(TileDB_MetadataIterator*) malloc(sizeof(struct TileDB_MetadataIterator));
// Set TileDB context
(*tiledb_metadata_it)->tiledb_ctx_ = tiledb_ctx;
// Initialize the metadata iterator
if(tiledb_ctx->storage_manager_->metadata_iterator_init(
(*tiledb_metadata_it)->metadata_it_,
metadata,
attributes,
attribute_num,
buffers,
buffer_sizes) != TILEDB_SM_OK) {
free(*tiledb_metadata_it);
return TILEDB_ERR;
} else {
return TILEDB_OK;
}
}
int tiledb_metadata_iterator_get_value(
TileDB_MetadataIterator* tiledb_metadata_it,
int attribute_id,
const void** value,
size_t* value_size) {
// Sanity check
if(!sanity_check(tiledb_metadata_it))
return TILEDB_ERR;
// Get value
if(tiledb_metadata_it->metadata_it_->get_value(
attribute_id,
value,
value_size) != TILEDB_MIT_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_metadata_iterator_next(
TileDB_MetadataIterator* tiledb_metadata_it) {
// Sanity check
if(!sanity_check(tiledb_metadata_it))
return TILEDB_ERR;
// Advance metadata iterator
if(tiledb_metadata_it->metadata_it_->next() != TILEDB_MIT_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_metadata_iterator_end(
TileDB_MetadataIterator* tiledb_metadata_it) {
// Sanity check
if(!sanity_check(tiledb_metadata_it))
return TILEDB_ERR;
// Check if the metadata iterator reached its end
return (int) tiledb_metadata_it->metadata_it_->end();
}
int tiledb_metadata_iterator_finalize(
TileDB_MetadataIterator* tiledb_metadata_it) {
// Sanity check
if(!sanity_check(tiledb_metadata_it))
return TILEDB_ERR;
// Finalize metadata iterator
int rc = tiledb_metadata_it->tiledb_ctx_->
storage_manager_->metadata_iterator_finalize(
tiledb_metadata_it->metadata_it_);
free(tiledb_metadata_it);
// Return
if(rc == TILEDB_SM_OK)
return TILEDB_OK;
else
return TILEDB_ERR;
}
/* ****************************** */
/* DIRECTORY MANAGEMENT */
/* ****************************** */
int tiledb_clear(
const TileDB_CTX* tiledb_ctx,
const char* dir) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check directory name length
if(dir == NULL || strlen(dir) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid directory name length");
return TILEDB_ERR;
}
// Clear
if(tiledb_ctx->storage_manager_->clear(dir) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_delete(
const TileDB_CTX* tiledb_ctx,
const char* dir) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check directory name length
if(dir == NULL || strlen(dir) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid directory name length");
return TILEDB_ERR;
}
// Delete
if(tiledb_ctx->storage_manager_->delete_entire(dir) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_move(
const TileDB_CTX* tiledb_ctx,
const char* old_dir,
const char* new_dir) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check old directory name length
if(old_dir == NULL || strlen(old_dir) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid old directory name length");
return TILEDB_ERR;
}
// Check new directory name length
if(new_dir == NULL || strlen(new_dir) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid new directory name length");
return TILEDB_ERR;
}
// Move
if(tiledb_ctx->storage_manager_->move(old_dir, new_dir) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_ls_workspaces(
const TileDB_CTX* tiledb_ctx,
char** workspaces,
int* workspace_num) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// List workspaces
if(tiledb_ctx->storage_manager_->ls_workspaces(
workspaces,
*workspace_num) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
int tiledb_ls(
const TileDB_CTX* tiledb_ctx,
const char* parent_dir,
char** dirs,
int* dir_types,
int* dir_num) {
// Sanity check
if(!sanity_check(tiledb_ctx))
return TILEDB_ERR;
// Check parent directory name length
if(parent_dir == NULL || strlen(parent_dir) > TILEDB_NAME_MAX_LEN) {
PRINT_ERROR("Invalid parent directory name length");
return TILEDB_ERR;
}
// List TileDB objects
if(tiledb_ctx->storage_manager_->ls(
parent_dir,
dirs,
dir_types,
*dir_num) != TILEDB_SM_OK)
return TILEDB_ERR;
else
return TILEDB_OK;
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
6b515bfd2ea0a072624a5f636de9735e30580483 | 79853ae21729ba9e4cfe11f9ab74b7947bf02c45 | /Tests.cpp | 4d32fa626a1b6139389e11a19288b6caa9d027b9 | [] | no_license | al3ks1002/AdoptAPet | 56fee9a6aa22f0c1805bff057e3b5005f275ca41 | 4ac0042dd332a640737832bf7e72b67e585fa246 | refs/heads/master | 2021-01-21T14:44:26.252156 | 2016-06-20T16:49:01 | 2016-06-20T16:49:01 | 58,822,387 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,609 | cpp | //
// Created by alex on 20.03.2016.
//
#include <cassert>
#include <iostream>
#include "Tests.h"
#include "Vector.h"
#include "RepositoryAdmin.h"
#include "ControllerAdmin.h"
#include "RepositoryUser.h"
#include "CustomException.h"
void Tests::run_tests() {
test_vector();
test_repository();
test_controller();
}
void Tests::test_vector() {
Vector<int> v(1);
for (int i = 0; i < 10; i++)
v.add(i);
assert(v.size() == 10);
for (int i = 0; i < 10; i++)
assert(v[i] == i);
for (int i = 0; i < 10; i++)
assert(v.find(i) == i);
Vector<int> w(v);
assert(w.size() == 10);
for (int i = 0; i < 10; i++)
assert(w[i] == i);
v.remove(5);
assert(v.size() == 9);
assert(v[5] == 6);
assert(v[8] == 9);
}
void Tests::test_repository() {
RepositoryAdmin v;
Dog d1{1, "Pitbull", "Rex", "link1"};
Dog d2{2, "Husky", "Max", "link2"};
Dog d3{2, "Doge", "Hachi", "link3"};
Dog d4{1, "Shepard", "Derek", "link4"};
Dog d5{3, "Husky", "Min", "link5"};
v.add(d1);
v.add(d2);
v.add(d3);
v.add(d4);
v.add(d5);
assert(v.get_dogs().size() == 5);
try {
v.add(d1);
assert(false);
} catch (OperationException& e) { }
v.remove(d1);
try {
v.remove(d1);
assert(false);
} catch (OperationException& e) { }
v.remove(d2);
try {
v.update(d1, d3);
assert(false);
} catch (OperationException& e) { }
try {
v.update(d3, d4);
assert(false);
} catch (OperationException& e) { }
v.update(d3, d1);
/*
RepositoryUser w;
w.set_list(v.get_dogs());
assert(w.get_size_list() == 3);
w.add_adoption(d3);
std::vector<Dog> z = w.get_adopted();
assert(z.size() == 1);
assert(z[0].get_name() == "Hachi");
assert(w.get_current().get_name() == "Rex");
w.go_next();
assert(w.get_current().get_name() == "Derek");
*/
}
void Tests::test_controller() {
RepositoryAdmin v;
ControllerAdmin c{v};
c.add(1, "Pitbull", "Rex", "link1");
try {
c.add(1, "Pitbull", "Rex", "link1");
assert(false);
} catch (OperationException& e) { }
c.remove(1, "Pitbull", "Rex");
try {
c.remove(1, "Pitbull", "Rex");
assert(false);
} catch (OperationException& e) { }
c.add(1, "Pitbull", "Rex", "link1");
c.update(1, "Pitbull", "Rex", 2, "Husky", "Max", "link2");
try {
c.update(1, "Pitbull", "Rex", 2, "Husky", "Max", "link2");
assert(false);
} catch (OperationException& e) { }
}
| [
"al3ks1002@gmail.com"
] | al3ks1002@gmail.com |
c01874d56e76a69099e83620d581147877072e87 | d9cdadc24bbd62fa0ac36e2ccd07975254a71e5a | /39.Combination Sum.cpp | f30ff97dcd5224990d72669543d91fa3957b6a08 | [] | no_license | GaoLF/LeetCode_THD | d2097881bd0dc41c7f1fe0fc2aca5de9f6c27f2f | ba464bc507342c483031c5bc79486fd18b5f78a9 | refs/heads/master | 2016-09-11T06:57:35.030031 | 2015-09-13T03:13:40 | 2015-09-13T03:13:40 | 42,153,341 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,277 | cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<unordered_set>
#include<unordered_map>
#include<math.h>
#include<stack>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
vector<vector<int> > combinationSum(vector<int>& candidates, int target) {
vector<vector<int> > res;
vector<int> temp;
sort(candidates.begin(),candidates.end());
sumHelper(candidates,target,temp,res,0);
return res;
}
void sumHelper(vector<int>& can,int tar,vector<int> &temp,vector<vector<int> >&res,int i){
if(i >= can.size())
return;
if(can[i] == tar){
temp.push_back(tar);
res.push_back(temp);
temp.erase(temp.end()-1);
}
else if(can[i] < tar){
sumHelper(can,tar,temp,res,i+1);
int size = temp.size();
temp.push_back(can[i]);
sumHelper(can,tar-can[i],temp,res,i);
temp.erase(temp.begin()+size);
}
}
void test(){
int A[] = {8,7,4,3};
vector<int> B(A,A+4);
vector<vector<int> > res = combinationSum(B,11);
for(int i = 0;i < res.size();i ++){
for(int j = 0;j < res[i].size();j ++)
cout<<res[i][j]<<" ";
cout<<endl;
}
}
};
int main(){
Solution A;
A.test();
system("pause");
}
| [
"gaolongfei@pku.edu.cn"
] | gaolongfei@pku.edu.cn |
f65e22a9a1c2b3165afa00eb3259903e16d55dff | 2bc835b044f306fca1affd1c61b8650b06751756 | /winhttp/v5/inc/makefile.inc | b362cbd85edac63959cba2eadb45324b2d5672e8 | [] | no_license | KernelPanic-OpenSource/Win2K3_NT_inetcore | bbb2354d95a51a75ce2dfd67b18cfb6b21c94939 | 75f614d008bfce1ea71e4a727205f46b0de8e1c3 | refs/heads/master | 2023-04-04T02:55:25.139618 | 2021-04-14T05:25:01 | 2021-04-14T05:25:01 | 357,780,123 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 63 | inc | winhttp.h: winhttp.w
hsplit -o winhttp.h internal.h winhttp.w
| [
"polarisdp@gmail.com"
] | polarisdp@gmail.com |
41798191c23095938c016cd371066ffb7f023820 | 2452e0375b99a3226f01814c3138c8edf7b3dbd1 | /光线跟踪/engine/Object.cpp | 7358b98c3ea7c3cccf4e36468d7f2771c70623f8 | [] | no_license | hello-choulvlv/hello-world | ac00931ab6b2e7e921e68875b1b8a918476351a7 | 29cdc82c847a4ecf5d6051a6bb084260cded5cc7 | refs/heads/master | 2021-12-29T09:40:58.368942 | 2021-12-15T04:45:47 | 2021-12-15T04:45:47 | 209,924,279 | 2 | 3 | null | null | null | null | GB18030 | C++ | false | false | 510 | cpp | /*
*@aim:引用计数实现
*&2016-4-23
*/
#include "Object.h"
#include<assert.h>
Object::Object()
{
_referenceCount = 1;
}
Object::~Object()
{
assert(!_referenceCount);
}
//
void Object::retain()
{
++_referenceCount;
}
//ref count
int Object::getReferenceCount()const
{
return _referenceCount;
}
//
void Object::release()
{
assert(_referenceCount > 0);
--_referenceCount;
if (!_referenceCount)
delete this;
} | [
"xiaoxiong@gmail.com"
] | xiaoxiong@gmail.com |
60b47f3ed13eed824f5308ab5353c9ec22936154 | a634f0d4796195e20f7c74d22fdb3ed3ee4e02eb | /labs/lab4-v.cpp | c257314c16e046c10ffceadff2e3bd496378c709 | [] | no_license | anelyausk/ADS | 40034fe29249ce6ae52a34a0da878307f488c046 | 2c6d5ce0631298155ad919f481519783d00c84f5 | refs/heads/main | 2023-02-01T22:49:35.372580 | 2020-12-20T16:13:57 | 2020-12-20T16:13:57 | 323,103,081 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,050 | cpp | #include <iostream>
using namespace std;
struct N{
int x;
N *left, *right;
N (int k){
x = k;
left = NULL;
right = NULL;
}
};
bool exist(N* root, int val){
if (root == NULL) return false;
if (root->x == val) return true;
if (val < root->x){
return exist(root->left, val);
}
return exist(root->right, val);
}
N* insert(N* root, int val){
if (exist(root, val) == true) return root;
if (root == NULL) return new N(val);
if (val < root->x) root->left = insert(root->left, val);
if (val > root->x) root->right = insert(root->right, val);
return root;
}
void v(N *root){
if (!root) return;
if (root->left) v(root->left);
if (root->left && !root->right)
cout << root->x << " ";
if (!root->left && root->right)
cout << root->x << " ";
if (root->right) v(root->right);
}
int main(){
int x;
cin >> x;
N a(x);
while (x != 0) {
cin >> x;
if (x != 0) insert(&a, x);
}
v(&a);
return 0;
}
| [
"noreply@github.com"
] | anelyausk.noreply@github.com |
a5dccb060c53ef6b32d4d3ed6184278b015424d5 | cbd56acc174f049cc1e5278b4c33732dd02cc6d7 | /src/miner.cpp | 75d06d1163549196acce9dfddff2d4518cf7da08 | [
"MIT"
] | permissive | TeleBETteam/TeleBET | 859887a03ba3fb450f87e815d1a534e001732c71 | 208e086b3799fbcb0ccc2dbd9b446737cd51f87a | refs/heads/master | 2021-01-17T14:00:35.221880 | 2015-05-11T09:15:52 | 2015-05-11T09:15:52 | 35,366,500 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,773 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013 The NovaCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "txdb.h"
#include "miner.h"
#include "kernel.h"
using namespace std;
//////////////////////////////////////////////////////////////////////////////
//
// BitcoinMiner
//
extern unsigned int nMinerSleep;
int static FormatHashBlocks(void* pbuffer, unsigned int len)
{
unsigned char* pdata = (unsigned char*)pbuffer;
unsigned int blocks = 1 + ((len + 8) / 64);
unsigned char* pend = pdata + 64 * blocks;
memset(pdata + len, 0, 64 * blocks - len);
pdata[len] = 0x80;
unsigned int bits = len * 8;
pend[-1] = (bits >> 0) & 0xff;
pend[-2] = (bits >> 8) & 0xff;
pend[-3] = (bits >> 16) & 0xff;
pend[-4] = (bits >> 24) & 0xff;
return blocks;
}
static const unsigned int pSHA256InitState[8] =
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
void SHA256Transform(void* pstate, void* pinput, const void* pinit)
{
SHA256_CTX ctx;
unsigned char data[64];
SHA256_Init(&ctx);
for (int i = 0; i < 16; i++)
((uint32_t*)data)[i] = ByteReverse(((uint32_t*)pinput)[i]);
for (int i = 0; i < 8; i++)
ctx.h[i] = ((uint32_t*)pinit)[i];
SHA256_Update(&ctx, data, sizeof(data));
for (int i = 0; i < 8; i++)
((uint32_t*)pstate)[i] = ctx.h[i];
}
// Some explaining would be appreciated
class COrphan
{
public:
CTransaction* ptx;
set<uint256> setDependsOn;
double dPriority;
double dFeePerKb;
COrphan(CTransaction* ptxIn)
{
ptx = ptxIn;
dPriority = dFeePerKb = 0;
}
};
uint64_t nLastBlockTx = 0;
uint64_t nLastBlockSize = 0;
int64_t nLastCoinStakeSearchInterval = 0;
// We want to sort transactions by priority and fee, so:
typedef boost::tuple<double, double, CTransaction*> TxPriority;
class TxPriorityCompare
{
bool byFee;
public:
TxPriorityCompare(bool _byFee) : byFee(_byFee) { }
bool operator()(const TxPriority& a, const TxPriority& b)
{
if (byFee)
{
if (a.get<1>() == b.get<1>())
return a.get<0>() < b.get<0>();
return a.get<1>() < b.get<1>();
}
else
{
if (a.get<0>() == b.get<0>())
return a.get<1>() < b.get<1>();
return a.get<0>() < b.get<0>();
}
}
};
// CreateNewBlock: create new block (without proof-of-work/proof-of-stake)
CBlock* CreateNewBlock(CReserveKey& reservekey, bool fProofOfStake, int64_t* pFees)
{
// Create new block
auto_ptr<CBlock> pblock(new CBlock());
if (!pblock.get())
return NULL;
CBlockIndex* pindexPrev = pindexBest;
int nHeight = pindexPrev->nHeight + 1;
// Create coinbase tx
CTransaction txNew;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
if (!fProofOfStake)
{
CPubKey pubkey;
if (!reservekey.GetReservedKey(pubkey))
return NULL;
txNew.vout[0].scriptPubKey.SetDestination(pubkey.GetID());
}
else
{
// Height first in coinbase required for block.version=2
txNew.vin[0].scriptSig = (CScript() << nHeight) + COINBASE_FLAGS;
assert(txNew.vin[0].scriptSig.size() <= 100);
txNew.vout[0].SetEmpty();
}
// Add our coinbase tx as first transaction
pblock->vtx.push_back(txNew);
// Largest block you're willing to create:
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/2);
// Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity:
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize));
// How much of the block should be dedicated to high-priority transactions,
// included regardless of the fees they pay
unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", 27000);
nBlockPrioritySize = std::min(nBlockMaxSize, nBlockPrioritySize);
// Minimum block size you want to create; block will be filled with free transactions
// until there are no more or the block reaches this size:
unsigned int nBlockMinSize = GetArg("-blockminsize", 0);
nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);
// Fee-per-kilobyte amount considered the same as "free"
// Be careful setting this: if you set it to zero then
// a transaction spammer can cheaply fill blocks using
// 1-satoshi-fee transactions. It should be set above the real
// cost to you of processing a transaction.
int64_t nMinTxFee = MIN_TX_FEE;
if (mapArgs.count("-mintxfee"))
ParseMoney(mapArgs["-mintxfee"], nMinTxFee);
pblock->nBits = GetNextTargetRequired(pindexPrev, fProofOfStake);
// Collect memory pool transactions into the block
int64_t nFees = 0;
{
LOCK2(cs_main, mempool.cs);
CTxDB txdb("r");
// Priority order to process transactions
list<COrphan> vOrphan; // list memory doesn't move
map<uint256, vector<COrphan*> > mapDependers;
// This vector will be sorted into a priority queue:
vector<TxPriority> vecPriority;
vecPriority.reserve(mempool.mapTx.size());
for (map<uint256, CTransaction>::iterator mi = mempool.mapTx.begin(); mi != mempool.mapTx.end(); ++mi)
{
CTransaction& tx = (*mi).second;
if (tx.IsCoinBase() || tx.IsCoinStake() || !IsFinalTx(tx, nHeight))
continue;
COrphan* porphan = NULL;
double dPriority = 0;
int64_t nTotalIn = 0;
bool fMissingInputs = false;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
// Read prev transaction
CTransaction txPrev;
CTxIndex txindex;
if (!txPrev.ReadFromDisk(txdb, txin.prevout, txindex))
{
// This should never happen; all transactions in the memory
// pool should connect to either transactions in the chain
// or other transactions in the memory pool.
if (!mempool.mapTx.count(txin.prevout.hash))
{
LogPrintf("ERROR: mempool transaction missing input\n");
if (fDebug) assert("mempool transaction missing input" == 0);
fMissingInputs = true;
if (porphan)
vOrphan.pop_back();
break;
}
// Has to wait for dependencies
if (!porphan)
{
// Use list for automatic deletion
vOrphan.push_back(COrphan(&tx));
porphan = &vOrphan.back();
}
mapDependers[txin.prevout.hash].push_back(porphan);
porphan->setDependsOn.insert(txin.prevout.hash);
nTotalIn += mempool.mapTx[txin.prevout.hash].vout[txin.prevout.n].nValue;
continue;
}
int64_t nValueIn = txPrev.vout[txin.prevout.n].nValue;
nTotalIn += nValueIn;
int nConf = txindex.GetDepthInMainChain();
dPriority += (double)nValueIn * nConf;
}
if (fMissingInputs) continue;
// Priority is sum(valuein * age) / txsize
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
dPriority /= nTxSize;
// This is a more accurate fee-per-kilobyte than is used by the client code, because the
// client code rounds up the size to the nearest 1K. That's good, because it gives an
// incentive to create smaller transactions.
double dFeePerKb = double(nTotalIn-tx.GetValueOut()) / (double(nTxSize)/1000.0);
if (porphan)
{
porphan->dPriority = dPriority;
porphan->dFeePerKb = dFeePerKb;
}
else
vecPriority.push_back(TxPriority(dPriority, dFeePerKb, &(*mi).second));
}
// Collect transactions into block
map<uint256, CTxIndex> mapTestPool;
uint64_t nBlockSize = 1000;
uint64_t nBlockTx = 0;
int nBlockSigOps = 100;
bool fSortedByFee = (nBlockPrioritySize <= 0);
TxPriorityCompare comparer(fSortedByFee);
std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);
while (!vecPriority.empty())
{
// Take highest priority transaction off the priority queue:
double dPriority = vecPriority.front().get<0>();
double dFeePerKb = vecPriority.front().get<1>();
CTransaction& tx = *(vecPriority.front().get<2>());
std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer);
vecPriority.pop_back();
// Size limits
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
if (nBlockSize + nTxSize >= nBlockMaxSize)
continue;
// Legacy limits on sigOps:
unsigned int nTxSigOps = GetLegacySigOpCount(tx);
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
// Timestamp limit
if (tx.nTime > GetAdjustedTime() || (fProofOfStake && tx.nTime > pblock->vtx[0].nTime))
continue;
// Transaction fee
int64_t nMinFee = GetMinFee(tx, nBlockSize, GMF_BLOCK);
// Skip free transactions if we're past the minimum block size:
if (fSortedByFee && (dFeePerKb < nMinTxFee) && (nBlockSize + nTxSize >= nBlockMinSize))
continue;
// Prioritize by fee once past the priority size or we run out of high-priority
// transactions:
if (!fSortedByFee &&
((nBlockSize + nTxSize >= nBlockPrioritySize) || (dPriority < COIN * 144 / 250)))
{
fSortedByFee = true;
comparer = TxPriorityCompare(fSortedByFee);
std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);
}
// Connecting shouldn't fail due to dependency on other memory pool transactions
// because we're already processing them in order of dependency
map<uint256, CTxIndex> mapTestPoolTmp(mapTestPool);
MapPrevTx mapInputs;
bool fInvalid;
if (!tx.FetchInputs(txdb, mapTestPoolTmp, false, true, mapInputs, fInvalid))
continue;
int64_t nTxFees = tx.GetValueIn(mapInputs)-tx.GetValueOut();
if (nTxFees < nMinFee)
continue;
nTxSigOps += GetP2SHSigOpCount(tx, mapInputs);
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
// Note that flags: we don't want to set mempool/IsStandard()
// policy here, but we still have to ensure that the block we
// create only contains transactions that are valid in new blocks.
if (!tx.ConnectInputs(txdb, mapInputs, mapTestPoolTmp, CDiskTxPos(1,1,1), pindexPrev, false, true, MANDATORY_SCRIPT_VERIFY_FLAGS))
continue;
mapTestPoolTmp[tx.GetHash()] = CTxIndex(CDiskTxPos(1,1,1), tx.vout.size());
swap(mapTestPool, mapTestPoolTmp);
// Added
pblock->vtx.push_back(tx);
nBlockSize += nTxSize;
++nBlockTx;
nBlockSigOps += nTxSigOps;
nFees += nTxFees;
if (fDebug && GetBoolArg("-printpriority", false))
{
LogPrintf("priority %.1f feeperkb %.1f txid %s\n",
dPriority, dFeePerKb, tx.GetHash().ToString());
}
// Add transactions that depend on this one to the priority queue
uint256 hash = tx.GetHash();
if (mapDependers.count(hash))
{
BOOST_FOREACH(COrphan* porphan, mapDependers[hash])
{
if (!porphan->setDependsOn.empty())
{
porphan->setDependsOn.erase(hash);
if (porphan->setDependsOn.empty())
{
vecPriority.push_back(TxPriority(porphan->dPriority, porphan->dFeePerKb, porphan->ptx));
std::push_heap(vecPriority.begin(), vecPriority.end(), comparer);
}
}
}
}
}
nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
if (fDebug && GetBoolArg("-printpriority", false))
LogPrintf("CreateNewBlock(): total size %u\n", nBlockSize);
if (!fProofOfStake)
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(nFees);
if (pFees)
*pFees = nFees;
// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
pblock->nTime = max(pindexPrev->GetPastTimeLimit()+1, pblock->GetMaxTransactionTime());
if (!fProofOfStake)
pblock->UpdateTime(pindexPrev);
pblock->nNonce = 0;
}
return pblock.release();
}
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce)
{
// Update nExtraNonce
static uint256 hashPrevBlock;
if (hashPrevBlock != pblock->hashPrevBlock)
{
nExtraNonce = 0;
hashPrevBlock = pblock->hashPrevBlock;
}
++nExtraNonce;
unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2
pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
}
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1)
{
//
// Pre-build hash buffers
//
struct
{
struct unnamed2
{
int nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;
}
block;
unsigned char pchPadding0[64];
uint256 hash1;
unsigned char pchPadding1[64];
}
tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.block.nVersion = pblock->nVersion;
tmp.block.hashPrevBlock = pblock->hashPrevBlock;
tmp.block.hashMerkleRoot = pblock->hashMerkleRoot;
tmp.block.nTime = pblock->nTime;
tmp.block.nBits = pblock->nBits;
tmp.block.nNonce = pblock->nNonce;
FormatHashBlocks(&tmp.block, sizeof(tmp.block));
FormatHashBlocks(&tmp.hash1, sizeof(tmp.hash1));
// Byte swap all the input buffer
for (unsigned int i = 0; i < sizeof(tmp)/4; i++)
((unsigned int*)&tmp)[i] = ByteReverse(((unsigned int*)&tmp)[i]);
// Precalc the first half of the first hash, which stays constant
SHA256Transform(pmidstate, &tmp.block, pSHA256InitState);
memcpy(pdata, &tmp.block, 128);
memcpy(phash1, &tmp.hash1, 64);
}
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
uint256 hashBlock = pblock->GetHash();
uint256 hashProof = pblock->GetPoWHash();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
if(!pblock->IsProofOfWork())
return error("CheckWork() : %s is not a proof-of-work block", hashBlock.GetHex());
if (hashProof > hashTarget)
return error("CheckWork() : proof-of-work not meeting target");
//// debug print
LogPrintf("CheckWork() : new proof-of-work block found \n proof hash: %s \ntarget: %s\n", hashProof.GetHex(), hashTarget.GetHex());
LogPrintf("%s\n", pblock->ToString());
LogPrintf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue));
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("CheckWork() : generated block is stale");
// Remove key from key pool
reservekey.KeepKey();
// Track how many getdata requests this block gets
{
LOCK(wallet.cs_wallet);
wallet.mapRequestCount[hashBlock] = 0;
}
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
return error("CheckWork() : ProcessBlock, block not accepted");
}
return true;
}
bool CheckStake(CBlock* pblock, CWallet& wallet)
{
uint256 proofHash = 0, hashTarget = 0;
uint256 hashBlock = pblock->GetHash();
if(!pblock->IsProofOfStake())
return error("CheckStake() : %s is not a proof-of-stake block", hashBlock.GetHex());
// verify hash target and signature of coinstake tx
if (!CheckProofOfStake(mapBlockIndex[pblock->hashPrevBlock], pblock->vtx[1], pblock->nBits, proofHash, hashTarget))
return error("CheckStake() : proof-of-stake checking failed");
//// debug print
LogPrintf("CheckStake() : new proof-of-stake block found \n hash: %s \nproofhash: %s \ntarget: %s\n", hashBlock.GetHex(), proofHash.GetHex(), hashTarget.GetHex());
LogPrintf("%s\n", pblock->ToString());
LogPrintf("out %s\n", FormatMoney(pblock->vtx[1].GetValueOut()));
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("CheckStake() : generated block is stale");
// Track how many getdata requests this block gets
{
LOCK(wallet.cs_wallet);
wallet.mapRequestCount[hashBlock] = 0;
}
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
return error("CheckStake() : ProcessBlock, block not accepted");
}
return true;
}
void ThreadStakeMiner(CWallet *pwallet)
{
SetThreadPriority(THREAD_PRIORITY_LOWEST);
// Make this thread recognisable as the mining thread
RenameThread("telebet-miner");
CReserveKey reservekey(pwallet);
bool fTryToSync = true;
while (true)
{
while (pwallet->IsLocked())
{
nLastCoinStakeSearchInterval = 0;
MilliSleep(1000);
}
while (vNodes.empty() || IsInitialBlockDownload())
{
nLastCoinStakeSearchInterval = 0;
fTryToSync = true;
MilliSleep(1000);
}
if (fTryToSync)
{
fTryToSync = false;
if (vNodes.size() < 3 || pindexBest->GetBlockTime() < GetTime() - 10 * 60)
{
MilliSleep(60000);
continue;
}
}
//
// Create new block
//
int64_t nFees;
auto_ptr<CBlock> pblock(CreateNewBlock(reservekey, true, &nFees));
if (!pblock.get())
return;
// Trying to sign a block
if (pblock->SignBlock(*pwallet, nFees))
{
SetThreadPriority(THREAD_PRIORITY_NORMAL);
CheckStake(pblock.get(), *pwallet);
SetThreadPriority(THREAD_PRIORITY_LOWEST);
MilliSleep(500);
}
else
MilliSleep(nMinerSleep);
}
}
| [
"telebetteam@gmail.com"
] | telebetteam@gmail.com |
696530ecb61aec701a00bf6f1a5532a8f90835e4 | 1c8856bd66702198a6748e19f61671e43c3d5076 | /src/Models/SortedAddressBookModel.h | 8647f931380bd7e46e22b8220f1496b58f360db8 | [] | no_license | Camellia73/Xcoin-GUI-wallet-dev | bd68f571c945f782379eafb77a63ab11b8b60f70 | a13d57f0f89fab92cfc368162e07080a6d1cd7ab | refs/heads/master | 2022-02-10T03:06:55.463672 | 2022-01-31T15:59:39 | 2022-01-31T15:59:39 | 195,107,451 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,143 | h | // Copyright (c) 2015-2017, The Bytecoin developers
//
// This file is part of Bytecoin.
//
// Xcoin is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Xcoin 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 Xcoin. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <QSortFilterProxyModel>
namespace WalletGui {
class SortedAddressBookModel : public QSortFilterProxyModel {
Q_OBJECT
Q_DISABLE_COPY(SortedAddressBookModel)
public:
SortedAddressBookModel(QAbstractItemModel* _sourceModel, QObject* _parent);
~SortedAddressBookModel();
protected:
bool lessThan(const QModelIndex& _left, const QModelIndex& _right) const override;
};
}
| [
"blackrosecoin@tutanota.com"
] | blackrosecoin@tutanota.com |
36eff11ed6c7a53aac56fe33051da06fb3fc4c13 | 70edb4f46d89276f678a994bd009f3ce13de04eb | /thirdparty/JavaScriptCore/JSWeakObjectMapRefPrivate.cpp | d2c537a8a0141b22dd34bf8984a39c630e9ebf46 | [
"MIT"
] | permissive | erickzhao/neutralinojs | f31f2b0d931f2cb62c166571a736765871d4a31b | 654644f65ff865ef1c9ff41608c02410ac4e9ed2 | refs/heads/master | 2020-09-16T13:35:18.529180 | 2019-11-25T01:46:29 | 2019-11-25T01:46:29 | 223,785,447 | 1 | 0 | MIT | 2019-11-24T17:50:44 | 2019-11-24T17:48:33 | C++ | UTF-8 | C++ | false | false | 3,453 | cpp | /*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "JSWeakObjectMapRefPrivate.h"
#include "APICast.h"
#include "JSCJSValue.h"
#include "JSCallbackObject.h"
#include "JSWeakObjectMapRefInternal.h"
#include "JSCInlines.h"
#include "Weak.h"
#include "WeakGCMapInlines.h"
using namespace JSC;
#ifdef __cplusplus
extern "C" {
#endif
JSWeakObjectMapRef JSWeakObjectMapCreate(JSContextRef context, void* privateData, JSWeakMapDestroyedCallback callback)
{
JSGlobalObject* globalObject = toJS(context);
VM& vm = globalObject->vm();
JSLockHolder locker(vm);
auto map = OpaqueJSWeakObjectMap::create(vm, privateData, callback);
globalObject->registerWeakMap(map.ptr());
return map.ptr();
}
void JSWeakObjectMapSet(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSObjectRef object)
{
if (!ctx) {
ASSERT_NOT_REACHED();
return;
}
JSGlobalObject* globalObject = toJS(ctx);
VM& vm = globalObject->vm();
JSLockHolder locker(vm);
JSObject* obj = toJS(object);
if (!obj)
return;
ASSERT(obj->inherits<JSProxy>(vm)
|| obj->inherits<JSCallbackObject<JSGlobalObject>>(vm)
|| obj->inherits<JSCallbackObject<JSDestructibleObject>>(vm));
map->map().set(key, obj);
}
JSObjectRef JSWeakObjectMapGet(JSContextRef ctx, JSWeakObjectMapRef map, void* key)
{
if (!ctx) {
ASSERT_NOT_REACHED();
return 0;
}
JSGlobalObject* globalObject = toJS(ctx);
JSLockHolder locker(globalObject);
return toRef(jsCast<JSObject*>(map->map().get(key)));
}
void JSWeakObjectMapRemove(JSContextRef ctx, JSWeakObjectMapRef map, void* key)
{
if (!ctx) {
ASSERT_NOT_REACHED();
return;
}
JSGlobalObject* globalObject = toJS(ctx);
JSLockHolder locker(globalObject);
map->map().remove(key);
}
// We need to keep this function in the build to keep the nightlies running.
JS_EXPORT bool JSWeakObjectMapClear(JSContextRef, JSWeakObjectMapRef, void*, JSObjectRef);
bool JSWeakObjectMapClear(JSContextRef, JSWeakObjectMapRef, void*, JSObjectRef)
{
return true;
}
#ifdef __cplusplus
}
#endif
| [
"erick@hotmail.ca"
] | erick@hotmail.ca |
affe5b2eca865f658da8ea6d9a0097648e054a19 | 73ebcf788041071a87add04bec5b08675573b78f | /final/phylobase/src/ncl/nxsdefs.h | 8117c7a0c2c59a0f7be99bd49aa31c292156b036 | [] | no_license | rachan5/ECS158HW2 | 3c721b23f0dcf6830531ca57b75d71ef32b56919 | 443e21edcb3a3622a2f6ed913ee86d7bf5fdcbe3 | refs/heads/master | 2020-04-10T00:08:04.302301 | 2015-03-21T06:51:37 | 2015-03-21T06:51:37 | 30,328,120 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,913 | h | // Copyright (C) 1999-2003 Paul O. Lewis
//
// This file is part of NCL (Nexus Class Library) version 2.0.
//
// NCL 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.
//
// NCL 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 NCL; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#ifndef NCL_NXSDEFS_H
#define NCL_NXSDEFS_H
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <utility>
#define NCL_MAJOR_VERSION 2
#define NCL_MINOR_VERSION 1
#define NCL_NAME_AND_VERSION "NCL version 2.1.10"
#define NCL_COPYRIGHT "Copyright (c) 1999-2010 by Paul O. Lewis"
#define NCL_HOMEPAGEURL "http://sourceforge.net/projects/ncl"
// NCL_COULD_BE_CONST is a mechanism for declaring some old (v < 2.1) functions
// to be const without breaking old client code.
// If you would like your code to be more const-correct, then define NCL_CONST_FUNCS
// when you compile NCL and your code. This will cause several functions that
// should have been declared as const to be declared that way in your code.
// By default NCL_CONST_FUNCS will not be defined and these functions will not
// be defined as const member functions.
#if defined(NCL_CONST_FUNCS) && NCL_CONST_FUNCS
# define NCL_COULD_BE_CONST const
int onlyDefinedInCouldBeConst();
#else
# define NCL_COULD_BE_CONST
#endif
#if defined(IGNORE_NXS_ASSERT) || defined(NDEBUG)
# define NCL_ASSERT(expr)
#else
void ncl_assertion_failed(char const * expr, char const * function, char const * file, long line);
# define NCL_ASSERT(expr) if (!(expr)) ncl_assertion_failed((const char *)#expr, (const char *)__FUNCTION__, __FILE__, __LINE__)
#endif
// Maximum number of states that can be stored; the only limitation is that this
// number be less than the maximum size of an int (not likely to be a problem).
// A good number for this is 76, which is 96 (the number of distinct symbols
// able to be input from a standard keyboard) less 20 (the number of symbols
// symbols disallowed by the NEXUS standard for use as state symbols)
//
#define NCL_MAX_STATES 76
typedef std::streampos file_pos;
#define SUPPORT_OLD_NCL_NAMES
class NxsString;
typedef std::vector<bool> NxsBoolVector;
typedef std::vector<char> NxsCharVector;
typedef std::vector<int> NxsIntVector;
typedef std::vector<unsigned> NxsUnsignedVector;
typedef std::vector<NxsString> NxsStringVector;
typedef std::vector<NxsStringVector> NxsAllelesVector;
typedef std::set<unsigned> NxsUnsignedSet;
typedef std::map< unsigned, NxsStringVector> NxsStringVectorMap;
typedef std::map< NxsString, NxsString> NxsStringMap;
typedef std::map< NxsString, NxsUnsignedSet> NxsUnsignedSetMap;
typedef std::pair<std::string, NxsUnsignedSet> NxsPartitionGroup;
typedef std::list<NxsPartitionGroup> NxsPartition;
typedef std::map<std::string, NxsPartition> NxsPartitionsByName;
// The following typedefs are simply for maintaining compatibility with existing code.
// The names on the right are deprecated and should not be used.
//
typedef NxsBoolVector BoolVect;
typedef NxsUnsignedSet IntSet;
typedef NxsUnsignedSetMap IntSetMap;
typedef NxsAllelesVector AllelesVect;
typedef NxsStringVector LabelList;
typedef NxsStringVector StrVec;
typedef NxsStringVector vecStr;
typedef NxsStringVectorMap LabelListBag;
typedef NxsStringMap AssocList;
class ProcessedNxsToken;
typedef std::vector<ProcessedNxsToken> ProcessedNxsCommand;
#endif
| [
"raschan@ucdavis.edu"
] | raschan@ucdavis.edu |
94f32afff9c382c498cf8399dbcdd824655b60ab | b4b6c04c65cff97e42999f7cfd2305b5c3f51cdd | /tensorpipe/channel/cuda_gdr/channel_impl.h | d6319857fbf29b8fa01e0cb5002c5179c3737fd8 | [
"BSD-3-Clause"
] | permissive | Pandinosaurus/tensorpipe | 84409f890083393acda38eeb38eebc82c8187cf6 | 6042f1a4cbce8eef997f11ed0012de137b317361 | refs/heads/master | 2023-07-14T22:06:26.443000 | 2021-08-31T10:10:51 | 2021-08-31T10:11:56 | 350,055,306 | 0 | 0 | NOASSERTION | 2021-08-31T14:16:07 | 2021-03-21T16:31:43 | C++ | UTF-8 | C++ | false | false | 8,808 | h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <list>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <nop/serializer.h>
#include <nop/structure.h>
#include <tensorpipe/channel/channel_impl_boilerplate.h>
#include <tensorpipe/common/cuda.h>
#include <tensorpipe/common/cuda_buffer.h>
#include <tensorpipe/common/ibv.h>
#include <tensorpipe/common/state_machine.h>
#include <tensorpipe/transport/context.h>
namespace tensorpipe {
namespace channel {
namespace cuda_gdr {
class ContextImpl;
// Ideally we would use NOP_EXTERNAL_STRUCTURE instead of defining the following
// two structs, but we tried so in D26460332 and failed because a bug in GCC 5.5
// (and probably other versions) requires every nop structure used inside a
// std::vector to have an explicit non-defaulted default constructor, which is
// something we cannot do with NOP_EXTERNAL_STRUCTURE and forces us to re-define
// separate structs.
// Replicate the IbvLib::gid struct so we can serialize it with libnop.
struct NopIbvGid {
uint64_t subnetPrefix;
uint64_t interfaceId;
NOP_STRUCTURE(NopIbvGid, subnetPrefix, interfaceId);
void fromIbvGid(const IbvLib::gid& globalIdentifier) {
subnetPrefix = globalIdentifier.global.subnet_prefix;
interfaceId = globalIdentifier.global.interface_id;
}
IbvLib::gid toIbvGid() const {
IbvLib::gid globalIdentifier;
globalIdentifier.global.subnet_prefix = subnetPrefix;
globalIdentifier.global.interface_id = interfaceId;
return globalIdentifier;
}
};
// Replicate the IbvSetupInformation struct so we can serialize it with libnop.
struct NopIbvSetupInformation {
// This pointless constructor is needed to work around a bug in GCC 5.5 (and
// possibly other versions). It appears to be needed in the nop types that
// are used inside std::vectors.
NopIbvSetupInformation() {}
uint32_t localIdentifier;
NopIbvGid globalIdentifier;
uint32_t queuePairNumber;
IbvLib::mtu maximumTransmissionUnit;
uint32_t maximumMessageSize;
NOP_STRUCTURE(
NopIbvSetupInformation,
localIdentifier,
globalIdentifier,
queuePairNumber,
maximumTransmissionUnit,
maximumMessageSize);
void fromIbvSetupInformation(const IbvSetupInformation& setupInfo) {
localIdentifier = setupInfo.localIdentifier;
globalIdentifier.fromIbvGid(setupInfo.globalIdentifier);
queuePairNumber = setupInfo.queuePairNumber;
maximumTransmissionUnit = setupInfo.maximumTransmissionUnit;
maximumMessageSize = setupInfo.maximumMessageSize;
}
IbvSetupInformation toIbvSetupInformation() const {
IbvSetupInformation setupInfo;
setupInfo.localIdentifier = localIdentifier;
setupInfo.globalIdentifier = globalIdentifier.toIbvGid();
setupInfo.queuePairNumber = queuePairNumber;
setupInfo.maximumTransmissionUnit = maximumTransmissionUnit;
setupInfo.maximumMessageSize = maximumMessageSize;
return setupInfo;
}
};
struct SendOperation {
enum State {
UNINITIALIZED,
READING_READY_TO_RECEIVE,
WAITING_FOR_CUDA_EVENT,
SENDING_OVER_IB,
FINISHED
};
// Fields used by the state machine
uint64_t sequenceNumber{0};
State state{UNINITIALIZED};
// Progress flags
bool doneReadingReadyToReceive{false};
bool doneWaitingForCudaEvent{false};
uint64_t numChunksBeingSent{0};
// Arguments at creation
const CudaBuffer buffer;
const size_t length;
const size_t localNicIdx;
TSendCallback callback;
// Other stuff
CudaEvent event;
size_t remoteNicIdx;
SendOperation(
CudaBuffer buffer,
size_t length,
TSendCallback callback,
size_t localGpuIdx,
size_t localNicIdx)
: buffer(buffer),
length(length),
localNicIdx(localNicIdx),
callback(std::move(callback)),
event(localGpuIdx) {}
};
struct RecvOperation {
enum State {
UNINITIALIZED,
READING_DESCRIPTOR,
WAITING_FOR_CUDA_EVENT,
RECEIVING_OVER_IB,
FINISHED
};
// Fields used by the state machine
uint64_t sequenceNumber{0};
State state{UNINITIALIZED};
// Progress flags
bool doneReadingDescriptor{false};
bool doneWaitingForCudaEvent{false};
uint64_t numChunksBeingReceived{0};
// Arguments at creation
const CudaBuffer buffer;
const size_t length;
const size_t localNicIdx;
TSendCallback callback;
// Other stuff
size_t remoteNicIdx;
CudaEvent event;
RecvOperation(
CudaBuffer buffer,
size_t length,
TSendCallback callback,
size_t deviceIdx,
size_t localNicIdx)
: buffer(buffer),
length(length),
localNicIdx(localNicIdx),
callback(std::move(callback)),
event(deviceIdx) {}
};
// First "round" of handshake.
struct HandshakeNumNics {
size_t numNics;
NOP_STRUCTURE(HandshakeNumNics, numNics);
};
// Second "round" of handshake.
struct HandshakeSetupInfo {
std::vector<std::vector<NopIbvSetupInformation>> setupInfo;
NOP_STRUCTURE(HandshakeSetupInfo, setupInfo);
};
// From sender to receiver (through pipe).
struct Descriptor {
size_t originNicIdx;
NOP_STRUCTURE(Descriptor, originNicIdx);
};
// From receiver to sender (through channel's connection).
struct ReadyToReceive {
size_t destinationNicIdx;
NOP_STRUCTURE(ReadyToReceive, destinationNicIdx);
};
class ChannelImpl final
: public ChannelImplBoilerplate<ContextImpl, ChannelImpl> {
public:
ChannelImpl(
ConstructorToken token,
std::shared_ptr<ContextImpl> context,
std::string id,
std::shared_ptr<transport::Connection> descriptorConnection,
std::shared_ptr<transport::Connection> readyToReceiveConnection);
protected:
// Implement the entry points called by ChannelImplBoilerplate.
void initImplFromLoop() override;
void sendImplFromLoop(
uint64_t sequenceNumber,
Buffer buffer,
size_t length,
TSendCallback callback) override;
void recvImplFromLoop(
uint64_t sequenceNumber,
Buffer buffer,
size_t length,
TRecvCallback callback) override;
void handleErrorImpl() override;
private:
const std::shared_ptr<transport::Connection> descriptorConnection_;
const std::shared_ptr<transport::Connection> readyToReceiveConnection_;
enum State {
INITIALIZING = 1,
WAITING_FOR_HANDSHAKE_NUM_NICS,
WAITING_FOR_HANDSHAKE_SETUP_INFO,
ESTABLISHED,
};
State state_{INITIALIZING};
std::vector<size_t> localGpuToNic_;
size_t numLocalNics_{0};
size_t numRemoteNics_{0};
// This struct is used to bundle the queue pair with some additional metadata.
struct QueuePair {
IbvQueuePair queuePair;
// The CUDA GDR channel could be asked to transmit arbitrarily large tensors
// and in principle it could directly forward them to the NIC as they are.
// However IB NICs have limits on the size of each message. Hence we
// determine these sizes, one per queue pair (as the minimum of the local
// and remote sizes) and then split our tensors in chunks of that size.
uint32_t maximumMessageSize;
};
std::vector<std::vector<QueuePair>> queuePairs_;
OpsStateMachine<ChannelImpl, SendOperation> sendOps_{
*this,
&ChannelImpl::advanceSendOperation};
using SendOpIter = decltype(sendOps_)::Iter;
OpsStateMachine<ChannelImpl, RecvOperation> recvOps_{
*this,
&ChannelImpl::advanceRecvOperation};
using RecvOpIter = decltype(recvOps_)::Iter;
uint32_t numSendsInFlight_{0};
uint32_t numRecvsInFlight_{0};
// Callbacks for the initial handshake phase.
void onReadHandshakeNumNics(const HandshakeNumNics& nopHandshakeNumNics);
void onReadHandshakeSetupInfo(
const HandshakeSetupInfo& nopHandshakeSetupInfo);
// Cleanup methods for teardown.
void tryCleanup();
void cleanup();
// State machines for send and recv ops.
void advanceSendOperation(
SendOpIter opIter,
SendOperation::State prevOpState);
void advanceRecvOperation(
RecvOpIter opIter,
RecvOperation::State prevOpState);
// Actions (i.e., methods that begin a state transition).
// For send operations:
void writeDescriptor(SendOpIter opIter);
void readReadyToReceive(SendOpIter opIter);
void waitForSendCudaEvent(SendOpIter opIter);
void sendOverIb(SendOpIter opIter);
void callSendCallback(SendOpIter opIter);
// For recv operations:
void readDescriptor(RecvOpIter opIter);
void waitForRecvCudaEvent(RecvOpIter opIter);
void recvOverIbAndWriteReadyToRecive(RecvOpIter opIter);
void callRecvCallback(RecvOpIter opIter);
};
} // namespace cuda_gdr
} // namespace channel
} // namespace tensorpipe
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
4fe633a28011c0f85188728f4b83ed10085e1b2e | e3ec7d68f544e82c6016409ce2a59a5680f19b1e | /C++/kniha/kody/kap17/17.14 peeker.cpp | 197176b7172ba2a1c38fd536902e7fdef85d63a9 | [] | no_license | branislavblazek/notes | 429a9c3ceb142de9cfb460a0a8c1389f2313454e | e88072ff01ecba6e96d70decb5b5597755b8e925 | refs/heads/master | 2021-10-23T13:33:59.211385 | 2021-10-13T19:41:03 | 2021-10-13T19:41:03 | 239,040,112 | 0 | 0 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 787 | cpp | // peeker.cpp -- některé metody z istream
#include <iostream>
int main()
{
using std::cout;
using std::cin;
using std::endl;
// čte a zobrazuje vstup až do znaku #
char ch;
while(cin.get(ch)) // skončí při EOF
{
if (ch != '#')
cout << ch;
else
{
cin.putback(ch); // vloží znak zpět
break;
}
}
if (!cin.eof())
{
cin.get(ch);
cout << endl << "Dalsim vstupnim znakem je " << ch << ".\n";
}
else
{
cout << "Konec souboru.\n";
std::exit(0);
}
while(cin.peek() != '#') // předem kontroluje vstupní znaky
{
cin.get(ch);
cout << ch;
}
if (!cin.eof())
{
cin.get(ch);
cout << endl << "Dalsim vstupnim znakem je " << ch << ".\n";
}
else
cout << "Konec souboru.\n";
return 0;
}
| [
"branislav.blazek.bb@gmail.com"
] | branislav.blazek.bb@gmail.com |
2a49a823fb8072a49bed2c65c60b79d307e6f21b | 3c65a5f203f2d4b02ff9c1bdd999c9e3b18007e7 | /rpc/msgcli.cpp | a39de843cc571be7e6b0f7722ae2f7ed680db2b2 | [
"BSL-1.0"
] | permissive | cristivlas/zerobugs | 07c81ceec27fd1191716e52b29825087baad39e4 | 5f080c8645b123d7887fd8a64f60e8d226e3b1d5 | refs/heads/master | 2020-03-19T17:20:35.491229 | 2018-06-09T20:17:55 | 2018-06-09T20:17:55 | 136,754,214 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,815 | cpp | // -*- tab-width: 4; indent-tabs-mode: nil; -*-
// vim: tabstop=4:softtabstop=4:expandtab:shiftwidth=4
//
// $Id$
//
// -------------------------------------------------------------------------
// This file is part of ZeroBugs, Copyright (c) 2010 Cristian L. Vlasceanu
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// -------------------------------------------------------------------------
#include <iostream>
#include <stdexcept>
#include "zdk/zero.h"
#include "dharma/syscall_wrap.h"
#include "msg.h"
using namespace std;
RPC::Error::Error(const exception& e)
{
value<RPC::err_what>(*this) = e.what();
}
RPC::Error::Error(const SystemError& e)
{
value<RPC::err_what>(*this) = e.what();
value<RPC::err_errno>(*this) = e.error();
}
bool RPC::Error::dispatch(InputStream&, OutputStream&)
{
if (word_t e = value<RPC::err_errno>(*this))
{
throw SystemError(e, value<RPC::err_what>(*this), false);
}
else
{
throw runtime_error(value<RPC::err_what>(*this));
}
return false;
}
RPC::Exec::Exec(const ExecArg& args, bool, const char* const* /* env */)
{
value<exec_cmd>(*this) = args.command_line();
}
RPC::Ptrace::Ptrace(__ptrace_request req, word_t pid, word_t addr, word_t data)
{
value<RPC::ptrace_req>(*this) = req;
value<RPC::ptrace_pid>(*this) = pid;
value<RPC::ptrace_addr>(*this) = addr;
value<RPC::ptrace_data>(*this) = data;
}
RPC::Waitpid::Waitpid(pid_t pid, int opt)
{
value<wait_pid>(*this) = pid;
value<wait_opt>(*this) = opt;
}
RPC::RemoteIO::RemoteIO(IOCommand op, const uint8_t* data, size_t size)
{
value<rio_op>(*this) = op;
value<rio_data>(*this).assign(data, data + size);
}
| [
"cvlasceanu@tableau.com"
] | cvlasceanu@tableau.com |
792b50054801c5519e0ead4a5347e4dae89c06ce | c1758d8320617d2358ef389412de09bc21ffd143 | /demo/cocos2dx/support/zip_support/ioapi.h | 98e0b2cfb33dd5aea98b178b888b78164db4b79f | [] | no_license | haxpor/ObjectAL-CppWrapper | 22b925bd62a205bd9037baaec0adb969286932f6 | 668db061f28897f78448105328bd9d4b3d5e78e6 | refs/heads/master | 2021-01-10T11:36:30.074583 | 2015-10-30T02:26:33 | 2015-10-30T02:26:33 | 45,214,418 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,877 | h | /* ioapi.h -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
Changes
Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)
Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
More if/def section may be needed to support other platforms
Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.
(but you should use iowin32.c for windows instead)
*/
#ifndef _ZLIBIOAPI64_H
#define _ZLIBIOAPI64_H
#include "platform/CCPlatformConfig.h"
#if (!defined(_WIN32)) && (!defined(WIN32))
// Linux needs this to support file operation on files larger then 4+GB
// But might need better if/def to select just the platforms that needs them.
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64
#endif
#ifndef __USE_LARGEFILE64
#define __USE_LARGEFILE64
#endif
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#ifndef _FILE_OFFSET_BIT
#define _FILE_OFFSET_BIT 64
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include "zconf.h"
#include "zlib.h"
namespace cocos2d {
#if defined(USE_FILE32API)
#define fopen64 fopen
#define ftello64 ftell
#define fseeko64 fseek
#else
#ifdef _MSC_VER
#define fopen64 fopen
#if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
#define ftello64 _ftelli64
#define fseeko64 _fseeki64
#else // old MSC
#define ftello64 ftell
#define fseeko64 fseek
#endif
#endif
#endif
/*
#ifndef ZPOS64_T
#ifdef _WIN32
#define ZPOS64_T fpos_t
#else
#include <stdint.h>
#define ZPOS64_T uint64_t
#endif
#endif
*/
#ifdef HAVE_MINIZIP64_CONF_H
#include "mz64conf.h"
#endif
/* a type chosen by DEFINE */
#ifdef HAVE_64BIT_INT_CUSTOM
typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
#else
#ifdef HAS_STDINT_H
#include "stdint.h"
typedef uint64_t ZPOS64_T;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 ZPOS64_T;
#else
typedef unsigned long long int ZPOS64_T;
#endif
#endif
#endif
#define ZLIB_FILEFUNC_SEEK_CUR (1)
#define ZLIB_FILEFUNC_SEEK_END (2)
#define ZLIB_FILEFUNC_SEEK_SET (0)
#define ZLIB_FILEFUNC_MODE_READ (1)
#define ZLIB_FILEFUNC_MODE_WRITE (2)
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
#define ZLIB_FILEFUNC_MODE_CREATE (8)
#ifndef ZCALLBACK
#if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
#define ZCALLBACK CALLBACK
#else
#define ZCALLBACK
#endif
#endif
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
/* here is the "old" 32 bits structure structure */
typedef struct zlib_filefunc_def_s
{
open_file_func zopen_file;
read_file_func zread_file;
write_file_func zwrite_file;
tell_file_func ztell_file;
seek_file_func zseek_file;
close_file_func zclose_file;
testerror_file_func zerror_file;
voidpf opaque;
} zlib_filefunc_def;
typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
typedef struct zlib_filefunc64_def_s
{
open64_file_func zopen64_file;
read_file_func zread_file;
write_file_func zwrite_file;
tell64_file_func ztell64_file;
seek64_file_func zseek64_file;
close_file_func zclose_file;
testerror_file_func zerror_file;
voidpf opaque;
} zlib_filefunc64_def;
void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
/* now internal definition, only for zip.c and unzip.h */
typedef struct zlib_filefunc64_32_def_s
{
zlib_filefunc64_def zfile_func64;
open_file_func zopen32_file;
tell_file_func ztell32_file;
seek_file_func zseek32_file;
} zlib_filefunc64_32_def;
#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);
#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
} // end of namespace cocos2d
#endif
| [
"haxpor@gmail.com"
] | haxpor@gmail.com |
69ece003cdaae23756a722bee4933555cfbe2a68 | a9e308c81c27a80c53c899ce806d6d7b4a9bbbf3 | /engine/xray/render/core/sources/xs_descriptor.cpp | 6453bac322410381d4c7bc2b1049a6e30bfcb0f8 | [] | no_license | NikitaNikson/xray-2_0 | 00d8e78112d7b3d5ec1cb790c90f614dc732f633 | 82b049d2d177aac15e1317cbe281e8c167b8f8d1 | refs/heads/master | 2023-06-25T16:51:26.243019 | 2020-09-29T15:49:23 | 2020-09-29T15:49:23 | 390,966,305 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,974 | cpp | ////////////////////////////////////////////////////////////////////////////
// Created : 13.04.2010
// Author : Armen Abroyan
// Copyright (C) GSC Game World - 2010
////////////////////////////////////////////////////////////////////////////
#include "pch.h"
#include <xray/render/core/xs_descriptor.h>
namespace xray {
namespace render_dx10 {
template <typename shader_data>
xs_descriptor <shader_data>::xs_descriptor()
{
}
template <typename shader_data>
void xs_descriptor <shader_data>::reset( res_xs_hw<shader_data> * xs_hw )
{
m_hw_shader = xs_hw;
if( m_hw_shader)
m_shader_data = xs_hw->data();
}
template<typename shader_data>
bool xs_descriptor<shader_data>::set_sampler ( char const * name, res_sampler_state * state)
{
for( int i = 0; i< D3D_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i)
{
if( m_shader_data.samplers[i].name != name)
continue;
m_shader_data.samplers[i].state = state;
return true;
}
return false;
}
template<typename shader_data>
bool xs_descriptor<shader_data>::set_texture ( char const * name, res_texture * texture)
{
for( int i = 0; i< D3D_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i)
{
if( m_shader_data.textures[i].name != name)
continue;
m_shader_data.textures[i].texture = texture;
return true;
}
return false;
}
template<typename shader_data>
bool xs_descriptor<shader_data>::use_texture ( char const * name)
{
for( int i = 0; i< D3D_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i)
if( m_shader_data.textures[i].name == name)
return true;
return false;
}
template<typename shader_data>
bool xs_descriptor<shader_data>::use_sampler ( char const * name)
{
for( int i = 0; i< D3D_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i)
if( m_shader_data.samplers[i].name == name)
return true;
return false;
}
// Specialization definitions
template class xs_descriptor<vs_data>;
template class xs_descriptor<gs_data>;
template class xs_descriptor<ps_data>;
} // namespace render
} // namespace xray
| [
"loxotron@bk.ru"
] | loxotron@bk.ru |
25b3e9f7598f58f99357750e522ed6a776f49949 | 87aba51b1f708b47d78b5c4180baf731d752e26d | /Replication/DataFileSystem/PRODUCT_SOURCE_CODE/itk/Modules/ThirdParty/VNL/src/vxl/vcl/emulation/vcl_list.h | 2001061c0e2666d29d52881926358f480d9dcca0 | [] | no_license | jstavr/Architecture-Relation-Evaluator | 12c225941e9a4942e83eb6d78f778c3cf5275363 | c63c056ee6737a3d90fac628f2bc50b85c6bd0dc | refs/heads/master | 2020-12-31T05:10:08.774893 | 2016-05-14T16:09:40 | 2016-05-14T16:09:40 | 58,766,508 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,911 | h | /*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Exception Handling:
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Adaptation:
* Copyright (c) 1997
* Moscow Center for SPARC Technology
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Moscow Center for SPARC Technology makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
#ifndef vcl_emulation_list_h
#define vcl_emulation_list_h
#include <vcl_new.h>
#include <vcl_cstddef.h>
#include "vcl_algobase.h"
#include "vcl_iterator.h"
#include "vcl_alloc.h"
# if defined ( __STL_USE_ABBREVS )
# define __list_iterator LIt
# define __list_const_iterator LcIt
# endif
template <class T> struct __list_iterator;
template <class T> struct __list_const_iterator;
template <class T>
struct __list_node {
typedef void* void_pointer;
void_pointer next;
void_pointer prev;
T data;
};
template<class T>
struct __list_iterator {
typedef __list_iterator<T> iterator;
typedef __list_const_iterator<T> const_iterator;
typedef T value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef vcl_size_t size_type;
typedef vcl_ptrdiff_t difference_type;
typedef __list_node<T>* link_type;
link_type node;
__list_iterator(link_type x) : node(x) {}
__list_iterator() {}
bool operator==(const iterator& x) const {
__stl_debug_check(__check_same_owner(*this,x));
return node == x.node;
}
bool operator!=(const iterator& x) const {
__stl_debug_check(__check_same_owner(*this,x));
return node != x.node;
}
reference operator*() const {
__stl_verbose_assert(node!=owner(), __STL_MSG_NOT_DEREFERENCEABLE);
return (*node).data;
}
iterator& operator++() {
__stl_verbose_assert(node!=owner(), __STL_MSG_INVALID_ADVANCE);
node = (link_type)((*node).next);
return *this;
}
iterator operator++(int) {
iterator tmp = *this;
++*this;
return tmp;
}
iterator& operator--() {
node = (link_type)((*node).prev);
__stl_verbose_assert(node!=owner(), __STL_MSG_INVALID_ADVANCE);
return *this;
}
iterator operator--(int) {
iterator tmp = *this;
--*this;
return tmp;
}
};
template<class T>
struct __list_const_iterator {
typedef __list_iterator<T> iterator;
typedef __list_const_iterator<T> const_iterator;
typedef T value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef vcl_size_t size_type;
typedef vcl_ptrdiff_t difference_type;
typedef __list_node<T>* link_type;
link_type node;
__list_const_iterator(link_type x) : node(x) {}
__list_const_iterator(const iterator& x) : node(x.node) {}
__list_const_iterator() {}
bool operator==(const const_iterator& x) const {
__stl_debug_check(__check_same_owner(*this,x));
return node == x.node;
}
bool operator!=(const const_iterator& x) const {
__stl_debug_check(__check_same_owner(*this,x));
return node != x.node;
}
const_reference operator*() const {
__stl_verbose_assert(node!=owner(), __STL_MSG_NOT_DEREFERENCEABLE);
return (*node).data; }
const_iterator& operator++() {
__stl_verbose_assert(node!=owner(), __STL_MSG_INVALID_ADVANCE);
node = (link_type)((*node).next);
return *this;
}
const_iterator operator++(int) {
const_iterator tmp = *this;
++*this;
return tmp;
}
const_iterator& operator--() {
node = (link_type)((*node).prev);
__stl_verbose_assert(node!=owner(), __STL_MSG_INVALID_ADVANCE);
return *this;
}
const_iterator operator--(int) {
const_iterator tmp = *this;
--*this;
return tmp;
}
};
template <class T>
inline vcl_bidirectional_iterator_tag
iterator_category(const __list_iterator<T>&) {
return vcl_bidirectional_iterator_tag();
}
template <class T>
inline T*
value_type(const __list_iterator<T>&) {
return (T*) 0;
}
template <class T>
inline vcl_ptrdiff_t*
distance_type(const __list_iterator<T>&) {
return (vcl_ptrdiff_t*) 0;
}
template <class T>
inline vcl_bidirectional_iterator_tag
iterator_category(const __list_const_iterator<T>&) {
return vcl_bidirectional_iterator_tag();
}
template <class T>
inline T*
value_type(const __list_const_iterator<T>&) {
return (T*) 0;
}
template <class T>
inline vcl_ptrdiff_t*
distance_type(const __list_const_iterator<T>&) {
return (vcl_ptrdiff_t*) 0;
}
template <class T, class Alloc>
class __list_base {
typedef __list_base<T,Alloc> self;
typedef T value_type;
typedef vcl_size_t size_type;
typedef __list_node<T> list_node;
typedef list_node* link_type;
protected:
typedef vcl_simple_alloc<list_node, Alloc> list_node_allocator;
link_type node;
size_type length;
public:
__list_base() {
node = get_node();
(*node).next = node;
(*node).prev = node;
length=0;
__stl_debug_do(iter_list.safe_init(node));
}
~__list_base() {
clear();
put_node(node);
__stl_debug_do(iter_list.invalidate());
}
protected:
link_type get_node() { return list_node_allocator::allocate(); }
void put_node(link_type p) { list_node_allocator::deallocate(p); }
inline void clear();
};
template <class T, class Alloc>
void __list_base<T, Alloc>::clear()
{
link_type cur = (link_type) node->next;
while (cur != node) {
link_type tmp = cur;
cur = (link_type) cur->next;
vcl_destroy(&(tmp->data));
put_node(tmp);
}
__stl_debug_do(invalidate_all());
}
__BEGIN_STL_FULL_NAMESPACE
# define list __WORKAROUND_RENAME(list)
template <class T, VCL_DFL_TYPE_PARAM_STLDECL(Alloc,vcl_alloc) >
class vcl_list : protected __list_base<T, Alloc> {
typedef __list_base<T, Alloc> super;
typedef vcl_list<T, Alloc> self;
protected:
typedef void* void_pointer;
public:
typedef T value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef __list_node<T> list_node;
typedef list_node* link_type;
typedef vcl_size_t size_type;
typedef vcl_ptrdiff_t difference_type;
typedef __list_iterator<T> iterator;
typedef __list_const_iterator<T> const_iterator;
typedef vcl_reverse_bidirectional_iterator<const_iterator, value_type,
const_reference, difference_type>
const_reverse_iterator;
typedef vcl_reverse_bidirectional_iterator<iterator, value_type, reference,
difference_type>
reverse_iterator;
protected:
link_type make_node(const T& x) {
link_type tmp = get_node();
IUEg__TRY {
vcl_construct(&((*tmp).data), x);
}
# if defined ( __STL_USE_EXCEPTIONS )
catch(...) {
put_node(tmp);
throw;
}
# endif
return tmp;
}
public:
vcl_list() {}
iterator begin() { return (link_type)((*node).next); }
const_iterator begin() const { return (link_type)((*node).next); }
iterator end() { return node; }
const_iterator end() const { return node; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
bool empty() const { return length == 0; }
size_type size() const { return length; }
size_type max_size() const { return size_type(-1); }
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(--end()); }
const_reference back() const { return *(--end()); }
void swap(vcl_list<T, Alloc>& x) {
__stl_debug_do(iter_list.swap_owners(x.iter_list));
vcl_swap(node, x.node);
vcl_swap(length, x.length);
}
iterator insert(iterator position, const T& x) {
__stl_debug_check(__check_if_owner(node,position));
link_type tmp = make_node(x);
(*tmp).next = position.node;
(*tmp).prev = (*position.node).prev;
(*(link_type((*position.node).prev))).next = tmp;
(*position.node).prev = tmp;
++length;
return tmp;
}
iterator insert(iterator position) { return insert(position, T()); }
inline void insert(iterator position, const T* first, const T* last);
inline void insert(iterator position, const_iterator first, const_iterator last);
inline void insert(iterator position, size_type n, const T& x);
void push_front(const T& x) { insert(begin(), x); }
void push_back(const T& x) { insert(end(), x); }
void erase(iterator position) {
__stl_debug_check(__check_if_owner(node,position));
__stl_verbose_assert(position.node!=node, __STL_MSG_ERASE_PAST_THE_END);
(*(link_type((*position.node).prev))).next = (*position.node).next;
(*(link_type((*position.node).next))).prev = (*position.node).prev;
vcl_destroy(&(*position.node).data);
put_node(position.node);
--length;
__stl_debug_do(invalidate_iterator(position));
}
inline void erase(iterator first, iterator last);
inline void resize(size_type new_size, const T& x);
void resize(size_type new_size) { resize(new_size, T()); }
inline void clear();
void pop_front() { erase(begin()); }
void pop_back() {
iterator tmp = end();
erase(--tmp);
}
explicit vcl_list(size_type n, const T& value) {
insert(begin(), n, value);
}
explicit vcl_list(size_type n) {
insert(begin(), n, T());
}
vcl_list(const T* first, const T* last) {
insert(begin(), first, last);
}
vcl_list(const_iterator first, const_iterator last) {
insert(begin(), first, last);
}
vcl_list(const self& x) {
insert(begin(), x.begin(), x.end());
}
~vcl_list() {}
inline self& operator=(const self& x);
protected:
void transfer(iterator position, iterator first, iterator last) {
if (position.node != last.node) {
(*(link_type((*last.node).prev))).next = position.node;
(*(link_type((*first.node).prev))).next = last.node;
(*(link_type((*position.node).prev))).next = first.node;
link_type tmp = link_type((*position.node).prev);
(*position.node).prev = (*last.node).prev;
(*last.node).prev = (*first.node).prev;
(*first.node).prev = tmp;
}
}
public:
void splice(iterator position, vcl_list<T, Alloc>& x) {
__stl_verbose_assert(&x!=this, __STL_MSG_INVALID_ARGUMENT);
__stl_debug_check(__check_if_owner(node,position));
if (!x.empty()) {
transfer(position, x.begin(), x.end());
length += x.length;
x.length = 0;
__stl_debug_do(x.invalidate_all());
}
}
void splice(iterator position, vcl_list<T, Alloc>& x, iterator i) {
__stl_debug_check(__check_if_owner(node,position) &&
__check_if_owner(x.node ,i));
__stl_verbose_assert(i.node!=i.owner(), __STL_MSG_NOT_DEREFERENCEABLE);
iterator j = i;
if (position == i || position == ++j) return;
transfer(position, i, j);
++length;
--x.length;
__stl_debug_do(x.invalidate_iterator(i));
}
void splice(iterator position, vcl_list<T, Alloc>& x, iterator first, iterator last) {
__stl_debug_check(__check_if_owner(node, position));
__stl_verbose_assert(first.owner()==x.node && last.owner()==x.node,
__STL_MSG_NOT_OWNER);
if (first != last) {
if (&x != this) {
difference_type n = 0;
vcl_distance(first, last, n);
x.length -= n;
length += n;
}
transfer(position, first, last);
__stl_debug_do(x.invalidate_all());
}
}
inline void remove(const T& value);
inline void unique();
inline void merge(vcl_list<T, Alloc>& x);
inline void reverse();
inline void sort();
};
# if defined (__STL_NESTED_TYPE_PARAM_BUG)
# define iterator __list_iterator<T>
# define const_iterator __list_const_iterator<T>
# define size_type vcl_size_t
# endif
template <class T, class Alloc>
INLINE_LOOP void vcl_list<T, Alloc>::insert(iterator position, const T* first, const T* last) {
for (; first != last; ++first) insert(position, *first);
}
template <class T, class Alloc>
INLINE_LOOP void vcl_list<T, Alloc>::insert(iterator position, const_iterator first,
const_iterator last) {
for (; first != last; ++first) insert(position, *first);
}
template <class T, class Alloc>
INLINE_LOOP void vcl_list<T, Alloc>::insert(iterator position, size_type n, const T& x) {
while (n--) insert(position, x);
}
template <class T, class Alloc>
INLINE_LOOP void vcl_list<T, Alloc>::erase(iterator first, iterator last) {
while (first != last) erase(first++);
}
template <class T, class Alloc>
void vcl_list<T, Alloc>::resize(size_type new_size, const T& x)
{
if (new_size < size()) {
iterator f;
if (new_size < size() / 2) {
f = begin();
vcl_advance(f, new_size);
}
else {
f = end();
vcl_advance(f, difference_type(size()) - difference_type(new_size));
}
erase(f, end());
}
else
insert(end(), new_size - size(), x);
}
template <class T, class Alloc>
void vcl_list<T, Alloc>::clear()
{
super::clear();
node->next = node;
node->prev = node;
length = 0;
}
template <class T, class Alloc>
#ifdef __SUNPRO_CC
inline
#endif
vcl_list<T, Alloc>& vcl_list<T, Alloc>::operator=(const vcl_list<T, Alloc>& x) {
if (this != &x) {
iterator first1 = begin();
iterator last1 = end();
const_iterator first2 = x.begin();
const_iterator last2 = x.end();
while (first1 != last1 && first2 != last2) *first1++ = *first2++;
if (first2 == last2)
erase(first1, last1);
else
insert(last1, first2, last2);
__stl_debug_do(invalidate_all());
}
return *this;
}
template <class T, class Alloc>
void vcl_list<T, Alloc>::remove(const T& value) {
iterator first = begin();
iterator last = end();
while (first != last) {
iterator next = first;
++next;
if (*first == value) erase(first);
first = next;
}
}
template <class T, class Alloc>
void vcl_list<T, Alloc>::unique() {
iterator first = begin();
iterator last = end();
if (first == last) return;
iterator next = first;
while (++next != last) {
if (*first == *next)
erase(next);
else
first = next;
next = first;
}
}
template <class T, class Alloc>
void vcl_list<T, Alloc>::merge(vcl_list<T, Alloc>& x) {
iterator first1 = begin();
iterator last1 = end();
iterator first2 = x.begin();
iterator last2 = x.end();
while (first1 != last1 && first2 != last2)
if (*first2 < *first1) {
iterator next = first2;
transfer(first1, first2, ++next);
first2 = next;
} else
++first1;
if (first2 != last2) transfer(last1, first2, last2);
length += x.length;
x.length= 0;
__stl_debug_do(x.invalidate_all());
}
template <class T, class Alloc>
void vcl_list<T, Alloc>::reverse() {
if (size() < 2) return;
iterator first(begin());
for (++first; first != end();) {
iterator old = first++;
transfer(begin(), old, first);
}
__stl_debug_do(invalidate_all());
}
template <class T, class Alloc>
void vcl_list<T, Alloc>::sort() {
if (size() < 2) return;
vcl_list<T, Alloc> carry;
vcl_list<T, Alloc> counter[64];
int fill = 0;
while (!empty()) {
carry.splice(carry.begin(), *this, begin());
int i = 0;
while (i < fill && !counter[i].empty()) {
counter[i].merge(carry);
carry.swap(counter[i++]);
}
carry.swap(counter[i]);
if (i == fill) ++fill;
}
for (int i = 1; i < fill; ++i) counter[i].merge(counter[i-1]);
swap(counter[fill-1]);
__stl_debug_do(invalidate_all());
}
# if defined ( __STL_NESTED_TYPE_PARAM_BUG )
# undef iterator
# undef const_iterator
# undef size_type
# endif
// do a cleanup
# undef vcl_list
# define __list__ __FULL_NAME(vcl_list)
__END_STL_FULL_NAMESPACE
#if !defined ( __STL_DEFAULT_TYPE_PARAM )
// provide a "default" vcl_list adaptor
template <class T>
class vcl_list : public __list__<T,vcl_alloc>
{
typedef vcl_list<T> self;
public:
typedef __list__<T,vcl_alloc> super;
__CONTAINER_SUPER_TYPEDEFS
__IMPORT_SUPER_COPY_ASSIGNMENT(vcl_list)
typedef super::link_type link_type;
vcl_list() { }
explicit vcl_list(size_type n, const T& value) : super(n, value) { }
explicit vcl_list(size_type n) : super(n) { }
vcl_list(const T* first, const T* last) : super(first, last) { }
vcl_list(const_iterator first, const_iterator last) : super(first, last) { }
};
# if defined (__STL_BASE_MATCH_BUG)
template <class T>
inline bool operator==(const vcl_list<T>& x, const vcl_list<T>& y) {
typedef typename vcl_list<T>::super super;
return operator == ((const super&)x,(const super&)y);
}
template <class T>
inline bool operator<(const vcl_list<T>& x, const vcl_list<T>& y) {
typedef typename vcl_list<T>::super super;
return operator < ((const super&)x,(const super&)y);
}
# endif
# endif /* __STL_DEFAULT_TYPE_PARAM */
template <class T, class Alloc>
inline bool operator==(const __list__<T, Alloc>& x, const __list__<T, Alloc>& y) {
return x.size() == y.size() && vcl_equal(x.begin(), x.end(), y.begin());
}
template <class T, class Alloc>
inline bool operator<(const __list__<T, Alloc>& x, const __list__<T, Alloc>& y) {
return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
}
# if defined (__STL_CLASS_PARTIAL_SPECIALIZATION )
template <class T, class Alloc>
inline void vcl_swap(__list__<T,Alloc>& a, __list__<T,Alloc>& b) { a.swap(b); }
# endif
#endif // vcl_emulation_list_h
| [
"jstavr2@gmail.com"
] | jstavr2@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.