blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
201
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
85
| license_type
stringclasses 2
values | repo_name
stringlengths 7
100
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 260
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 11.4k
681M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 80
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 8
9.86M
| extension
stringclasses 52
values | content
stringlengths 8
9.86M
| authors
sequencelengths 1
1
| author
stringlengths 0
119
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4de11b417b247cec9edd9e4dbd2e76293aa4c4d9 | 4db34f4ac120894642ff9404a2d06af2e3d5a3f3 | /bmjcui/src/ui/trojancheck/trojancheckwidget.cpp | c0b36abe639e5dcbf7639db56308250f04218163 | [] | no_license | zhanrui/apollo | a233449f27d7469e9d33d76bd4709bd05815ddc1 | a43c007c9db340797b56649bc2b396d21ca50023 | refs/heads/master | 2020-05-19T18:55:37.053102 | 2015-05-24T22:45:54 | 2015-05-24T22:45:54 | 29,225,236 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 10,596 | cpp | #include "trojancheckwidget.h"
#include "src/ui/base/basestylewidget.h"
#include "src/ui/base/staticbutton.h"
#include "src/ui/base/commonwidget.h"
#include "src/ui/commoncheck/tabbutton.h"
#include "src/ui/commoncheck/mydelegate.h"
#include "src/common/globals.h"
#include "src/common/common.h"
#include <QLabel>
#include <QStandardItemModel>
#include <QTableView>
#include <QHeaderView>
#include <QBrush>
#include <QScrollBar>
#include <QAbstractItemView>
#include <QStyledItemDelegate>
#include <QItemDelegate>
#include <QFrame>
#include <QDateTime>
#include <QTimer>
#include <QTime>
#include <QDebug>
#include <QMovie>
#include <QFileDialog>
#include <QCheckBox>
#include <QComboBox>
#include <QtWidgets>
TrojanCheckWidget::TrojanCheckWidget(QWidget* parent)
: BaseStyleWidget(parent)
{
initUI();
initConnect();
}
TrojanCheckWidget::~TrojanCheckWidget()
{
}
void TrojanCheckWidget::initUI()
{
this->setFixedSize(900, 600);
returnbtn = new StaticButton(":image/common/returnbtn", 3, this);
returnbtn->move(0, 0);
startcheckbtn = new StaticButton(":image/common/startcheckbtn", 3, this);
startcheckbtn->move(703, 60);
cancelcheckbtn = new StaticButton(":image/common/cancelcheckbtn", 3, this);
cancelcheckbtn->move(739, 74);
cancelcheckbtn->hide();
trojanchecklogo = new QLabel(this);
trojanchecklogo->setPixmap(QPixmap(":image/trojancheck/trojanchecklogo"));
trojanchecklogo->move(40, 55);
descriptiontitle = new QLabel(this);
descriptiontitle->setText("木马检查");
descriptiontitle->setObjectName("tc_descriptiontitle");
descriptiontitle->move(130, 69);
description = new QLabel(this);
description->setText("查看用户终端是否存在威胁文档和网络武器");
description->setObjectName("tc_description");
description->move(133, 109);
progressbar_background = new QLabel(this);
progressbar_background->setPixmap(QPixmap(":image/common/progressbar_background"));
progressbar_background->move(0, 147);
progressbar_background->hide();
progressbar_front = new QLabel(this);
QMovie* movie = new QMovie(":image/common/progressbar_front");
movie->setParent(this);
movie->start();
progressbar_front->setMovie(movie);
//progressbar_front->setPixmap(QPixmap(":image/commoncheck/progressbar_front"));
progressbar_front->move(-900, 147);
progressbar_front->hide();
checkingElapsedTime = new QLabel(this);
checkingElapsedTime->move(584, 82);
checkingElapsedTime->setObjectName("tc_checkingelapsedtime");
checkingElapsedTime->setText("已用时:00:00:00");
checkingElapsedTime->hide();
checkingElapsedTimer = new QTimer(this);
settings = new CommonWidget(this);
settings->setFixedSize(900, 447);
settings->setObjectName("trojanchecksetting");
int y = 153;
settings->move(0, y);
// QLabel* typeIcon = new QLabel(settings);
// typeIcon->setPixmap(QPixmap(":image/trojancheck/typeIcon"));
// typeIcon->move(53, 184 - y);
// QLabel* typeDes = new QLabel(settings);
// typeDes->move(82, 184 - y);
// typeDes->setText("检查类型");
// QLabel* typeLabel = new QLabel(settings);
// typeLabel->move(0, 0);
// typeLabel->setText("选择检查类型");
// typeLabel->move(757, 180 - y);
// QLabel* hline1 = new QLabel(settings);
// hline1->move(0, 209 - y);
// hline1->setPixmap(QPixmap(":image/filecheck/hline"));
// typeLE = new QLineEdit(settings);
// typeLE->setText("威胁文档;网络武器");
// typeLE->setPlaceholderText("请选择检查类型");
// typeLE->move(51, 218 - y);
// typeLE->setReadOnly(true);
// threatdocumentCheck = new QCheckBox("威胁文档", settings);
// threatdocumentCheck->setCheckState(Qt::Checked);
// threatdocumentCheck->move(177, 181 - y);
// networkweaponCheck = new QCheckBox("网络武器", settings);
// networkweaponCheck->setCheckState(Qt::Checked);
// networkweaponCheck->move(277, 181 - y);
QLabel* pathIcon = new QLabel(settings);
pathIcon->move(53, 184 - y);
pathIcon->setPixmap(QPixmap(":image/trojancheck/pathIcon"));
QLabel* pathDes = new QLabel(settings);
pathDes->move(82, 184- y);
pathDes->setText("检查路径");
pathBrowserBtn = new StaticButton(":image/trojancheck/pathBrowserBtn", 3, settings);
pathBrowserBtn->move(772, 180- y);
QLabel* hline2 = new QLabel(settings);
hline2->move(0, 209 - y);
hline2->setPixmap(QPixmap(":image/trojancheck/hline"));
pathLE = new QLineEdit(settings);
pathLE->setPlaceholderText("请设置检查路径");
pathLE->move(51, 218 - y);
checkResultBtn = new StaticButton(":image/trojancheck/checkResultBtn", 3, settings);
checkResultBtn->move(738, 272 - y);
checkResultBtn->hide();
}
void TrojanCheckWidget::initConnect()
{
connect(startcheckbtn, SIGNAL(buttonClicked()), this, SLOT(startCheck()));
connect(cancelcheckbtn, SIGNAL(buttonClicked()), this, SLOT(cancelCheck()));
connect(checkingElapsedTimer, SIGNAL(timeout()), this, SLOT(updateCheckingElapsedTime()));
connect(checkingElapsedTimer, SIGNAL(timeout()), this, SLOT(updateCheckingElapsedTime()));
connect(pathBrowserBtn, &StaticButton::buttonClicked, this, &TrojanCheckWidget::setFolderPath);
//connect(threatdocumentCheck, &QCheckBox::stateChanged, this, &TrojanCheckWidget::setCheckType);
//connect(networkweaponCheck, &QCheckBox::stateChanged, this, &TrojanCheckWidget::setCheckType);
//connect(threatdocumentCheck, &QCheckBox::stateChanged, [=](int status) {
// if(status == Qt::Unchecked){
// emit disableThreatDocument();
// }
// if(status == Qt::Checked){
// emit enableThreatDocument();
// }
//});
//connect(networkweaponCheck, &QCheckBox::stateChanged, [=](int status) {
// if(status == Qt::Unchecked){
// emit disableNetworkWeapon();
// }
// if(status == Qt::Checked){
// emit enableNetworkWeapon();
// }
//});
connect(pathLE, &QLineEdit::textChanged, [=](const QString& newValue) {
emit setParameter("path", newValue.trimmed());
});
//connect(typeLE, &QLineEdit::textChanged, [=](const QString& newValue) {
// emit setParameter("type", newValue);
//});
}
void TrojanCheckWidget::setFolderPath()
{
QString directory = QFileDialog::getExistingDirectory(this, "选择文件夹", QDir::currentPath());
if (!directory.isEmpty()) {
pathLE->setText(directory.trimmed());
// QString currentText = pathLE->text();
// if (currentText.trimmed().isEmpty()) {
// pathLE->setText(directory.trimmed());
// } else {
// pathLE->setText(currentText.trimmed().append(";").append(directory.trimmed()));
// }
}
}
void TrojanCheckWidget::setCheckType()
{
//QString types;
//if (threatdocumentCheck->checkState() == Qt::Checked) {
// if (!types.isEmpty()) {
// types.append(";");
// }
// types.append("威胁文档");
//}
//if (networkweaponCheck->checkState() == Qt::Checked) {
// if (!types.isEmpty()) {
// types.append(";");
// }
// types.append("网络武器");
// }
//typeLE->setText(types);
}
void TrojanCheckWidget::startCheck()
{
if (pathLE->text().trimmed().isEmpty()) {
pathLE->setFocus();
return;
}
//if (typeLE->text().isEmpty()) {
// typeLE->setFocus();
// return;
//}
emit setParameter("path", pathLE->text().trimmed());
//emit setParameter("type", typeLE->text());
// keyWordCB->set
startcheckbtn->hide();
cancelcheckbtn->show();
progressbar_background->show();
progressbar_front->move(-900, 147);
progressbar_front->show();
descriptiontitle->setText("正在检查。。。");
descriptiontitle->adjustSize();
description->setText("还未检查出可疑问题");
description->adjustSize();
checkingElapsedTime->show();
checkingElapsedTime->setText("已用时:00:00:00");
checkingElapsedTime->adjustSize();
checkingStartTime = (QDateTime::currentDateTime()).toTime_t();
checkingElapsedTimer->start(1000);
checkResultBtn->show();
emit startCheckSig();
}
void TrojanCheckWidget::cancelCheck()
{
startcheckbtn->show();
cancelcheckbtn->hide();
progressbar_background->hide();
progressbar_front->hide();
QString currentstatus=descriptiontitle->text();
if(currentstatus.contains("发现")){
descriptiontitle->setText(currentstatus+"检查取消!");
}else{
descriptiontitle->setText("检查已取消!");
}
descriptiontitle->adjustSize();
checkingElapsedTime->hide();
checkingElapsedTime->setText("");
checkingElapsedTimer->stop();
}
void TrojanCheckWidget::updateCheckingElapsedTime()
{
//qDebug() << "updateCheckingElapsedTime";
unsigned int timedifference = (QDateTime::currentDateTime()).toTime_t() - checkingStartTime;
checkingElapsedTime->setText("已用时:" + (QTime(0, 0)).addSecs(timedifference).toString("hh:mm:ss"));
}
void TrojanCheckWidget::completerateUpdate(const int completerate, const QString& status)
{
qDebug() << "completerate::" << completerate;
progressbar_front->move(-895 + 900 * completerate / 100, 147);
description->setText(status);
description->adjustSize();
if(completerate ==100){
startcheckbtn->show();
cancelcheckbtn->hide();
progressbar_background->hide();
progressbar_front->hide();
QString currentstatus=descriptiontitle->text();
if(currentstatus.contains("发现")){
descriptiontitle->setText(currentstatus+"检查完成!");
}else{
descriptiontitle->setText("检查完成!");
}
descriptiontitle->adjustSize();
checkingElapsedTime->hide();
checkingElapsedTime->setText("");
checkingElapsedTimer->stop();
}
}
void TrojanCheckWidget::dataCountUpdate(const int totalproblems, const int totalinfomations)
{
QString qs;
if (totalproblems > 0)
qs.append("已发现问题").append(QString::number(totalproblems)).append("条");
if (qs.size() > 0 && totalinfomations > 0)
qs.append(",");
if (totalinfomations > 0)
qs.append("发现信息").append(QString::number(totalinfomations)).append("条");
if (qs.size() > 0)
qs.append(".");
if (qs.size() > 0)
descriptiontitle->setText(qs);
descriptiontitle->adjustSize();
}
| [
"[email protected]"
] | |
92abeb29bdf51d7d32c9e977f0a372bfe0ca2d21 | 6915155b31bfd3f945d2da6b51cdda9037b68f2f | /schlee_qt/024_falloff_buttons/main.cpp | 31fddc9136991d8e7915f7fe70d12fc49591d426 | [] | no_license | AxelStoneX/tutorial | 86c1e5cdaa749fb2a109d0a8ed51153194a23d03 | eef7e73da27de342094958ff836fb87258d6a53f | refs/heads/master | 2021-01-11T16:46:30.602132 | 2017-01-23T18:16:58 | 2017-01-23T18:16:58 | 79,669,825 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 385 | cpp | #include "mainwindow.h"
#include <QApplication>
#include <QtWidgets>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton cmd("Menu");
QMenu* pmnu = new QMenu(&cmd);
pmnu->addAction("Item1");
pmnu->addAction("Item2");
pmnu->addAction("&Quit", &app, SLOT(quit()));
cmd.setMenu(pmnu);
cmd.show();
return app.exec();
}
| [
"[email protected]"
] | |
8b857aafefcdbc63d9a9250817d04455570fe9b4 | ebfe9aef86a7d98d28f58f9b36d10b8c211e5e21 | /bin/vertexBinning.h | b10a25983168cb0475931dfac3768e1434949f13 | [] | no_license | lattaud/NewGammaJet | a3b47bad121ae5f6e8e029b5bdae0a4dfc176a46 | e5278b938f67b6435e8d04e7b0e4066095bc45e2 | refs/heads/master | 2020-06-28T20:37:35.267709 | 2018-06-14T07:25:41 | 2018-06-14T07:25:41 | 74,473,629 | 0 | 3 | null | 2018-03-28T15:15:58 | 2016-11-22T13:11:08 | C++ | UTF-8 | C++ | false | false | 1,398 | h | #pragma once
#include <cmath>
#include <vector>
#include <utility>
class VertexBinning {
public:
VertexBinning() {
fillVertexBins();
}
int getVertexBin(int n) {
std::vector<std::pair<int, int> >::const_iterator it = mVertexBins.begin();
for (; it != mVertexBins.end(); ++it) {
std::pair<int, int> bin = *it;
if (n >= bin.first && n < bin.second) {
return it - mVertexBins.begin();
}
}
return -1;
}
size_t size() const {
return mVertexBins.size();
}
std::pair<int, int> getBinValue(int bin) const {
return mVertexBins[bin];
}
std::vector<std::pair<int, int> > getBinning(int n = -1) const {
if (n < 0) {
n = size();
}
return std::vector<std::pair<int, int> >(mVertexBins.begin(), mVertexBins.begin() + n);
}
std::vector<std::pair<int, int> > getBinning(unsigned int from, unsigned int to) const {
if (to > size()) {
to = size();
}
return std::vector<std::pair<int, int> >(mVertexBins.begin() + from, mVertexBins.begin() + to);
}
private:
std::vector<std::pair<int, int> > mVertexBins;
void fillVertexBins() {
mVertexBins.push_back(std::make_pair(0, 6)); // 6 escluso = Npv <= 5
mVertexBins.push_back(std::make_pair(6, 13));
mVertexBins.push_back(std::make_pair(13, 50));
}
};
| [
"[email protected]"
] | |
7ee48d2752e224bcf93fe2a336a5a0b2835892dc | 61070bede040a6f5318adafdd661dcb1bbe622e2 | /src/hsdk/win/direct3d/d3d10_font.h | 5646d204c6fb75c8a581595727d96bb3af030695 | [] | no_license | hanjuho/mysdk | 835694f73bc8b808b2ec87f23043f6fd63090bac | 284922ed3f962bb46124f3553e15ca7cfd94d613 | refs/heads/master | 2021-01-10T11:04:57.272796 | 2015-12-27T15:07:48 | 2015-12-27T15:07:48 | 44,182,150 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,079 | h | #pragma once
#include "d3d10_common.h"
namespace hsdk
{
namespace direct3d
{
// 설명 :
DECL_STRUCT(D3D10MY_FONTINFO)
{
// 설명 :
float left;
// 설명 :
float right;
// 설명 :
int size;
};
// 설명 :
DECL_CLASS(D3D10_Font)
{
public:
// 설명 :
INTERFACE_DECL_FUNC(initialize)(
_In_ const char * _fontDirecoty,
_In_ const wchar_t * _fontTableDirecoty);
// 설명 :
INTERFACE_DECL_FUNC_T(void, destory)(
_X_ void);
// 설명 :
INTERFACE_DECL_FUNC(build_Text)(
_Out_ D3D10MY_CONTEXT & _context,
_In_ const char * _text)const;
// 설명 :
INTERFACE_DECL_FUNC_T(ID3D10ShaderResourceView *, font)(
_X_ void)const;
private:
// 설명 :
INTERFACE_DECL_FUNC(create_ContexBuffer)(
_Out_ ID3D10Buffer ** _buffer,
_In_ unsigned int _width,
_In_ D3D10_USAGE _usage = D3D10_USAGE_DEFAULT)const;
protected:
// 설명 :
std::vector<D3D10MY_FONTINFO> my_DataTable;
// 설명 :
AutoRelease<ID3D10ShaderResourceView> my_Texture;
};
}
}
| [
"[email protected]"
] | |
63c3538600d768e6f735afb4f5316b2901072777 | 0287787791d1fd921590a988bae5adce2299e218 | /hrs/src/business/idgen/EmpIdGen.cpp | 378708f559f4872c6a6699a608e33ecab5a17401 | [] | no_license | samridhi22/HRSapp | a41922e8c443982b8a2865946300b2c731581a76 | 79a66db7181d9cdb44356ff62f02411fe439c63e | refs/heads/master | 2021-01-21T08:44:09.487822 | 2016-07-13T05:02:07 | 2016-07-13T05:02:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,908 | cpp | #include <fstream>
#include <iostream>
#include<string>
#include<common/GeneralException.h> // must be declared before DBException.
#include<dao/DAOConstants.h>
#include<dbaccess/ODBCConnection.h>
#include<dbaccess/ODBCResultSet.h>
#include<dbaccess/ODBCStatement.h>
#include<dbaccess/dbAccess.h>
#include<dbaccess/DBException.h>
#include<dbaccess/ODBCError.h>
#include<business/idgen/EmpIdGen.h>
#include<string>
/**@file EmpIdGen.h
* @brief Declares the EmpIdGen
*
* <BR>NAME:EmpIdGen
*
* <BR>BASE CLASSES:None
*
* <BR>PURPOSE:To generate employee id.
*
* <BR>AUTHOR:Smitha Manjunath
* <BR>
* <BR>$Revision: $12/14/2005
*
* <BR>$Log:12/14/2005
*
* <BR>COPYRIGHT NOTICE:
* <BR>Copyright (c) 2005 C++ Capability team at Accenture. All rights reserved.
*/
/**@namespace idgen
*@brief All the classes related to IDGenerator is defined in this namespace.
*/
namespace idgen {
EmpIdGen* EmpIdGen::m_thisInstance = NULL;
/**@class EmpIdGen
* @brief Declaration of EmpIdGen
* <PRE>This class shall do the following
* This class is the singleton.
* It will provide a method to get an instance of it.
* It will also provide a method to create a next id.
</PRE>
*/
/**@fn EmpIdGen.
* @brief empty private Constructor.
* This constructor will not take any argument.
* Instance can be obtained through getInstance()
* @param none
* @return none
*/
EmpIdGen::EmplIdGen()
{
}
/**@fn getInstance
* @brief implements singleton EmplIdGen class.
* @param none
* @return Pointer to EmpIdGen.
*/
static EmpIdGen* EmpIdGen::getInstance()
{
if (m_thisInstance == Null)
{
m_thisInstance = new EmplIdGen;
}
return m_thisInstance;
}
/**@fn getNextId
* @brief gets the next system-generated id.
* @param none.
* @return string.
*/
std::string EmpIdGen::getNextId()
{
try{
dbaccess::ODBCConnection* conn = dbaccess::DBAccess::getConnection();
if(conn->getError().isError()) //Checks for error.
{
throw new GeneralException(conn->getError().getErrorMessage());
}
dbaccess::ODBCStatement* stmt = conn->createStatement();
if(conn->getError().isError()) //Checks for error.
{
throw new GeneralException(conn->getError().getErrorMessage());
}
dbaccess::ODBCResultSet* res = stmt->executeQuery( DAOConstants::EMPSQL_GETID);
if(conn->getError().isError()) //Checks for error.
{
throw new GeneralException(conn->getError().getErrorMessage());
}
if(!res->next())
{
res->close();
stmt->close();
dbaccess::DBAccess::releaseConnection();
throw new GeneralException("Error obtaining next Id");
}
std::string id = res->getString(1);
res->close();
stmt->close();
dbaccess::DBAccess::releaseConnection();
return id;
}catch(dbaccess::DBException* dbe)
{
throw new GeneralException(dbe->getMessage());
}
}
} //namespace idgen
#endif //EMPIDGEN_H
| [
"[email protected]"
] | |
5253a4ec6bbf524e2face4acc81d3cc6c4e3d791 | fcb200a43b37e63df6760c33c9427131e40650c6 | /StackWithMin.h | 2bb0cd5fa3616c53eefb7e099430059ef8e32516 | [] | no_license | ruoan777/HelloGithub | 3e80d2b37a5385b61e964d7f1ffb909d0840f32b | 7399d3193c912fc15f1b87f6206418d01359d1ab | refs/heads/master | 2020-03-22T21:25:10.869717 | 2018-07-12T09:12:29 | 2018-07-12T09:12:29 | 140,686,393 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,999 | h | //==================================================================
// 《剑指Offer——名企面试官精讲典型编程题》代码
// 作者:何海涛
//==================================================================
// 面试题30:包含min函数的栈
// 题目:定义栈的数据结构,请在该类型中实现一个能够得到栈的最小元素的min
// 函数。在该栈中,调用min、push及pop的时间复杂度都是O(1)。
#pragma once
#include <stack>
#include <assert.h>
template <typename T> class StackWithMin
{
public:
StackWithMin() {}
virtual ~StackWithMin() {}
T& top();
const T& top() const;
void push(const T& value);
void pop();
const T& min() const;
bool empty() const;
size_t size() const;
private:
std::stack<T> m_data; // 数据栈,存放栈的所有元素
std::stack<T> m_min; // 辅助栈,存放栈的最小元素
};
template <typename T> void StackWithMin<T>::push(const T& value)
{
// 把新元素添加到辅助栈
m_data.push(value);
// 当新元素比之前的最小元素小时,把新元素插入辅助栈里;
// 否则把之前的最小元素重复插入辅助栈里
if(m_min.size() == 0 || value < m_min.top())
m_min.push(value);
else
m_min.push(m_min.top());
}
template <typename T> void StackWithMin<T>::pop()
{
assert(m_data.size() > 0 && m_min.size() > 0);
m_data.pop();
m_min.pop();
}
template <typename T> const T& StackWithMin<T>::min() const
{
assert(m_data.size() > 0 && m_min.size() > 0);
return m_min.top();
}
template <typename T> T& StackWithMin<T>::top()
{
return m_data.top();
}
template <typename T> const T& StackWithMin<T>::top() const
{
return m_data.top();
}
template <typename T> bool StackWithMin<T>::empty() const
{
return m_data.empty();
}
template <typename T> size_t StackWithMin<T>::size() const
{
return m_data.size();
}
| [
"[email protected]"
] | |
3ae64a05c591afc71b0bc5d109c377a8492b3ab2 | 6b84794b2b0aa23a2d2c3c5f1437001d103213ae | /Problems & Contents/URI/2-Ad-Hoc/1428-ProcurandoNessy.cpp | 3874ba2314069393027506e93b59e080d45b73d2 | [] | no_license | mtreviso/university | 2406d3782759a75ef00af4da8e4e1ed99cfb89d8 | 164dbfc13d6dddb3bdbb04957c4702d0e0885402 | refs/heads/master | 2021-01-09T08:14:21.551497 | 2016-06-09T23:19:01 | 2016-06-09T23:19:01 | 16,703,296 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 279 | cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
int n, a, b;
cin >> n;
while(n--){
cin >> a >> b;
int x = a-2;
int y = b-2;
int val = ceil(double(x)/3) * ceil(double(y)/3);
cout << val << endl;
}
return 0;
} | [
"[email protected]"
] | |
05240bb95c49b66e0ad610ec107ba22eaab2f8ef | e565def47d49a21467442f7ad0ffe9a692303ff0 | /src/game_state_popup.cpp | d9ee203a5d56d594aa322caded4e0624b0adbe50 | [] | no_license | MisanthropicBit/Blockzorz-2 | 8a10dc62119ff5a8309ded3381ad5650d7a5e0d1 | 3045b4722fc7652998f0bd4e2e509796821057b6 | refs/heads/master | 2021-01-18T20:29:49.348879 | 2016-10-05T18:25:51 | 2016-10-05T18:25:51 | 20,334,643 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,546 | cpp | #include "audio_manager.hpp"
#include "color.hpp"
#include "font.hpp"
#include "game_state_manager.hpp"
#include "game_state_pop_up.hpp"
#include "graphics.hpp"
#include "particle_effect.hpp"
#include "screen.hpp"
game_state_popup::GameStatePopUp() {
fader = nullptr;
popup = nullptr;
title = nullptr;
text = nullptr;
}
game_state_popup::game_state_popup(const std::string& caption,
const std::string& text,
const std::string& confirmtext,
const std::string& quittext,
game_state* return_state) {
fader = nullptr;
popup = nullptr;
title = nullptr;
text = nullptr;
font title_font("./fonts/biocomv2.ttf", 30);
font text_font("./fonts/biocomv2.ttf", 20);
title = title_font.load_hq_text_image(caption, color::dark_blue);
text = text_font.load_hq_text_image(text, color::black);
yes.load(confirm_text, "./fonts/biocomv2.ttf", color::black, 25, 200 - text_font.string_width(confirm_text)/2, 280);
no.load(quit_text, "./fonts/biocomv2.ttf", color::black, 25, 400 - text_font.string_width(quit_text)/2, 280);
yes.set_alpha(0.8f);
no.set_alpha(0.8f);
this->return_state = return_state;
titlex = screen::get().width()/2 - title_font.string_width(caption)/2;
textx = screen::get().width()/2 - text_font.string_width(text)/2;
title_font.close();
text_font.close();
}
game_state_popup::~game_state_popup() {
}
bool game_state_popup::load() {
fader = graphics::load_image("./images/fader.png");
popup = graphics::load_image("./images/popup.png", color::magenta);
graphics::set_transparency(fader, 0.5f);
return fader && popup && title && text;
}
void game_state_popup::on_event(SDL_Event& event) {
event::on_event(event);
}
void game_state_popup::update(int dt) {
}
void game_state_popup::draw() {
graphics::draw_image(fader, 0, 0);
graphics::draw_image(popup, 120, 140);
graphics::draw_image(title, titlex, 150);
graphics::draw_image(text, 140, 230);
yes.draw();
no.draw();
}
void game_state_popup::unload() {
returnstate = nullptr;
SDL_FreeSurface(fader);
SDL_FreeSurface(popup);
SDL_FreeSurface(title);
SDL_FreeSurface(text);
fader = nullptr;
popup = nullptr;
title = nullptr;
text = nullptr;
}
void game_state_popup::key_down(SDLKey key, SDLMod modifier, Uint16 unicode) {
if (key == SDLK_y || key == SDLK_RETURN) {
if (return_state) {
game_state_manager::get().change_state(return_state);
} else {
delete return_state;
game_state_manager::get().quit();
}
} else if (key == SDLK_n || key == SDLK_BACKSPACE || key == SDLK_ESCAPE) {
delete return_state;
game_state_manager::get().pop_state();
}
}
void game_state_popup::mouse_move(int mx, int my, int relx, int rely, Uint8 state) {
yes.mouse_move(mx, my);
no.mouse_move(mx, my);
}
void game_state_popup::left_button_down(int mx, int my) {
if (yes.has_mouse_hover(mx, my)) {
if (return_state) {
game_state_manager::get().change_state(return_state);
} else {
delete return_state;
game_state_manager::get().quit();
}
} else if (no.has_mouse_hover(mx, my)) {
delete return_state;
game_state_manager::get().pop_state();
}
}
game_state_mode_unlocked::game_state_mode_unlocked() : game_state_popup() {
particle_interval = 400;
}
game_state_mode_unlocked::game_state_mode_unlocked(const std::string& caption,
const std::string& text,
game_state* return_state) : game_state_popup() {
font title_font("./fonts/biocomv2.ttf", 30);
font text_font("./fonts/biocomv2.ttf", 20);
title = title_font.load_hq_text_image(caption, color::dark_blue);
text = text_font.load_hq_text_image(text, color::black);
awesome.load("Yeeees!", "./fonts/biocomv2.ttf", color::gold, 25, 250, 280);
awesome.set_alpha(0.5f);
this->return_state = return_state;
particle_interval = 400;
titlex = screen::get().width()/2 - title_font.string_width(caption)/2;
textx = screen::get().width()/2 - text_font.string_width(text)/2;
title_font.close();
text_font.close();
}
game_state_mode_unlocked::~game_state_mode_unlocked() {
}
bool game_state_mode_unlocked::Load() {
audio_manager::get()->play_sound("screech", 0);
audio_manager::get()->play_sound("moves", 0);
return game_state_popup::load();
}
void game_state_mode_unlocked::on_event(SDL_Event& event) {
event::on_event(event);
}
void game_state_mode_unlocked::update(int dt) {
particle_interval -= dt;
pe_manager.update(dt);
if (particle_interval <= 0) {
particle_interval = 400;
particle_explosion_effect* pex = new particle_explosion_effect("./images/cursor.png", 8, 0.1f, 0.1f, rand() % 641, rand() % 481);
pex->set_update_interval(40, 80);
pex->show();
pe_manager.add_effect(pex);
}
}
void game_state_mode_unlocked::draw() {
graphics::draw_image(fader, 0, 0);
graphics::draw_image(popup, 120, 140);
graphics::draw_image(title, titlex, 150);
graphics::draw_image(text, 140, 230);
awesome.draw();
pe_manager.draw();
}
void game_state_mode_unlocked::unload() {
game_state_popup::unload();
}
void game_state_mode_unlocked::key_down(SDLKey key, SDLMod modifier, Uint16 unicode) {
if (key == SDLK_RETURN) {
game_state_manager::get().pop_state();
}
}
void game_state_mode_unlocked::mouse_move(int mx, int my, int relx, int rely, Uint8 state) {
if (awesome.has_mouse_hover(mx, my)) {
if (!awesome.selected()) {
awesome.select();
awesome.set_alpha(0.f);
audio_manager::get()->play_sound("click", 0);
}
} else {
if (awesome.selected()) {
awesome.deselect();
awesome.set_alpha(0.8f);
}
}
}
void game_state_mode_unlocked::left_button_down(int mx, int my) {
if (awesome.has_mouse_hover(mx, my)) {
game_state_manager::get().pop_state();
}
}
| [
"[email protected]"
] | |
592cef35658bd9324055b3fbb90168a1ee4aed6b | 12ad42a6ff34ddf72f43bfeddb9f623816686747 | /lib/ui3/utils/DragMode.cpp | b299e8fd421dfee4752db9f782fd3395ab4fc263 | [] | no_license | cmann1/DustScripts | 45ba9c7161cee91e2de1056cc71b0c5314258a3b | 90a876a566461bca6aaf782455618d0c466b8d1f | refs/heads/master | 2023-04-27T05:38:08.151035 | 2023-04-24T12:54:11 | 2023-04-24T12:54:11 | 168,861,112 | 0 | 1 | null | 2021-03-27T17:46:33 | 2019-02-02T18:02:27 | C++ | UTF-8 | C++ | false | false | 127 | cpp | enum DragMode
{
Idle = 0x0,
Dragging = 0x1,
Resizing = 0x2,
Top = 0x4,
Bottom = 0x8,
Left = 0x10,
Right = 0x20,
}
| [
"[email protected]"
] | |
250875ce1552251d6b64b46eb8150afdba72375a | 803f0fbc5973ff31fd5faca5c0f2981b2c52a591 | /C++/CodeForces/R-486-div.3/pB.cpp | 2102c5aaf0179b7b40769685cc7a7aeae18995ba | [] | no_license | MiohitoKiri5474/CodesBackUp | 00ab52bd55732b8164a42cffd664407878f4390e | 4247fa032c8e88259dcc3992a21c510b6f2e8850 | refs/heads/master | 2023-08-09T14:46:10.445697 | 2023-08-04T01:12:58 | 2023-08-04T01:12:58 | 126,162,563 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,614 | cpp | // by. MiohitoKiri5474
#include<bits/stdc++.h>
#pragma GCC optimize ( "O3" )
#pragma loop_opt ( on )
using namespace std;
typedef long long LL;
// define tools
#define REPP(i,f,s) for ( int i = f ; i < s ; i++ )
#define REPM(i,f,s) for ( int i = f ; i >= s ; i-- )
#define REPALL(i,n) for ( auto &i: n )
#define debuger cout << "111\n"
#define MEM(n,i) memset ( n, i, sizeof n )
// define pair
typedef pair < LL, LL > pll;
typedef pair < int, int > pii;
#define F first
#define S second
#define mp make_pair
// define vector && some stl's api
template < class T > using vec = vector < T >;
typedef vec < int > vi;
typedef vec < LL > vl;
#define pb push_back
#define ep emplace_back
#define REV reverse
#define SZ(n) ( int ) n.size()
#define CLR(n) n.clear()
#define BEG(n) n.begin()
#define END(n) n.end()
#define EMP(n) n.empty()
#define RSZ(n,s) n.resize ( s )
#define ALL(n) BEG ( n ), END ( n )
#define PIO(n) REPALL ( i, n ) cout << i << ' '; cout << '\n'
#define GETDATA(data,n) RSZ ( data, n ); REPALL ( i, data ) cin >> i
// define set
typedef set < int > si;
typedef set < LL > sl;
#define FID(n,Index) ( n.find ( Index ) != n.end() )
// graph
#define GRE(T,edge) vec < T > edge[maxN]
#define UNI(u,v,edge) edge[u].pb ( v ), edge[v].pb ( u )
#define UNIw(u,v,w,edge) edge[u].pb ( mp ( v, w ) ), edge[v].pb ( mp ( u, w ) )
// IO
#define GL(n) getline ( cin, n )
// define stack, queue, pri-queue
template < class T > using stack = stack < T, vec < T > >;
template < class T > using MaxHeap = priority_queue < T, vec < T >, less < T > >;
template < class T > using MinHeap = priority_queue < T, vec < T >, greater < T > >;
// define stringstream
#define sstr stringstream
// number~ remember change maxN
#define INF 0x3f3f3f3f
#define NEG_INF 0x8f8f8f8f
#define maxN 100005
// ready~ go!
// let's go coding and have fun!
// I can solve this problem!
inline bool cmpSZ ( string a, string b ){
return SZ ( a ) < SZ ( b );
}
int main(){
ios::sync_with_stdio ( false );
cin.tie ( 0 );
cout.tie ( 0 );
int n;
cin >> n;
vec < string > data;
GETDATA ( data, n );
sort ( ALL ( data ), cmpSZ );
REPP ( k, 1, n ){
bool check = false;
string a = data[k], b = data[k - 1];
REPP ( i, 0, SZ ( a ) - SZ ( b ) + 1 ){
if ( a[i] == b[0] ){
bool tf = true;
REPP ( j, 1, SZ ( b ) ){
if ( a[i + j] != b[j] ){
tf = false;
break;
}
}
if ( tf )
check = true;
}
if ( check )
break;
}
if ( !check ){
cout << "NO\n";
return 0;
}
// cout << k << ' ' << check << '\n';
}
cout << "YES\n";
REPALL ( i, data ) cout << i << '\n';
} | [
"[email protected]"
] | |
1afe9898e52901e3e5bca877ad8b4700a5aa2495 | 49e9e128aa9a26fca92106297c71370eadcd8a8d | /Arrays read and print 2D array.cpp | 84aea172a394059236283d9f06dd1e3091544186 | [] | no_license | Niharika-Sunnam/Niharika | 17576e21ae89c6e6717d2a7f11f4ec179cec4f71 | 1aecb366684e8d6280847c736ef5affb373b9587 | refs/heads/main | 2023-06-30T06:07:48.633190 | 2021-08-07T06:57:49 | 2021-08-07T06:57:49 | 377,099,895 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 470 | cpp | #include<stdio.h>
int main()
{
int arr1[3][3],i,j;
printf("\n\nRead a 2D array of size 3x3 and print the matrix :\n");
printf("Input elements in the matrix :\n");
for (i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("element - [%d],[%d] : ",i,j);
scanf("%d",&arr1[i][j]);
}
}
printf("\nThe matrix is : \n");
for(i=0;i<3;i++)
{
printf("\n");
for(j=0;j<3;j++)
printf("%d\n",arr1[i][j]);
}
printf("\n\n");
return 0;
}
| [
"[email protected]"
] | |
da478dc4f4a557501db7002b6f974d182ea1ea0a | ea12a42ba43f23bfcdf7d6c97ba658cc7cf07e89 | /src/analysisgraph.hpp | 3e2b08d459aecde78abc44b60543d45cffa7a6fc | [
"MIT"
] | permissive | svenojavee/hydra | 16cbd4d9416087920cfd8e3453ea9cfc47b8c663 | cbbf70867b016d2e8b016d373cc1e0dd044bd5ca | refs/heads/master | 2022-12-19T15:33:41.223814 | 2020-10-05T18:33:29 | 2020-10-05T18:33:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 498 | hpp | #ifndef ANALYSISGRAPH_H
#define ANALYSISGRAPH_H
#include <cstddef>
#include <vector>
class BayesRRmz;
class AnalysisGraph
{
public:
AnalysisGraph(BayesRRmz *bayes, size_t maxParallel = 12);
virtual ~AnalysisGraph();
virtual void exec(unsigned int numInds,
unsigned int numSnps,
const std::vector<unsigned int> &markerIndices) = 0;
protected:
BayesRRmz *m_bayes = nullptr;
size_t m_maxParallel = 12;
};
#endif // ANALYSISGRAPH_H
| [
"[email protected]"
] | |
2a28446a74c289b5fee46c5a471abc63382c6a0f | 572580660d475027fa349e47a078479222066726 | /Server/kennel/monitor/base/SNMP_lib.cpp | ed836470cd875fd69b1107a8e21d46b9eb2dacec | [] | no_license | SiteView/ecc82Server | 30bae118932435e226ade01bfbb05b662742e6dd | 084b06af3a7ca6c5abf5064e0d1f3f8069856d25 | refs/heads/master | 2021-01-10T21:11:37.487455 | 2013-01-16T09:22:02 | 2013-01-16T09:22:02 | 7,639,874 | 6 | 3 | null | null | null | null | GB18030 | C++ | false | false | 41,534 | cpp |
#include "SNMP_lib.h"
#ifdef SNMP_PP_NAMESPACE
using namespace Snmp_pp;
#endif
extern "C" long _ftol( double ); //defined by VC6 C libs
extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
/////////////////////////////////////////////////////////////////////////////
// BasicSNMP类
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// 函数:BasicSNMP //
// 说明:构造函数 //
/////////////////////////////////////////////////////////////////////////////
BasicSNMP::BasicSNMP()
{
timeout = 500;//超时时间
retries = 3;
community = "public";//共同体
m_nPort = 161;//网络设备端口
version = version1;//SNMP版本
pResult = NULL;//链表头
oid = "1.3.6";//OID
m_nOIDValue = 0;
pSnmp = NULL;
authProtocol = SNMPv3_usmNoAuthProtocol;//用户密码加密方式
privProtocol = SNMPv3_usmNoPrivProtocol;//私有访问密码加密方式
memset(chOIDStart, 0 , MAX_BUFF_LEN);//
memset(chErrMsg, 0 , MAX_BUFF_LEN);//错误消息提示
}
/////////////////////////////////////////////////////////////////////////////
// 函数:~BasicSNM //
// 说明:析构函数 //
/////////////////////////////////////////////////////////////////////////////
BasicSNMP::~BasicSNMP()
{
if(pSnmp)
delete pSnmp;//销毁SNMP++环境
DestroyResultList();//销毁结果链表
}
/////////////////////////////////////////////////////////////////////////////
// 函数:DestroyResultList //
// 说明:销毁查询OID结果链表 //
// 参数:无 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::DestroyResultList()
{
try
{
if(pResult)
{//如果存在结果链表
while(pResult != NULL)
{//循环终止条件是:链表指向地址为空
OIDResult *pTemp = pResult;//得到第一条
pResult = pResult->pNext;//当前链表头下移一条
free(pTemp);//释放当前
pTemp = NULL;
}
}
}
catch(...)
{
DWORD dwError = GetLastError();
char strErr[MAX_BUFF_LEN];
sprintf(strErr, "%u", dwError);
MessageBox(NULL,strErr, "Error Code", MB_OK);
}
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetBulkRequest //
// 说明:得到表格变量的结果 //
// 参数:无 //
// 返回值: //
// 成功返回0,否则返回一个非0 值 //
/////////////////////////////////////////////////////////////////////////////
int BasicSNMP::GetBulkRequest()
{
puts("BasicSNMP::GetBulkRequest");
int nResult = 0;
char chPrvOID[MAX_BUFF_LEN] = {0};
bool bEnd = false;
Pdu pdu; // construct a Pdu object
Vb vb; // construct a Vb object
vb.set_oid( oid); // set the Oid portion of the Vb
pdu += vb; // add the vb to the Pdu
DestroyResultList();
SnmpTarget *target;// = &ctarget;
if(version ==version3)
{//If SNMP Version Is 3
nResult = InitUTarget();//Init UTarget
pdu.set_security_level( m_nSecurityLevel);//Set the Security Level portion of Pdu
pdu.set_context_name (contextName);//Set the Context Name portion of Pdu
pdu.set_context_engine_id(contextEngineID);//Set the Context Engine ID portion of Pdu
target = &utarget; //Set SNMP Target
}
else
{
target = &ctarget; //Set SNMP Target
}
OIDResult *pTemp = new OIDResult();
OIDResult *pPrevResult = pTemp;
//pTemp->pNext = NULL;
pResult = pTemp;
// try
// {
//SnmpTarget *target = &ctarget;
while (( nResult = pSnmp->get_next(pdu, *target))== SNMP_CLASS_SUCCESS)
{
if(bEnd)
{
break;
}
for ( int z=0;z<pdu.get_vb_count(); z++)
{
pdu.get_vb( vb,z);
if (pdu.get_type() == REPORT_MSG)
{
Oid tmp;
vb.get_oid(tmp);
return -5;
}
// look for var bind exception, applies to v2 only
if ( vb.get_syntax() != sNMP_SYNTAX_ENDOFMIBVIEW)
{
char chOID[MAX_BUFF_LEN] = {0};
sprintf(chOID, "%s", vb.get_printable_oid());
char *pDest = strstr(chOID, chOIDStart);
if(pDest == NULL)
{//OID名称是否包含开始OID
bEnd = true;
break;
}
if(strlen(chPrvOID)>0)
{//如果上次OID不为空
if(strcmp(vb.get_printable_oid(), chPrvOID) == 0)
{//比较OID名称是否相同,相同则退出循环
bEnd = true;
break;
}
}
//结果赋值
strcpy(chPrvOID, vb.get_printable_oid());
strcpy(pTemp->chOID, vb.get_printable_oid());
strcpy(pTemp->chValue,vb.get_printable_value());
puts(oid.get_printable());
puts(pTemp->chOID);
char *pIndex;
pIndex=pTemp->chOID+strlen(oid.get_printable())+1;
//puts(pIndex);
//puts(pTemp->chValue);
pTemp->nLen = strlen(pTemp->chValue);
//char *pdest = strrchr(pTemp->chOID, '.');
//int nLast = (int)(pdest - pTemp->chOID + 1);
//memcpy(pTemp->chIndex, (pTemp->chOID)+nLast, strlen(pTemp->chOID) - nLast);
strcpy(pTemp->chIndex,pIndex);
//pTemp->chIndex[strlen(pTemp->chOID) - nLast] = '\0';
puts(pTemp->chIndex);
}
else
{
memset(chErrMsg, 0 , MAX_BUFF_LEN);
strcpy(chErrMsg, "End of MIB Reached");
return -4;
}
if(pTemp->pNext == NULL)
{
pPrevResult = pTemp;
pTemp->pNext = new OIDResult();
pTemp = pTemp->pNext;
//pTemp->pNext = NULL;
}
}
// last vb becomes seed of next rquest
pdu.set_vblist(&vb, 1);
}
if(nResult == 0)
{
if(pTemp->pNext == NULL)
{
free(pTemp);
pTemp = NULL;
pPrevResult->pNext = NULL;
}
}
// }
// catch(...)
// {
// DWORD dwErr = GetLastError();
// char strErr[MAX_BUFF_LEN];
// sprintf(strErr, "%u", dwErr);
// MessageBox(NULL, strErr, "", MB_OK);
// }
if(nResult == SNMP_ERROR_NO_SUCH_NAME)
{
nResult = 0;
pPrevResult->pNext = NULL;
}
return nResult;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetNextRequest //
// 说明:以当前OID变量为开始,得到下一个简单变量的结果 //
// 参数:无 //
// 返回值: //
// 成功返回0,否则返回一个非0 值 //
/////////////////////////////////////////////////////////////////////////////
int BasicSNMP::GetNextRequest()
{
int nResult = 0;
Pdu pdu; // construct a Pdu object
Vb vb; // construct a Vb object
vb.set_oid( oid); // set the Oid portion of the Vb
pdu += vb; // add the vb to the Pdu
DestroyResultList();
SnmpTarget *target;// = &ctarget;
if(version ==version3)
{//If SNMP Version Is 3
nResult = InitUTarget();//Init UTarget
pdu.set_security_level( m_nSecurityLevel);//Set the Security Level portion of Pdu
pdu.set_context_name (contextName);//Set the Context Name portion of Pdu
pdu.set_context_engine_id(contextEngineID);//Set the Context Engine ID portion of Pdu
target = &utarget; //Set SNMP Target
}
else
{
target = &ctarget; //Set SNMP Target
}
OIDResult *pTemp = new OIDResult();
pTemp->pNext = NULL;
pResult = pTemp;
//SnmpTarget *target = &ctarget;
nResult = pSnmp->get_next( pdu,*target);
if(nResult != 0)
{//当有错误发生时候
strcpy(chErrMsg, pSnmp->error_msg(nResult));
}
for ( int z=0;z<pdu.get_vb_count(); z++)
{
pdu.get_vb( vb,z);
if (pdu.get_type() == REPORT_MSG)
{
Oid tmp;
vb.get_oid(tmp);
return -5;
}
// look for var bind exception, applies to v2 only
if ( vb.get_syntax() != sNMP_SYNTAX_ENDOFMIBVIEW)
{
strcpy(pTemp->chOID, vb.get_printable_oid());
strcpy(pTemp->chValue,vb.get_printable_value());
pTemp->nLen = strlen(pTemp->chValue);
char *pdest = strrchr(pTemp->chOID, '.');
int nLast = (int)(pdest - pTemp->chOID + 1);
memcpy(pTemp->chIndex, (pTemp->chOID)+nLast, strlen(pTemp->chOID) - nLast);
pTemp->chIndex[strlen(pTemp->chOID) - nLast] = '\0';
oid = pTemp->chOID;
}
else
{
// memset(chErrMsg, 0 , MAX_BUFF_LEN);
// strcpy(chErrMsg, "End of MIB Reached");
return -4;
}
}
return nResult;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetErrorMsg //
// 说明:根据错误号得到错误信息 //
// 参数: //
// nErrCode,错误号 //
// 返回值: //
// 错误信息 //
/////////////////////////////////////////////////////////////////////////////
const char* BasicSNMP::GetErrorMsg(int nErrCode)
{
strcpy(chErrMsg, pSnmp->error_msg(nErrCode));//拷贝错误信息
return chErrMsg;//返回错误信息
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetResultList //
// 说明:得到结果列表 //
// 参数:无 //
// 返回值: //
// 结果列表 //
/////////////////////////////////////////////////////////////////////////////
OIDResult* BasicSNMP::GetResultList()
{
return pResult;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetRequest //
// 说明:设置简单变量的结果 //
// 参数:无 //
// 返回值: //
// 成功返回0,否则返回一个非0 值 //
/////////////////////////////////////////////////////////////////////////////
int BasicSNMP::SetRequest()
{
int nResult = 0;
Pdu pdu; // construct a Pdu object
Vb vb; // construct a Vb object
vb.set_oid(oid); // set the Oid portion of the Vb
vb.set_value(m_nOIDValue); // set the Oid portion of the Vb
pdu += vb;
SnmpTarget *target;// = &ctarget;
if(version ==version3)
{//If SNMP Version Is 3
nResult = InitUTarget();//Init UTarget
pdu.set_security_level( m_nSecurityLevel);//Set the Security Level portion of Pdu
pdu.set_context_name (contextName);//Set the Context Name portion of Pdu
pdu.set_context_engine_id(contextEngineID);//Set the Context Engine ID portion of Pdu
target = &utarget; //Set SNMP Target
}
else
{
target = &ctarget; //Set SNMP Target
}
nResult = pSnmp->set(pdu,*target);//Get Reques
return nResult;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetRequest //
// 说明:得到简单变量的结果 //
// 参数:无 //
// 返回值: //
// 成功返回0,否则返回一个非0 值 //
/////////////////////////////////////////////////////////////////////////////
int BasicSNMP::GetRequest()
{
int nResult = 0;
Pdu pdu; // construct a Pdu object
Vb vb; // construct a Vb object
vb.set_oid( oid); // set the Oid portion of the Vb
pdu += vb; // add the vb to the Pdu
DestroyResultList();
SnmpTarget *target;// = &ctarget;
if(version ==version3)
{//If SNMP Version Is 3
nResult = InitUTarget();//Init UTarget
pdu.set_security_level( m_nSecurityLevel);//Set the Security Level portion of Pdu
pdu.set_context_name (contextName);//Set the Context Name portion of Pdu
pdu.set_context_engine_id(contextEngineID);//Set the Context Engine ID portion of Pdu
target = &utarget; //Set SNMP Target
}
else
{
target = &ctarget; //Set SNMP Target
}
OIDResult *pTemp = new OIDResult();//construct OIDResult Struct
pTemp->pNext = NULL;
pResult = pTemp;
nResult = pSnmp->get( pdu,*target);//Get Reques
if(nResult != 0)
{//当有错误发生时候
strcpy(chErrMsg, pSnmp->error_msg(nResult));
return nResult;
}
for ( int z=0;z<pdu.get_vb_count(); z++)
{
pdu.get_vb( vb,z);
if (pdu.get_type() == REPORT_MSG)
{
Oid tmp;
vb.get_oid(tmp);
return -5;
}
// look for var bind exception, applies to v2 only
if ( vb.get_syntax() != sNMP_SYNTAX_ENDOFMIBVIEW)
{
//Set OIDResult Value
strcpy(pTemp->chOID, vb.get_printable_oid());
strcpy(pTemp->chValue,vb.get_printable_value());
pTemp->nLen = strlen(pTemp->chValue);
char *pdest = strrchr(pTemp->chOID, '.');
int nLast = (int)(pdest - pTemp->chOID + 1);
memcpy(pTemp->chIndex, (pTemp->chOID)+nLast, strlen(pTemp->chOID) - nLast);
pTemp->chIndex[strlen(pTemp->chOID) - nLast] = '\0';
}
else
{
memset(chErrMsg, 0 , MAX_BUFF_LEN);
strcpy(chErrMsg, "End of MIB Reached");
return -4;
}
}
return nResult;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:InitSNMP //
// 说明:初始化SNMP //
// 参数:无 //
// 返回值: //
// 成功为0,否则为1 //
/////////////////////////////////////////////////////////////////////////////
int BasicSNMP::InitSNMP()
{
int nResult = 0;
// bind to any port and use IPv6 if needed
pSnmp = new Snmp(nResult, 0, (address.get_ip_version() == Address::version_ipv6));
address.set_port(m_nPort);
ctarget = address; // make a target using the address
ctarget.set_version( version); // set the SNMP version SNMPV1 or V2
ctarget.set_retry( retries); // set the number of auto retries
ctarget.set_timeout( timeout); // set timeout
ctarget.set_readcommunity( community); // set the read community name
//add by mtx
ctarget.set_writecommunity("private"); // set the write community name
if(version == version3)
{//如果SNMP版本是V3
nResult = InitSNMPV3();//初始化V3变量
}
// else
// {
// int construct_status;
// v3MP *v3_MP = new v3MP("dummy", 0, construct_status);
// }
return nResult;
}
/////////////////////////////////////////////////////////////////////////////
// 函数: InitSNMPV3 //
// 说明: 当SNMP版本是3,初始化环境变量 //
// 参数: //
// 无 //
// 返回值: //
// 成功为0 ,否则为1 //
/////////////////////////////////////////////////////////////////////////////
int BasicSNMP::InitSNMPV3()
{
char *engineId = "snmpWalk";//Engine ID
char *filename = "snmpv3_boot_counter"; //Local File Name
unsigned int snmpEngineBoots = 0;
int status = 0;
//Get Current Boot Counter
status = getBootCounter(filename, engineId, snmpEngineBoots);
if ((status != SNMPv3_OK) && (status < SNMPv3_FILEOPEN_ERROR))
{
return 1;
}
//Add Boot Counter
snmpEngineBoots++;
//Save Boot Counter In File
status = saveBootCounter(filename, engineId, snmpEngineBoots);
if (status != SNMPv3_OK)
{//Save File Failed
return 1;
}
//Construct Status
int construct_status;
//Create v3MP Class By Engine ID and Boot Counter, return Result into
//Construct status
v3MP *v3_MP = new v3MP(engineId, snmpEngineBoots, construct_status);
//Get v3MP Property (Point to USM Class)
USM *usm = v3_MP->get_usm();
//Set USM Discovery Mode
usm->set_discovery_mode();
//Add Auth User , Auth Password and Private Password
usm->add_usm_user(securityName, authProtocol, privProtocol,
authPassword, privPassword);
//Return Status
delete v3_MP;
return 0;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:InitUTarget //
// 说明:当SNMP版本是3时,初始化Utarget //
// 参数: //
// 无 //
// 返回: //
// 成功返回0,否则返回1 //
/////////////////////////////////////////////////////////////////////////////
int BasicSNMP::InitUTarget()
{
int nResult = 0;
utarget = address;//construct UTarger By address Class
utarget.set_version(version); // set the SNMP version SNMPV1 or V2 or V3
utarget.set_retry(retries); // set the number of auto retries
utarget.set_timeout(timeout); // set timeout
utarget.set_security_model(m_nSecurityModel);//Set Security Model
utarget.set_security_name( securityName);//Set Security Name (Auth Name)
OctetStr EgID;//Engine ID
//Get Engine ID
nResult = pSnmp->unicast_discovery(EgID,
(timeout + 99) / 100,
address, version, &community);
if(EgID.len()>0)
{//Engine ID Length Big Than 0
utarget.set_engine_id(EgID);//Set Engine ID
}
else
{//Less Than 0
return 1;//return Failed
}
return 0;//retrun Successed
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetAuthProtocol //
// 说明:设置Auth Password的加密方式 //
// 参数: //
// chAuthProtocol,Auth Password的加密方式 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetAuthProtocol(char* chAuthProtocol)
{
strlwr(chAuthProtocol);//字符串全部小写
if ( strcmp(chAuthProtocol ,"sha") == 0)
{//比较加密方式字符串是否与'sha'完全相等
authProtocol = SNMPv3_usmHMACSHAAuthProtocol;//加密算法为SHA
}
if ( strcmp(chAuthProtocol ,"md5") == 0)
{//比较加密方式字符串是否与'md5'完全相等
authProtocol = SNMPv3_usmHMACMD5AuthProtocol;//加密算法为MD5
}
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetPrivProtocol //
// 说明:设置Priv Password的加密方式 //
// 参数: //
// chAuthProtocol,Priv Password的加密方式 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetPrivProtocol(char* chPrivProtocol)
{
strlwr(chPrivProtocol);//字符串全部小写
if ( strcmp(chPrivProtocol, "des") == 0)
{//比较加密方式字符串是否与'des'完全相等
privProtocol = SNMPv3_usmDESPrivProtocol;
}
if ( strcmp(chPrivProtocol,"idea") == 0)
{//比较加密方式字符串是否与'idea'完全相等
privProtocol = SNMPv3_usmIDEAPrivProtocol;
}
if ( strcmp(chPrivProtocol, "aes128") == 0)
{//比较加密方式字符串是否与'aes128'完全相等
privProtocol = SNMPv3_usmAES128PrivProtocol;
}
if ( strcmp(chPrivProtocol, "aes192") == 0)
{//比较加密方式字符串是否与'aes192'完全相等
privProtocol = SNMPv3_usmAES192PrivProtocol;
}
if ( strcmp(chPrivProtocol, "aes256") == 0)
{//比较加密方式字符串是否与'aes256'完全相等
privProtocol = SNMPv3_usmAES256PrivProtocol;
}
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetCommunity //
// 说明:设置共同体名称,缺省为public //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetCommunity(char* chCommunity)
{
community = chCommunity;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetIPAddress //
// 说明:设置网络设备的IP地址 //
// 参数:网络设备的IP地址 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetIPAddress(char* chAddress)
{
address = chAddress;
if ( !address.valid())
{// check validity of address
memset(chErrMsg, 0 , MAX_BUFF_LEN);
strcpy(chErrMsg, "Invalid Address or DNS Name");
}
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetOID //
// 说明:设置开始查询使用的OID //
// 参数:OID //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetOID(char *chOID)
{
strcpy(chOIDStart, chOID);
oid = chOID;
if ( !oid.valid())
{// check validity of user oid
memset(chErrMsg, 0 , MAX_BUFF_LEN);
strcpy(chErrMsg, "Invalid Oid");
}
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetPort //
// 说明:设置网络设备的端口号,缺省为161 //
// 参数:端口号 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetNetworkPort(int nPort)
{
m_nPort = nPort;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetPrivatePwd //
// 说明:设置私有访问密码,仅限于SNMPV3版本 //
// 参数: //
// chPassword,char类型指针变量,私有访问密码 //
// 返回值: //
// 无 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetPrivatePwd(char* chPassword)
{
privPassword = chPassword;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetPwd //
// 说明:设置访问用户密码,仅限于SNMPV3版本 //
// 参数: //
// chPassword,char类型指针变量,访问用户密码 //
// 返回值: //
// 无 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetPwd(char* chPassword)
{
authPassword = chPassword;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// 函数:SetSecurityLevel //
// 说明:设置SNMP安全级别,只适用于V3 //
// 参数:安全级别 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetSecurityLevel(int nSecurityLevel)
{
m_nSecurityLevel = nSecurityLevel;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetSecurityMode //
// 说明:设置SNMP安全模式,只适用于V3 //
// 参数:安全级别 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetSecurityMode(int nSecurityMode)
{
m_nSecurityModel = nSecurityMode;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetUser //
// 说明:设置访问用户,仅限于SNMPV3版本 //
// 参数: //
// chUserName,char类型指针变量,访问用户名称 //
// 返回值: //
// 无 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetUser(char* chUserName)
{
securityName = chUserName;//construct Auth User Name By Parameter
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetVersion //
// 说明:设置SNMP的版本 //
// 参数: //
// nVersion,int类型变量,SNMP版本 //
// 返回值: //
// 无 //
/////////////////////////////////////////////////////////////////////////////
void BasicSNMP::SetVersion(int nVersion)
{
switch (nVersion)
{
case SNMP_VERSION_C1://版本号等于1
version = version1;//SNMP版本为1
break;
case SNMP_VERSION_C2://版本号等于2
version = version2c;//SNMP版本为2
break;
case SNMP_VERSION_C3://版本号等于3
version = version3;//SNMP版本为3
break;
default://缺省情况下为SNMP版本为1
version = version1;
break;
}
}
/////////////////////////////////////////////////////////////////////////////
// 类:clsOID //
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// 函数:clsOID //
// 说明:构造函数 //
/////////////////////////////////////////////////////////////////////////////
clsOID::clsOID()
{
m_nType = 0;//OID类型为简单标量
m_nValue = 0;
memset(chOIDIndex, 0 , MAX_BUFF_LEN);//初始化OID为空字符串
}
/////////////////////////////////////////////////////////////////////////////
// 函数:clsOID //
// 说明:构造函数 //
// 参数: //
// objSNMP,已经初始化的BasicSNMP //
/////////////////////////////////////////////////////////////////////////////
clsOID::clsOID(BasicSNMP objSNMP)
{
pSNMP = (BasicSNMP*)&objSNMP;//
memset(chOIDIndex, 0 , MAX_BUFF_LEN);//初始化OID为空字符串
m_nType = 0;//OID类型为简单标量
}
/////////////////////////////////////////////////////////////////////////////
// 函数:clsOID //
// 说明:析构函数 //
/////////////////////////////////////////////////////////////////////////////
clsOID::~clsOID()
{
}
/////////////////////////////////////////////////////////////////////////////
// 函数:Average //
// 说明:计算结果的平均值 //
// 参数:无 //
// 返回值: //
// 平均值 //
/////////////////////////////////////////////////////////////////////////////
unsigned long clsOID::IndexCount()
{
unsigned long nIndexCount = 0;
OIDResult *pTemp = pResultList;
while(pTemp != NULL)
{//循环得到总数
if(stricmp(selname,pTemp->chValue)==0)
nIndexCount++;
pTemp = pTemp->pNext;//下一条
}
return nIndexCount;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:Average //
// 说明:计算结果的平均值 //
// 参数:无 //
// 返回值: //
// 平均值 //
/////////////////////////////////////////////////////////////////////////////
unsigned long clsOID::Average()
{
unsigned long nAverage = 0;
__int64 nTotal = 0;
int nCount = 0;
OIDResult *pTemp = pResultList;
while(pTemp != NULL)
{//循环得到总数
nTotal += _atoi64(pTemp->chValue);
pTemp = pTemp->pNext;//下一条
nCount ++;
}
nAverage = (unsigned long)(nTotal / nCount);//计算平均值
return nAverage;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetOID //
// 说明:得到当前正在查询OID //
// 参数:无 //
// 返回值: //
// OID //
/////////////////////////////////////////////////////////////////////////////
char* clsOID::GetOID()
{
return chOID;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetResult //
// 说明:取得结果 //
// 参数:无 //
// 返回值: //
// 成功返回0,否则返回1
/////////////////////////////////////////////////////////////////////////////
int clsOID::GetResult()
{
int nResult = 0;
pSNMP->SetOID(chOID);//设置OID
if(m_nType == 0)
{//如果OID类型是简单变量
nResult = pSNMP->GetRequest();
//失败
if(nResult != 0)
return nResult;
}
else
{//如果是表格变量
if(strlen(chOIDIndex) ==0)
{//如果索引值为空,取表格变量
nResult = pSNMP->GetBulkRequest();//获得表格变量结果
}
else
{//索引值不为空,取简单变量
char chOIDTmp[MAX_BUFF_LEN] = {0};
sprintf(chOIDTmp, "%s.%s", chOID, chOIDIndex);
//strcpy(chOID, chOIDTmp);//替换当前查询OID
pSNMP->SetOID(chOIDTmp);//重新设置OID
nResult = pSNMP->GetRequest();//获得简单变量结果
}
}
if(nResult == 0)
{
pResultList = pSNMP->GetResultList();//得到结果列表
}
return nResult;//返回结果
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetResult //
// 说明:取得结果 //
// 参数:无 //
// 返回值: //
// 成功返回0,否则返回1
/////////////////////////////////////////////////////////////////////////////
//add by mtx
int clsOID::SetResult()
{
int nResult = 0;
pSNMP->SetOID(chOID);//设置OID
pSNMP->SetOIDValue(m_nValue);//设置OID的值
if(m_nType == 0)
{//如果OID类型是简单变量
nResult = pSNMP->SetRequest();
}
return nResult;//返回结果
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetResultList //
// 说明:得到所有值的列表 //
// 参数:无 //
// 返回值: //
// 所有值列表 //
/////////////////////////////////////////////////////////////////////////////
OIDResult* clsOID::GetResultList()
{
return pResultList;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:GetValue //
// 说明:得到第一条数据的值 //
// 参数:无 //
// 返回值: //
// char类型指针,第一条数据的值 //
/////////////////////////////////////////////////////////////////////////////
char* clsOID::GetValue()
{
return pResultList->chValue;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:Max //
// 说明:求全部结果的最大值 //
// 参数:无 //
// 返回值: //
// 最大值 //
/////////////////////////////////////////////////////////////////////////////
unsigned long clsOID::Max()
{
unsigned long nMax = 0;
OIDResult *pTemp = pResultList;
nMax = (unsigned long)_atoi64(pTemp->chValue);
while(pTemp != NULL)
{//循环每一条数据以得到最大值
if((unsigned long)_atoi64(pTemp->chValue) > nMax)
nMax = (unsigned long)_atoi64(pTemp->chValue);
pTemp = pTemp->pNext;//下一条
}
return nMax;//返回最大值
}
/////////////////////////////////////////////////////////////////////////////
// 函数:Min //
// 说明:求全部结果的最小值 //
// 参数:无 //
// 返回值: //
// 最小值 //
/////////////////////////////////////////////////////////////////////////////
unsigned long clsOID::Min()
{
unsigned long nMin = 0;
OIDResult *pTemp = pResultList;
nMin = (unsigned long)_atoi64(pTemp->chValue);
while(pTemp != NULL)
{//循环每一条数据以得到最小值
if((unsigned long)(_atoi64(pTemp->chValue)) < nMin)
nMin = (unsigned long)_atoi64(pTemp->chValue);
pTemp = pTemp->pNext;
}
return nMin;//返回结果
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetObjSNMP //
// 说明:设置clsOID使用的SNMP基类 //
// 参数: //
// objSNMP,BasicSNMP基类指针 //
// 返回值:无 //
/////////////////////////////////////////////////////////////////////////////
void clsOID::SetObjSNMP(BasicSNMP *objSNMP)
{
pSNMP = objSNMP;//
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetOID //
// 说明:设置OID //
// 参数: //
// chOIDValue,OID //
// 返回值:无 //
/////////////////////////////////////////////////////////////////////////////
void clsOID::SetOID(char* chOIDValue)
{
strcpy(chOID, chOIDValue);
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetOIDIndex //
// 说明:设置OID索引 //
// 参数: //
// chIndex,OID索引值 //
// 返回值:无 //
/////////////////////////////////////////////////////////////////////////////
void clsOID::SetOIDIndex(char* chIndex)
{
strcpy(chOIDIndex, chIndex);
}
/////////////////////////////////////////////////////////////////////////////
// 函数:SetOIDType //
// 说明:设置OID类型 //
// 参数: //
// nType,OID的类型(0简单变量,1表格变量;缺省为简单变量) //
// 返回值:无 //
/////////////////////////////////////////////////////////////////////////////
void clsOID::SetOIDType(int nType)
{
m_nType = nType;
}
/////////////////////////////////////////////////////////////////////////////
// 函数:Total //
// 说明:计算表格变量类型的OID总数 //
// 参数:无 //
// 返回值: //
// __int64类型的总数 //
/////////////////////////////////////////////////////////////////////////////
__int64 clsOID::Total()
{
__int64 nTotal = 0;
OIDResult *pTemp = pResultList;
while(pTemp != NULL)
{//循环每一条数据累加以得到总数
nTotal += _atoi64(pTemp->chValue);
pTemp = pTemp->pNext;
}
return nTotal;//返回总数
}
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
const char* clsOID::GetErrorMsg(int nErrCode)
{
return pSNMP->GetErrorMsg(nErrCode);
}
void clsOID::SetSValue(int nValue)
{
m_nValue = nValue;
}
int clsOID::GetSValue()
{
return m_nValue;
}
/////////////////////////////////////////////////////////////////////////////
// 命名空间SV_SNMP_LIB //
// 初始化LIB, 释放LIB //
/////////////////////////////////////////////////////////////////////////////
namespace SV_SNMP_LIB
{//命名空间Siteview SNMP LIB
void InitLib()
{//初始化Lib
Snmp::socket_startup();//初始化Socket子系统
}
void ReleaseLib()
{//释放Lib
Snmp::socket_cleanup(); //关闭socket子系统
}
}
| [
"[email protected]"
] | |
d44f407a49e3ff4bd4cb9b62ecb24c60b9c75446 | 1fbb86a68429b4a013e4dd5536bd11b5f01bd481 | /libs/glbinding/include/glbinding/gl43core/values.h | cb1410cd697880d0bc06f0664d9875235272b552 | [
"MIT"
] | permissive | drzajwo/UJ-Programowanie-grafiki-3D | e1dfcf0c6ba7706eada293425262905588136f26 | 9e76ed4d528208bb18525e2b5e80a74944a9b67d | refs/heads/master | 2020-08-28T12:06:27.049514 | 2019-11-23T12:49:47 | 2019-11-23T12:49:47 | 217,693,941 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 205 | h |
#pragma once
#include <glbinding/nogl.h>
#include <glbinding/gl/values.h>
namespace gl43core
{
using gl::GL_INVALID_INDEX;
using gl::GL_TIMEOUT_IGNORED;
} // namespace gl43core
| [
"[email protected]"
] | |
24cf14fb4b52f0e3775a564445e2d45ec504fbdd | f83ef53177180ebfeb5a3e230aa29794f52ce1fc | /ACE/ACE_wrappers/TAO/tao/ORB_Core.h | 6832bac73a7f795e4112eb49b3bb15092fceef21 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-sun-iiop"
] | permissive | msrLi/portingSources | fe7528b3fd08eed4a1b41383c88ee5c09c2294ef | 57d561730ab27804a3172b33807f2bffbc9e52ae | refs/heads/master | 2021-07-08T01:22:29.604203 | 2019-07-10T13:07:06 | 2019-07-10T13:07:06 | 196,183,165 | 2 | 1 | Apache-2.0 | 2020-10-13T14:30:53 | 2019-07-10T10:16:46 | null | UTF-8 | C++ | false | false | 48,198 | h | // -*- C++ -*-
// ===================================================================
/**
* @file ORB_Core.h
*
* @author DOC Center - Washington University at St. Louis
* @author DOC Laboratory - University of California at Irvine
*/
// ===================================================================
#ifndef TAO_ORB_CORE_H
#define TAO_ORB_CORE_H
#include /**/ "ace/pre.h"
#include "tao/Resource_Factory.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/Collocation_Strategy.h"
#include "tao/params.h"
#include "tao/ORB_Constants.h"
#include "tao/Parser_Registry.h"
#include "tao/Service_Callbacks.h"
#include "tao/Fault_Tolerance_Service.h"
#include "tao/Cleanup_Func_Registry.h"
#include "tao/Object_Ref_Table.h"
#include "tao/ObjectKey_Table.h"
#include "tao/Messaging_SyncScopeC.h"
#include "tao/Object.h"
#include "tao/Invocation_Utils.h"
#include "tao/Adapter_Registry.h"
#include "tao/ORB_Core_TSS_Resources.h"
#include "tao/Service_Context_Handler_Registry.h"
#include "ace/Array_Map.h"
#include "ace/Auto_Ptr.h"
#include "ace/Thread_Manager.h"
#include "ace/Lock_Adapter_T.h"
#include "ace/TSS_T.h"
#include "ace/Service_Config.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Data_Block;
ACE_END_VERSIONED_NAMESPACE_DECL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
#if TAO_HAS_INTERCEPTORS == 1
namespace TAO
{
class ClientRequestInterceptor_Adapter;
class ServerRequestInterceptor_Adapter;
}
#endif /* TAO_HAS_INTERCEPTORS == 1 */
class TAO_Adapter;
class TAO_Acceptor;
class TAO_Connector;
class TAO_Connector_Registry;
class TAO_Resource_Factory;
class TAO_Client_Strategy_Factory;
class TAO_Server_Strategy_Factory;
class TAO_TSS_Resources;
class TAO_Leader_Follower;
class TAO_LF_Strategy;
class TAO_RT_ORB;
class TAO_MProfile;
class TAO_Profile;
class TAO_Endpoint_Selector_Factory;
class TAO_Message_State_Factory;
class TAO_Protocols_Hooks;
class TAO_Network_Priority_Protocols_Hooks;
class TAO_BiDir_Adapter;
class TAO_ZIOP_Adapter;
class TAO_Flushing_Strategy;
class TAO_Thread_Lane_Resources_Manager;
class TAO_Collocation_Resolver;
class TAO_Thread_Lane_Resources;
class TAO_Stub_Factory;
class TAO_Endpoint_Selector_Factory;
class TAO_Service_Context;
class TAO_Request_Dispatcher;
class TAO_Policy_Set;
class TAO_Policy_Manager;
class TAO_Policy_Current;
class TAO_Codeset_Manager;
class TAO_IORInterceptor_Adapter;
class TAO_Valuetype_Adapter;
class TAO_Policy_Validator;
namespace TAO
{
class GUIResource_Factory;
class PolicyFactory_Registry_Adapter;
class ORBInitializer_Registry_Adapter;
class Transport_Queueing_Strategy;
}
namespace CORBA
{
class ORB_ObjectIdList; // CORBA::ORB::ObjectIdList
class ORB;
typedef ORB *ORB_ptr;
class PolicyList;
}
namespace IOP
{
class ServiceContextList;
}
namespace PortableInterceptor
{
class IORInterceptor;
typedef IORInterceptor *IORInterceptor_ptr;
#if TAO_HAS_INTERCEPTORS == 1
class ClientRequestInterceptor;
typedef ClientRequestInterceptor *ClientRequestInterceptor_ptr;
class ServerRequestInterceptor;
typedef ServerRequestInterceptor *ServerRequestInterceptor_ptr;
#endif /* TAO_HAS_INTERCEPTORS == 1 */
}
// ****************************************************************
/**
* @class TAO_ORB_Core
*
* @brief Encapsulates the state of an ORB.
*
* This is the implementation class for the CORBA::ORB interface. The
* class also encapsulates the access to the ORB resources and its
* state.
* @par
* Some resources can be TSS or global, those resources are always
* accessed through a TSS interface, but are allocated using the
* Resource_Factory. If the resource is really global the
* Resource_Factory will simply return a pointer to the global
* instance.
*/
class TAO_Export TAO_ORB_Core
{
friend class TAO_ORB_Core_Auto_Ptr;
friend TAO_Export CORBA::ORB_ptr CORBA::ORB_init (int &,
ACE_TCHAR *argv[],
const char *);
public:
/// Constructor.
TAO_ORB_Core (const char* id, ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> g);
/// Accessor for the ORB parameters.
TAO_ORB_Parameters *orb_params (void);
/**
* @todo
* In the future this hook should change, instead of hardcoding the
* object we should add a "Resolver" to the ORB, so the "POACurrent"
* object returns a per-ORB object.
* @par
* Similarly, each ORB should implement the TSS pattern to put the
* POA_Current_Impl in a void* slot. The current approach *does*
* decouple the POA from the ORB, but it cannot add new adapters or
* other components transparently.
*/
/// Accessor to the POA current.
//@{
CORBA::Object_ptr poa_current(void);
//@}
/// Get the connector registry
TAO_Connector_Registry *connector_registry (void);
/// Get the IOR parser registry
TAO_Parser_Registry *parser_registry (void);
/// Return pointer to the policy factory registry associated with
/// this ORB core.
TAO::PolicyFactory_Registry_Adapter *policy_factory_registry (void);
/// Return pointer to the orb initializer registry associated with
/// this ORB core. Tries to load the PI library if it is not loaded
/// yet
TAO::ORBInitializer_Registry_Adapter *orbinitializer_registry (void);
TAO_ZIOP_Adapter *ziop_adapter () const;
void ziop_adapter (TAO_ZIOP_Adapter *adapter);
TAO_Service_Context_Registry &service_context_registry (void);
/// Get the protocol factories
TAO_ProtocolFactorySet *protocol_factories (void);
/// Get pointer to the ORB.
CORBA::ORB_ptr orb (void);
/// Wrappers that forward the request to the concurrency strategy.
ACE_Reactor *reactor (void);
/// Get the ACE_Thread_Manager
ACE_Thread_Manager *thr_mgr (void);
/// Return the RootPOA, or try to load it if not initialized already.
CORBA::Object_ptr root_poa (void);
/// Get the adapter registry
TAO_Adapter_Registry &adapter_registry (void);
/// @name Collocation Strategies as configured by the user
//@{
enum
{
/// Indicate object should refer to ORB for either one of the
/// following strategies.
ORB_CONTROL,
/// Collocated calls will go thru POA.
TAO_COLLOCATION_THRU_POA,
/// Collocated calls invoke operation on Servant directly.
TAO_COLLOCATION_DIRECT,
/// Collocated calls invoke operation on Servant directly if possible,
/// else Collocated calls will go thru POA if possible, else
/// use REMOTE_STRATEGY
TAO_COLLOCATION_BEST
};
/// Set/get the collocation flags
//@{
void optimize_collocation_objects (CORBA::Boolean opt);
CORBA::Boolean optimize_collocation_objects (void) const;
void use_global_collocation (CORBA::Boolean opt);
CORBA::Boolean use_global_collocation (void) const;
CORBA::ULong get_collocation_strategy (void) const;
//@}
/// Get the adapter named "RootPOA" and cache the result, this is an
/// optimization for the POA.
TAO_Adapter *poa_adapter (void);
/**
* @name Access to Factories
*
* These factories are not thread-specific, and are presented here
* in order to have one place to get useful information. Often, the
* instances to which the return pointers are stored in the Service
* Repository.
*/
//@{
/// Returns pointer to the resource factory.
TAO_Resource_Factory *resource_factory (void);
/// Returns pointer to the factory for creating gui resources
TAO::GUIResource_Factory *gui_resource_factory (void);
/// Returns pointer to the client factory.
TAO_Client_Strategy_Factory *client_factory (void);
/// Returns pointer to the server factory.
TAO_Server_Strategy_Factory *server_factory (void);
/// Returns pointer to the Protocols_Hooks.
TAO_Protocols_Hooks *protocols_hooks (void);
/// Returns a pointer to the Thread Lane Resources Manager.
TAO_Thread_Lane_Resources_Manager &thread_lane_resources_manager (void);
/// Returns a pointer to the Collocation Resolver.
TAO_Collocation_Resolver &collocation_resolver (void);
/// Returns a pointer to the Stub factory.
TAO_Stub_Factory *stub_factory (void);
/// Returns a pointer to the endpoint selector factory.
TAO_Endpoint_Selector_Factory *endpoint_selector_factory (void);
//@}
/// Sets the value of TAO_ORB_Core::resource_factory_
static void set_resource_factory (const char *resource_factory_name);
/** Sets the value of TAO_ORB_Core::gui_resource_factory_.
*
* Sets the value of gui_resource_factory in TSS. ORB_Core is responsible
* for releasing this factory if needed.
*/
static void set_gui_resource_factory (TAO::GUIResource_Factory *gui_factory);
/// Sets the value of TAO_ORB_Core::network_priority_protocols_hooks_
static void set_network_priority_protocols_hooks (
const char *network_priority_protocols_hooks_name);
/// Gets the value of TAO_ORB_Core::protocols_hooks__
TAO_Protocols_Hooks * get_protocols_hooks (void);
/// Gets the value of TAO_ORB_Core::network_priority_protocols_hooks__
TAO_Network_Priority_Protocols_Hooks *
get_network_priority_protocols_hooks (void);
/// Sets the value of TAO_ORB_Core::dynamic_adapter_name_.
static void dynamic_adapter_name (const char *name);
/// Gets the value of TAO_ORB_Core::dynamic_adapter_name_.
static const char *dynamic_adapter_name (void);
/// Sets the value of TAO_ORB_Core::ifr_client_adapter_name_.
static void ifr_client_adapter_name (const char *name);
/// Gets the value of TAO_ORB_Core::ifr_client_adapter_name_.
static const char *ifr_client_adapter_name (void);
/// Sets the value of TAO_ORB_Core::typecodefactory_adapter_name_.
static void typecodefactory_adapter_name (const char *name);
/// Gets the value of TAO_ORB_Core::typecodefactory_adapter_name_.
static const char *typecodefactory_adapter_name (void);
/// Sets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_.
static void iorinterceptor_adapter_factory_name (const char *name);
/// Gets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_.
static const char *iorinterceptor_adapter_factory_name (void);
/// Sets the value of TAO_ORB_Core::valuetype_adapter_factory_name.
static void valuetype_adapter_factory_name (const char *name);
/// Gets the value of TAO_ORB_Core::valuetype_adapter_factory_name.
static const char *valuetype_adapter_factory_name (void);
/// See if we have a collocated address, if yes, return the POA
/// associated with the address.
int is_collocated (const TAO_MProfile& mprofile);
/// This allocator is always TSS and has no locks. It is intended
/// for allocating the ACE_Data_Blocks used in *outgoing* CDR
/// streams.
ACE_Allocator *output_cdr_dblock_allocator (void);
/// This allocator is always TSS and has no locks. It is intended
/// for allocating the buffers used in *outgoing* CDR streams.
ACE_Allocator *output_cdr_buffer_allocator (void);
/// This allocator is always TSS and has no locks. It is intended
/// for allocating the ACE_Data_Blocks used in *outgoing* CDR
/// streams.
ACE_Allocator *output_cdr_msgblock_allocator (void);
/// This allocator is global, may or may not have locks. It is
/// intended for allocating the ACE_Data_Blocks used in *incoming*
/// CDR streams.
ACE_Allocator *input_cdr_dblock_allocator (void);
/// This allocator is always global and has no locks. It is intended
/// for allocating the buffers used in *incoming* CDR streams.
ACE_Allocator *input_cdr_buffer_allocator (void);
/// This allocator is always global and has no locks. It is intended
/// for allocating the buffers used in *incoming* CDR streams.
ACE_Allocator *input_cdr_msgblock_allocator (void);
/// This allocator is always global and has no locks. It is intended
/// for allocating the buffers used to queue messages in
/// transports.
ACE_Allocator *transport_message_buffer_allocator (void);
/// The Message Blocks used for input CDRs must have appropiate
/// locking strategies.
ACE_Data_Block *create_input_cdr_data_block (size_t size);
/// Return the locking strategy used for the data blocks.
ACE_Lock *locking_strategy (void);
#if (TAO_HAS_CORBA_MESSAGING == 1)
/// Accessor method for the default_policies_
TAO_Policy_Set *get_default_policies (void);
/// Get a policy. First, check the ORB-level Policy Manager, then
/// check the ORB defaults.
CORBA::Policy_ptr get_policy (CORBA::PolicyType type);
/// Get a policy. First, check the thread current, then check the
/// ORB-level Policy Manager, then check the ORB defaults.
CORBA::Policy_ptr get_policy_including_current (CORBA::PolicyType type);
/// Get a cached policy. First, check the ORB-level Policy Manager,
/// then check the ORB defaults.
CORBA::Policy_ptr get_cached_policy (TAO_Cached_Policy_Type type);
/// Get a cached policy. First, check the thread current, then
/// check the ORB-level Policy Manager, then check the ORB defaults.
CORBA::Policy_ptr get_cached_policy_including_current (
TAO_Cached_Policy_Type type);
#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
/**
* The thread has a default environment to simplify porting between
* platforms that support native C++ exceptions and those that
* don't. This is a TSS resource (always), but with a twist: if the
* user creates a new environment the old one is "pushed" (actually
* the new one remembers it), eventually the new environment
* destructor pops itself from the stack and we recover the old
* environment.
* @par
* This means that if the user create a new environment and somebody
* calls a function using the default one the exception will still
* be received in the environment created by the user.
* The only drawback is that environments life time must nest
* properly, this shouldn't be a problem because environments are
* usually created on the stack, but, the spec allows their creation
* on the heap and/or as class members; we need to investigate the
* tradeoffs and take a decision.
*/
//@{
CORBA::Environment *default_environment (void) const;
void default_environment (CORBA::Environment*);
//@}
#if (TAO_HAS_CORBA_MESSAGING == 1)
/// Return the Policy_Manager for this ORB.
TAO_Policy_Manager *policy_manager (void);
/// Accesors to the policy current, this object should be kept in
/// TSS storage. The POA has to reset the policy current object on
/// every upcall.
TAO_Policy_Current &policy_current (void);
#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
/// Invoke the timeout hook if present.
/**
* The timeout hook is used to determine if the timeout policy is
* set and with what value. If the ORB is compiled without support
* for Messaging this feature does not take effect
* \param has_timeout returns 0 if there is no timeout policy set.
* \param time_value returns the timeout value in effect for the object,
* thread and current ORB.
*/
void call_timeout_hook (TAO_Stub *stub,
bool &has_timeout,
ACE_Time_Value &time_value);
/// Define the Timeout_Hook signature
typedef void (*Timeout_Hook) (TAO_ORB_Core *,
TAO_Stub *,
bool&,
ACE_Time_Value&);
void set_timeout_hook (Timeout_Hook hook);
/// Invoke the timeout hook if present.
/**
* The timeout hook is used to determine if the timeout policy is
* set and with what value. If the ORB is compiled without support
* for Messaging this feature does not take effect
* \param has_timeout returns 0 if there is no timeout policy set.
* \param time_value returns the timeout value in effect for the object,
* thread and current ORB.
*/
void connection_timeout (TAO_Stub *stub,
bool &has_timeout,
ACE_Time_Value &time_value);
/// Define the Timeout_Hook signature
/**
* The connection timeout hook was originally defined to allow the
* TAO Messaging code to be factored out of the core TAO library and
* placed in to an optional library. Since then, a new invocation
* endpoint selector, the optimised connection endpoint selector
* (see Strategies/OC_Endpoint_Selector.h) reused this connection
* timeout hook. However, this set up a problem when both the
* Messaging library and OCES are being used in the same
* application.
*
* The solution was to add a new connection timeout hook attribute
* (see alt_connection_timeout_hook_ below). This method now checks
* to see if the connection timeout hook is already set, and if so
* assigns the supplied hook value to the alternate connection
* timeout hook. This functionality has a side-effect of assuming
* that hooks are NEVER unloaded or actively replaced. IOW, no one
* will call this method with a 0 or some other pointer value to
* replace an existing hook.
*
* If such functionality as unloading a hook pointer is required,
* then this method must be extended to give some kind of identity
* for the hook. Additional changes to the definition of the hook
* will also be necessary to support such identity and manipulation.
*/
static void connection_timeout_hook (Timeout_Hook hook);
void call_sync_scope_hook (TAO_Stub *stub,
bool &has_synchronization,
Messaging::SyncScope &scope);
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
TAO::Transport_Queueing_Strategy *get_transport_queueing_strategy (
TAO_Stub *stub,
Messaging::SyncScope &scope);
#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
typedef void (*Sync_Scope_Hook) (TAO_ORB_Core *,
TAO_Stub *,
bool &,
Messaging::SyncScope &);
void set_sync_scope_hook (Sync_Scope_Hook hook);
/// Default Sync_Scope_Hook.
static void default_sync_scope_hook (TAO_ORB_Core *,
TAO_Stub *,
bool &has_synchronization,
Messaging::SyncScope &scope);
/// Return the default sync scope configured for this ORB
Messaging::SyncScope default_sync_scope (void);
/// Handle to the factory for protocols_hooks_..
TAO_Protocols_Hooks *protocols_hooks_;
/// Handle to the factory for network_priority_protocols_hooks_..
TAO_Network_Priority_Protocols_Hooks *network_priority_protocols_hooks_;
/// Obtain the TSS resources of this orb.
TAO_ORB_Core_TSS_Resources* get_tss_resources (void);
/// Obtain the TSS resource in the given slot.
void* get_tss_resource (size_t slot_id);
/// Set the TSS resource at the given slot.
/// Returns 0 on success, and -1 on failure.
int set_tss_resource (size_t slot_id, void *);
/// Register a TSS cleanup function. The slot ID for the
/// corresponding ORB core TSS resource is returned by the reference
/// argument. This method return 0 on success, and -1 on failure.
int add_tss_cleanup_func (ACE_CLEANUP_FUNC cleanup, size_t &slot_id);
/// Cleans up ts_objects using the underlying TSS cleanup function registry.
void tss_cleanup (ACE_Array_Base<void *> &ts_objects);
/// Get access to the leader_follower class.
TAO_Leader_Follower &leader_follower (void);
/// Get access to the leader follower strategy.
TAO_LF_Strategy &lf_strategy (void);
/// Get access to the thread lane resources.
TAO_Thread_Lane_Resources &lane_resources (void);
/// Run the event loop.
int run (ACE_Time_Value *tv, int perform_work);
/// End the event loop
void shutdown (CORBA::Boolean wait_for_completion);
/// Get the shutdown flag value
bool has_shutdown (void) const;
/// Shutdown the ORB and free resources
void destroy (void);
/// Check if ORB has shutdown. If it has, throw an exception.
void check_shutdown (void);
/// Returns the @a timeout value used by the server threads to poll
/// the shutdown flag. If the return value is zero then the server
/// threads block forever.
int thread_per_connection_timeout (ACE_Time_Value &timeout) const;
/// Makes sure that the ORB is open and then creates a TAO_Stub
/// based on the endpoint.
TAO_Stub *create_stub_object (TAO_MProfile &mprofile,
const char *type_id,
CORBA::PolicyList *policy_list);
/// Factory method that create the "right" Stub depending on
/// wheather RTCORBA is loaded or not. The factory used to create
/// the stub, is loaded at ORB initialization, and its type depends
/// on the fact that RTCORBA is being used or not.
TAO_Stub *create_stub (const char *repository_id,
const TAO_MProfile &profiles);
/// Create a new object, use the adapter registry to create a
/// collocated object, if not possible then create a regular
/// object.
CORBA::Object_ptr create_object (TAO_Stub *the_stub);
/// Initialize a new object, use the adapter registry to initialize a
/// collocated object, if not possible then initialize a regular
/// object.
/// NOTE: Why would this method be required? The answer is if the
/// user decides to use lazy initialization of CORBA object, then
/// this is the route that we have to take to do the
/// initialization.
CORBA::Long initialize_object (TAO_Stub *the_stub, CORBA::Object_ptr obj);
/// Reinitialise a stub after the effective profile has changed.
/// This will happen after a location forward has been received
/// or if a location forward supplied new target subsequently fails.
CORBA::Long reinitialize_object (TAO_Stub *stub);
/// Return ORBid string.
const char *orbid (void) const;
/// Set/Get the IOR of the Implementation Repository service.
//@{
CORBA::Object_ptr implrepo_service (void);
void implrepo_service (const CORBA::Object_ptr ir);
//@}
/// Do we attempt to register with the Implementation Repository
CORBA::Boolean use_implrepo (void);
/// Do we put the ImR's endpoints into persistent object references we create
CORBA::Boolean imr_endpoints_in_ior (void);
/// Resolve the TypeCodeFactory DLL.
CORBA::Object_ptr resolve_typecodefactory (void);
#if TAO_HAS_INTERCEPTORS == 1
/// Resolve the PICurrent.
CORBA::Object_ptr resolve_picurrent (void);
#endif /* TAO_HAS_INTERCEPTORS == 1 */
/// Resolve POA Current.
CORBA::Object_ptr resolve_poa_current (void);
/// Resolve the CodecFactory DLL.
CORBA::Object_ptr resolve_codecfactory (void);
/// Resolve the Compression DLL.
CORBA::Object_ptr resolve_compression_manager (void);
/// Resolve the Dynamic Any Factory
CORBA::Object_ptr resolve_dynanyfactory (void);
/// Resolve the IOR Manipulation reference for this ORB.
CORBA::Object_ptr resolve_ior_manipulation (void);
TAO_ZIOP_Adapter* ziop_adapter_i (void);
/// Resolve the IOR Table reference for this ORB.
CORBA::Object_ptr resolve_ior_table (void);
/// Resolve the Async IOR Table reference for this ORB.
CORBA::Object_ptr resolve_async_ior_table (void);
/// Resolve the Monitor reference for this ORB.
CORBA::Object_ptr resolve_monitor (void);
/// Resolve an initial reference via the -ORBInitRef and
// -ORBDefaultInitRef options.
CORBA::Object_ptr resolve_rir (const char *name);
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
/// Resolve the RT ORB reference for this ORB.
CORBA::Object_ptr resolve_rt_orb (void);
#endif
/// Resolve the RT Current flyweight for this ORB.
/// Return server_id string.
const char *server_id (void) const;
/// List all the service known by the ORB
CORBA::ORB_ObjectIdList *list_initial_references (void);
/// Reference counting...
unsigned long _incr_refcnt (void);
unsigned long _decr_refcnt (void);
unsigned long _refcnt (void) const;
/// Register the handle of an open connection with the ORB Core
/// handle set. This handle set will be used to explicitly remove
/// corresponding event handlers from the reactor.
int register_handle (ACE_HANDLE handle);
/// Remove @a handle from the ORB Core's handle set so that it
/// isn't included in the set that is passed to the reactor upon ORB
/// destruction.
int remove_handle (ACE_HANDLE handle);
/**
* @name ORB Core Service Hooks
*
* These methods would represent the hooks in the ORB Core. These
* hooks would be used to call back on the services or other
* features that are dynamically loaded.
*/
//@{
/**
* The loaded service in the ORB_Core would determine if the profile
* selection is going to be made by the services or not. If the
* services do make the selection they would return the selected
* profile through <profile>.
*/
CORBA::Boolean service_profile_selection (const TAO_MProfile &mprofile,
TAO_Profile *&profile);
/**
* The loaded service would determine if the CORBA::Object_ptr is
* actually nil or not. This would be useful to accomodate new
* enhanced definitions as defined by the service specification.
*/
CORBA::Boolean object_is_nil (CORBA::Object_ptr object);
/// Hook for the services to determine whether the profiles are
/// equivalent or not.
/**
* For details on how this is used please see the FT service
*/
TAO_Service_Callbacks::Profile_Equivalence is_profile_equivalent (
const TAO_Profile *this_p,
const TAO_Profile *that_p);
/// Hook for the services to determine the <hash> value of a
/// profile.
/**
* For details on how this is used please see the FT service
*/
CORBA::ULong hash_service (TAO_Profile *this_p, CORBA::ULong max);
/// Return a reference to the Fault Tolerant service object.
TAO_Fault_Tolerance_Service &fault_tolerance_service (void);
/// Transmit the entire TAG_FT_GROUP component data from a server IOGR as
/// a FT_GROUP_VERSION tagged service context on requests to that IOGR instead
/// of just the group version.
CORBA::Boolean ft_send_extended_sc (void);
/// Raise a comm failure exception if a service is not loaded, else
/// delegate to the service to see what the service has to do for
/// this case.
TAO::Invocation_Status service_raise_comm_failure (
IOP::ServiceContextList &clist,
TAO_Profile *profile);
/// Raise a transient failure exception if a service is not loaded,
/// else delegate to the service to see what the service has to do
/// for this case.
TAO::Invocation_Status service_raise_transient_failure (
IOP::ServiceContextList &clist,
TAO_Profile *profile);
//@}
/**
* @name Portable Interceptor Related Methods
*
* These are support methods for interceptor registration and
* interceptor set (an array) access, in addition to PICurrent
* access.
*/
//@{
#if TAO_HAS_INTERCEPTORS == 1
/// Return a pointer to the cached TAO::PICurrent object.
CORBA::Object_ptr pi_current (void);
/// Set the pointer to the cached TAO::PICurrent object.
void pi_current (CORBA::Object_ptr current);
/// Register a client request interceptor.
void add_interceptor (
PortableInterceptor::ClientRequestInterceptor_ptr interceptor);
/// Register a server request interceptor.
void add_interceptor (
PortableInterceptor::ServerRequestInterceptor_ptr interceptor);
/// Register a client request interceptor with policies.
void add_interceptor (
PortableInterceptor::ClientRequestInterceptor_ptr interceptor,
const CORBA::PolicyList& policies);
/// Register a server request interceptor with policies.
void add_interceptor (
PortableInterceptor::ServerRequestInterceptor_ptr interceptor,
const CORBA::PolicyList& policies);
/// Get the Client Request Interceptor adapter.
/// Will not create a new one if not available yet.
TAO::ClientRequestInterceptor_Adapter *clientrequestinterceptor_adapter (void);
/// Get the Server Request Interceptor adapter.
/// Will not create a new one if not available yet.
TAO::ServerRequestInterceptor_Adapter *serverrequestinterceptor_adapter (void);
#endif /* TAO_HAS_INTERCEPTORS */
/// Register an IOR interceptor.
void add_interceptor (PortableInterceptor::IORInterceptor_ptr interceptor);
//@}
/// Return the valuetype adapter
TAO_Valuetype_Adapter *valuetype_adapter (void);
#if !defined(CORBA_E_MICRO)
/// Value factory operations (CORBA 2.3 ptc/98-10-05 Ch. 4.2 p.4-7)
CORBA::ValueFactory register_value_factory (
const char *repository_id,
CORBA::ValueFactory factory);
#endif
#if !defined(CORBA_E_MICRO)
void unregister_value_factory (const char * repository_id);
#endif
#if !defined(CORBA_E_MICRO)
CORBA::ValueFactory lookup_value_factory (const char *repository_id);
#endif
/// Get the IOR Interceptor adapter. If not created, this method will try
/// to create one.
TAO_IORInterceptor_Adapter *ior_interceptor_adapter (void);
/// Set and Get methods to indicate whether a BiDir IIOP policy has
/// been set in the POA.
/// @note At present, the value will be true even if one of the POA's
/// is set with the Bi Dir GIOP policy.
CORBA::Boolean bidir_giop_policy (void);
void bidir_giop_policy (CORBA::Boolean);
/// Return the table that maps object key/name to de-stringified
/// object reference. It is needed for supporting local objects in
/// the resolve_initial_references() mechanism.
TAO_Object_Ref_Table &object_ref_table (void);
/// Acceessor to the table that stores the object_keys.
TAO::ObjectKey_Table &object_key_table (void);
/// Return the current request dispatcher strategy.
TAO_Request_Dispatcher *request_dispatcher (void);
/// Set a new request dispatcher. The ORB Core retains ownership
/// of the request dispatcher once it gets it. Currently, this only
/// gets called at initialization.
void request_dispatcher (TAO_Request_Dispatcher *rd);
/// Call the libraries to handover the validators if they haven't
/// registered yet with the list of validators.
void load_policy_validators (TAO_Policy_Validator &validator);
/// Return the flushing strategy
/**
* The flushing strategy is created by the resource factory, and it
* is used by the ORB to control the mechanism used to flush the
* outgoing data queues.
* The flushing strategies are stateless, therefore, there is only
* one per ORB.
*/
TAO_Flushing_Strategy *flushing_strategy (void);
/// Get Code Set Manager
TAO_Codeset_Manager *codeset_manager (void);
typedef ACE_Array_Map<ACE_CString, ACE_CString> InitRefMap;
/// Return a pointer to the -ORBInitRef map.
InitRefMap * init_ref_map (void);
/// Set the ORB related to the orb_id as the default ORB and not the
/// ORB that is first binded in the ORB Table
void set_default (const char * orb_id);
/// Choose to be not a default ORB when there is more than one ORB.
void not_default (const char * orb_id);
/// Verify condition for permanent forward is given,
/// both parameters must provide group attributes.
CORBA::Boolean is_permanent_forward_condition
(const CORBA::Object_ptr obj,
const TAO_Service_Context &service_context);
/// Configuration accessor method
ACE_Service_Gestalt* configuration () const;
/// Get outgoing fragmentation strategy.
auto_ptr<TAO_GIOP_Fragmentation_Strategy>
fragmentation_strategy (TAO_Transport * transport);
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
void set_eager_transport_queueing_strategy (
TAO::Transport_Queueing_Strategy* strategy);
void set_delayed_transport_queueing_strategy (
TAO::Transport_Queueing_Strategy* strategy);
#endif
protected:
/// Destructor is protected since the ORB Core is a reference
/// counted object.
~TAO_ORB_Core (void);
/// Initialize the guts of the ORB Core. It is intended that this be
/// called by CORBA::ORB_init().
int init (int &argc, char *argv[]);
/// Final termination hook, typically called by CORBA::ORB's
/// destructor.
int fini (void);
/// Routine that creates a ACE_Data_Block given the lock and allocators.
ACE_Data_Block *create_data_block_i (size_t size,
ACE_Allocator *buffer_allocator,
ACE_Allocator *dblock_allocator,
ACE_Lock *lock);
/// Obtain and cache the typecode factory object reference.
void resolve_typecodefactory_i (void);
/// Obtain and cache the poa current.
void resolve_poa_current_i (void);
#if TAO_HAS_INTERCEPTORS == 1
/// Obtain and cache the picurrent factory object reference.
void resolve_picurrent_i (void);
/// Get the Client Request Interceptor adapter.
/// If not created, this method will try to create one if needed.
TAO::ClientRequestInterceptor_Adapter *clientrequestinterceptor_adapter_i (void);
/// Get the Server Request Interceptor adapter.
/// If not created, this method will try to create one if needed.
TAO::ServerRequestInterceptor_Adapter *serverrequestinterceptor_adapter_i (void);
#endif /* TAO_HAS_INTERCEPTORS */
/// Obtain and cache the codec factory object reference.
void resolve_codecfactory_i (void);
/// Obtain and cache the compression manager object reference.
void resolve_compression_manager_i (void);
/// Obtain and cache the dynamic any factory object reference.
void resolve_dynanyfactory_i (void);
/// Obtain and cache the IORManipulation factory object reference.
void resolve_iormanipulation_i (void);
/// Obtain and cache the Monitor object reference.
void resolve_monitor_i (void);
/// Search the Dynamic service list for well known services that has
/// callbacks which can be dynamically loaded.
void services_callbacks_init (void);
/// Helper method that invokes Interceptor::destroy() on all
/// registered interceptors when ORB::destroy() is called. Prevents
/// exceptions from propagating up the call chain.
void destroy_interceptors (void);
/// Pointer to the list of protocol loaded into this ORB instance.
/// Helper method to hold the common code part for -ORBEndpoint and
/// -ORBListenEndpoints options.
int set_endpoint_helper (const ACE_CString &lane,
const ACE_CString &endpoints);
/// Return pointer to the policy factory registry associated with
/// this ORB core.
TAO::PolicyFactory_Registry_Adapter *policy_factory_registry_i (void);
/// Return pointer to the orb initializer registry associated with
/// this ORB core.
TAO::ORBInitializer_Registry_Adapter *orbinitializer_registry_i (void);
/// Common code from ::initialize_object and ::reinitialize_object
CORBA::Long initialize_object_i (TAO_Stub *the_stub,
const TAO_MProfile& mprofile);
private:
/// The ORB Core should not be copied.
//@{
TAO_ORB_Core(const TAO_ORB_Core&);
void operator=(const TAO_ORB_Core&);
//@}
/// Obtain and cache the ior table object reference.
void resolve_ior_table_i (void);
/// Obtain and cache the async ior table object reference.
void resolve_async_ior_table_i (void);
/// Checks to see whether collocation optimizations have to be
/// applied on objects in the @a other_orb
CORBA::Boolean is_collocation_enabled (TAO_ORB_Core *other_orb,
const TAO_MProfile &mp);
bool use_local_memory_pool_;
protected:
/// Synchronize internal state...
TAO_SYNCH_MUTEX lock_;
TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager_;
TAO_Collocation_Resolver *collocation_resolver_;
TAO_Stub_Factory *stub_factory_;
TAO_ProtocolFactorySet *protocol_factories_;
/// The cached IOR for the Implementation Repository.
// @@ If this is a _var, where should it get deleted? (brunsch)
CORBA::Object_ptr implrepo_service_;
/// Flag for whether the implrepo support is enabled or not.
int use_implrepo_;
/// Flag for whether to put the ImR endpoints into our object refs.
int imr_endpoints_in_ior_;
/// The cached IOR for the TypeCodeFactory DLL.
CORBA::Object_ptr typecode_factory_;
/// The cached IOR for the CodecFactory DLL.
CORBA::Object_ptr codec_factory_;
/// The cached IOR for the Compression DLL.
CORBA::Object_ptr compression_manager_;
/// The cached object reference for the DynAnyFactory.
CORBA::Object_ptr dynany_factory_;
/// The cached object reference for the IORManipulataion.
CORBA::Object_ptr ior_manip_factory_;
/// The cached object reference for the IORTable.
CORBA::Object_ptr ior_table_;
/// The cached object reference for the Async_IORTable.
CORBA::Object_ptr async_ior_table_;
/// The cached object reference for the Monitor.
CORBA::Object_ptr monitor_;
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
/// The cached object reference for the RTCORBA::RTORB.
CORBA::Object_var rt_orb_;
/// The cached object reference for the RTCORBA::Current interface.
CORBA::Object_var rt_current_;
#endif
/**
* @note
* Should we keep a single ORB pointer? This is good because
* multiple calls to ORB_init() with the same ORBid can use the same
* object, but maybe don't want so much coupling.
*
* Pointer to the ORB.
*/
CORBA::ORB_ptr orb_;
/// Object reference to the root POA. It will eventually be the
/// object reference returned by calls to
/// CORBA::ORB::resolve_initial_references ("RootPOA").
CORBA::Object_var root_poa_;
/// Parameters used by the ORB.
TAO_ORB_Parameters orb_params_;
/// Return InitRefMap to find if a particular object id is present.
InitRefMap init_ref_map_;
/// Table that maps object key/name to (de-stringified) object
/// reference. It is needed for supporting local objects in the
/// resolve_initial_references() mechanism.
TAO_Object_Ref_Table object_ref_table_;
/// Table that stores the object key instead of caching one per-profile.
TAO::ObjectKey_Table object_key_table_;
/// The ORBid for this ORB.
char *orbid_;
/// Handle to the factory for resource information..
TAO_Resource_Factory *resource_factory_;
/// The server_id_ that was passed via -ORBServerId option
ACE_CString server_id_;
/// Handle to the factory for Client-side strategies.
TAO_Client_Strategy_Factory *client_factory_;
/// Handle to the factory for Server-side strategies.
TAO_Server_Strategy_Factory *server_factory_;
/**
* @name Service Level Hooks
*/
//@{
/// Fault Tolerant service hook.
TAO_Fault_Tolerance_Service ft_service_;
//@}
/// TRUE transmits a full TAG_FT_GROUP component in place of the FT_GROUP_VERSION
/// context on FT requests. This is contrary to the spec but enables more effective
/// fault tolerant stuff. @todo reference to OMG issue. Default false.
CORBA::Boolean ft_send_extended_sc_;
/// TRUE if we want to take advantage of collocation optimization in
/// this ORB.
CORBA::Boolean opt_for_collocation_;
/// TRUE if we want to consider all ORBs in this address space
/// collocated.
CORBA::Boolean use_global_collocation_;
/// Default collocation policy. This should never be ORB_CONTROL.
CORBA::ULong collocation_strategy_;
#if (TAO_HAS_CORBA_MESSAGING == 1)
/// The Policy_Manager for this ORB.
TAO_Policy_Manager *policy_manager_;
/// The default policies.
TAO_Policy_Set *default_policies_;
/// Policy current.
TAO_Policy_Current *policy_current_;
#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
/// The request dispatching strategy.
TAO_Request_Dispatcher *request_dispatcher_;
/**
* POA current.
*/
CORBA::Object_var poa_current_;
/// The list of Adapters used in this ORB.
TAO_Adapter_Registry adapter_registry_;
/// An optimization for the POA.
TAO_Adapter *poa_adapter_;
/// The Thread Manager
ACE_Thread_Manager tm_;
/// The data block reference counts are locked using this mutex
ACE_Lock_Adapter<TAO_SYNCH_MUTEX> data_block_lock_;
/// TSS Object cleanup functions. These correspond to the TSS
/// objects stored in TAO's TSS resources.
TAO_Cleanup_Func_Registry tss_cleanup_funcs_;
/// This is where the tss resources for this ORB are stored.
ACE_TSS_TYPE (TAO_ORB_Core_TSS_Resources) tss_resources_;
/// Flag which denotes that the ORB has been shutdown.
bool has_shutdown_;
/// The value of the timeout if the flag above is not zero.
//@{
int thread_per_connection_use_timeout_;
ACE_Time_Value thread_per_connection_timeout_;
//@}
/// Mutual exclusion for calling open.
TAO_SYNCH_MUTEX open_lock_;
TAO_Endpoint_Selector_Factory *endpoint_selector_factory_;
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
/// This strategy will buffer messages.
TAO::Transport_Queueing_Strategy *eager_transport_queueing_strategy_;
/// This strategy will buffer messages.
TAO::Transport_Queueing_Strategy *delayed_transport_queueing_strategy_;
/// This strategy will not queue by default, but will flush the queue
/// each time
TAO::Transport_Queueing_Strategy *flush_transport_queueing_strategy_;
#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
/// Number of outstanding references to this object.
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
/// Registry containing all registered policy factories.
TAO::PolicyFactory_Registry_Adapter *policy_factory_registry_;
/// Registry containing all orb initializers
TAO::ORBInitializer_Registry_Adapter *orbinitializer_registry_;
/// Registry containing all service context handlers
TAO_Service_Context_Registry service_context_registry_;
#if (TAO_HAS_INTERCEPTORS == 1)
/// Cached pointer/reference to the PICurrent object.
/**
* A pointer/reference to the PICurrent object is cached in the ORB
* Core since it is accessed in the critical path (i.e. the request
* invocation path). Caching it prevents additional overhead to due
* object resolution from occurring.
*/
CORBA::Object_ptr pi_current_;
/// The adapter for handling client request interceptors
TAO::ClientRequestInterceptor_Adapter *client_request_interceptor_adapter_;
/// The adapter for handling server request interceptors
TAO::ServerRequestInterceptor_Adapter *server_request_interceptor_adapter_;
#endif /* TAO_HAS_INTERCEPTORS */
/// IORInterceptor adapter.
TAO_IORInterceptor_Adapter *ior_interceptor_adapter_;
/// Pointer to the valuetype adapter.
TAO_Valuetype_Adapter *valuetype_adapter_;
/// The IOR parser registry.
TAO_Parser_Registry parser_registry_;
/// BiDirectional GIOP factory
TAO_BiDir_Adapter *bidir_adapter_;
/// Bir Dir GIOP policy value
CORBA::Boolean bidir_giop_policy_;
/// ZIOP Adapter
TAO_ZIOP_Adapter *ziop_adapter_;
/// ZIOP enabled or not
CORBA::Boolean ziop_enabled_;
/// Hold the flushing strategy
TAO_Flushing_Strategy *flushing_strategy_;
/// Code Set Manager, received from the Resource Factory
TAO_Codeset_Manager *codeset_manager_;
/// ORB's service configuration
ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> config_;
/// The hook to be set for the SyncScopePolicy
Sync_Scope_Hook sync_scope_hook_;
/// The configured value used as the default sync scope
Messaging::SyncScope default_sync_scope_;
/// The hook to be set for the RelativeRoundtripTimeoutPolicy.
Timeout_Hook timeout_hook_;
};
// ****************************************************************
/**
* @class TAO_ORB_Core_Static_Resources
*
* @brief The static (global) resoures of all ORB cores.
*
* This class is used by the ORB_Core to store the resources global to
* all ORB_Cores. All instance variables that would have been
* declared "static" in TAO_ORB_Core, should be declared in this class
* to avoid the "static initialization order fiasco" as described in
* http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11.
* Briefly, this is the problem that occurs if any static initializers
* in any other code call into set static members of TAO_ORB_Core.
* Since the order in which these initializers execute is unspecified,
* uninitialized members can be accessed.
*/
class TAO_Export TAO_ORB_Core_Static_Resources : public ACE_Service_Object
{
public:
/// Return the context-specific singleton instance.
static TAO_ORB_Core_Static_Resources* instance (void);
public:
/**
* Name of the network_priority_protocols_hooks that needs to be instantiated.
*/
ACE_CString network_priority_protocols_hooks_name_;
/// The hook to be set for the ConnectionTimeoutPolicy
TAO_ORB_Core::Timeout_Hook connection_timeout_hook_;
/**
* Name of the resource factory that needs to be instantiated.
* The default value is "Resource_Factory". If TAO_Strategies is
* linked, the set_resource_factory will be called to set the value
* to be "Advanced_Resource_Factory".
*/
ACE_CString resource_factory_name_;
/**
* Name of the service object for DII request creation that needs
* to be instantiated. The default value is "Dynamic_Adaper". If
* TAO_DynamicInterface is linked, dynamic_adapter_name() will be
* called to set the value to "Concrete_Dynamic_Adapter".
*/
ACE_CString dynamic_adapter_name_;
/**
* Name of the service object for functions that make calls on
* the Interface Repository. The default value is "IFR_Client_Adaper".
* If TAO_IFR_CLient is linked, ifr_client_adapter_name() will be
* called to set the value to "Concrete_IFR_Client_Adapter".
*/
ACE_CString ifr_client_adapter_name_;
/**
* Name of the service object used by the ORB create_*_tc functions.
* The default value is "TypeCodeFactory_Adapter". If the
* TypeCodeFactory library is linked, the corresponding accessor
* function typecodefactory_adapter_name() will be called to set
* the value to "Concrete_TypeCodeFactory_Adapter".
*/
ACE_CString typecodefactory_adapter_name_;
/**
* Name of the factory object used to adapt function calls on
* the PortableInterceptor interfaces IORInfo and IORInterceptor.
* The default value is "IORInterceptor_Adapter_Factory". If the
* IORInterceptor library is linked, the corresponding accessor
* function iorinterceptor_adapter_factory_name() will be called to set
* the value to "Concrete_IORInterceptor_Adapter_Factory".
*/
ACE_CString iorinterceptor_adapter_factory_name_;
/**
* Name of the factory object used to adapt function calls on
* the valuetype-related interfaces.
* The default value is "Valuetype_Adapter_Factory". If the
* Valuetype library is linked, the corresponding accessor
* function valuetype_adapter_factory_name() will be called to set
* the value to "Concrete_Valuetype_Adapter_Factory".
*/
ACE_CString valuetype_adapter_factory_name_;
/// An alternative hook to be set for the ConnectionTimeoutPolicy
TAO_ORB_Core::Timeout_Hook alt_connection_timeout_hook_;
//private:
/// Constructor.
TAO_ORB_Core_Static_Resources (void);
TAO_ORB_Core_Static_Resources& operator=
(const TAO_ORB_Core_Static_Resources&);
private:
/// Mostly unused variable whose sole purpose is to enforce
/// the instantiation of a TAO_ORB_Core_Static_Resources instance
/// at initialization time.
static TAO_ORB_Core_Static_Resources* initialization_reference_;
};
// ****************************************************************
/// Obtain an instance of the first ORB core registered in the ORB
/// table.
TAO_Export TAO_ORB_Core * TAO_ORB_Core_instance (void);
// ****************************************************************
ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_ORB_Core_Static_Resources)
ACE_FACTORY_DECLARE (TAO, TAO_ORB_Core_Static_Resources)
TAO_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
# include "tao/ORB_Core.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
#endif /* TAO_ORB_CORE_H */
| [
"[email protected]"
] | |
3123db8d24352ccd89b207e4fa8e5f3daf7d496c | 9a687607c91f13c53f06d92f78579b838fc227a7 | /common/common/PlatformUtil.cpp | cf85bf667700a9239d75c1cc663fef246e458a65 | [
"MIT"
] | permissive | lemontreehuang/cef-demos | 3ca80a60a3707c0febcd66adf68370f93b4b0bbc | 29386b72312231634f86c03e36763f2a2dfdf064 | refs/heads/master | 2020-06-21T06:38:45.474677 | 2019-04-03T17:16:44 | 2019-04-03T17:20:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,885 | cpp | // CEF-Demos
// Copyright (c) 2019 Borislav Stanimirov
//
// Distributed under the MIT Software License
// See accompanying file LICENSE.txt or copy at
// http://opensource.org/licenses/MIT
//
#include "PlatformUtil.hpp"
#if defined(_WIN32)
# include <Windows.h>
#else
# include <dlfcn.h>
# include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
namespace cefdemos
{
#if defined(_WIN32)
namespace
{
// local function used to identify the current module on Windows
void getAddr() {}
}
#endif
std::string PlatformUtil::getCurrentExecutablePath()
{
std::string modulePath;
#if defined(_WIN32)
HMODULE engine;
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPCSTR)getAddr,
&engine);
char path[_MAX_PATH + _MAX_FNAME + 1];
GetModuleFileNameA(engine, path, _MAX_PATH + _MAX_FNAME);
// normalize path
char* p = path;
while (*p)
{
if (*p == '\\')
{
*p = '/';
}
++p;
}
modulePath = path;
#else
// retrieve the executable path and hope for the best
char buff[2048];
size_t len = readlink("/proc/self/exe", buff, sizeof(buff) - 1);
if (len > 0)
{
buff[len] = 0;
modulePath = buff;
}
#endif
return modulePath;
}
std::string PlatformUtil::getAssetPath(std::string baseDir, const std::string& assetDir)
{
while (true)
{
auto slash = baseDir.rfind('/');
if (slash == std::string::npos)
{
baseDir = assetDir;
break;
}
baseDir.erase(slash + 1);
baseDir += assetDir;
struct stat info;
if (stat(baseDir.c_str(), &info) == 0 && (info.st_mode & S_IFDIR))
{
break;
}
baseDir.erase(slash);
}
return baseDir;
}
}
| [
"[email protected]"
] | |
f4c770a7f5827f4c07b3c954f1db9a72759687f2 | 337c527999a16059b99bdb4fb07424730b871c6f | /gtest/LearningGtest/tests/hello_test.cc | 4899a97bc42cb768ac415d6442040a4ea9ab42dc | [
"Apache-2.0"
] | permissive | JuhunC/SelfStudy | 5a94b46f7a0f9071baae679761870143bc25008a | 0742bfa96be588c04a8a2eaed6e3eeaa0a9ce52a | refs/heads/main | 2023-07-05T11:59:56.412601 | 2021-08-05T14:24:07 | 2021-08-05T14:24:07 | 363,918,108 | 0 | 0 | null | 2021-05-21T14:02:52 | 2021-05-03T12:12:57 | null | UTF-8 | C++ | false | false | 230 | cc | #include <gtest/gtest.h>
// Demonstrate some basic assertions.
TEST(HelloTest, BasicAssertions)
{
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
} | [
"[email protected]"
] | |
e8319d72ded0aafd89036f4a5afb309805b35737 | a63d60c270433e84398f6be4642feb7643c0c8b0 | /BOI/BOI 2018/dna.cpp | 86c5013bb7fa4e889aa202b996d3ebb85424ba03 | [] | no_license | luciocf/Problems | 70a97784c17a106cb9e0f0ec28ac57cf58fea8c7 | 19f6000e9e6a5fe483ad4bb17e9ba50644ac954a | refs/heads/master | 2023-08-21T10:54:18.574403 | 2021-10-29T03:45:16 | 2021-10-29T03:45:16 | 169,012,579 | 8 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,187 | cpp | // BOI 2018 - DNA
// Lúcio Cardoso
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int MAXN = 2e5+10;
int num[MAXN], freq[MAXN], M[MAXN], n, k, m;
bool is[MAXN];
pii q[MAXN];
bool ok(int x)
{
memset(freq, 0, sizeof freq);
int qtd = 0;
int l = 1, r = x;
for (int i = l; i <= r; i++)
{
if (is[num[i]]) freq[num[i]]++;
if (is[num[i]] && freq[num[i]] == q[M[num[i]]].second) qtd++;
}
if (qtd == m) return true;
while (r < n)
{
if (is[num[l]] && freq[num[l]] == q[M[num[l]]].second) qtd--;
freq[num[l]]--, l++, r++;
if (is[num[r]] && freq[num[r]]+1 == q[M[num[r]]].second) qtd++;
freq[num[r]]++;
if (qtd == m) return true;
}
return false;
}
int busca(void)
{
int ini = 1, fim = n, ans = -1;
while (ini <= fim)
{
int mid = (ini+fim)/2;
if (ok(mid)) fim = mid-1, ans = mid;
else ini = mid+1;
}
return ans;
}
int main(void)
{
cin >> n >> k >> m;
for (int i = 1; i <= n; i++)
cin >> num[i];
for (int i = 1; i <= m; i++)
{
int x;
cin >> q[i].first >> q[i].second;
is[q[i].first] = 1;
M[q[i].first] = i;
}
int ans = busca();
if (ans == -1) cout << "impossible\n";
else cout << ans << "\n";
}
| [
"[email protected]"
] | |
7df96eddfde48e1c81037bf2cafdfa8535dc4b88 | 464aa9d7d6c4906b083e6c3da12341504b626404 | /src/lib/math/unit_test/test_blend_transform.cpp | d0ea5317adc7b4ec06be9f304cd3809bf7a2793b | [] | no_license | v2v3v4/BigWorld-Engine-2.0.1 | 3a6fdbb7e08a3e09bcf1fd82f06c1d3f29b84f7d | 481e69a837a9f6d63f298a4f24d423b6329226c6 | refs/heads/master | 2023-01-13T03:49:54.244109 | 2022-12-25T14:21:30 | 2022-12-25T14:21:30 | 163,719,991 | 182 | 167 | null | null | null | null | UTF-8 | C++ | false | false | 1,814 | cpp | /******************************************************************************
BigWorld Technology
Copyright BigWorld Pty, Ltd.
All Rights Reserved. Commercial in confidence.
WARNING: This computer program is protected by copyright law and international
treaties. Unauthorized use, reproduction or distribution of this program, or
any portion of this program, may result in the imposition of civil and
criminal penalties as provided by law.
******************************************************************************/
#include "pch.hpp"
#include "cstdmf/cstdmf.hpp"
#include "math/blend_transform.hpp"
namespace
{
struct Fixture
{
Fixture()
{
new CStdMf;
}
~Fixture()
{
delete CStdMf::pInstance();
}
BlendTransform transform_;
};
}
TEST_F( Fixture, BlendTransform_testValid )
{
// Identity matrix should be valid
BlendTransform bt( Matrix::identity );
CHECK( bt.valid() );
}
TEST_F( Fixture, BlendTransform_testValid2 )
{
Quaternion okRotation( 0.70711f, 0.0f, 0.0f, 0.70711f );
Vector3 okScale( 10.0f, 1.0f, 1.5f );
Vector3 okTranslation( -10.0f, 10.0f, -10.f );
Quaternion nonUnitRotation( 1.0f, -1.0f, -1.0f, 1.0f );
Vector3 badScale( 1100.0f, -1100.0f, 10.0f );
Vector3 badTranslation( 250.0f, -250.0f, 10.0f );
// Control test - this should be fine
BlendTransform bt1( okRotation,
okScale,
okTranslation );
CHECK( bt1.valid() );
// Bad rotation, should not be valid
BlendTransform bt2( nonUnitRotation,
okScale,
okTranslation );
CHECK( !bt2.valid() );
// Bad scale, should not be valid
BlendTransform bt3( okRotation,
badScale,
okTranslation );
CHECK( !bt3.valid() );
// Bad translation, should not be valid
BlendTransform bt4( okRotation,
okScale,
badTranslation );
CHECK( !bt4.valid() );
}
| [
"[email protected]"
] | |
82f357fd409c86af1774b6e0688f621e08ccef8a | 2865d0fd61bc33d1d10f73460508de64601b8f24 | /OREZ_Reconstruct/orez_reconstruct.h | 022464f3adc0f4020d1e598829465a667bcfa8a6 | [] | no_license | XungangYin/ZERO | 85c4f0d5982e79e26116864af55c591c929b6d36 | ffb4d53cd43a8e956f8040df0f6f69cb00b0c966 | refs/heads/master | 2020-04-14T23:19:41.451374 | 2019-04-02T07:09:09 | 2019-04-02T07:09:09 | 164,198,622 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 975 | h | #ifndef OREZ_RECONSTRUCT_H
#define OREZ_RECONSTRUCT_H
#include "orez_reconstruct_global.h"
#include "../common.h"
#include "../Common/common.h"
#include <pcl/surface/poisson.h> //泊松
#include <pcl/surface/marching_cubes.h> //mc重建
class OREZ_RECONSTRUCTSHARED_EXPORT OREZ_Reconstruct
{
public:
OREZ_Reconstruct();
pcl::PolygonMesh poissonReconstruction(PointCloudT::Ptr p,bool confidence,unsigned int depth,unsigned int samplePerNode,float scale/*,unsigned int solverDivide*/);
pcl::PolygonMesh poissonReconstruction(PointCloudTRGB::Ptr p,bool confidence,unsigned int depth,unsigned int samplePerNode,float scale/*,unsigned int solverDivide*/);
private:
pcl::PolygonMesh mesh;
// pcl::search::KdTree<PointNormal>::Ptr kdtree;
//泊松重建参数
bool confidence;
unsigned int depth;
unsigned int samplePerNode;
float scale;
unsigned int solverDivide;
//法向
Common *common;
};
#endif // OREZ_RECONSTRUCT_H
| [
""
] | |
381a69934cc9bcc0cb8b073bddfbc9f2e69e51db | d5cef2c6bcb7188cb7c917c450528cf37e98bc5e | /ArchaicDomination/BitmapFont.h | 8d686b8edf30f509a78b1f7d80942ecd27864fef | [] | no_license | ahfawaz/ArchaicDomination | 3fa809e720cca8140514a7af6f2efeaf72a7a794 | af6c4bbabb47f76702b288faa6175d04a866d9df | refs/heads/master | 2021-01-10T14:58:56.915798 | 2016-03-16T07:04:27 | 2016-03-16T07:04:27 | 54,007,385 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 980 | h | ////////////////////////////////////////////////////
// File: CBitmapFont.h
// Purpose: Loads in the bitmap font to be used by
// Other classes throughout the project
//
// Author: Joshua Ford ([email protected])
// Course: SGP 1310
////////////////////////////////////////////////////
#pragma once
#include <Windows.h>
#include "SGD Wrappers\SGD_String.h"
#include <vector>
//class CAnimation;
class CLetters;
class CBitmapFont
{
public:
CBitmapFont(void);
~CBitmapFont(void);
void Initialize ( void );
void Terminate ( void );
void Draw ( const TCHAR* OutputText, int X, int Y, float Scale , DWORD Color );
bool LoadFiles ( std::vector<CLetters*> TempLetters );
private:
int ImageID;
int CharWidth;
int CharHeight;
TCHAR FirstChar;
float PositionX;
float PositionY;
int NumRows;
int NumCols;
//CAnimation* m_cAnimation;
RECT CellAlgorithm( int id ) const;
std::vector<CLetters*> m_cCharacters;
bool m_bOnlyUpperCasse;
};
| [
"[email protected]"
] | |
fa20bafe15a697bd15d1026a04f7bc111b03b6d7 | c588c442150354d4b6b0005982cbc9eb760ff7bd | /include/KeyfileIncIndex.hpp | fce81a2c0a5f354cb4f1f9ca123fc5621b32fdec | [
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | danrugeles/retrieval-algorithms | 548d593637e9ecc2029b89fa2e0e15e7b10310e7 | 970a645107200a79e6f5a8ef62a34d54bc72f254 | refs/heads/master | 2020-05-29T15:35:00.906805 | 2013-02-19T02:22:56 | 2013-02-19T02:22:56 | 8,242,635 | 2 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 12,564 | hpp | /*==========================================================================
* Copyright (c) 2001 Carnegie Mellon University. All Rights Reserved.
*
* Use of the Lemur Toolkit for Language Modeling and Information Retrieval
* is subject to the terms of the software license set forth in the LICENSE
* file included with this software, and also available at
* http://www.lemurproject.org/license.html
*
*==========================================================================
*/
#ifndef _LEMUR_KEYFILE_INCINDEX_HPP
#define _LEMUR_KEYFILE_INCINDEX_HPP
/*
* NAME DATE - COMMENTS
* tnt 01/02 - created
* dmf 07/03 - converted to incremental berkeley db btree indexer with
* integrated document manager.
* tds 09/03 - modified from BTIncIndex to use keyfile
* dmf 12/03 - update to 2.1 API and remove parser/docmgr components.
*/
#include "common_headers.hpp"
#include "Index.hpp"
#include "InvFPDocList.hpp"
#include "InvFPTermList.hpp"
#include "InvFPTypes.hpp"
#include "BasicCollectionProps.hpp"
#include "Param.hpp"
#include "PushIndex.hpp"
#include "MemCache.hpp"
#include "Keyfile.hpp"
#include "KeyfileDocMgr.hpp"
#include "ReadBuffer.hpp"
#include "WriteBuffer.hpp"
#include "TermCache.hpp"
#include <cstring>
#include <queue>
namespace lemur
{
namespace index
{
// for counts array
#define UNIQUE_TERMS 0
#define TOTAL_TERMS 1
#define DOCS 2
#define DT_FILES 3
#define INV_FILES 4
// keyref.h -- 512
#define MAX_DOCID_LENGTH 512
#define MAX_TERM_LENGTH 512
#define KEYFILE_MAX_SEGMENTS (16)
// we love multiple inheritance
/*!
KeyfileIncIndex builds an index assigning termids, docids, tracking
locations of term within documents, and tracking terms within
documents. It also expects a DocumentProp to have the total number of
terms that were in a document. It expects that all stopping and
stemming (if any) occurs before the term is passed in. If used with an
existing index, new documents are added incrementally. Records are stored
in keyfile b-trees. KeyfileIncIndex also provides the Index API for using
the index.
*/
class KeyfileIncIndex : public PushIndex, public lemur::api::Index {
public:
/// principle record
class record {
public:
/// file offset
lemur::file::File::offset_type offset;
/// length of list
int len;
/// token length of doc
int totalLen;
/// mgrid for terminfolist, df for docinfolist
int num;
};
/// offset within an individual file segment
struct SegmentOffset {
/// segment number
unsigned int segment;
/// length of data
unsigned int length;
/// file offset
lemur::file::File::offset_type offset;
};
/// individual term data
struct TermData {
/// total number of times this term occurs in the corpus
lemur::api::COUNT_T totalCount;
/// total number of documents this term occurs in
lemur::api::COUNT_T documentCount;
/// segments containing the data associated with the the term
SegmentOffset segments[ KEYFILE_MAX_SEGMENTS ];
};
/// Instantiate with index name without extension. Optionally pass in
/// cachesize and starting document id number.
KeyfileIncIndex(const string &prefix, int cachesize=128000000,
lemur::api::DOCID_T startdocid=1);
/// New empty one for index manager to use.
KeyfileIncIndex();
/// Clean up.
~KeyfileIncIndex();
/// sets the name for this index
void setName(const string &prefix);
/// the beginning of a new document
bool beginDoc(const lemur::parse::DocumentProps* dp);
/// adding a term to the current document
bool addTerm(const lemur::api::Term& t);
/// signify the end of current document
void endDoc(const lemur::parse::DocumentProps* dp);
/// signify the end of current document
virtual void endDoc(const lemur::parse::DocumentProps* dp, const string &mgr);
/// signify the end of this collection.
void endCollection(const lemur::parse::CollectionProps* cp);
/// set the document manager to use for succeeding documents
void setDocManager(const string &mgrID);
protected:
/// try to open an existing index
bool tryOpen();
/// write out the table of contents file.
void writeTOC(const lemur::parse::CollectionProps* cp);
/// write out the cache
void writeCache( bool lastRun = false );
/// final run write out of cache
void lastWriteCache();
/// out-of-tree cache management combine segments into single segment
void mergeCacheSegments();
/// write out segments
void writeCacheSegment();
/// write out document manager ids
void writeDocMgrIDs();
/// returns the internal id of given docmgr
/// if not already registered, mgr will be added
int docMgrID(const string &mgr);
/// handle end of document token.
virtual void doendDoc(const lemur::parse::DocumentProps* dp, int mgrid);
/// how long all the lists are
int listlengths;
public:
/// @name Open index
//@{
/// Open previously created Index with given prefix
bool open(const string &indexName);
//@}
/// @name Spelling and index conversion
//@{
/// Convert a term spelling to a termID
lemur::api::TERMID_T term(const lemur::api::TERM_T &word) const;
/// Convert a termID to its spelling
const lemur::api::TERM_T term(lemur::api::TERMID_T termID) const;
/// Convert a spelling to docID
lemur::api::DOCID_T document(const lemur::api::EXDOCID_T &docIDStr) const;
/// Convert a docID to its spelling
const lemur::api::EXDOCID_T document(lemur::api::DOCID_T docID) const;
/// The document manager for this document
const lemur::api::DocumentManager *docManager(lemur::api::DOCID_T docID) const;
const lemur::parse::CollectionProps *collectionProps() const;
//@}
/// @name Summary counts
//@{
/// Total count (i.e., number) of documents in collection
lemur::api::COUNT_T docCount() const { return counts[DOCS]; };
/// Total count of unique terms in collection
lemur::api::COUNT_T termCountUnique() const { return counts[UNIQUE_TERMS]; };
/// Total counts of a term in collection
lemur::api::COUNT_T termCount(lemur::api::TERMID_T termID) const;
/// Total counts of all terms in collection
lemur::api::COUNT_T termCount() const { return counts[TOTAL_TERMS]; };
/// Average document length
float docLengthAvg() const;
/// Total counts of doc with a given term
lemur::api::COUNT_T docCount(lemur::api::TERMID_T termID) const;
/// Total counts of terms in a document, including stop words maybe
lemur::api::COUNT_T docLength(lemur::api::DOCID_T docID) const;
/// Total counts of terms in a document including stopwords for sure.
virtual lemur::api::COUNT_T totaldocLength (lemur::api::DOCID_T docID) const;
/// Total count of terms in given document, not including stop words
lemur::api::COUNT_T docLengthCounted(lemur::api::DOCID_T docID) const;
//@}
/// @name Index entry access
//@{
/// doc entries in a term index, @see DocList @see InvFPDocList
lemur::api::DocInfoList* docInfoList(lemur::api::TERMID_T termID) const;
/// word entries in a document index (bag of words), @see TermList
lemur::api::TermInfoList* termInfoList(lemur::api::DOCID_T docID) const;
/// word entries in a document index (sequence of words), @see TermList
lemur::api::TermInfoList* termInfoListSeq(lemur::api::DOCID_T docID) const;
//@}
/// set the mesg stream
void setMesgStream(ostream * lemStream);
/// update data for an already seen term
void addKnownTerm( lemur::api::TERMID_T termID, lemur::api::LOC_T position );
/// initialize data for a previously unseen term.
lemur::api::TERMID_T addUnknownTerm( const InvFPTerm* term );
/// update data for a term that is not cached in the term cache.
lemur::api::TERMID_T addUncachedTerm( const InvFPTerm* term );
protected:
/// open the database files
void openDBs();
/// open the segment files
void openSegments();
/// create the database files
void createDBs();
/// readin all toc
void fullToc();
/// read in document manager internal and external ids map
bool docMgrIDs();
/// retrieve a document record.
record fetchDocumentRecord( lemur::api::DOCID_T key ) const;
/// store a document record
void addDocumentLookup( lemur::api::DOCID_T documentKey, const char* documentName );
/// store a term record
void addTermLookup( lemur::api::TERMID_T termKey, const char* termSpelling );
/// store a record
void addGeneralLookup( lemur::file::Keyfile& numberNameIndex,
lemur::file::Keyfile& nameNumberIndex,
lemur::api::TERMID_T number, const char* name );
/// retrieve and construct the DocInfoList for a term.
InvFPDocList* internalDocInfoList(lemur::api::TERMID_T termID) const;
/// add a position to a DocInfoList
void _updateTermlist( InvFPDocList* curlist, lemur::api::LOC_T position );
/// total memory used by cache
int _cacheSize();
/// cache size limits based on cachesize parameter to constructor
void _computeMemoryBounds( int memorySize );
/// Approximate how many updates to collect before flushing the cache.
void _resetEstimatePoint();
/// array to hold all the overall count stats of this db
lemur::api::COUNT_T* counts;
/// array to hold all the names for files we need for this db
std::vector<std::string> names;
/// the average document length in this index
float aveDocLen;
/// list of document managers
vector<std::string> docmgrs;
/// Lemur code messages stream
ostream* msgstream;
// All database handles are marked mutable since they sometimes
// must be used to fetch values during const methods
/// termID -> TermData (term statistics and inverted list segment offsets)
mutable lemur::file::Keyfile invlookup;
// int <-> string mappings for documents and terms
/// documentName -> documentID
mutable lemur::file::Keyfile dIDs;
/// documentID -> documentName
mutable lemur::file::Keyfile dSTRs;
/// termName -> termID
mutable lemur::file::Keyfile tIDs;
/// termID -> termName
mutable lemur::file::Keyfile tSTRs;
/// document statistics (document length, etc.)
mutable lemur::file::File dtlookup;
/// read buffer for dtlookup
lemur::file::ReadBuffer* dtlookupReadBuffer;
/// filestream for writing the list of located terms
/// mutable for index access mode of Index API (not PushIndex)
mutable lemur::file::File writetlist;
/// buffers for term() lookup functions
mutable char termKey[MAX_TERM_LENGTH];
/// buffers for document() lookup functions
mutable char docKey[MAX_DOCID_LENGTH];
/// memory for use by inverted list buffers
int _listsSize;
/// upper bound for memory use
int _memorySize;
/// the prefix name
std::string name;
/// array of pointers to doclists
vector<InvFPDocList*> invertlists;
/// list of terms and their locations in this document
vector<LocatedTerm> termlist;
/// the current docmanager to use
int curdocmgr;
/// list of document manager objects
vector<lemur::api::DocumentManager*> docMgrs;
/// cache of term entries
lemur::utility::TermCache _cache;
/// list of collection properties
mutable lemur::parse::BasicCollectionProps* cprops;
/// out-of-tree segments for data
std::vector<lemur::file::File*> _segments;
/// highest term id flushed to disk.
lemur::api::TERMID_T _largestFlushedTermID;
/// invertlists point where we should next check on the cache size
int _estimatePoint;
/// are we in a bad document state?
bool ignoreDoc;
/// are we read only
bool _readOnly;
};
}
}
#endif //_LEMUR_KEYFILE_INCINDEX_HPP
| [
"[email protected]"
] | |
3777d770b84763c168128288bf781f352539c8f9 | 09a4962b93c196f2f8a70c2384757142793612fd | /Dripdoctors/build/Android/Preview/Dripdoctors/app/src/main/include/Uno.Diagnostics.FreeEvent.h | 833a96a93272c5de341c9fa1b93c5bf1216a00fa | [] | no_license | JimmyRodriguez/apps-fuse | 169779ff2827a6e35be91d9ff17e0c444ba7f8cd | 14114328c3cea08c1fd766bf085bbf5a67f698ae | refs/heads/master | 2020-12-03T09:25:26.566750 | 2016-09-24T14:24:49 | 2016-09-24T14:24:49 | 65,154,944 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 617 | h | // This file was generated based on C:\ProgramData\Uno\Packages\UnoCore\0.32.2\Source\Uno\Diagnostics\$.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Diagnostics.ProfileEvent.h>
namespace g{namespace Uno{namespace Diagnostics{struct FreeEvent;}}}
namespace g{
namespace Uno{
namespace Diagnostics{
// public sealed class FreeEvent :226
// {
::g::Uno::Diagnostics::ProfileEvent_type* FreeEvent_typeof();
void FreeEvent__get_Type_fn(FreeEvent* __this, int* __retval);
struct FreeEvent : ::g::Uno::Diagnostics::ProfileEvent
{
};
// }
}}} // ::g::Uno::Diagnostics
| [
"[email protected]"
] | |
04fd92d270b58ad8de84092dea2f771a5bf032f9 | 834ede1ca23230af8c3dec93585fd9ba8b05780a | /src/enemyAnimate.h | a8723f42beba3216da380b6ab30b8f1bf11baf07 | [] | no_license | mintos5/quickBall | 6010d47785046c0f2f4306baada6a5bfa8cde47f | ca238a10e1dad68e93359627775cddda3d9d0b31 | refs/heads/master | 2021-04-30T22:18:39.313681 | 2016-12-14T18:25:28 | 2016-12-14T18:25:28 | 74,216,940 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 842 | h | //
// Created by michal on 7.12.2016.
//
#ifndef PPGSO_ENEMYA_H
#define PPGSO_ENEMYA_H
#include <mesh.h>
#include <shader.h>
#include <texture.h>
#include <meshAnimate.h>
#include "object.h"
#include "scene.h"
class enemyAnimate : public Object {
public:
enemyAnimate();
enemyAnimate(bool combiAnimation);
~enemyAnimate();
bool Update(Scene &scene, float dt) override;
void Render(Scene &scene) override;
void setWorldPosition(const glm::vec3 &worldPosition);
private:
float lifeTime = 0.0f;
glm::vec3 worldPosition;
bool combiAnimation = false;
int animationCount = 0;
// Static resources (Shared between instances)
static MeshAnimatePtr mesh;
static ShaderPtr shader;
static TexturePtr texture;
};
typedef std::shared_ptr<enemyAnimate> EnemyAnimPtr;
#endif //PPGSO_ENEMYA_H
| [
"[email protected]"
] | |
52195bf98020d931fe10cd49dc9b116a1583aef8 | a06a9ae73af6690fabb1f7ec99298018dd549bb7 | /_Library/_Include/boost/icl/detail/interval_morphism.hpp | 4b2f88573cc3270f8045cd1a5e66b6fd92b35491 | [] | no_license | longstl/mus12 | f76de65cca55e675392eac162dcc961531980f9f | 9e1be111f505ac23695f7675fb9cefbd6fa876e9 | refs/heads/master | 2021-05-18T08:20:40.821655 | 2020-03-29T17:38:13 | 2020-03-29T17:38:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,522 | hpp | ////////////////////////////////////////////////////////////////////////////////
// interval_morphism.hpp
/*-----------------------------------------------------------------------------+
Copyright (c) 2008-2009: Joachim Faulhaber
+------------------------------------------------------------------------------+
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)
+-----------------------------------------------------------------------------*/
#ifndef BOOST_ICL_DETAIL_INTERVAL_MORPHISM_HPP_JOFA_080315
#define BOOST_ICL_DETAIL_INTERVAL_MORPHISM_HPP_JOFA_080315
#include <boost/icl/detail/notate.hpp>
#include <boost/icl/concept/interval_set_value.hpp>
#include <boost/icl/concept/element_set_value.hpp>
#include <boost/icl/concept/set_value.hpp>
#include <boost/icl/concept/map_value.hpp>
#include <boost/icl/associative_interval_container.hpp>
#include <boost/icl/associative_element_container.hpp>
namespace boost{namespace icl
{
namespace segmental
{
template <typename ElementContainerT, typename IntervalContainerT>
void atomize(ElementContainerT& result, const IntervalContainerT& src)
{
ICL_const_FORALL(typename IntervalContainerT, itv_, src)
{
const typename IntervalContainerT::key_type& itv = icl::key_value<IntervalContainerT>(itv_);
typename IntervalContainerT::codomain_type coval = icl::co_value<IntervalContainerT>(itv_);
for(typename IntervalContainerT::domain_type element = first(itv); element <= last(itv); ++element)
icl::insert(result, icl::make_value<ElementContainerT>(element, coval));
}
}
template <typename IntervalContainerT, typename ElementContainerT>
void cluster(IntervalContainerT& result, const ElementContainerT& src)
{
typedef typename IntervalContainerT::key_type key_type;
ICL_const_FORALL(typename ElementContainerT, element_, src)
{
const typename ElementContainerT::key_type& key
= key_value<ElementContainerT>(element_);
const typename codomain_type_of<ElementContainerT>::type& coval
= co_value<ElementContainerT>(element_);
result += icl::make_value<IntervalContainerT>(key_type(key), coval);
}
}
template <typename AtomizedType, typename ClusteredType>
struct atomizer
{
void operator()(AtomizedType& atomized, const ClusteredType& clustered)
{
segmental::atomize(atomized, clustered);
}
};
template <typename ClusteredType, typename AtomizedType>
struct clusterer
{
void operator()(ClusteredType& clustered, const AtomizedType& atomized)
{
segmental::cluster(clustered, atomized);
}
};
template <typename JointType, typename SplitType>
struct joiner
{
void operator()(JointType& joint, SplitType& split)
{
icl::join(split);
ICL_FORALL(typename SplitType, split_, split)
joint.insert(*split_);
}
};
template <typename AbsorberType, typename EnricherType>
struct identity_absorber
{
void operator()(AbsorberType& absorber, EnricherType& enricher)
{
icl::absorb_identities(enricher);
ICL_FORALL(typename EnricherType, enricher_, enricher)
absorber.insert(*enricher_);
}
};
} // namespace Interval
template<>
inline std::string binary_template_to_string<segmental::atomizer>::apply() { return "@"; }
template<>
inline std::string binary_template_to_string<segmental::clusterer>::apply() { return "&"; }
template<>
inline std::string binary_template_to_string<segmental::joiner>::apply() { return "j"; }
template<>
inline std::string binary_template_to_string<segmental::identity_absorber>::apply() { return "a0"; }
}} // namespace boost icl
#endif // BOOST_ICL_DETAIL_INTERVAL_MORPHISM_HPP_JOFA_080315
/////////////////////////////////////////////////
// vnDev.Games - Trong.LIVE - DAO VAN TRONG //
////////////////////////////////////////////////////////////////////////////////
| [
"[email protected]"
] | |
13a1ee558431b6c85782bf55f8f0780b7bc90f7a | e8a562e13ca47764ba96cb47b9e0c477447a6296 | /graph/cycle_detection/verifier.cpp | 3a00c766881ef44ac8e376f9e854aca56da34c9a | [
"Apache-2.0"
] | permissive | yosupo06/library-checker-problems | 0600700ee39a7b32fdec635076d75ee270c0e636 | 9d8930c908153adc3bd3f50999d782c89f666725 | refs/heads/master | 2023-08-22T19:59:02.303444 | 2023-08-10T07:58:08 | 2023-08-10T07:58:08 | 189,480,738 | 440 | 129 | Apache-2.0 | 2023-09-12T08:39:13 | 2019-05-30T20:49:42 | C++ | UTF-8 | C++ | false | false | 406 | cpp | #include "testlib.h"
#include "params.h"
#include <set>
#include <utility>
int main() {
registerValidation();
int N = inf.readInt(N_MIN, N_MAX);
inf.readSpace();
int M = inf.readInt(M_MIN, M_MAX);
inf.readChar('\n');
for(int i=0; i<M; i++) {
int u = inf.readInt(0, N-1);
inf.readSpace();
int v = inf.readInt(0, N-1);
inf.readChar('\n');
ensure(u != v);
}
inf.readEof();
return 0;
}
| [
"[email protected]"
] | |
e922ed63db494a05bbcc9cd33d8809aeef317b82 | b7f3edb5b7c62174bed808079c3b21fb9ea51d52 | /third_party/blink/common/privacy_budget/scoped_identifiability_test_sample_collector.cc | 2dc799a72fb7301308ba9a632bc0dc29f6f3183c | [
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"BSD-3-Clause"
] | permissive | otcshare/chromium-src | 26a7372773b53b236784c51677c566dc0ad839e4 | 64bee65c921db7e78e25d08f1e98da2668b57be5 | refs/heads/webml | 2023-03-21T03:20:15.377034 | 2020-11-16T01:40:14 | 2020-11-16T01:40:14 | 209,262,645 | 18 | 21 | BSD-3-Clause | 2023-03-23T06:20:07 | 2019-09-18T08:52:07 | null | UTF-8 | C++ | false | false | 1,884 | cc | // Copyright 2020 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 "third_party/blink/public/common/privacy_budget/scoped_identifiability_test_sample_collector.h"
#include <memory>
#include "base/notreached.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "third_party/blink/common/privacy_budget/aggregating_sample_collector.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_sample_collector.h"
#include "third_party/blink/public/common/privacy_budget/scoped_switch_sample_collector.h"
namespace blink {
namespace test {
ScopedIdentifiabilityTestSampleCollector::
ScopedIdentifiabilityTestSampleCollector()
: scoped_default_(this) {}
ScopedIdentifiabilityTestSampleCollector::
~ScopedIdentifiabilityTestSampleCollector() = default;
void ScopedIdentifiabilityTestSampleCollector::Record(
ukm::UkmRecorder* recorder,
ukm::SourceId source,
std::vector<IdentifiableSample> metrics) {
entries_.emplace_back(source, std::move(metrics));
AggregatingSampleCollector::UkmMetricsContainerType metrics_map;
for (auto metric : metrics) {
metrics_map.emplace(metric.surface.ToUkmMetricHash(),
metric.value.ToUkmMetricValue());
}
recorder->AddEntry(ukm::mojom::UkmEntry::New(
source, ukm::builders::Identifiability::kEntryNameHash,
std::move(metrics_map)));
}
void ScopedIdentifiabilityTestSampleCollector::Flush(
ukm::UkmRecorder* recorder) {}
void ScopedIdentifiabilityTestSampleCollector::FlushSource(
ukm::UkmRecorder* recorder,
ukm::SourceId source) {}
void ScopedIdentifiabilityTestSampleCollector::ClearEntries() {
entries_.clear();
}
} // namespace test
} // namespace blink
| [
"[email protected]"
] | |
8496d4482ee899b39a7a623df9cd67cf5e8508d9 | 2cf838b54b556987cfc49f42935f8aa7563ea1f4 | /aws-cpp-sdk-kinesisanalyticsv2/include/aws/kinesisanalyticsv2/model/UpdateApplicationMaintenanceConfigurationRequest.h | 43288697293dcbfd69c8a602d1368693403e4bed | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | QPC-database/aws-sdk-cpp | d11e9f0ff6958c64e793c87a49f1e034813dac32 | 9f83105f7e07fe04380232981ab073c247d6fc85 | refs/heads/main | 2023-06-14T17:41:04.817304 | 2021-07-09T20:28:20 | 2021-07-09T20:28:20 | 384,714,703 | 1 | 0 | Apache-2.0 | 2021-07-10T14:16:41 | 2021-07-10T14:16:41 | null | UTF-8 | C++ | false | false | 5,443 | h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/kinesisanalyticsv2/KinesisAnalyticsV2_EXPORTS.h>
#include <aws/kinesisanalyticsv2/KinesisAnalyticsV2Request.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/kinesisanalyticsv2/model/ApplicationMaintenanceConfigurationUpdate.h>
#include <utility>
namespace Aws
{
namespace KinesisAnalyticsV2
{
namespace Model
{
/**
*/
class AWS_KINESISANALYTICSV2_API UpdateApplicationMaintenanceConfigurationRequest : public KinesisAnalyticsV2Request
{
public:
UpdateApplicationMaintenanceConfigurationRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "UpdateApplicationMaintenanceConfiguration"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline const Aws::String& GetApplicationName() const{ return m_applicationName; }
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline bool ApplicationNameHasBeenSet() const { return m_applicationNameHasBeenSet; }
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline void SetApplicationName(const Aws::String& value) { m_applicationNameHasBeenSet = true; m_applicationName = value; }
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline void SetApplicationName(Aws::String&& value) { m_applicationNameHasBeenSet = true; m_applicationName = std::move(value); }
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline void SetApplicationName(const char* value) { m_applicationNameHasBeenSet = true; m_applicationName.assign(value); }
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline UpdateApplicationMaintenanceConfigurationRequest& WithApplicationName(const Aws::String& value) { SetApplicationName(value); return *this;}
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline UpdateApplicationMaintenanceConfigurationRequest& WithApplicationName(Aws::String&& value) { SetApplicationName(std::move(value)); return *this;}
/**
* <p>The name of the application for which you want to update the maintenance
* configuration.</p>
*/
inline UpdateApplicationMaintenanceConfigurationRequest& WithApplicationName(const char* value) { SetApplicationName(value); return *this;}
/**
* <p>Describes the application maintenance configuration update.</p>
*/
inline const ApplicationMaintenanceConfigurationUpdate& GetApplicationMaintenanceConfigurationUpdate() const{ return m_applicationMaintenanceConfigurationUpdate; }
/**
* <p>Describes the application maintenance configuration update.</p>
*/
inline bool ApplicationMaintenanceConfigurationUpdateHasBeenSet() const { return m_applicationMaintenanceConfigurationUpdateHasBeenSet; }
/**
* <p>Describes the application maintenance configuration update.</p>
*/
inline void SetApplicationMaintenanceConfigurationUpdate(const ApplicationMaintenanceConfigurationUpdate& value) { m_applicationMaintenanceConfigurationUpdateHasBeenSet = true; m_applicationMaintenanceConfigurationUpdate = value; }
/**
* <p>Describes the application maintenance configuration update.</p>
*/
inline void SetApplicationMaintenanceConfigurationUpdate(ApplicationMaintenanceConfigurationUpdate&& value) { m_applicationMaintenanceConfigurationUpdateHasBeenSet = true; m_applicationMaintenanceConfigurationUpdate = std::move(value); }
/**
* <p>Describes the application maintenance configuration update.</p>
*/
inline UpdateApplicationMaintenanceConfigurationRequest& WithApplicationMaintenanceConfigurationUpdate(const ApplicationMaintenanceConfigurationUpdate& value) { SetApplicationMaintenanceConfigurationUpdate(value); return *this;}
/**
* <p>Describes the application maintenance configuration update.</p>
*/
inline UpdateApplicationMaintenanceConfigurationRequest& WithApplicationMaintenanceConfigurationUpdate(ApplicationMaintenanceConfigurationUpdate&& value) { SetApplicationMaintenanceConfigurationUpdate(std::move(value)); return *this;}
private:
Aws::String m_applicationName;
bool m_applicationNameHasBeenSet;
ApplicationMaintenanceConfigurationUpdate m_applicationMaintenanceConfigurationUpdate;
bool m_applicationMaintenanceConfigurationUpdateHasBeenSet;
};
} // namespace Model
} // namespace KinesisAnalyticsV2
} // namespace Aws
| [
"[email protected]"
] | |
95edf215d41a681c2e9fca0d4d2e8e2498ceb03b | c3106e8b2d46dc5c23dd1797b00462f2873dd321 | /Codeforces/Contest1486/A.Shifting_Stacks.cpp | ebad52408d0c8e26cce65c51b25fadf9603d4413 | [] | no_license | cppaymurat/Codeforces_contests | 00dfa66b6b3ce60566c044633ba3a4bd731356fb | 2e900f372af6c67b07f8700a60baa0bdb24d9b2e | refs/heads/main | 2023-05-25T07:41:23.063186 | 2021-06-06T14:26:06 | 2021-06-06T14:26:06 | 374,211,344 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 789 | cpp | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define eb emplace_back
#define ll long long
void solve() {
int n;
cin >> n;
vector<ll> a(n + 1);
ll s = 0;
bool ok = 1;
for(int i = 0; i < n; i += 1) {
cin >> a[i];
}
vector<ll> need(n);
for(int i = 0; i < n; i += 1) {
need[i] = i;
}
for(int i = 0; i < n; i += 1) {
if (a[i] < need[i]) {
ok = 0;
break;
}
a[i + 1] += a[i] - need[i];
}
if (ok) {
cout << "YES\n";
} else {
cout << "NO\n";
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("taskA.in", "r", stdin);
// freopen("taskA.out", "w", stdout);
int t = 1;
cin >> t;
while(t--) {
solve();
}
return 0;
}
| [
"[email protected]"
] | |
067c092838a63fd108bfe61db36b248f03097f7c | 62816626aca6f4ed73ef576c0dfdf1c586ca7a9d | /VSL/source/vsGLInfoLib.cpp | 73ae6c02c473689292958783af9997138ed7790e | [] | no_license | pfac/CG-MV | 7274aaa6d7cb075513f23f00a7323e2c278c7e4a | e5b90f80c3cbea52eb7ef3957303e1526c2bebca | refs/heads/master | 2020-04-05T21:35:51.341005 | 2012-02-22T04:27:22 | 2012-02-22T04:27:22 | 3,112,668 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 57,408 | cpp | /** ----------------------------------------------------------
* \class VSGLInfoLib
*
* Lighthouse3D
*
* VSGLInfoLib - Very Simple GL Information Library
*
*
* \version 0.1.0
* - Initial Release
*
* This class provides information about GL stuff
*
* Full documentation at
* http://www.lighthouse3d.com/very-simple-libs
*
---------------------------------------------------------------*/
#include "vsGLInfoLib.h"
// static local variables
std::map<int, std::string> VSGLInfoLib::spInternalF;
std::map<int, std::string> VSGLInfoLib::spDataF;
std::map<int, std::string> VSGLInfoLib::spTextureDataType;
std::map<int, std::string> VSGLInfoLib::spGLSLType;
std::map<int, int> VSGLInfoLib::spGLSLTypeSize;
std::map<int, std::string> VSGLInfoLib::spTextureFilter;
std::map<int, std::string> VSGLInfoLib::spTextureWrap;
std::map<int, std::string> VSGLInfoLib::spTextureCompFunc;
std::map<int, std::string> VSGLInfoLib::spTextureCompMode;
std::map<int, std::string> VSGLInfoLib::spTextureUnit;
std::map<int, int> VSGLInfoLib::spTextureBound;
std::map<int, std::string> VSGLInfoLib::spHint;
std::map<int, std::string> VSGLInfoLib::spTextureTarget;
std::map<int, std::string> VSGLInfoLib::spBufferAccess;
std::map<int, std::string> VSGLInfoLib::spBufferUsage;
std::map<int, std::string> VSGLInfoLib::spBufferBinding;
std::map<int, int> VSGLInfoLib::spBufferBound;
std::map<int, int> VSGLInfoLib::spBoundBuffer;
std::map<int, std::string> VSGLInfoLib::spShaderType;
std::map<int, std::string> VSGLInfoLib::spTransFeedBufferMode;
std::map<int, std::string> VSGLInfoLib::spGLSLPrimitives;
std::map<int, std::string> VSGLInfoLib::spTessGenSpacing;
std::map<int, std::string> VSGLInfoLib::spVertexOrder;
std::map<int, std::string> VSGLInfoLib::spShaderPrecision;
std::vector<unsigned int> VSGLInfoLib::spResult;
std::ostream *VSGLInfoLib::spOutS = (std::iostream *)&std::cout;
bool VSGLInfoLib::__spInit = VSGLInfoLib::init();
char VSGLInfoLib::spAux[256];
// sets the output stream
void
VSGLInfoLib::setOutputStream(std::ostream *outStream) {
if (!outStream)
// if null use cout
spOutS = (std::iostream *)&std::cout;
else
spOutS = outStream;
}
// check if an extension is supported
bool
VSGLInfoLib::isExtensionSupported(std::string extName) {
int max, i = 0;
char *s;
glGetIntegerv(GL_NUM_EXTENSIONS, &max);
do {
s = (char *)glGetStringi(GL_EXTENSIONS, ++i);
}
while (i < max && strcmp(s,extName.c_str()) != 0);
if (i == max)
return false;
else
return true;
}
// general information
void
VSGLInfoLib::getGeneralInfo() {
int info;
addNewLine();
addMessage("General Information");
addMessage("Vendor: %s", glGetString (GL_VENDOR));
addMessage("Renderer: %s", glGetString (GL_RENDERER));
addMessage("Version: %s", glGetString (GL_VERSION));
addMessage("GLSL: %s", glGetString (GL_SHADING_LANGUAGE_VERSION));
glGetIntegerv (GL_NUM_EXTENSIONS, &info);
addMessage("Num. Extensions: %d", info);
}
/* ------------------------------------------------------
Buffers
-------------------------------------------------------- */
// display info for currently bound buffers
void
VSGLInfoLib::getCurrentBufferInfo() {
int info;
addNewLine();
addMessage("Current Buffer Bindings");
// iterate for all buffer types
std::map<int, int>::iterator iter = spBufferBound.begin();
for ( ; iter != spBufferBound.end(); ++iter) {
// get current binding for a type of buffer
glGetIntegerv(iter->first, &info);
// if a buffer is bound get its info
if (info) {
addMessage("Buffer Info for name: %d", info);
addMessage(" Buffer Type: %s", spBufferBinding[iter->first].c_str());
glGetBufferParameteriv(iter->second, GL_BUFFER_ACCESS, &info);
addMessage(" Access: %s", spBufferAccess[info].c_str());
glGetBufferParameteriv(iter->second, GL_BUFFER_MAPPED, &info);
addMessage(" Mapped: %d", info);
glGetBufferParameteriv(iter->second, GL_BUFFER_SIZE, &info);
addMessage(" Size: %d", info);
glGetBufferParameteriv(iter->second, GL_BUFFER_USAGE, &info);
addMessage(" Usage: %s", spBufferUsage[info].c_str());
}
}
}
// gets all the names currently bound to buffers
std::vector<unsigned int> &
VSGLInfoLib::getBufferNames() {
spResult.clear();
for (unsigned int i = 0; i < 65535; ++i) {
if (glIsBuffer(i)) {
spResult.push_back(i);
}
}
return spResult;
}
// display buffer info
void
VSGLInfoLib::getBufferInfo(GLenum target, int bufferName) {
int info, prevBuffer;
addNewLine();
addMessage("Info for buffer name: %d target: %s", bufferName, spBufferBinding[spBoundBuffer[target]].c_str());
// get previously bound buffer
glGetIntegerv(spBoundBuffer[target], &prevBuffer);
// bind requested buffer to get info
glBindBuffer(target,bufferName);
glGetBufferParameteriv(target, GL_BUFFER_ACCESS, &info);
addMessage(" Access: %s", spBufferAccess[info].c_str());
glGetBufferParameteriv(target, GL_BUFFER_MAPPED, &info);
addMessage(" Mapped: %d", info);
glGetBufferParameteriv(target, GL_BUFFER_SIZE, &info);
addMessage(" Size: %d", info);
glGetBufferParameteriv(target, GL_BUFFER_USAGE, &info);
addMessage(" Usage: %s", spBufferUsage[info].c_str());
// re-bind previous buffer
glBindBuffer(target, prevBuffer);
}
/* ------------------------------------------------------
Textures
-------------------------------------------------------- */
// gets all the names currently bound to textures
std::vector<unsigned int> &
VSGLInfoLib::getTextureNames() {
spResult.clear();
for (unsigned int i = 0; i < 65535; ++i) {
if (glIsTexture(i))
spResult.push_back(i);
}
return spResult;
}
// gets the current texture bindings for all texture units
void
VSGLInfoLib::getCurrentTextureInfo() {
int info, activeUnit, anyBindings;
std::vector<int> textures;
// get current active unit, for later restoration
glGetIntegerv(GL_ACTIVE_TEXTURE, &activeUnit);
addNewLine();
addMessage("Current Texture Bindings");
addMessage("Currently Active Texture Unit: %s", spTextureUnit[activeUnit].c_str());
addMessage("Texture Bindings:");
// for each unit
for (int i = 0; i < 8; ++i) {
glActiveTexture(GL_TEXTURE0 + i);
textures.clear();
anyBindings = 0;
std::map<int, int>::iterator iterTT;
iterTT = spTextureBound.begin();
for ( ; iterTT != spTextureBound.end(); ++iterTT) {
glGetIntegerv((iterTT)->second, &info);
textures.push_back(info);
anyBindings |= info;
}
if (anyBindings) {
addMessage("Unit %d", i);
iterTT = spTextureBound.begin();
for (int j = 0 ; iterTT != spTextureBound.end(); ++j, ++iterTT) {
if (textures[j])
addMessage(" %s: %d", spTextureTarget[(iterTT)->first].c_str(), textures[j]);
}
}
}
// restore previous active texture unit
glActiveTexture(activeUnit);
}
// returns the name of the currently bound texture for a target
int
VSGLInfoLib::getCurrentTexture(GLenum textureTarget) {
int t;
glGetIntegerv(spTextureBound[textureTarget], &t);
return(t);
}
// returns the currently active texture unit
int
VSGLInfoLib::getCurrentTextureActiveUnitInfo() {
int activeUnit;
glGetIntegerv(GL_ACTIVE_TEXTURE, &activeUnit);
return(activeUnit);
}
// sends to the stream all the texture info
void
VSGLInfoLib::getTextureInfo(GLenum textureTarget, GLenum textureID) {
addNewLine();
if (!glIsTexture(textureID)) {
addMessage("name: %d is not a texture", textureID);
return;
}
if (!glIsTexture(textureID)) {
addMessage("ID %d does not represent a valid texture name", textureID);
return;
}
addMessage("Texture Info - target: %s tex ID %d", spTextureTarget[textureTarget].c_str(), textureID);
int prevTex = getCurrentTexture(textureTarget);
glBindTexture(textureTarget, textureID);
int info;
// Dimensions
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_WIDTH, &info);
addMessage("Dimensions");
addMessage(" Width: %d", info);
if (textureTarget != GL_TEXTURE_1D) {
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_HEIGHT, &info);
addMessage(" Height: %d", info);
if (textureTarget != GL_TEXTURE_2D) {
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_DEPTH, &info);
addMessage(" Depth: %d", info);
}
}
// Internal Format
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_INTERNAL_FORMAT, &info);
addMessage("Internal Format: %s", spInternalF[info].c_str());
// Compression info
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_COMPRESSED, &info);
// sizes
if (info) {
glGetIntegerv(GL_TEXTURE_COMPRESSION_HINT, &info);
addMessage("Compression Hint: %s", spHint[info].c_str());
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &info);
addMessage("Compressed Size: %d", info);
}
else {
addMessage("Bits per channel -");
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_RED_SIZE, &info);
if (info)
addMessage(" Red: %d", info);
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_GREEN_SIZE, &info);
if (info)
addMessage(" Green: %d", info);
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_BLUE_SIZE, &info);
if (info)
addMessage(" Blue: %d", info);
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_ALPHA_SIZE, &info);
if (info)
addMessage(" Alpha: %d", info);
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_DEPTH_SIZE, &info);
if (info)
addMessage(" Depth: %d", info);
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_STENCIL_SIZE, &info);
if (info)
addMessage(" Stencil: %d", info);
glGetTexLevelParameteriv(textureTarget, 0,
GL_TEXTURE_RED_TYPE, &info);
addMessage("Data Type: %s", spTextureDataType[info].c_str());
}
// Get texture sampling state
glGetTexParameteriv(textureTarget, GL_TEXTURE_MIN_FILTER, &info);
addMessage("Min Filter: %s", spTextureFilter[info].c_str());
glGetTexParameteriv(textureTarget, GL_TEXTURE_MAG_FILTER, &info);
addMessage("Mag Filter: %s", spTextureFilter[info].c_str());
// wrapping info
glGetTexParameteriv(textureTarget, GL_TEXTURE_WRAP_S, &info);
addMessage("Wrap S: %s", spTextureWrap[info].c_str());
if (textureTarget != GL_TEXTURE_1D) {
glGetTexParameteriv(textureTarget, GL_TEXTURE_WRAP_T, &info);
addMessage("Wrap T: %s", spTextureWrap[info].c_str());
if (textureTarget != GL_TEXTURE_2D) {
glGetTexParameteriv(textureTarget, GL_TEXTURE_WRAP_R, &info);
addMessage("Wrap R: %s", spTextureWrap[info].c_str());
}
}
// mipmap info
glGetTexParameteriv(textureTarget, GL_TEXTURE_BASE_LEVEL, &info);
addMessage("Base Level: %d", info);
glGetTexParameteriv(textureTarget, GL_TEXTURE_MAX_LEVEL, &info);
addMessage("Max Level: %d", info);
// compare info
glGetTexParameteriv(textureTarget, GL_TEXTURE_COMPARE_MODE, &info);
addMessage("Compare Mode : %s", spTextureCompMode[info].c_str());
if (info != GL_NONE) {
glGetTexParameteriv(textureTarget, GL_TEXTURE_COMPARE_FUNC, &info);
addMessage("Compare Mode : %s", spTextureCompFunc[info].c_str());
}
glBindTexture(textureTarget, prevTex);
}
/* ------------------------------------------------------
GLSL
-------------------------------------------------------- */
// gets all the names currently boundo to programs
std::vector<unsigned int> &
VSGLInfoLib::getProgramNames() {
spResult.clear();
for (unsigned int i = 0; i < 65535; ++i) {
if (glIsProgram(i))
spResult.push_back(i);
}
return spResult;
}
// gets all the names currently bound to Shaders
std::vector<unsigned int> &
VSGLInfoLib::getShaderNames() {
spResult.clear();
for (unsigned int i = 0; i < 65535; ++i) {
if (glIsShader(i))
spResult.push_back(i);
}
return spResult;
}
// gets all the names currently bound to VAOs
std::vector<unsigned int> &
VSGLInfoLib::getVAONames() {
spResult.clear();
for (unsigned int i = 0; i < 65535; ++i) {
if (glIsVertexArray(i))
spResult.push_back(i);
}
return spResult;
}
// display VAO information, including its attributes
void
VSGLInfoLib::getVAOInfo(unsigned int buffer) {
int count, info, prevBuffer;
addNewLine();
// is it a VAO?
if (!glIsVertexArray(buffer)) {
addMessage("name: %d is not a VAO", buffer);
return;
}
addMessage("VAO Info for name: %d", buffer);
// bind requested VAO
// should be able to get previously bounded VAO...
glBindVertexArray(buffer);
// get element array buffer name
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &info);
if (info)
addMessage("Element Array: %d", info);
// get info for each attrib mapped buffer
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &count);
for (int i = 0; i < count; ++i) {
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &info);
if (info) {
addMessage("Attrib index: %d", i);
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &info);
addMessage(" Buffer bound: %d", info);
glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &prevBuffer);
glBindBuffer(GL_ARRAY_BUFFER, info);
glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &info);
glBindBuffer(GL_ARRAY_BUFFER, prevBuffer);
addMessage(" Size: %d", info);
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_SIZE, &info);
addMessage(" Components: %d", info);
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_TYPE, &info);
addMessage(" Data Type: %s", spDataF[info].c_str());
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &info);
addMessage(" Stride: %d", info);
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &info);
addMessage(" Normalized: %d", info);
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_DIVISOR, &info);
addMessage(" Divisor: %d", info);
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_INTEGER, &info);
addMessage(" Integer: %d", info);
}
}
}
// display info for all active uniforms in a program
void
VSGLInfoLib::getUniformsInfo(unsigned int program) {
addNewLine();
// is it a program ?
if (!glIsProgram(program)) {
addMessage("name: %d is not a program", program);
return;
}
int activeUnif, actualLen, index, uniType,
uniSize, uniMatStride, uniArrayStride, uniOffset;
char name[256];
// Get uniforms info (not in named blocks)
addMessage("Uniforms Info for program: %d", program);
glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &activeUnif);
for (unsigned int i = 0; i < (unsigned int)activeUnif; ++i) {
glGetActiveUniformsiv(program, 1, &i, GL_UNIFORM_BLOCK_INDEX, &index);
if (index == -1) {
glGetActiveUniformName(program, i, 256, &actualLen, name);
glGetActiveUniformsiv(program, 1, &i, GL_UNIFORM_TYPE, &uniType);
addMessage("%s", name);
addMessage(" %s", spGLSLType[uniType].c_str());
addMessage(" location: %d", i);
glGetActiveUniformsiv(program, 1, &i, GL_UNIFORM_SIZE, &uniSize);
glGetActiveUniformsiv(program, 1, &i, GL_UNIFORM_ARRAY_STRIDE, &uniArrayStride);
int auxSize;
if (uniArrayStride > 0)
auxSize = uniArrayStride * uniSize;
else
auxSize = spGLSLTypeSize[uniType];
addMessage(" size: %d", auxSize);
if (uniArrayStride > 0)
addMessage(" stride: %d", uniArrayStride);
}
}
// Get named blocks info
int count, dataSize, info;
glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &count);
for (int i = 0; i < count; ++i) {
// Get buffers name
glGetActiveUniformBlockName(program, i, 256, NULL, name);
glGetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_DATA_SIZE, &dataSize);
addMessage("%s\n Size %d", name, dataSize);
glGetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_BINDING, &index);
addMessage(" Block binding point: %d", index);
glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, index, &info);
addMessage(" Buffer bound to binding point: %d {", info);
glGetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &activeUnif);
unsigned int *indices;
indices = (unsigned int *)malloc(sizeof(unsigned int) * activeUnif);
glGetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, (int *)indices);
for (int k = 0; k < activeUnif; ++k) {
glGetActiveUniformName(program, indices[k], 256, &actualLen, name);
glGetActiveUniformsiv(program, 1, &indices[k], GL_UNIFORM_TYPE, &uniType);
addMessage("\t%s\n\t %s", name, spGLSLType[uniType].c_str());
glGetActiveUniformsiv(program, 1, &indices[k], GL_UNIFORM_OFFSET, &uniOffset);
addMessage("\t offset: %d", uniOffset);
glGetActiveUniformsiv(program, 1, &indices[k], GL_UNIFORM_SIZE, &uniSize);
glGetActiveUniformsiv(program, 1, &indices[k], GL_UNIFORM_ARRAY_STRIDE, &uniArrayStride);
glGetActiveUniformsiv(program, 1, &indices[k], GL_UNIFORM_MATRIX_STRIDE, &uniMatStride);
int auxSize;
if (uniArrayStride > 0)
auxSize = uniArrayStride * uniSize;
else if (uniMatStride > 0) {
switch(uniType) {
case GL_FLOAT_MAT2:
case GL_FLOAT_MAT2x3:
case GL_FLOAT_MAT2x4:
case GL_DOUBLE_MAT2:
case GL_DOUBLE_MAT2x3:
case GL_DOUBLE_MAT2x4:
auxSize = 2 * uniMatStride;
break;
case GL_FLOAT_MAT3:
case GL_FLOAT_MAT3x2:
case GL_FLOAT_MAT3x4:
case GL_DOUBLE_MAT3:
case GL_DOUBLE_MAT3x2:
case GL_DOUBLE_MAT3x4:
auxSize = 3 * uniMatStride;
break;
case GL_FLOAT_MAT4:
case GL_FLOAT_MAT4x2:
case GL_FLOAT_MAT4x3:
case GL_DOUBLE_MAT4:
case GL_DOUBLE_MAT4x2:
case GL_DOUBLE_MAT4x3:
auxSize = 4 * uniMatStride;
break;
}
}
else
auxSize = spGLSLTypeSize[uniType];
auxSize = getUniformByteSize(uniSize, uniType, uniArrayStride, uniMatStride);
addMessage("\t size: %d", auxSize);
if (uniArrayStride > 0)
addMessage("\t array stride: %d", uniArrayStride);
if (uniMatStride > 0)
addMessage("\t mat stride: %d", uniMatStride);
}
addMessage(" }");
}
}
// display the values for uniforms in the default block
void
VSGLInfoLib::getUniformInfo(unsigned int program, std::string uniName) {
addNewLine();
// is it a program ?
if (!glIsProgram(program)) {
addMessage("name: %d is not a program", program);
return;
}
GLenum type;
GLsizei l;
GLint s;
char c[50];
int loc = glGetUniformLocation((int)program, uniName.c_str());
glGetActiveUniform(program, loc, 0, &l, &s, &type, c);
if (loc != -1) {
addMessage("Values for uniform %s in program %d", uniName.c_str(), program);
int rows = getRows(type), columns = getColumns(type);
if (getType(type) == FLOAT) {
float f[16];
glGetUniformfv(program, loc, f);
displayUniformf(f,rows,columns);
}
else if (getType(type) == INT) {
int f[16];
glGetUniformiv(program, loc, f);
displayUniformi(f,rows,columns);
}
else if (getType(type) == UNSIGNED_INT) {
unsigned int f[16];
glGetUniformuiv(program, loc, f);
displayUniformui(f,rows,columns);
}
else if (getType(type) == DOUBLE) {
double f[16];
glGetUniformdv(program, loc, f);
displayUniformd(f,rows,columns);
}
}
else
addMessage("%s is not an active uniform in program %u", uniName, program);
}
// display the values for a uniform in a named block
void
VSGLInfoLib::getUniformInBlockInfo(unsigned int program,
std::string blockName,
std::string uniName) {
addNewLine();
// is it a program ?
if (!glIsProgram(program)) {
addMessage("name: %d is not a program", program);
return;
}
int index = glGetUniformBlockIndex(program, blockName.c_str());
if (index == GL_INVALID_INDEX) {
addMessage("%s is not a valid uniform name in block %s", uniName.c_str(), blockName.c_str());
return;
}
int bindIndex,bufferIndex;
glGetActiveUniformBlockiv(program, index, GL_UNIFORM_BLOCK_BINDING, &bindIndex);
addMessage("Block binding point: %d", bindIndex);
glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, bindIndex, &bufferIndex);
addMessage("Buffer bound to binding point: %d ", bufferIndex);
unsigned int uniIndex;
const char *c = uniName.c_str();
glGetUniformIndices(program, 1, &c, &uniIndex);
addMessage("Index of Uniform: %u", uniIndex);
int uniType, uniOffset, uniSize, uniArrayStride, uniMatStride;
glGetActiveUniformsiv(program, 1, &uniIndex, GL_UNIFORM_TYPE, &uniType);
glGetActiveUniformsiv(program, 1, &uniIndex, GL_UNIFORM_OFFSET, &uniOffset);
glGetActiveUniformsiv(program, 1, &uniIndex, GL_UNIFORM_SIZE, &uniSize);
glGetActiveUniformsiv(program, 1, &uniIndex, GL_UNIFORM_ARRAY_STRIDE, &uniArrayStride);
glGetActiveUniformsiv(program, 1, &uniIndex, GL_UNIFORM_MATRIX_STRIDE, &uniMatStride);
int auxSize = getUniformByteSize(uniSize, uniType, uniArrayStride, uniMatStride);
// get previously bound buffer
int prevBuffer;
glGetIntegerv(spBoundBuffer[GL_UNIFORM_BUFFER], &prevBuffer);
glBindBuffer(GL_UNIFORM_BUFFER, bufferIndex);
int rows = getRows(uniType);
int columns = auxSize / (rows * sizeof(float));
if (getType(uniType) == FLOAT) {
float f[16];
glGetBufferSubData(GL_UNIFORM_BUFFER, uniOffset, auxSize, f);
displayUniformf(f,rows,columns);
}
else if (getType(uniType) == INT) {
int f[16];
glGetBufferSubData(GL_UNIFORM_BUFFER, uniOffset, auxSize, f);
displayUniformi(f,rows,columns);
}
else if (getType(uniType) == UNSIGNED_INT) {
unsigned int f[16];
glGetBufferSubData(GL_UNIFORM_BUFFER, uniOffset, auxSize, f);
displayUniformui(f,rows,columns);
}
else if (getType(uniType) == DOUBLE) {
double f[16];
glGetBufferSubData(GL_UNIFORM_BUFFER, uniOffset, auxSize, f);
displayUniformd(f,rows,columns);
}
glBindBuffer(GL_UNIFORM_BUFFER, prevBuffer);
}
// display information for a program's attributes
void
VSGLInfoLib::getAttributesInfo(unsigned int program) {
int activeAttr, size, loc;
GLsizei length;
GLenum type;
char name[256];
addNewLine();
// check if it is a program
if (!glIsProgram(program)) {
addMessage("name: %d is not a program", program);
return;
}
addMessage("Attribute Info for program %d", program);
// how many attribs?
glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &activeAttr);
// get location and type for each attrib
for (unsigned int i = 0; i < (unsigned int)activeAttr; ++i) {
glGetActiveAttrib(program, i, 256, &length, &size, &type, name);
loc = glGetAttribLocation(program, name);
addMessage("%s loc: %d type: %s", name, loc, spGLSLType[type].c_str());
}
}
// display program's information
void
VSGLInfoLib::getProgramInfo(unsigned int program) {
addNewLine();
// check if name is really a program
if (!glIsProgram(program)) {
addMessage("Name %u is not a program", program);
return;
}
addMessage("Program Information for name %u", program);
unsigned int shaders[5];
int count, info, linked;
bool geom= false, tess = false;
// Get the shader's name
addMessage(" Shaders {");
glGetProgramiv(program, GL_ATTACHED_SHADERS,&count);
glGetAttachedShaders(program, count, NULL, shaders);
for (int i = 0; i < count; ++i) {
glGetShaderiv(shaders[i], GL_SHADER_TYPE, &info);
addMessage("\t%s: %d", spShaderType[info].c_str(), shaders[i]);
if (info == GL_GEOMETRY_SHADER)
geom = true;
if (info == GL_TESS_EVALUATION_SHADER || info == GL_TESS_CONTROL_SHADER)
tess = true;
}
addMessage(" }");
// Get program info
glGetProgramiv(program, GL_PROGRAM_SEPARABLE, &info);
addMessage(" Program Separable: %d", info);
glGetProgramiv(program, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, &info);
addMessage(" Program Binary Retrievable Hint: %d", info);
glGetProgramiv(program, GL_LINK_STATUS, &linked);
addMessage(" Link Status: %d", linked);
glGetProgramiv(program, GL_VALIDATE_STATUS, &info);
addMessage(" Validate_Status: %d", info);
glGetProgramiv(program, GL_DELETE_STATUS, &info);
addMessage(" Delete_Status: %d", info);
glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &info);
addMessage(" Active_Attributes: %d", info);
glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &info);
addMessage(" Active_Uniforms: %d", info);
glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &info);
addMessage(" Active_Uniform_Blocks: %d", info);
#ifdef VSGL_VERSION_4_2
glGetProgramiv(program, GL_ACTIVE_ATOMIC_COUNTER_BUFFERS, &info);
addMessage(" Active_Atomic Counters: %d", info);
#endif
// check if trans feed is active
glGetProgramiv(program, GL_TRANSFORM_FEEDBACK_BUFFER_MODE, &info);
addMessage(" Transform Feedback Buffer Mode: %s", spTransFeedBufferMode[info].c_str());
glGetProgramiv(program, GL_TRANSFORM_FEEDBACK_VARYINGS, &info);
addMessage(" Transform Feedback Varyings: %d", info);
// Geometry shader info, if present
if (geom && linked) {
glGetProgramiv(program, GL_GEOMETRY_VERTICES_OUT, &info);
addMessage(" Geometry Vertices Out: %d", info);
glGetProgramiv(program, GL_GEOMETRY_INPUT_TYPE, &info);
addMessage(" Geometry Input Type: %s", spGLSLPrimitives[info].c_str());
glGetProgramiv(program, GL_GEOMETRY_OUTPUT_TYPE, &info);
addMessage(" Geometry Output Type: %s", spGLSLPrimitives[info].c_str());
glGetProgramiv(program, GL_GEOMETRY_SHADER_INVOCATIONS, &info);
addMessage(" Geometry Shader Invocations: %d", info);
}
// tessellation shaders info, if present
if (tess && linked) {
glGetProgramiv(program, GL_TESS_CONTROL_OUTPUT_VERTICES, &info);
addMessage(" Tess Control Output Vertices: %d", info);
glGetProgramiv(program, GL_TESS_GEN_MODE, &info);
addMessage(" Tess Gen Mode: %s", spGLSLPrimitives[info].c_str());
glGetProgramiv(program, GL_TESS_GEN_SPACING, &info);
addMessage(" Tess Spacing: %s", spTessGenSpacing[info].c_str());
glGetProgramiv(program, GL_TESS_GEN_VERTEX_ORDER, &info);
addMessage(" Tess Vertex Order: %s", spVertexOrder[info].c_str());
glGetProgramiv(program, GL_TESS_GEN_POINT_MODE, &info);
addMessage(" Tess Gen Point Mode: %d", info);
}
addMessage("");
}
/* ----------------------------------------------
private auxiliary functions
----------------------------------------------- */
// add a newline to the stream
void
VSGLInfoLib::addNewLine() {
*spOutS << "\n";
}
// Printf style! plus a newline at the end
void
VSGLInfoLib::addMessage(std::string format, ...) {
va_list args;
va_start(args,format);
vsprintf(spAux, format.c_str(), args);
va_end(args);
*spOutS << spAux << "\n";
}
// init the library
// fills up the maps with enum to string
// to display human-readable messages
bool
VSGLInfoLib::init() {
spShaderPrecision[GL_LOW_FLOAT] = "GL_LOW_FLOAT";
spShaderPrecision[GL_MEDIUM_FLOAT] = "GL_MEDIUM_FLOAT";
spShaderPrecision[GL_HIGH_FLOAT] = "GL_HIGH_FLOAT";
spShaderPrecision[GL_LOW_INT] = "GL_LOW_INT";
spShaderPrecision[GL_MEDIUM_INT] = "GL_MEDIUM_INT";
spShaderPrecision[GL_HIGH_INT] = "GL_HIGH_INT";
spTessGenSpacing[GL_EQUAL] = "GL_EQUAL";
spTessGenSpacing[GL_FRACTIONAL_EVEN] = "GL_FRACTIONAL_EVEN";
spTessGenSpacing[GL_FRACTIONAL_ODD] = "GL_FRACTIONAL_ODD";
spVertexOrder[GL_CCW] = "GL_CCW";
spVertexOrder[GL_CW] = "GL_CW";
spGLSLPrimitives[GL_QUADS] = "GL_QUADS";
spGLSLPrimitives[GL_ISOLINES] = "GL_ISOLINES";
spGLSLPrimitives[GL_POINTS] = "GL_POINTS";
spGLSLPrimitives[GL_LINES] = "GL_LINES";
spGLSLPrimitives[GL_LINES_ADJACENCY] = "GL_LINES_ADJACENCY";
spGLSLPrimitives[GL_TRIANGLES] = "GL_TRIANGLES";
spGLSLPrimitives[GL_LINE_STRIP] = "GL_LINE_STRIP";
spGLSLPrimitives[GL_TRIANGLE_STRIP] = "GL_TRIANGLE_STRIP";
spGLSLPrimitives[GL_TRIANGLES_ADJACENCY] = "GL_TRIANGLES_ADJACENCY";
spTransFeedBufferMode[GL_SEPARATE_ATTRIBS] = "GL_SEPARATE_ATTRIBS";
spTransFeedBufferMode[GL_INTERLEAVED_ATTRIBS] = "GL_INTERLEAVED_ATTRIBS";
spShaderType[GL_VERTEX_SHADER] = "GL_VERTEX_SHADER";
spShaderType[GL_GEOMETRY_SHADER] = "GL_GEOMETRY_SHADER";
spShaderType[GL_TESS_CONTROL_SHADER] = "GL_TESS_CONTROL_SHADER";
spShaderType[GL_TESS_EVALUATION_SHADER] = "GL_TESS_EVALUATION_SHADER";
spShaderType[GL_FRAGMENT_SHADER] = "GL_FRAGMENT_SHADER";
spHint[GL_FASTEST] = "GL_FASTEST";
spHint[GL_NICEST] = "GL_NICEST";
spHint[GL_DONT_CARE] = "GL_DONT_CARE";
spBufferBinding[GL_ARRAY_BUFFER_BINDING] = "GL_ARRAY_BUFFER";
spBufferBinding[GL_ELEMENT_ARRAY_BUFFER_BINDING] = "GL_ELEMENT_ARRAY_BUFFER";
spBufferBinding[GL_PIXEL_PACK_BUFFER_BINDING] = "GL_PIXEL_PACK_BUFFER";
spBufferBinding[GL_PIXEL_UNPACK_BUFFER_BINDING] = "GL_PIXEL_UNPACK_BUFFER";
spBufferBinding[GL_TRANSFORM_FEEDBACK_BUFFER_BINDING] = "GL_TRANSFORM_FEEDBACK_BUFFER";
spBufferBinding[GL_UNIFORM_BUFFER_BINDING] = "GL_UNIFORM_BUFFER";
#ifdef VSGL_VERSION_4_2
spBufferBinding[GL_TEXTURE_BUFFER_BINDING] = "GL_TEXTURE_BUFFER";
spBufferBinding[GL_COPY_READ_BUFFER_BINDING] = "GL_COPY_READ_BUFFER";
spBufferBinding[GL_COPY_WRITE_BUFFER_BINDING] = "GL_COPY_WRITE_BUFFER";
spBufferBinding[GL_DRAW_INDIRECT_BUFFER_BINDING] = "GL_DRAW_INDIRECT_BUFFER";
spBufferBinding[GL_ATOMIC_COUNTER_BUFFER_BINDING] = "GL_ATOMIC_COUNTER_BUFFER";
#endif
spBufferBound[GL_ARRAY_BUFFER_BINDING] = GL_ARRAY_BUFFER;
spBufferBound[GL_ELEMENT_ARRAY_BUFFER_BINDING] = GL_ELEMENT_ARRAY_BUFFER;
spBufferBound[GL_PIXEL_PACK_BUFFER_BINDING] = GL_PIXEL_PACK_BUFFER;
spBufferBound[GL_PIXEL_UNPACK_BUFFER_BINDING] = GL_PIXEL_UNPACK_BUFFER;
spBufferBound[GL_TRANSFORM_FEEDBACK_BUFFER_BINDING] = GL_TRANSFORM_FEEDBACK_BUFFER;
spBufferBound[GL_UNIFORM_BUFFER_BINDING] = GL_UNIFORM_BUFFER;
#ifdef VSGL_VERSION_4_2
spBufferBound[GL_TEXTURE_BUFFER_BINDING] = GL_TEXTURE_BUFFER;
spBufferBound[GL_COPY_READ_BUFFER_BINDING] = GL_COPY_READ_BUFFER;
spBufferBound[GL_COPY_WRITE_BUFFER_BINDING] = GL_COPY_WRITE_BUFFER;
spBufferBound[GL_DRAW_INDIRECT_BUFFER_BINDING] = GL_DRAW_INDIRECT_BUFFER;
spBufferBound[GL_ATOMIC_COUNTER_BUFFER_BINDING] = GL_ATOMIC_COUNTER_BUFFER;
#endif
spBoundBuffer[GL_ARRAY_BUFFER] = GL_ARRAY_BUFFER_BINDING;
spBoundBuffer[GL_ELEMENT_ARRAY_BUFFER] = GL_ELEMENT_ARRAY_BUFFER_BINDING;
spBoundBuffer[GL_PIXEL_PACK_BUFFER] = GL_PIXEL_PACK_BUFFER_BINDING;
spBoundBuffer[GL_PIXEL_UNPACK_BUFFER] = GL_PIXEL_UNPACK_BUFFER_BINDING;
spBoundBuffer[GL_TRANSFORM_FEEDBACK_BUFFER] = GL_TRANSFORM_FEEDBACK_BUFFER_BINDING;
spBoundBuffer[GL_UNIFORM_BUFFER] = GL_UNIFORM_BUFFER_BINDING;
#ifdef VSGL_VERSION_4_2
spBoundBuffer[GL_TEXTURE_BUFFER] = GL_TEXTURE_BUFFER_BINDING;
spBoundBuffer[GL_COPY_READ_BUFFER] = GL_COPY_READ_BUFFER_BINDING;
spBoundBuffer[GL_COPY_WRITE_BUFFER] = GL_COPY_WRITE_BUFFER_BINDING;
spBoundBuffer[GL_DRAW_INDIRECT_BUFFER] = GL_DRAW_INDIRECT_BUFFER;
spBoundBuffer[GL_ATOMIC_COUNTER_BUFFER] = GL_ATOMIC_COUNTER_BUFFER;
#endif
spBufferUsage[GL_STREAM_DRAW] = "GL_STREAM_DRAW";
spBufferUsage[GL_STREAM_READ] = "GL_STREAM_READ";
spBufferUsage[GL_STREAM_COPY] = "GL_STREAM_COPY";
spBufferUsage[GL_STATIC_DRAW] = "GL_STATIC_DRAW";
spBufferUsage[GL_STATIC_READ] = "GL_STATIC_READ";
spBufferUsage[GL_STATIC_COPY] = "GL_STATIC_COPY";
spBufferUsage[GL_DYNAMIC_DRAW] = "GL_DYNAMIC_DRAW";
spBufferUsage[GL_DYNAMIC_READ] = "GL_DYNAMIC_READ";
spBufferUsage[GL_DYNAMIC_COPY] = "GL_DYNAMIC_COPY";
spBufferAccess[GL_READ_ONLY] = "GL_READ_ONLY";
spBufferAccess[GL_WRITE_ONLY] = "GL_WRITE_ONLY";
spBufferAccess[GL_READ_WRITE] = "GL_READ_WRITE";
spTextureTarget[GL_TEXTURE_1D] = "GL_TEXTURE_1D";
spTextureTarget[GL_TEXTURE_1D_ARRAY] = "GL_TEXTURE_1D_ARRAY";
spTextureTarget[GL_TEXTURE_2D] = "GL_TEXTURE_2D";
spTextureTarget[GL_TEXTURE_2D_ARRAY] = "GL_TEXTURE_2D_ARRAY";
spTextureTarget[GL_TEXTURE_2D_MULTISAMPLE] = "GL_TEXTURE_2D_MULTISAMPLE";
spTextureTarget[GL_TEXTURE_2D_MULTISAMPLE_ARRAY] = "GL_TEXTURE_2D_MULTISAMPLE_ARRAY";
spTextureTarget[GL_TEXTURE_3D] = "GL_TEXTURE_3D";
spTextureTarget[GL_TEXTURE_BUFFER] = "GL_TEXTURE_BUFFER";
spTextureTarget[GL_TEXTURE_CUBE_MAP] = "GL_TEXTURE_CUBE_MAP";
spTextureTarget[GL_TEXTURE_RECTANGLE] = "GL_TEXTURE_RECTANGLE";
spTextureBound[GL_TEXTURE_1D] = GL_TEXTURE_BINDING_1D;
spTextureBound[GL_TEXTURE_1D_ARRAY] = GL_TEXTURE_BINDING_1D_ARRAY;
spTextureBound[GL_TEXTURE_2D] = GL_TEXTURE_BINDING_2D;
spTextureBound[GL_TEXTURE_2D_ARRAY] = GL_TEXTURE_BINDING_2D_ARRAY;
spTextureBound[GL_TEXTURE_2D_MULTISAMPLE] = GL_TEXTURE_BINDING_2D_MULTISAMPLE;
spTextureBound[GL_TEXTURE_2D_MULTISAMPLE_ARRAY] = GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY;
spTextureBound[GL_TEXTURE_3D] = GL_TEXTURE_BINDING_3D;
spTextureBound[GL_TEXTURE_BUFFER] = GL_TEXTURE_BINDING_BUFFER;
spTextureBound[GL_TEXTURE_CUBE_MAP] = GL_TEXTURE_BINDING_CUBE_MAP;
spTextureBound[GL_TEXTURE_RECTANGLE] = GL_TEXTURE_BINDING_RECTANGLE;
spTextureUnit[GL_TEXTURE0] = "GL_TEXTURE0";
spTextureUnit[GL_TEXTURE1] = "GL_TEXTURE1";
spTextureUnit[GL_TEXTURE2] = "GL_TEXTURE2";
spTextureUnit[GL_TEXTURE3] = "GL_TEXTURE3";
spTextureUnit[GL_TEXTURE4] = "GL_TEXTURE4";
spTextureUnit[GL_TEXTURE5] = "GL_TEXTURE5";
spTextureUnit[GL_TEXTURE6] = "GL_TEXTURE6";
spTextureUnit[GL_TEXTURE7] = "GL_TEXTURE7";
spTextureCompMode[GL_NONE] = "GL_NONE";
spTextureCompFunc[GL_COMPARE_REF_TO_TEXTURE] = "GL_COMPARE_REF_TO_TEXTURE";
spTextureCompFunc[GL_LEQUAL] = "GL_LEQUAL";
spTextureCompFunc[GL_GEQUAL] = "GL_GEQUAL";
spTextureCompFunc[GL_LESS] = "GL_LESS";
spTextureCompFunc[GL_GREATER] = "GL_GREATER";
spTextureCompFunc[GL_EQUAL] = "GL_EQUAL";
spTextureCompFunc[GL_NOTEQUAL] = "GL_NOTEQUAL";
spTextureCompFunc[GL_ALWAYS] = "GL_ALWAYS";
spTextureCompFunc[GL_NEVER] = "GL_NEVER";
spTextureWrap[GL_CLAMP_TO_EDGE] = "GL_CLAMP_TO_EDGE";
spTextureWrap[GL_CLAMP_TO_BORDER] = "GL_CLAMP_TO_BORDER";
spTextureWrap[GL_MIRRORED_REPEAT] = "GL_MIRRORED_REPEAT";
spTextureWrap[GL_REPEAT] = "GL_REPEAT";
spTextureFilter[GL_NEAREST] = "GL_NEAREST";
spTextureFilter[GL_LINEAR] = "GL_LINEAR";
spTextureFilter[GL_NEAREST_MIPMAP_NEAREST] = "GL_NEAREST_MIPMAP_NEAREST";
spTextureFilter[GL_LINEAR_MIPMAP_NEAREST] = "GL_LINEAR_MIPMAP_NEAREST";
spTextureFilter[GL_NEAREST_MIPMAP_LINEAR] = "GL_NEAREST_MIPMAP_LINEAR";
spTextureFilter[GL_LINEAR_MIPMAP_LINEAR] = "GL_LINEAR_MIPMAP_LINEAR";
spGLSLTypeSize[GL_FLOAT] = sizeof(float);
spGLSLTypeSize[GL_FLOAT_VEC2] = sizeof(float)*2;
spGLSLTypeSize[GL_FLOAT_VEC3] = sizeof(float)*3;
spGLSLTypeSize[GL_FLOAT_VEC4] = sizeof(float)*4;
spGLSLTypeSize[GL_DOUBLE] = sizeof(double);
spGLSLTypeSize[GL_DOUBLE_VEC2] = sizeof(double)*2;
spGLSLTypeSize[GL_DOUBLE_VEC3] = sizeof(double)*3;
spGLSLTypeSize[GL_DOUBLE_VEC4] = sizeof(double)*4;
spGLSLTypeSize[GL_SAMPLER_1D] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_3D] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_CUBE] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_1D_SHADOW] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D_SHADOW] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_1D_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_1D_ARRAY_SHADOW] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D_ARRAY_SHADOW] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D_MULTISAMPLE] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D_MULTISAMPLE_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_CUBE_SHADOW] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_BUFFER] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D_RECT] = sizeof(int);
spGLSLTypeSize[GL_SAMPLER_2D_RECT_SHADOW] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_1D] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_2D] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_3D] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_CUBE] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_1D_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_2D_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_2D_MULTISAMPLE] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_BUFFER] = sizeof(int);
spGLSLTypeSize[GL_INT_SAMPLER_2D_RECT] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_1D] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_2D] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_3D] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_CUBE] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_1D_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_2D_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_BUFFER] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_SAMPLER_2D_RECT] = sizeof(int);
spGLSLTypeSize[GL_BOOL] = sizeof(int);
spGLSLTypeSize[GL_INT] = sizeof(int);
spGLSLTypeSize[GL_BOOL_VEC2] = sizeof(int)*2;
spGLSLTypeSize[GL_INT_VEC2] = sizeof(int)*2;
spGLSLTypeSize[GL_BOOL_VEC3] = sizeof(int)*3;
spGLSLTypeSize[GL_INT_VEC3] = sizeof(int)*3;
spGLSLTypeSize[GL_BOOL_VEC4] = sizeof(int)*4;
spGLSLTypeSize[GL_INT_VEC4] = sizeof(int)*4;
spGLSLTypeSize[GL_UNSIGNED_INT] = sizeof(int);
spGLSLTypeSize[GL_UNSIGNED_INT_VEC2] = sizeof(int)*2;
spGLSLTypeSize[GL_UNSIGNED_INT_VEC3] = sizeof(int)*2;
spGLSLTypeSize[GL_UNSIGNED_INT_VEC4] = sizeof(int)*2;
spGLSLTypeSize[GL_FLOAT_MAT2] = sizeof(float)*4;
spGLSLTypeSize[GL_FLOAT_MAT3] = sizeof(float)*9;
spGLSLTypeSize[GL_FLOAT_MAT4] = sizeof(float)*16;
spGLSLTypeSize[GL_FLOAT_MAT2x3] = sizeof(float)*6;
spGLSLTypeSize[GL_FLOAT_MAT2x4] = sizeof(float)*8;
spGLSLTypeSize[GL_FLOAT_MAT3x2] = sizeof(float)*6;
spGLSLTypeSize[GL_FLOAT_MAT3x4] = sizeof(float)*12;
spGLSLTypeSize[GL_FLOAT_MAT4x2] = sizeof(float)*8;
spGLSLTypeSize[GL_FLOAT_MAT4x3] = sizeof(float)*12;
spGLSLTypeSize[GL_DOUBLE_MAT2] = sizeof(double)*4;
spGLSLTypeSize[GL_DOUBLE_MAT3] = sizeof(double)*9;
spGLSLTypeSize[GL_DOUBLE_MAT4] = sizeof(double)*16;
spGLSLTypeSize[GL_DOUBLE_MAT2x3] = sizeof(double)*6;
spGLSLTypeSize[GL_DOUBLE_MAT2x4] = sizeof(double)*8;
spGLSLTypeSize[GL_DOUBLE_MAT3x2] = sizeof(double)*6;
spGLSLTypeSize[GL_DOUBLE_MAT3x4] = sizeof(double)*12;
spGLSLTypeSize[GL_DOUBLE_MAT4x2] = sizeof(double)*8;
spGLSLTypeSize[GL_DOUBLE_MAT4x3] = sizeof(double)*12;
spGLSLType[GL_FLOAT] = "GL_FLOAT";
spGLSLType[GL_FLOAT_VEC2] = "GL_FLOAT_VEC2";
spGLSLType[GL_FLOAT_VEC3] = "GL_FLOAT_VEC3";
spGLSLType[GL_FLOAT_VEC4] = "GL_FLOAT_VEC4";
spGLSLType[GL_DOUBLE] = "GL_DOUBLE";
spGLSLType[GL_DOUBLE_VEC2] = "GL_DOUBLE_VEC2";
spGLSLType[GL_DOUBLE_VEC3] = "GL_DOUBLE_VEC3";
spGLSLType[GL_DOUBLE_VEC4] = "GL_DOUBLE_VEC4";
spGLSLType[GL_SAMPLER_1D] = "GL_SAMPLER_1D";
spGLSLType[GL_SAMPLER_2D] = "GL_SAMPLER_2D";
spGLSLType[GL_SAMPLER_3D] = "GL_SAMPLER_3D";
spGLSLType[GL_SAMPLER_CUBE] = "GL_SAMPLER_CUBE";
spGLSLType[GL_SAMPLER_1D_SHADOW] = "GL_SAMPLER_1D_SHADOW";
spGLSLType[GL_SAMPLER_2D_SHADOW] = "GL_SAMPLER_2D_SHADOW";
spGLSLType[GL_SAMPLER_1D_ARRAY] = "GL_SAMPLER_1D_ARRAY";
spGLSLType[GL_SAMPLER_2D_ARRAY] = "GL_SAMPLER_2D_ARRAY";
spGLSLType[GL_SAMPLER_1D_ARRAY_SHADOW] = "GL_SAMPLER_1D_ARRAY_SHADOW";
spGLSLType[GL_SAMPLER_2D_ARRAY_SHADOW] = "GL_SAMPLER_2D_ARRAY_SHADOW";
spGLSLType[GL_SAMPLER_2D_MULTISAMPLE] = "GL_SAMPLER_2D_MULTISAMPLE";
spGLSLType[GL_SAMPLER_2D_MULTISAMPLE_ARRAY] = "GL_SAMPLER_2D_MULTISAMPLE_ARRAY";
spGLSLType[GL_SAMPLER_CUBE_SHADOW] = "GL_SAMPLER_CUBE_SHADOW";
spGLSLType[GL_SAMPLER_BUFFER] = "GL_SAMPLER_BUFFER";
spGLSLType[GL_SAMPLER_2D_RECT] = "GL_SAMPLER_2D_RECT";
spGLSLType[GL_SAMPLER_2D_RECT_SHADOW] = "GL_SAMPLER_2D_RECT_SHADOW";
spGLSLType[GL_INT_SAMPLER_1D] = "GL_INT_SAMPLER_1D";
spGLSLType[GL_INT_SAMPLER_2D] = "GL_INT_SAMPLER_2D";
spGLSLType[GL_INT_SAMPLER_3D] = "GL_INT_SAMPLER_3D";
spGLSLType[GL_INT_SAMPLER_CUBE] = "GL_INT_SAMPLER_CUBE";
spGLSLType[GL_INT_SAMPLER_1D_ARRAY] = "GL_INT_SAMPLER_1D_ARRAY";
spGLSLType[GL_INT_SAMPLER_2D_ARRAY] = "GL_INT_SAMPLER_2D_ARRAY";
spGLSLType[GL_INT_SAMPLER_2D_MULTISAMPLE] = "GL_INT_SAMPLER_2D_MULTISAMPLE";
spGLSLType[GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY] = "GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY";
spGLSLType[GL_INT_SAMPLER_BUFFER] = "GL_INT_SAMPLER_BUFFER";
spGLSLType[GL_INT_SAMPLER_2D_RECT] = "GL_INT_SAMPLER_2D_RECT";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_1D] = "GL_UNSIGNED_INT_SAMPLER_1D";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_2D] = "GL_UNSIGNED_INT_SAMPLER_2D";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_3D] = "GL_UNSIGNED_INT_SAMPLER_3D";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_CUBE] = "GL_UNSIGNED_INT_SAMPLER_CUBE";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_1D_ARRAY] = "GL_UNSIGNED_INT_SAMPLER_1D_ARRAY";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_2D_ARRAY] = "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE] = "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY] = "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_BUFFER] = "GL_UNSIGNED_INT_SAMPLER_BUFFER";
spGLSLType[GL_UNSIGNED_INT_SAMPLER_2D_RECT] = "GL_UNSIGNED_INT_SAMPLER_2D_RECT";
spGLSLType[GL_BOOL] = "GL_BOOL";
spGLSLType[GL_INT] = "GL_INT";
spGLSLType[GL_BOOL_VEC2] = "GL_BOOL_VEC2";
spGLSLType[GL_INT_VEC2] = "GL_INT_VEC2";
spGLSLType[GL_BOOL_VEC3] = "GL_BOOL_VEC3";
spGLSLType[GL_INT_VEC3] = "GL_INT_VEC3";
spGLSLType[GL_BOOL_VEC4] = "GL_BOOL_VEC4";
spGLSLType[GL_INT_VEC4] = "GL_INT_VEC4";
spGLSLType[GL_UNSIGNED_INT] = "GL_UNSIGNED_INT";
spGLSLType[GL_UNSIGNED_INT_VEC2] = "GL_UNSIGNED_INT_VEC2";
spGLSLType[GL_UNSIGNED_INT_VEC3] = "GL_UNSIGNED_INT_VEC3";
spGLSLType[GL_UNSIGNED_INT_VEC4] = "GL_UNSIGNED_INT_VEC4";
spGLSLType[GL_FLOAT_MAT2] = "GL_FLOAT_MAT2";
spGLSLType[GL_FLOAT_MAT3] = "GL_FLOAT_MAT3";
spGLSLType[GL_FLOAT_MAT4] = "GL_FLOAT_MAT4";
spGLSLType[GL_FLOAT_MAT2x3] = "GL_FLOAT_MAT2x3";
spGLSLType[GL_FLOAT_MAT2x4] = "GL_FLOAT_MAT2x4";
spGLSLType[GL_FLOAT_MAT3x2] = "GL_FLOAT_MAT3x2";
spGLSLType[GL_FLOAT_MAT3x4] = "GL_FLOAT_MAT3x4";
spGLSLType[GL_FLOAT_MAT4x2] = "GL_FLOAT_MAT4x2";
spGLSLType[GL_FLOAT_MAT4x3] = "GL_FLOAT_MAT4x3";
spGLSLType[GL_DOUBLE_MAT2] = "GL_DOUBLE_MAT2";
spGLSLType[GL_DOUBLE_MAT3] = "GL_DOUBLE_MAT3";
spGLSLType[GL_DOUBLE_MAT4] = "GL_DOUBLE_MAT4";
spGLSLType[GL_DOUBLE_MAT2x3] = "GL_DOUBLE_MAT2x3";
spGLSLType[GL_DOUBLE_MAT2x4] = "GL_DOUBLE_MAT2x4";
spGLSLType[GL_DOUBLE_MAT3x2] = "GL_DOUBLE_MAT3x2";
spGLSLType[GL_DOUBLE_MAT3x4] = "GL_DOUBLE_MAT3x4";
spGLSLType[GL_DOUBLE_MAT4x2] = "GL_DOUBLE_MAT4x2";
spGLSLType[GL_DOUBLE_MAT4x3] = "GL_DOUBLE_MAT4x3";
spTextureDataType[GL_NONE] = "GL_NONE";
spTextureDataType[GL_SIGNED_NORMALIZED] = "GL_SIGNED_NORMALIZED";
spTextureDataType[GL_UNSIGNED_NORMALIZED] = "GL_UNSIGNED_NORMALIZED";
spTextureDataType[GL_FLOAT] = "GL_FLOAT";
spTextureDataType[GL_INT] = "GL_INT";
spTextureDataType[GL_UNSIGNED_INT] = "GL_UNSIGNED_INT";
spDataF[GL_UNSIGNED_BYTE] = "GL_UNSIGNED_BYTE";
spDataF[GL_BYTE] = "GL_BYTE";
spDataF[GL_UNSIGNED_SHORT] = "GL_UNSIGNED_SHORT";
spDataF[GL_SHORT] = "GL_SHORT";
spDataF[GL_UNSIGNED_INT] = "GL_UNSIGNED_INT";
spDataF[GL_INT] = "GL_INT";
spDataF[GL_HALF_FLOAT] = "GL_HALF_FLOAT";
spDataF[GL_FLOAT] = "GL_FLOAT";
spDataF[GL_UNSIGNED_BYTE_3_3_2] = "GL_UNSIGNED_BYTE_3_3_2";
spDataF[GL_UNSIGNED_BYTE_2_3_3_REV] = "GL_UNSIGNED_BYTE_2_3_3_REV";
spDataF[GL_UNSIGNED_SHORT_5_6_5] = "GL_UNSIGNED_SHORT_5_6_5";
spDataF[GL_UNSIGNED_SHORT_5_6_5_REV] = "GL_UNSIGNED_SHORT_5_6_5_REV";
spDataF[GL_UNSIGNED_SHORT_4_4_4_4] = "GL_UNSIGNED_SHORT_4_4_4_4";
spDataF[GL_UNSIGNED_SHORT_4_4_4_4_REV] = "GL_UNSIGNED_SHORT_4_4_4_4_REV";
spDataF[GL_UNSIGNED_SHORT_5_5_5_1] = "GL_UNSIGNED_SHORT_5_5_5_1";
spDataF[GL_UNSIGNED_SHORT_1_5_5_5_REV] = "GL_UNSIGNED_SHORT_1_5_5_5_REV";
spDataF[GL_UNSIGNED_INT_8_8_8_8] = "GL_UNSIGNED_INT_8_8_8_8";
spDataF[GL_UNSIGNED_INT_8_8_8_8_REV] = "GL_UNSIGNED_INT_8_8_8_8_REV";
spDataF[GL_UNSIGNED_INT_10_10_10_2] = "GL_UNSIGNED_INT_10_10_10_2";
spDataF[GL_UNSIGNED_INT_2_10_10_10_REV] = "GL_UNSIGNED_INT_2_10_10_10_REV";
spInternalF[GL_STENCIL_INDEX] = "GL_STENCIL_INDEX";
spInternalF[GL_DEPTH_COMPONENT] = "GL_DEPTH_COMPONENT";
spInternalF[GL_DEPTH_STENCIL] = "GL_DEPTH_STENCIL";
spInternalF[GL_DEPTH_COMPONENT16] = "GL_DEPTH_COMPONENT16";
spInternalF[GL_DEPTH_COMPONENT24] = "GL_DEPTH_COMPONENT24";
spInternalF[GL_DEPTH_COMPONENT32] = "GL_DEPTH_COMPONENT32";
spInternalF[GL_DEPTH_COMPONENT32F] = "GL_DEPTH_COMPONENT32F";
spInternalF[GL_DEPTH24_STENCIL8] = "GL_DEPTH24_STENCIL8";
spInternalF[GL_DEPTH32F_STENCIL8] = "GL_DEPTH32F_STENCIL8";
spInternalF[GL_RED_INTEGER] = "GL_RED_INTEGER";
spInternalF[GL_GREEN_INTEGER] = "GL_GREEN_INTEGER";
spInternalF[GL_BLUE_INTEGER] = "GL_BLUE_INTEGER";
spInternalF[GL_RG_INTEGER] = "GL_RG_INTEGER";
spInternalF[GL_RGB_INTEGER] = "GL_RGB_INTEGER";
spInternalF[GL_RGBA_INTEGER] = "GL_RGBA_INTEGER";
spInternalF[GL_BGR_INTEGER] = "GL_BGR_INTEGER";
spInternalF[GL_BGRA_INTEGER] = "GL_BGRA_INTEGER";
spInternalF[GL_RED] = "GL_RED";
spInternalF[GL_RG] = "GL_RG";
spInternalF[GL_RGB] = "GL_RGB";
spInternalF[GL_RGBA] = "GL_RGBA";
spInternalF[GL_R3_G3_B2] = "GL_R3_G3_B2";
spInternalF[GL_RGB2_EXT] = "GL_RGB2_EXT";
spInternalF[GL_COMPRESSED_RED] = "GL_COMPRESSED_RED";
spInternalF[GL_COMPRESSED_RG] = "GL_COMPRESSED_RG";
spInternalF[GL_COMPRESSED_RGB] = "GL_COMPRESSED_RGB";
spInternalF[GL_COMPRESSED_RGBA] = "GL_COMPRESSED_RGBA";
spInternalF[GL_COMPRESSED_SRGB] = "GL_COMPRESSED_SRGB";
spInternalF[GL_COMPRESSED_SRGB_ALPHA] = "GL_COMPRESSED_SRGB_ALPHA";
spInternalF[GL_COMPRESSED_RED_RGTC1] = "GL_COMPRESSED_RED_RGTC1";
spInternalF[GL_COMPRESSED_SIGNED_RED_RGTC1] = "GL_COMPRESSED_SIGNED_RED_RGTC1";
spInternalF[GL_COMPRESSED_RG_RGTC2] = "GL_COMPRESSED_RG_RGTC2"; spInternalF[GL_RG] = "GL_RG";
spInternalF[GL_COMPRESSED_SIGNED_RG_RGTC2] = "GL_COMPRESSED_SIGNED_RG_RGTC2";
#ifdef VSGL_VERSION_4_2
spInternalF[GL_COMPRESSED_RGBA_BPTC_UNORM] = "GL_COMPRESSED_RGBA_BPTC_UNORM";
spInternalF[GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM] = "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM";
spInternalF[GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT] = "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT";
spInternalF[GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT] = "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT";
#endif
spInternalF[GL_R8] = "GL_R8";
spInternalF[GL_R16] = "GL_R16";
spInternalF[GL_RG8] = "GL_RG8";
spInternalF[GL_RG16] = "GL_RG16";
spInternalF[GL_R16F] = "GL_R16F";
spInternalF[GL_R32F] = "GL_R32F";
spInternalF[GL_RG16F] = "GL_RG16F";
spInternalF[GL_RG32F] = "GL_RG32F";
spInternalF[GL_R8I] = "GL_R8I";
spInternalF[GL_R8UI] = "GL_R8UI";
spInternalF[GL_R16I] = "GL_R16I";
spInternalF[GL_R16UI] = "GL_R16UI";
spInternalF[GL_R32I] = "GL_R32I";
spInternalF[GL_R32UI] = "GL_R32UI";
spInternalF[GL_RG8I] = "GL_RG8I";
spInternalF[GL_RG8UI] = "GL_RG8UI";
spInternalF[GL_RG16I] = "GL_RG16I";
spInternalF[GL_RG16UI] = "GL_RG16UI";
spInternalF[GL_RG32I] = "GL_RG32I";
spInternalF[GL_RG32UI] = "GL_RG32UI";
spInternalF[GL_RGB_S3TC] = "GL_RGB_S3TC";
spInternalF[GL_RGB4_S3TC] = "GL_RGB4_S3TC";
spInternalF[GL_RGBA_S3TC] = "GL_RGBA_S3TC";
spInternalF[GL_RGBA4_S3TC] = "GL_RGBA4_S3TC";
spInternalF[GL_RGBA_DXT5_S3TC] = "GL_RGBA_DXT5_S3TC";
spInternalF[GL_RGBA4_DXT5_S3TC] = "GL_RGBA4_DXT5_S3TC";
spInternalF[GL_COMPRESSED_RGB_S3TC_DXT1_EXT] = "GL_COMPRESSED_RGB_S3TC_DXT1_EXT";
spInternalF[GL_COMPRESSED_RGBA_S3TC_DXT1_EXT] = "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT";
spInternalF[GL_COMPRESSED_RGBA_S3TC_DXT3_EXT] = "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT";
spInternalF[GL_COMPRESSED_RGBA_S3TC_DXT5_EXT] = "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT";
spInternalF[GL_R1UI_V3F_SUN] = "GL_R1UI_V3F_SUN";
spInternalF[GL_R1UI_C4UB_V3F_SUN] = "GL_R1UI_C4UB_V3F_SUN";
spInternalF[GL_R1UI_C3F_V3F_SUN] = "GL_R1UI_C3F_V3F_SUN";
spInternalF[GL_R1UI_N3F_V3F_SUN] = "GL_R1UI_N3F_V3F_SUN";
spInternalF[GL_R1UI_C4F_N3F_V3F_SUN] = "GL_R1UI_C4F_N3F_V3F_SUN";
spInternalF[GL_R1UI_T2F_V3F_SUN] = "GL_R1UI_T2F_V3F_SUN";
spInternalF[GL_R1UI_T2F_N3F_V3F_SUN] = "GL_R1UI_T2F_N3F_V3F_SUN";
spInternalF[GL_R1UI_T2F_C4F_N3F_V3F_SUN] = "GL_R1UI_T2F_C4F_N3F_V3F_SUN";
spInternalF[GL_RGB_SIGNED_SGIX] = "GL_RGB_SIGNED_SGIX";
spInternalF[GL_RGBA_SIGNED_SGIX] = "GL_RGBA_SIGNED_SGIX";
spInternalF[GL_RGB16_SIGNED_SGIX] = "GL_RGB16_SIGNED_SGIX";
spInternalF[GL_RGBA16_SIGNED_SGIX] = "GL_RGBA16_SIGNED_SGIX";
spInternalF[GL_RGB_EXTENDED_RANGE_SGIX] = "GL_RGB_EXTENDED_RANGE_SGIX";
spInternalF[GL_RGBA_EXTENDED_RANGE_SGIX] = "GL_RGBA_EXTENDED_RANGE_SGIX";
spInternalF[GL_RGB16_EXTENDED_RANGE_SGIX] = "GL_RGB16_EXTENDED_RANGE_SGIX";
spInternalF[GL_RGBA16_EXTENDED_RANGE_SGIX] = "GL_RGBA16_EXTENDED_RANGE_SGIX";
spInternalF[GL_COMPRESSED_RGB_FXT1_3DFX] = "GL_COMPRESSED_RGB_FXT1_3DFX";
spInternalF[GL_COMPRESSED_RGBA_FXT1_3DFX] = "GL_COMPRESSED_RGBA_FXT1_3DFX";
spInternalF[GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV] = "GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV";
spInternalF[GL_RGBA_FLOAT_MODE_ARB] = "GL_RGBA_FLOAT_MODE_ARB";
spInternalF[GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI] = "GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI";
spInternalF[GL_RGB_422_APPLE] = "GL_RGB_422_APPLE";
spInternalF[GL_RGBA_SIGNED_COMPONENTS_EXT] = "GL_RGBA_SIGNED_COMPONENTS_EXT";
spInternalF[GL_COMPRESSED_SRGB_S3TC_DXT1_EXT] = "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT";
spInternalF[GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT] = "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT";
spInternalF[GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT] = "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT";
spInternalF[GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT] = "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT";
spInternalF[GL_COMPRESSED_LUMINANCE_LATC1_EXT] = "GL_COMPRESSED_LUMINANCE_LATC1_EXT";
spInternalF[GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT] = "GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT";
spInternalF[GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT] = "GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT";
spInternalF[GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT] = "GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT";
spInternalF[GL_RGBA_INTEGER_MODE_EXT] = "GL_RGBA_INTEGER_MODE_EXT";
spInternalF[GL_COMPRESSED_RGBA_BPTC_UNORM_ARB] = "GL_COMPRESSED_RGBA_BPTC_UNORM_ARB";
spInternalF[GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB] = "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB";
spInternalF[GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB] = "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB";
spInternalF[GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB] = "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB";
spInternalF[GL_RG_SNORM] = "GL_RG_SNORM";
spInternalF[GL_RGB_SNORM] = "GL_RGB_SNORM";
spInternalF[GL_RGBA_SNORM] = "GL_RGBA_SNORM";
spInternalF[GL_R8_SNORM] = "GL_R8_SNORM";
spInternalF[GL_RG8_SNORM] = "GL_RG8_SNORM";
spInternalF[GL_RGB8_SNORM] = "GL_RGB8_SNORM";
spInternalF[GL_RGBA8_SNORM] = "GL_RGBA8_SNORM";
spInternalF[GL_R16_SNORM] = "GL_R16_SNORM";
spInternalF[GL_RG16_SNORM] = "GL_RG16_SNORM";
spInternalF[GL_RGB16_SNORM] = "GL_RGB16_SNORM";
spInternalF[GL_RGBA16_SNORM] = "GL_RGBA16_SNORM";
spInternalF[GL_RGB10_A2UI] = "GL_RGB10_A2UI";
return true;
}
// aux function to display float based uniforms
void
VSGLInfoLib::displayUniformf(float *f, int rows, int columns) {
for (int i = 0; i < rows; ++i) {
if (columns == 1)
addMessage("%f", f[i*columns]);
else if (columns == 2)
addMessage("%f %f", f[i*columns], f[i*columns+1]);
else if (columns == 3)
addMessage("%f %f %f", f[i*columns], f[i*columns+1], f[i*columns+2]);
else if (columns == 4)
addMessage("%f %f %f %f", f[i*columns], f[i*columns+1], f[i*columns+2], f[i*columns+3]);
}
}
// aux function to display int based uniforms
void
VSGLInfoLib::displayUniformi(int *f, int rows, int columns) {
for (int i = 0; i < rows; ++i) {
if (columns == 1)
addMessage("%d", f[i*columns]);
else if (columns == 2)
addMessage("%d %d", f[i*columns], f[i*columns+1]);
else if (columns == 3)
addMessage("%d %d %d", f[i*columns], f[i*columns+1], f[i*columns+2]);
else if (columns == 4)
addMessage("%d %d %d %d", f[i*columns], f[i*columns+1], f[i*columns+2], f[i*columns+3]);
}
}
// aux function to display unsigned int based uniforms
void
VSGLInfoLib::displayUniformui(unsigned int *f, int rows, int columns) {
for (int i = 0; i < rows; ++i) {
if (columns == 1)
addMessage("%u", f[i*columns]);
else if (columns == 2)
addMessage("%u %u", f[i*columns], f[i*columns+1]);
else if (columns == 3)
addMessage("%u %u %u", f[i*columns], f[i*columns+1], f[i*columns+2]);
else if (columns == 4)
addMessage("%u %u %u %u", f[i*columns], f[i*columns+1], f[i*columns+2], f[i*columns+3]);
}
}
// aux function to display double based uniforms
void
VSGLInfoLib::displayUniformd(double *f, int rows, int columns) {
for (int i = 0; i < rows; ++i) {
if (columns == 1)
addMessage("%f", f[i*columns]);
else if (columns == 2)
addMessage("%f %f", f[i*columns], f[i*columns+1]);
else if (columns == 3)
addMessage("%f %f %f", f[i*columns], f[i*columns+1], f[i*columns+2]);
else if (columns == 4)
addMessage("%f %f %f %f", f[i*columns], f[i*columns+1], f[i*columns+2], f[i*columns+3]);
}
}
// gets the atomic data type
VSGLInfoLib::Types
VSGLInfoLib::getType(GLenum type) {
switch (type) {
case GL_DOUBLE:
case GL_DOUBLE_MAT2:
case GL_DOUBLE_MAT2x3:
case GL_DOUBLE_MAT2x4:
case GL_DOUBLE_MAT3:
case GL_DOUBLE_MAT3x2:
case GL_DOUBLE_MAT3x4:
case GL_DOUBLE_MAT4:
case GL_DOUBLE_MAT4x2:
case GL_DOUBLE_MAT4x3:
case GL_DOUBLE_VEC2:
case GL_DOUBLE_VEC3:
case GL_DOUBLE_VEC4:
return VSGLInfoLib::DOUBLE;
case GL_FLOAT:
case GL_FLOAT_MAT2:
case GL_FLOAT_MAT2x3:
case GL_FLOAT_MAT2x4:
case GL_FLOAT_MAT3:
case GL_FLOAT_MAT3x2:
case GL_FLOAT_MAT3x4:
case GL_FLOAT_MAT4:
case GL_FLOAT_MAT4x2:
case GL_FLOAT_MAT4x3:
case GL_FLOAT_VEC2:
case GL_FLOAT_VEC3:
case GL_FLOAT_VEC4:
return VSGLInfoLib::FLOAT;
case GL_BOOL:
case GL_BOOL_VEC2:
case GL_BOOL_VEC3:
case GL_BOOL_VEC4:
case GL_INT:
case GL_INT_SAMPLER_1D:
case GL_INT_SAMPLER_1D_ARRAY:
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_INT_SAMPLER_2D_RECT:
case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_BUFFER:
case GL_INT_SAMPLER_CUBE:
case GL_INT_VEC2:
case GL_INT_VEC3:
case GL_INT_VEC4:
case GL_SAMPLER_1D:
case GL_SAMPLER_1D_ARRAY:
case GL_SAMPLER_1D_ARRAY_SHADOW:
case GL_SAMPLER_1D_SHADOW:
case GL_SAMPLER_2D:
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_SAMPLER_2D_RECT:
case GL_SAMPLER_2D_RECT_SHADOW:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_3D:
case GL_SAMPLER_BUFFER:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_CUBE_SHADOW:
return VSGLInfoLib::INT;
case GL_UNSIGNED_INT:
case GL_UNSIGNED_INT_SAMPLER_1D:
case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_RECT:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_VEC2:
case GL_UNSIGNED_INT_VEC3:
case GL_UNSIGNED_INT_VEC4:
return VSGLInfoLib::UNSIGNED_INT;
default:
return VSGLInfoLib::DONT_KNOW;
}
}
// gets the number of rows for a GLSL type
int
VSGLInfoLib::getRows(GLenum type) {
switch(type) {
case GL_DOUBLE_MAT2:
case GL_DOUBLE_MAT2x3:
case GL_DOUBLE_MAT2x4:
case GL_FLOAT_MAT2:
case GL_FLOAT_MAT2x3:
case GL_FLOAT_MAT2x4:
return 2;
case GL_DOUBLE_MAT3:
case GL_DOUBLE_MAT3x2:
case GL_DOUBLE_MAT3x4:
case GL_FLOAT_MAT3:
case GL_FLOAT_MAT3x2:
case GL_FLOAT_MAT3x4:
return 3;
case GL_DOUBLE_MAT4:
case GL_DOUBLE_MAT4x2:
case GL_DOUBLE_MAT4x3:
case GL_FLOAT_MAT4:
case GL_FLOAT_MAT4x2:
case GL_FLOAT_MAT4x3:
return 4;
default: return 1;
}
}
// gets the number of columns for a GLSL type
int
VSGLInfoLib::getColumns(GLenum type) {
switch(type) {
case GL_DOUBLE_MAT2:
case GL_FLOAT_MAT2:
case GL_DOUBLE_MAT3x2:
case GL_FLOAT_MAT3x2:
case GL_DOUBLE_MAT4x2:
case GL_FLOAT_MAT4x2:
case GL_UNSIGNED_INT_VEC2:
case GL_INT_VEC2:
case GL_BOOL_VEC2:
case GL_FLOAT_VEC2:
case GL_DOUBLE_VEC2:
return 2;
case GL_DOUBLE_MAT2x3:
case GL_FLOAT_MAT2x3:
case GL_DOUBLE_MAT3:
case GL_FLOAT_MAT3:
case GL_DOUBLE_MAT4x3:
case GL_FLOAT_MAT4x3:
case GL_UNSIGNED_INT_VEC3:
case GL_INT_VEC3:
case GL_BOOL_VEC3:
case GL_FLOAT_VEC3:
case GL_DOUBLE_VEC3:
return 3;
case GL_DOUBLE_MAT2x4:
case GL_FLOAT_MAT2x4:
case GL_DOUBLE_MAT3x4:
case GL_FLOAT_MAT3x4:
case GL_DOUBLE_MAT4:
case GL_FLOAT_MAT4:
case GL_UNSIGNED_INT_VEC4:
case GL_INT_VEC4:
case GL_BOOL_VEC4:
case GL_FLOAT_VEC4:
case GL_DOUBLE_VEC4:
return 4;
default: return 1;
}
}
// aux function to get the size in bytes of a uniform
// it takes the strides into account
int
VSGLInfoLib::getUniformByteSize(int uniSize,
int uniType,
int uniArrayStride,
int uniMatStride) {
int auxSize;
if (uniArrayStride > 0)
auxSize = uniArrayStride * uniSize;
else if (uniMatStride > 0) {
switch(uniType) {
case GL_FLOAT_MAT2:
case GL_FLOAT_MAT2x3:
case GL_FLOAT_MAT2x4:
case GL_DOUBLE_MAT2:
case GL_DOUBLE_MAT2x3:
case GL_DOUBLE_MAT2x4:
auxSize = 2 * uniMatStride;
break;
case GL_FLOAT_MAT3:
case GL_FLOAT_MAT3x2:
case GL_FLOAT_MAT3x4:
case GL_DOUBLE_MAT3:
case GL_DOUBLE_MAT3x2:
case GL_DOUBLE_MAT3x4:
auxSize = 3 * uniMatStride;
break;
case GL_FLOAT_MAT4:
case GL_FLOAT_MAT4x2:
case GL_FLOAT_MAT4x3:
case GL_DOUBLE_MAT4:
case GL_DOUBLE_MAT4x2:
case GL_DOUBLE_MAT4x3:
auxSize = 4 * uniMatStride;
break;
}
}
else
auxSize = spGLSLTypeSize[uniType];
return auxSize;
}
| [
"[email protected]"
] | |
da2259d83f09981097624bebdc24eee906446e91 | cf8ddfc720bf6451c4ef4fa01684327431db1919 | /SDK/ARKSurvivalEvolved_TurretWarningLong_classes.hpp | 0b22a1de16d6292adcb89d9cf8db48d60fc63c47 | [
"MIT"
] | permissive | git-Charlie/ARK-SDK | 75337684b11e7b9f668da1f15e8054052a3b600f | c38ca9925309516b2093ad8c3a70ed9489e1d573 | refs/heads/master | 2023-06-20T06:30:33.550123 | 2021-07-11T13:41:45 | 2021-07-11T13:41:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 803 | hpp | #pragma once
// ARKSurvivalEvolved (329.9) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_TurretWarningLong_structs.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass TurretWarningLong.TurretWarningLong_C
// 0x0000 (0x0518 - 0x0518)
class ATurretWarningLong_C : public APrimalEmitterSpawnable
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass TurretWarningLong.TurretWarningLong_C");
return ptr;
}
void UserConstructionScript();
void ExecuteUbergraph_TurretWarningLong(int EntryPoint);
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"[email protected]"
] | |
e32c24d268c1515931f785a7382377147171a712 | acd26d78390e5943690d4966f4392010acf85c7d | /PrevisUI/Source/PrevisUIEditor/Menu/MenuBar.cpp | 21b4a38713b965405ec2ba60382cd659dd19facb | [] | no_license | OlivierArgentieri/save_unrealPrevisTools | 494156b970a77dc6669ae3042baf8114400838e1 | 272099913eb9b9b47a0c32b7901aeb38923729ae | refs/heads/main | 2023-03-01T03:30:29.609619 | 2021-02-04T13:01:47 | 2021-02-04T13:01:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,568 | cpp | #include "MenuBar.h"
void FMenuBar::OnStartupModule()
{
if (!IsRunningCommandlet())
{
// Store a reference to the level editor
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
// Store a reference to the extensibility manager
TSharedPtr<FExtensibilityManager> LevelEditorMenuExtensibilityManager = LevelEditorModule.GetMenuExtensibilityManager();
// Initialize the class containing the elements for the extension (in our case it will be the menu bar)
MenuExtender = MakeShareable(new FExtender);
// Add to the extender a menu bar extension
MenuExtender->AddMenuBarExtension(
"Window", // The name of the extension of the menu bar
EExtensionHook::After, // The place where we want to place our extension
NULL, // The command list to be called when it is open
FMenuBarExtensionDelegate::CreateRaw(this, &FMenuBar::CreateMenuBar)); // Funcion that will create the UI element
// Apply the extender to the extensibility manager
LevelEditorMenuExtensibilityManager->AddExtender(MenuExtender);
}
UE_LOG(LogTemp, Warning, TEXT("PrevisUI Module : Menu bar loaded"));
}
void FMenuBar::OnShutdownModule()
{
}
void FMenuBar::CreateMenuBar(FMenuBarBuilder& menuBuilder)
{
// Create the menu bar
menuBuilder.AddPullDownMenu(
FText::FromString("Example"), // The name of the menu bar
FText::FromString("Open the Example menu"), // The tooltip
FNewMenuDelegate::CreateRaw(this, &FMenuBar::CreateMenuContent), // Funcion that will create the content of this menu bar
"Example"); // Hook name to place future extensions
}
void FMenuBar::CreateMenuContent(FMenuBuilder& menuBuilder)
{
// Create sections for the menu
menuBuilder.BeginSection("ExampleSection", FText::FromString("Section 1"));
menuBuilder.AddMenuSeparator(FName("Section_1"));
menuBuilder.EndSection();
menuBuilder.BeginSection("ExampleSection", FText::FromString("Section 2"));
menuBuilder.AddMenuSeparator(FName("Section_2"));
menuBuilder.EndSection();
menuBuilder.BeginSection("DebugSection", FText::FromString("Shot Section"));
menuBuilder.AddMenuSeparator(FName("Shot_Section"));
menuBuilder.EndSection();
}
void FMenuBar::AddMenuExtension(const FMenuExtensionDelegate& extensionDelegate, FName extensionHook, const TSharedPtr<FUICommandList>& CommandList, EExtensionHook::Position position)
{
if (!CommandList) return;
; MenuExtender->AddMenuExtension(extensionHook, position, CommandList, extensionDelegate);
} | [
"[email protected]"
] | |
bcabdb3d92cf4e4c728991013d0c092199e5e3d2 | 299f5e3a469a2d888496ff81f660f1f26cfcb01c | /core/sse_matrix.cc | e83c3945921e3c3e76f20fc3c7bb495fe84d9dc6 | [] | no_license | SRaimondi/pixel | 2ecdb1d159e76c92ab8de53ad4aa2f132091925b | fd5cc8d956d37db852f800758a160924a9637c01 | refs/heads/master | 2020-02-26T17:25:35.192005 | 2016-11-12T22:04:21 | 2016-11-12T22:04:21 | 71,735,696 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,391 | cc | /*
* The MIT License
*
* Copyright 2016 simon.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "sse_matrix.h"
namespace pixel {
SSEMatrix Inverse(const SSEMatrix &m) {
// Matrix inversion based on the Gauss method
int indxc[4], indxr[4];
int ipiv[4] = {0, 0, 0, 0};
float minv[4][4];
memcpy(minv, Transpose(m).data, 16 * sizeof(float));
for (int i = 0; i < 4; i++) {
int irow = 0, icol = 0;
float big = 0.f;
// Choose pivot
for (int j = 0; j < 4; j++) {
if (ipiv[j] != 1) {
for (int k = 0; k < 4; k++) {
if (ipiv[k] == 0) {
if (std::abs(minv[j][k]) >= big) {
big = std::abs(minv[j][k]);
irow = j;
icol = k;
}
} else if (ipiv[k] > 1) {
std::cerr << "Singular matrix given to inversion procedure" << std::endl;
exit(EXIT_FAILURE);
}
}
}
}
++ipiv[icol];
// Swap rows irow_ and icol_ for pivot
if (irow != icol) {
for (int k = 0; k < 4; ++k) {
std::swap(minv[irow][k], minv[icol][k]);
}
}
indxr[i] = irow;
indxc[i] = icol;
if (minv[icol][icol] == 0.f) {
std::cerr << "Singular matrix given to inversion procedure" << std::endl;
exit(EXIT_FAILURE);
}
// Set $m[icol][icol]$ to one by scaling row _icol_ appropriately
float pivinv = 1.f / minv[icol][icol];
minv[icol][icol] = 1.f;
for (int j = 0; j < 4; j++) {
minv[icol][j] *= pivinv;
}
// Subtract this row from others to zero out their columns
for (int j = 0; j < 4; j++) {
if (j != icol) {
float save = minv[j][icol];
minv[j][icol] = 0;
for (int k = 0; k < 4; k++) {
minv[j][k] -= minv[icol][k] * save;
}
}
}
}
// Swap columns to reflect permutation
for (int j = 3; j >= 0; j--) {
if (indxr[j] != indxc[j]) {
for (int k = 0; k < 4; k++) {
std::swap(minv[k][indxr[j]], minv[k][indxc[j]]);
}
}
}
return SSEMatrix(minv[0][0], minv[0][1], minv[0][2], minv[0][3],
minv[1][0], minv[1][1], minv[1][2], minv[1][3],
minv[2][0], minv[2][1], minv[2][2], minv[2][3],
minv[3][0], minv[3][1], minv[3][2], minv[3][3]);
}
void PrintSSEMatrix(const SSEMatrix &m) {
for (size_t i = 0; i < 4; i++) {
std::cout << "[";
for (size_t j = 0; j < 4; j++) {
std::cout << m.data[j][i];
if (j < 3) {
std::cout << "\t";
}
}
std::cout << "]" << std::endl;
}
std::cout << std::endl;
}
} | [
"[email protected]"
] | |
9497a13fb7512bf474cbe909cd17dc3f06bb96b0 | 02f9a317672c08aaa8a8c32a3486a4f368febdd4 | /MoneyClass.cpp | 225656868a48f1f2941e095032a0e81b51695b1c | [] | no_license | Akantonio/Homework3 | cbf8a4c0e59d5ac608efff765e490e58b9c1a124 | 425f89a8add88e66f8f37a7661b46df198826482 | refs/heads/master | 2023-03-10T05:27:38.045335 | 2021-02-27T04:59:54 | 2021-02-27T04:59:54 | 341,785,104 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,081 | cpp | //
// Created by Adrian Antonio on 2/23/2021.
//
#include "MoneyClass.h"
Money::Money(): _value(0) {
}
Money::Money(double amount){
_value= amount*100+0.5;
}
Money::Money(int dollar, int cents){
if(cents<0){
_value= -1*(dollar*100-cents);
}else {
_value = dollar * 100 + cents;
}
}
std::ostream &operator<<(std::ostream & os, const Money &right) {
if(right._value==0){
return os<<"$0.00";
}
int dollars = right._value/100.0;
int cents= right._value%100;
if(right._value<0){
dollars*= -1;
cents*=-1;
os<<"-$";
}else{
os<<"$";
}
if(cents>0) {
os << dollars << "." << cents;
}
return os;
}
Money operator+(Money left, const Money &right) {
left+=right;
return left;
}
Money operator-(const Money &right){
return {-right._value};
}
Money operator-(const Money& left, const Money& right){
return left + -right;
}
Money operator*(Money left, const Money& right){
left*=right;
return left;
}
Money operator/(Money left, const Money& right){
return left/=right;
}
bool operator==(const Money & left, const Money& right){
return left._value == right._value;
}
bool operator<(const Money & left, const Money& right){
return left._value < right._value;
}
Money & Money::operator+=(const Money &right) {
_value = _value + right._value;
return *this;
}
Money & Money::operator-=(const Money& right){
*this = *this - right;
return *this;
}
Money & Money::operator/=(const Money& right){
return *this *= {1/right._value};
}
int Money::getValue()const {
return _value;
}
Money &Money::operator*=(const Money &right) {
_value *= right._value;
return *this;
}
bool operator!=(const Money & left, const Money& right){
return !(right==left);
}
bool operator>(const Money & left, const Money& right){
return right < left;
}
bool operator<=(const Money & left, const Money& right){
return !(right>left);
}
bool operator>=(const Money & left, const Money& right){
return !(right<left);
}
| [
"[email protected]"
] | |
6a76e77095d26ceb7f772b852429b3f472f8d726 | 970f7c9f5b2f80f4cb6b11cf33a6349047c3b4e2 | /Tues/145.binary-tree-postorder-traversal.35792090.ac.cpp | c39b4f98e18b9dcbc4851e224248fe797428a9eb | [] | no_license | claireyuan92/expressCourse | 02b36e3b54915a668ba8c986f67093705c5b932f | 2de236894f41c3587fe9fd53d6dc21e3726b9610 | refs/heads/master | 2021-01-25T09:14:25.097211 | 2017-08-22T07:19:29 | 2017-08-22T07:19:29 | 93,800,028 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 486 | cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
vector<int> res;
public:
vector<int> postorderTraversal(TreeNode* root) {
if(!root)return res;
postorderTraversal(root->left);
postorderTraversal(root->right);
res.push_back(root->val);
return res;
}
}; | [
"[email protected]"
] | |
3e4360253fc6ff8f2f104ae0972c4a8196c01e90 | 030e2b6547d937956716ac484de829b19a35a644 | /src/model.cpp | 0cc85cbd0cca8adf87660b7c814e0c6de95527cc | [] | no_license | sigsegv/tinyrenderer | cc5bbb253c5d7522ef1208aa69d3d29978ad5eca | ec474a7de868d210917b2827341a693cd112bd20 | refs/heads/master | 2021-01-02T08:53:27.604046 | 2019-12-31T01:37:24 | 2019-12-31T01:37:24 | 99,086,354 | 0 | 1 | null | 2018-01-08T05:35:01 | 2017-08-02T07:29:36 | C++ | UTF-8 | C++ | false | false | 3,901 | cpp | #include "model.hpp"
#include <fstream>
#include <sstream>
model::model()
{
}
void model::load_from_disk(const std::string& filepath)
{
std::ifstream fin(filepath);
if(!fin.is_open()) throw std::runtime_error("unable to open file " + filepath);
std::string line;
while(!fin.eof())
{
std::getline(fin, line);
std::istringstream iss(line);
if(line.compare(0, 2, "vt") == 0)
{
iss.ignore(2, ' ');
vertex_texture vt;
iss >> vt.u >> vt.v;
this->vt.push_back(vt);
}
else if(line.compare(0, 2, "vn") == 0)
{
iss.ignore(2, ' ');
vertex_normal vn;
iss >> vn.x >> vn.y >> vn.z;
this->vn.push_back(vn);
}
else if(line.compare(0, 2, "vp") == 0)
{
}
else if(line.compare(0, 1, "v") == 0)
{
iss.ignore(1, ' ');
vertex v;
iss >> v.x >> v.y >> v.z;
this->v.push_back(v);
}
else if(line.compare(0, 1, "f") == 0)
{
//std::string trash;
char trash;
iss.ignore(1, ' ');
face f;
iss >> f.v1 >> trash >> f.vt1 >> trash >> f.vn1
>> f.v2 >> trash >> f.vt2 >> trash >> f.vn2
>> f.v3 >> trash >> f.vt3 >> trash >> f.vn3;
// shift indexes down 1
--f.v1;
--f.vt1;
--f.vn1;
--f.v2;
--f.vt2;
--f.vn2;
--f.v3;
--f.vt3;
--f.vn3;
this->f.push_back(f);
}
}
}
TGAColor model::diffuse(const vector2f& uv)
{
const float u = m_diffuse.get_width() * uv[0];
const float v = m_diffuse.get_height() * uv[1];
return m_diffuse.get(static_cast<int>(u), static_cast<int>(v));
}
TGAColor model::specular(const vector2f& uv)
{
const int u = static_cast<int>(m_specular.get_width() * uv[0]);
const int v = static_cast<int>(m_specular.get_height() * uv[1]);
TGAColor color = m_specular.get(u, v);
if (color.bytespp == 1)
{
return TGAColor(color.b, color.b, color.b, color.a);
}
return color;
}
vector3f model::normal(const vector2f& uv)
{
const float u = m_normal.get_width() * uv[0];
const float v = m_normal.get_height() * uv[1];
TGAColor color = m_normal.get(static_cast<int>(u), static_cast<int>(v));
return {static_cast<float>(color.r) / 255.0f, static_cast<float>(color.g) / 255.0f, static_cast<float>(color.b) / 255.0f};
}
//const vector3f& model::normal(int iface, int nthvert)
//{
// face& fc = f[iface];
// const unsigned int ni = (nthvert == 0) ? fc.vn1 : ((nthvert == 1) ? fc.vn2 : fc.vn3);
// return vn[ni];
//}
vector2f model::get_uv(int iface, int nthvert)
{
face& fc = f[iface];
const unsigned int ti = (nthvert == 0) ? fc.vt1 : ((nthvert == 1) ? fc.vt2 : fc.vt3);
return {vt[ti].u, vt[ti].v};
}
vector3f model::get_vertex(int iface, int nthvert)
{
face& fc = f[iface];
const unsigned int vi = (nthvert == 0) ? fc.v1 : ((nthvert == 1) ? fc.v2 : fc.v3);
return v[vi];
}
void model::load_diffuse_map_from_disk(const std::string& filepath)
{
if(!m_diffuse.read_tga_file(filepath.c_str()))
{
throw std::runtime_error("unable to open file " + filepath);
}
m_diffuse.flip_vertically();
}
void model::load_normal_map_from_disk(const std::string& filepath)
{
if(!m_normal.read_tga_file(filepath.c_str()))
{
throw std::runtime_error("unable to open file " + filepath);
}
m_normal.flip_vertically();
}
void model::load_specular_map_from_disk(const std::string& filepath)
{
if(!m_specular.read_tga_file(filepath.c_str()))
{
throw std::runtime_error("unable to open file " + filepath);
}
m_specular.flip_vertically();
}
| [
"[email protected]"
] | |
47583c06a65870aed4fdcec3a880d90425c76174 | 9804b34b1ac01c5873401779875154a675223d3c | /arduino/Project Backup/Project 1.2.2020/loop/setup.ino | 44813493e3140f267eb33b0e6ddba27280c9072d | [] | no_license | AnushkaX/Hik | ad364c5dba98ceb79ad5bdaf54c202087ffb9cad | 41615256d5f93b9184fbd06c87c5a8ce8d4633d7 | refs/heads/master | 2020-12-04T04:27:14.306547 | 2020-02-27T06:07:13 | 2020-02-27T06:07:13 | 231,611,884 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,163 | ino | #include <Servo.h>
//-------color sensor----------
#define Color_S0 3
#define Color_S1 4
#define Color_S2 5
#define Color_S3 6
#define Color_sensorOut 2
int frequency = 0;
//-------------------------------
//--------Servo-----------
Servo BigServo;
Servo SmallServo;
#define smallServoPin 5
#define bigServoPin 10
//------------------------
//-----------Sonar-----------
#define pingPin 4
#define echoPin 3
//----------------------
boolean flag = false;
void setup() {
//-------------Servo setup-------------------
BigServo.attach(bigServoPin);
SmallServo.attach(smallServoPin);
//-------------------------------------------
//------------Sonar setup--------------------------
pinMode(pingPin, OUTPUT);
pinMode(echoPin, INPUT);
//-------------------------------------------
//------------Color sense setup---------------
pinMode(Color_S0, OUTPUT);
pinMode(Color_S1, OUTPUT);
pinMode(Color_S2, OUTPUT);
pinMode(Color_S3, OUTPUT);
pinMode(Color_sensorOut, INPUT);
// Setting frequency-scaling to 20%
digitalWrite(Color_S0, HIGH);
digitalWrite(Color_S1, LOW);
//----------------------------------------------
}
| [
"[email protected]"
] | |
5e3cb9053c135c80bc6f32dfbd9ad55f7c80679a | 0e61dc2a18ced57b91b81fff43b1c2b59e0154cc | /findMinimum/findMinimum/findMinimum.cpp | ae016dfa90a19ac25ac3c7f057af5d100a7f0584 | [] | no_license | rockdonald2/leetcode | 53179a4435e9ad4582432c435a51c3f22cee1cd4 | 2256ab0a0a00d307bec581b08eae00a83e76a49c | refs/heads/master | 2021-07-13T14:26:03.327928 | 2021-02-20T13:42:13 | 2021-02-20T13:42:13 | 238,773,596 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 686 | cpp | #include <iostream>
#include <vector>
using namespace std;
int findMin(vector<int>& nums) {
if (nums.size() == 1) return nums[0];
if (nums.empty()) return -1;
int left = 0, right = nums.size() - 1, mid;
if (nums[left] < nums[right]) return nums[left];
while (left <= right) {
mid = left + (right - left) / 2;
if (mid < nums.size() - 1 && nums[mid] > nums[mid + 1]) return nums[mid + 1];
else if (mid > 0 && nums[mid - 1] > nums[mid]) return nums[mid];
else if (nums[mid] > nums[left]) left = mid + 1;
else if (nums[mid] < nums[left]) right = mid - 1;
}
return -1;
}
int main() {
vector<int> nums{ 3, 4, 0, 1, 2 };
cout << findMin(nums) << endl;
return 0;
} | [
"[email protected]"
] | |
af097ed3f047e0f058b4f5ca8cb20d3e3893842f | 8dff0d8850bc7f1e5ecfbb50592f530809a15ec8 | /TopTagger/include/TTModule.h | bc74a7d99d132eac3e76e8e9eba71ec1e569039b | [] | no_license | zhenbinwu/TopTagger | 3dee3b5e7b41aa502264541c05015168fb3dfbf6 | fab6957fc53eb16550a3de8b96e54a02ec418f0a | refs/heads/master | 2020-12-03T04:03:16.205013 | 2017-06-06T20:41:25 | 2017-06-06T20:41:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 641 | h | #ifndef TTMODULE_H
#define TTMODULE_H
#include "TopTagger/TopTagger/include/TTMFactory.h"
#include <functional>
class TopTaggerResults;
namespace cfg
{
class CfgDocument;
}
//Base Object for Top Taggger Modules
class TTModule
{
private:
protected:
public:
virtual void getParameters(const cfg::CfgDocument*, const std::string&) = 0;
virtual void run(TopTaggerResults&) = 0;
};
//magic macro for registering classes with the factory object
#define REGISTER_TTMODULE( _module ) \
static bool _module ## _module_created = TTMFactory::registerModule( #_module, []()->TTModule*{ return new _module(); } )
#endif
| [
"[email protected]"
] | |
bedcb685539f6717909330dcd2808997e2a88be6 | 618e345bd49738101d1720fbe94896aa953a64ba | /VINS/src/utility/utility.cpp | e8d382775d0706ed425c359e472a8182b72c9817 | [] | no_license | 0iui0/slam_play | 16174cf10d5c56b5811ac553e8677ca29c7300cd | d8dd535b9bf550a5d6172a082c3d35f15a554d82 | refs/heads/main | 2023-08-01T15:56:35.869318 | 2021-09-30T10:28:48 | 2021-09-30T10:28:48 | 382,791,469 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 441 | cpp | #include "utility/utility.h"
Eigen::Matrix3d Utility::g2R(const Eigen::Vector3d &g) {
Eigen::Matrix3d R0;
Eigen::Vector3d ng1 = g.normalized();
Eigen::Vector3d ng2{0, 0, 1.0};
R0 = Eigen::Quaterniond::FromTwoVectors(ng1, ng2).toRotationMatrix();
double yaw = Utility::R2ypr(R0).x();
R0 = Utility::ypr2R(Eigen::Vector3d{-yaw, 0, 0}) * R0;
// R0 = Utility::ypr2R(Eigen::Vector3d{-90, 0, 0}) * R0;
return R0;
}
| [
"[email protected]"
] | |
e947ee59720b00c8edf448d1b419d171ecccaf3b | 4ee1a4147938da3265c85e7b447282e0f5d9fcb9 | /Gloggly/GLoggly/HeaderInfo.cpp | b8b0cf1e9fe99a86f41aec75f3111c0f6cd13015 | [] | no_license | YeonchulKim/GeniChartTools | c9f58a024585dbb91acafd049a0f3bce875e4f26 | 58c6fa2929e7c7221889aa8ae03afb30cfde3152 | refs/heads/master | 2021-05-07T15:52:11.207493 | 2017-11-01T23:06:37 | 2017-11-01T23:06:37 | 108,549,939 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 161 | cpp | #include "StdAfx.h"
#include "HeaderInfo.h"
CHeaderInfo::CHeaderInfo(void)
{
m_Header.resize(COUNT);
}
CHeaderInfo::~CHeaderInfo(void)
{
m_Header.clear();
}
| [
"[email protected]"
] | |
3f2780e5578de418ba7356a325d6f05737a00dc9 | 6fd4e46a21502a07ae9dd0ac04691ea6fbda18db | /MusicPlayer2/strcpcvt.cpp | 6a112d1e8fef49932afa992fd0c6e28184535b46 | [
"MIT"
] | permissive | devcxx/MusicPlayerPlus | 27aca3a895c6b77f61240079529c5d342be53930 | ffbcce181308cc516be9377e75a4c8a82cc9c16b | refs/heads/master | 2020-05-22T08:25:51.907575 | 2019-05-13T16:29:00 | 2019-05-13T16:29:00 | 186,277,442 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,669 | cpp | #include "stdafx.h"
#include "strcpcvt.h"
std::string cvt::utf8ts(const std::string& utf8)
{
// convert an utf8 string to widechar
__int32 nLen = ::MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), utf8.size(), NULL, 0);
wchar_t* lpszW = NULL;
lpszW = new wchar_t[nLen];
__int32 nRtn = ::MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), utf8.size(), lpszW, nLen);
if (nRtn != nLen)
{
delete[] lpszW;
return "";
}
// convert widechar string to multibyte
__int32 mbLen = ::WideCharToMultiByte(CP_ACP, 0, lpszW, nLen, NULL, 0, NULL, NULL);
if (mbLen <= 0)
{
return "";
}
std::string _str;
_str.resize(mbLen);
nRtn = ::WideCharToMultiByte(CP_ACP, 0, lpszW, nLen, (LPSTR)_str.c_str(), mbLen, NULL, NULL);
if (nRtn != mbLen)
{
delete[] lpszW;
return "";
}
delete[] lpszW;
return _str;
}
std::wstring cvt::s2ws(std::string s)
{
std::wstring ws;
#ifdef _MSC_VER
int iLen = ::MultiByteToWideChar(CP_ACP, 0, s.c_str(), -1, NULL, 0);
if (iLen > 0)
{
wchar_t* pwszDst = new wchar_t[iLen];
if (pwszDst)
{
::MultiByteToWideChar(CP_ACP, 0, s.c_str(), -1, pwszDst, iLen);
pwszDst[iLen - 1] = 0;
ws = pwszDst;
delete[]pwszDst;
}
}
#else
std::string curLocale = setlocale(LC_ALL, NULL); // curLocale = "C";
setlocale(LC_ALL, "chs");
size_t _Dsize = 2 * (wcslen(wstr) + 1);
char *_Dest = new char[_Dsize];
memset(_Dest, 0, _Dsize);
wcstombs(_Dest, wstr, _Dsize);
ws = _Dest;
delete[]_Dest;
setlocale(LC_ALL, curLocale.c_str());
#endif
return (ws);
}
std::string cvt::ws2s(std::wstring wstr)
{
std::string str;
#ifdef _MSC_VER
int iLen = ::WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, NULL, 0, NULL, NULL);
if (iLen > 0)
{
char* pszDst = new char[iLen];
if (pszDst)
{
::WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, pszDst, iLen, NULL, NULL);
pszDst[iLen - 1] = 0;
str = pszDst;
delete[] pszDst;
}
}
#else
std::string curLocale = setlocale(LC_ALL, NULL); // curLocale = "C";
setlocale(LC_ALL, "chs");
size_t _Dsize = 2 * (wcslen(wstr) + 1);
char *_Dest = new char[_Dsize];
memset(_Dest, 0, _Dsize);
wcstombs(_Dest, wstr, _Dsize);
str = _Dest;
delete[]_Dest;
setlocale(LC_ALL, curLocale.c_str());
#endif
return (str);
}
unsigned char cvt::tohex(const unsigned char& x)
{
return x > 9 ? x + 55 : x + 48;
}
std::string cvt::urlencoder(std::string& sIn)
{
std::string sOut;
for (unsigned int ix = 0; ix < sIn.size(); ix++)
{
unsigned char buf[4];
memset(buf, 0, 4);
if (isalnum((unsigned char)sIn[ix]))
{
buf[0] = sIn[ix];
}
else if (isspace((unsigned char)sIn[ix]))
{
buf[0] = '+';
}
else
{
buf[0] = '%';
buf[1] = tohex((unsigned char)sIn[ix] >> 4);
buf[2] = tohex((unsigned char)sIn[ix] % 16);
}
sOut += (char *)buf;
}
return sOut;
}
std::wstring cvt::utf8tws(const std::string& utf8)
{
// convert an utf8 string to widechar
__int32 nLen = ::MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), utf8.size(), NULL, 0);
std::wstring _str;
_str.resize(nLen);
__int32 nRtn = ::MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), utf8.size(), (LPWSTR)_str.c_str(), nLen);
return _str;
}
std::string cvt::s2utf8(const std::string& str)
{
std::string _utf8(str);
__int32 nLen = ::MultiByteToWideChar(CP_ACP, 0, _utf8.c_str(), _utf8.size(), NULL, 0);
wchar_t* lpszW = NULL;
lpszW = new wchar_t[nLen];
__int32 nRtn = ::MultiByteToWideChar(CP_ACP, 0, _utf8.c_str(), _utf8.size(), lpszW, nLen);
if (nRtn != nLen)
{
delete[] lpszW;
return "";
}
// convert widechar string to utf-8
__int32 utf8Len = ::WideCharToMultiByte(CP_UTF8, 0, lpszW, nLen, NULL, 0, NULL, NULL);
if (utf8Len <= 0)
return "";
_utf8.resize(utf8Len);
nRtn = ::WideCharToMultiByte(CP_UTF8, 0, lpszW, nLen, (LPSTR)_utf8.c_str(), utf8Len, NULL, NULL);
delete[] lpszW;
return _utf8;
}
void cvt::replaceSubStr(std::string& strSource, const std::string& strOld, const std::string& strNew)
{
int nPos = 0;
while ((nPos = strSource.find(strOld, nPos)) != strSource.npos)
{
strSource.replace(nPos, strOld.length(), strNew);
nPos += strNew.length();
}
}
void cvt::eraseSubStr(std::string & mainStr, const std::string & toErase)
{
// Search for the substring in string
size_t pos = mainStr.find(toErase);
if (pos != std::string::npos)
{
// If found then erase it from string
mainStr.erase(pos, toErase.length());
}
}
void cvt::eraseAllSubStr(std::string & mainStr, const std::string & toErase)
{
size_t pos = std::string::npos;
// Search for the substring in string in a loop untill nothing is found
while ((pos = mainStr.find(toErase)) != std::string::npos)
{
// If found then erase it from string
mainStr.erase(pos, toErase.length());
}
}
| [
"[email protected]"
] | |
2505f922b79f390a2a22dc06016ee5981c7b0899 | c2a1c834cb35cfacc000a8116c671455ed1704ca | /trie.cc | f494b29e4fe25e751bda14d65f6a5a406be5053f | [] | no_license | rollschild/MyAlgorithms | a4ece400bd5730999efcf7a5afc0fdc29eecf50d | cff86bbad5cca099b26467e06e4fe23ed9ce8840 | refs/heads/master | 2021-06-05T07:58:03.293145 | 2020-01-25T20:09:15 | 2020-01-25T20:09:15 | 111,488,428 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,811 | cc | /* Trie
*/
#include <iostream>
#include <vector>
#define ALPHABET 26
using namespace std;
struct TrieNode {
// vector<TrieNode*> children(ALPHABET);
bool is_end;
TrieNode* children[ALPHABET];
};
TrieNode* make_node() {
TrieNode* node = new TrieNode();
for (auto trie_node_ptr : node->children) {
trie_node_ptr = nullptr;
}
node->is_end = false;
return node;
}
void insert(TrieNode* root, string word) {
TrieNode* crawler_ptr = root;
for (int i = 0; i < word.length(); ++i) {
int index = word[i] - 'a';
if (crawler_ptr->children[index] == nullptr) {
crawler_ptr->children[index] = make_node();
}
crawler_ptr = crawler_ptr->children[index];
}
crawler_ptr->is_end = true;
}
bool search(TrieNode* root, string word) {
TrieNode* crawler_ptr = root;
for (int j = 0; j < word.length(); ++j) {
int index = word[j] - 'a';
if (crawler_ptr->children[index] == nullptr) return false;
crawler_ptr = crawler_ptr->children[index];
}
return (crawler_ptr != nullptr && crawler_ptr->is_end == true);
}
int main() {
vector<string> words = {"the", "a", "there", "answer",
"any", "by", "bye", "their"};
TrieNode* root = make_node();
for (auto word : words) {
insert(root, word);
}
search(root, "the") ? cout << "\"the\" exists" << endl
: cout << "\"the\" does not exist" << endl;
search(root, "these") ? cout << "\"theese\" exists" << endl
: cout << "\"these\" does not exist" << endl;
search(root, "their") ? cout << "\"their\" exists" << endl
: cout << "\"their\" does not exist" << endl;
search(root, "thaw") ? cout << "\"thaw\" exists" << endl
: cout << "\"thaw\" does not exist " << endl;
return 0;
}
| [
"[email protected]"
] | |
bf9c4e33809b366f7d87a5641a15f509e16089af | a33aac97878b2cb15677be26e308cbc46e2862d2 | /program_data/PKU_raw/58/313.c | af0c6662fa31a456cacdf61eea2fdd855de5e743 | [] | no_license | GabeOchieng/ggnn.tensorflow | f5d7d0bca52258336fc12c9de6ae38223f28f786 | 7c62c0e8427bea6c8bec2cebf157b6f1ea70a213 | refs/heads/master | 2022-05-30T11:17:42.278048 | 2020-05-02T11:33:31 | 2020-05-02T11:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,165 | c | int main()
{
char sen[200][90];
int i,n,p,j,len,q;
cin>>n;
cin.ignore();
for(i=1;i<=n;i++)
{
cin.getline(sen[i],90);
}
for(i=1;i<=n;i++)
{
q=0;
p=0;
len=strlen(sen[i]);
if(len==1)
{
if(sen[i][0]=='_'||(sen[i][0]>='a'&&sen[i][0]<='z')||(sen[i][0]>='A'&&sen[i][0]<='Z'))
{
cout<<1<<endl;continue;
}
}
else
{
for(j=1;j<=len-1;j++)
{
if(sen[i][0]=='_'||(sen[i][0]>='a'&&sen[i][0]<='z')||(sen[i][0]>='A'&&sen[i][0]<='Z'))
{
p=1;
}
if((sen[i][j]>='a'&&sen[i][0]<='z')||(sen[i][j]>='A'&&sen[i][j]<='Z')||(sen[i][j]>='0'&&sen[i][j]<='9')||(sen[i][j]=='_'))
{
q=1;
}
else
{
q=0;break;
}
}
if(p==1&&q==1)
{
cout<<1<<endl;
}
else
{
cout<<0<<endl;
}
}
}
return 0;
}
| [
"[email protected]"
] | |
42de93b3a76c3340c9871be2ee28a7deb8c14249 | 2ad789090db7a377f746413e397b603c76f547fa | /V-REP_PRO_EDU_V3_6_0_Ubuntu16_04/programming/bluezero/include/cppzmq/tests/testutil.hpp | 6bb41fac54e6b5469ec9c07c72f3a0a82cd55ac1 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JasonLeeUT/Robotics | 442b8217918a32b3e8df454b9890ab83280ee7f3 | 7e21e5d18b42cfcaafd01b0243f221a051692f11 | refs/heads/master | 2023-01-23T00:14:41.801025 | 2020-11-19T02:23:55 | 2020-11-19T02:23:55 | 314,112,186 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,375 | hpp | #pragma once
#include <gtest/gtest.h>
#include <zmq.hpp>
#if defined(ZMQ_CPP11)
#include <array>
class loopback_ip4_binder
{
public:
loopback_ip4_binder(zmq::socket_t &socket) { bind(socket); }
std::string endpoint() { return endpoint_; }
private:
// Helper function used in constructor
// as Gtest allows ASSERT_* only in void returning functions
// and constructor/destructor are not.
void bind(zmq::socket_t &socket)
{
ASSERT_NO_THROW(socket.bind("tcp://127.0.0.1:*"));
std::array<char, 100> endpoint{};
size_t endpoint_size = endpoint.size();
ASSERT_NO_THROW(
socket.getsockopt(ZMQ_LAST_ENDPOINT, endpoint.data(), &endpoint_size));
ASSERT_TRUE(endpoint_size < endpoint.size());
endpoint_ = std::string{endpoint.data()};
}
std::string endpoint_;
};
struct common_server_client_setup
{
common_server_client_setup(bool initialize = true)
{
if (initialize)
init();
}
void init()
{
endpoint = loopback_ip4_binder{server}.endpoint();
ASSERT_NO_THROW(client.connect(endpoint));
}
zmq::context_t context;
zmq::socket_t server{context, zmq::socket_type::pair};
zmq::socket_t client{context, zmq::socket_type::pair};
std::string endpoint;
};
#endif
| [
"[email protected]"
] | |
2f85401fd10ea58218f877c4b94f9b41baee4be0 | 1337a747db741d24a11cf10d3c4b0c9d173f8a6d | /Libraries/gtkmm/include/glibmm/giomm/private/dbusinterface_p.h | 1afe76642f91936b691e4c23ae35349008bd72a9 | [
"MIT"
] | permissive | iCodeIN/Wings | 0a1c17979439fc17e9bd55c43a7cc993973a3032 | 1dbf0c88cf3cc97b48788c23abc50c32447e228a | refs/heads/master | 2021-06-12T22:29:07.009637 | 2017-03-19T07:10:42 | 2017-03-19T07:10:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,384 | h | // -*- c++ -*-
// Generated by gmmproc 2.46.2 -- DO NOT MODIFY!
#ifndef _GIOMM_DBUSINTERFACE_P_H
#define _GIOMM_DBUSINTERFACE_P_H
#include <glibmm/private/interface_p.h>
#include <gio/gio.h>
#include <glibmm/private/interface_p.h>
namespace Gio
{
namespace DBus
{
class Interface_Class : public Glib::Interface_Class
{
public:
typedef Interface CppObjectType;
typedef GDBusInterface BaseObjectType;
typedef GDBusInterfaceIface BaseClassType;
typedef Glib::Interface_Class CppClassParent;
friend class Interface;
const Glib::Interface_Class& init();
static void iface_init_function(void* g_iface, void* iface_data);
static Glib::ObjectBase* wrap_new(GObject*);
protected:
//Callbacks (default signal handlers):
//These will call the *_impl member methods, which will then call the existing default signal callbacks, if any.
//You could prevent the original default signal handlers being called by overriding the *_impl method.
//Callbacks (virtual functions):
static GDBusInterfaceInfo* get_info_vfunc_callback(GDBusInterface* self);
static GDBusObject* get_object_vfunc_callback(GDBusInterface* self);
static void set_object_vfunc_callback(GDBusInterface* self, GDBusObject* object);
static GDBusObject* dup_object_vfunc_callback(GDBusInterface* self);
};
} // namespace DBus
} // namespace Gio
#endif /* _GIOMM_DBUSINTERFACE_P_H */
| [
"[email protected]"
] | |
f61eb6c01bf3a9c9232bd1cbb0245d57415b8c79 | 73ee941896043f9b3e2ab40028d24ddd202f695f | /external/chromium_org/chrome/browser/download/download_path_reservation_tracker_unittest.cc | 06183a54cfa893b91e10af535be290b5ba5564b2 | [
"BSD-3-Clause"
] | permissive | CyFI-Lab-Public/RetroScope | d441ea28b33aceeb9888c330a54b033cd7d48b05 | 276b5b03d63f49235db74f2c501057abb9e79d89 | refs/heads/master | 2022-04-08T23:11:44.482107 | 2016-09-22T20:15:43 | 2016-09-22T20:15:43 | 58,890,600 | 5 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 24,026 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/observer_list.h"
#include "base/strings/stringprintf.h"
#include "base/test/test_file_util.h"
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "chrome/browser/download/download_target_determiner.h"
#include "content/public/test/mock_download_item.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
using content::DownloadItem;
using content::MockDownloadItem;
using testing::AnyNumber;
using testing::Return;
using testing::ReturnRef;
using testing::ReturnRefOfCopy;
namespace {
// MockDownloadItem with real observers and state.
class FakeDownloadItem : public MockDownloadItem {
public:
explicit FakeDownloadItem()
: state_(IN_PROGRESS) {
}
virtual ~FakeDownloadItem() {
FOR_EACH_OBSERVER(Observer, observers_, OnDownloadDestroyed(this));
EXPECT_EQ(0u, observers_.size());
}
virtual void AddObserver(Observer* observer) OVERRIDE {
observers_.AddObserver(observer);
}
virtual void RemoveObserver(Observer* observer) OVERRIDE {
observers_.RemoveObserver(observer);
}
virtual void UpdateObservers() OVERRIDE {
FOR_EACH_OBSERVER(Observer, observers_, OnDownloadUpdated(this));
}
virtual DownloadState GetState() const OVERRIDE {
return state_;
}
void SetState(DownloadState state) {
state_ = state;
UpdateObservers();
}
private:
DownloadState state_;
ObserverList<Observer> observers_;
};
class DownloadPathReservationTrackerTest : public testing::Test {
public:
DownloadPathReservationTrackerTest();
// testing::Test
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
FakeDownloadItem* CreateDownloadItem(int32 id);
base::FilePath GetPathInDownloadsDirectory(
const base::FilePath::CharType* suffix);
bool IsPathInUse(const base::FilePath& path);
void CallGetReservedPath(
DownloadItem* download_item,
const base::FilePath& target_path,
bool create_directory,
DownloadPathReservationTracker::FilenameConflictAction conflict_action,
base::FilePath* return_path,
bool* return_verified);
const base::FilePath& default_download_path() const {
return default_download_path_;
}
void set_default_download_path(const base::FilePath& path) {
default_download_path_ = path;
}
// Creates a name of form 'a'*repeat + suffix
base::FilePath GetLongNamePathInDownloadsDirectory(
size_t repeat, const base::FilePath::CharType* suffix);
protected:
base::ScopedTempDir test_download_dir_;
base::FilePath default_download_path_;
base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread file_thread_;
private:
void TestReservedPathCallback(base::FilePath* return_path,
bool* return_verified, bool* did_run_callback,
const base::FilePath& path, bool verified);
};
DownloadPathReservationTrackerTest::DownloadPathReservationTrackerTest()
: ui_thread_(BrowserThread::UI, &message_loop_),
file_thread_(BrowserThread::FILE, &message_loop_) {
}
void DownloadPathReservationTrackerTest::SetUp() {
ASSERT_TRUE(test_download_dir_.CreateUniqueTempDir());
set_default_download_path(test_download_dir_.path());
}
void DownloadPathReservationTrackerTest::TearDown() {
message_loop_.RunUntilIdle();
}
FakeDownloadItem* DownloadPathReservationTrackerTest::CreateDownloadItem(
int32 id) {
FakeDownloadItem* item = new ::testing::StrictMock<FakeDownloadItem>;
EXPECT_CALL(*item, GetId())
.WillRepeatedly(Return(id));
EXPECT_CALL(*item, GetTargetFilePath())
.WillRepeatedly(ReturnRefOfCopy(base::FilePath()));
return item;
}
base::FilePath DownloadPathReservationTrackerTest::GetPathInDownloadsDirectory(
const base::FilePath::CharType* suffix) {
return default_download_path().Append(suffix).NormalizePathSeparators();
}
bool DownloadPathReservationTrackerTest::IsPathInUse(
const base::FilePath& path) {
return DownloadPathReservationTracker::IsPathInUseForTesting(path);
}
void DownloadPathReservationTrackerTest::CallGetReservedPath(
DownloadItem* download_item,
const base::FilePath& target_path,
bool create_directory,
DownloadPathReservationTracker::FilenameConflictAction conflict_action,
base::FilePath* return_path,
bool* return_verified) {
// Weak pointer factory to prevent the callback from running after this
// function has returned.
base::WeakPtrFactory<DownloadPathReservationTrackerTest> weak_ptr_factory(
this);
bool did_run_callback = false;
DownloadPathReservationTracker::GetReservedPath(
download_item,
target_path,
default_download_path(),
create_directory,
conflict_action,
base::Bind(&DownloadPathReservationTrackerTest::TestReservedPathCallback,
weak_ptr_factory.GetWeakPtr(), return_path, return_verified,
&did_run_callback));
message_loop_.RunUntilIdle();
EXPECT_TRUE(did_run_callback);
}
void DownloadPathReservationTrackerTest::TestReservedPathCallback(
base::FilePath* return_path, bool* return_verified, bool* did_run_callback,
const base::FilePath& path, bool verified) {
*did_run_callback = true;
*return_path = path;
*return_verified = verified;
}
base::FilePath
DownloadPathReservationTrackerTest::GetLongNamePathInDownloadsDirectory(
size_t repeat, const base::FilePath::CharType* suffix) {
return GetPathInDownloadsDirectory(
(base::FilePath::StringType(repeat, FILE_PATH_LITERAL('a'))
+ suffix).c_str());
}
} // namespace
// A basic reservation is acquired and committed.
TEST_F(DownloadPathReservationTrackerTest, BasicReservation) {
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
ASSERT_FALSE(IsPathInUse(path));
base::FilePath reserved_path;
bool verified = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(verified);
EXPECT_EQ(path.value(), reserved_path.value());
// Destroying the item should release the reservation.
item->SetState(DownloadItem::COMPLETE);
item.reset();
message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
}
// A download that is interrupted should lose its reservation.
TEST_F(DownloadPathReservationTrackerTest, InterruptedDownload) {
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
ASSERT_FALSE(IsPathInUse(path));
base::FilePath reserved_path;
bool verified = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(verified);
EXPECT_EQ(path.value(), reserved_path.value());
// Once the download is interrupted, the path should become available again.
item->SetState(DownloadItem::INTERRUPTED);
message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
}
// A completed download should also lose its reservation.
TEST_F(DownloadPathReservationTrackerTest, CompleteDownload) {
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
ASSERT_FALSE(IsPathInUse(path));
base::FilePath reserved_path;
bool verified = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(verified);
EXPECT_EQ(path.value(), reserved_path.value());
// Once the download completes, the path should become available again. For a
// real download, at this point only the path reservation will be released.
// The path wouldn't be available since it is occupied on disk by the
// completed download.
item->SetState(DownloadItem::COMPLETE);
message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
}
// If there are files on the file system, a unique reservation should uniquify
// around it.
TEST_F(DownloadPathReservationTrackerTest, ConflictingFiles) {
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
base::FilePath path1(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo (1).txt")));
// Create a file at |path|, and a .crdownload file at |path1|.
ASSERT_EQ(0, file_util::WriteFile(path, "", 0));
ASSERT_EQ(0,
file_util::WriteFile(
DownloadTargetDeterminer::GetCrDownloadPath(path1), "", 0));
ASSERT_TRUE(IsPathInUse(path));
base::FilePath reserved_path;
bool verified = false;
bool create_directory = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::UNIQUIFY;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(IsPathInUse(reserved_path));
EXPECT_TRUE(verified);
// The path should be uniquified, skipping over foo.txt but not over
// "foo (1).txt.crdownload"
EXPECT_EQ(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo (1).txt")).value(),
reserved_path.value());
item->SetState(DownloadItem::COMPLETE);
item.reset();
message_loop_.RunUntilIdle();
EXPECT_TRUE(IsPathInUse(path));
EXPECT_FALSE(IsPathInUse(reserved_path));
}
// Multiple reservations for the same path should uniquify around each other.
TEST_F(DownloadPathReservationTrackerTest, ConflictingReservations) {
scoped_ptr<FakeDownloadItem> item1(CreateDownloadItem(1));
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
base::FilePath uniquified_path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo (1).txt")));
ASSERT_FALSE(IsPathInUse(path));
ASSERT_FALSE(IsPathInUse(uniquified_path));
base::FilePath reserved_path1;
bool verified = false;
bool create_directory = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::UNIQUIFY;
CallGetReservedPath(
item1.get(),
path,
create_directory,
conflict_action,
&reserved_path1,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(verified);
{
// Requesting a reservation for the same path with uniquification results in
// a uniquified path.
scoped_ptr<FakeDownloadItem> item2(CreateDownloadItem(2));
base::FilePath reserved_path2;
CallGetReservedPath(
item2.get(),
path,
create_directory,
conflict_action,
&reserved_path2,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(IsPathInUse(uniquified_path));
EXPECT_EQ(uniquified_path.value(), reserved_path2.value());
item2->SetState(DownloadItem::COMPLETE);
}
message_loop_.RunUntilIdle();
EXPECT_TRUE(IsPathInUse(path));
EXPECT_FALSE(IsPathInUse(uniquified_path));
{
// Since the previous download item was removed, requesting a reservation
// for the same path should result in the same uniquified path.
scoped_ptr<FakeDownloadItem> item2(CreateDownloadItem(2));
base::FilePath reserved_path2;
CallGetReservedPath(
item2.get(),
path,
create_directory,
conflict_action,
&reserved_path2,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(IsPathInUse(uniquified_path));
EXPECT_EQ(uniquified_path.value(), reserved_path2.value());
item2->SetState(DownloadItem::COMPLETE);
}
message_loop_.RunUntilIdle();
// Now acquire an overwriting reservation. We should end up with the same
// non-uniquified path for both reservations.
scoped_ptr<FakeDownloadItem> item3(CreateDownloadItem(2));
base::FilePath reserved_path3;
conflict_action = DownloadPathReservationTracker::OVERWRITE;
CallGetReservedPath(
item3.get(),
path,
create_directory,
conflict_action,
&reserved_path3,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_FALSE(IsPathInUse(uniquified_path));
EXPECT_EQ(path.value(), reserved_path1.value());
EXPECT_EQ(path.value(), reserved_path3.value());
item1->SetState(DownloadItem::COMPLETE);
item3->SetState(DownloadItem::COMPLETE);
}
// If a unique path cannot be determined after trying kMaxUniqueFiles
// uniquifiers, then the callback should notified that verification failed, and
// the returned path should be set to the original requested path.
TEST_F(DownloadPathReservationTrackerTest, UnresolvedConflicts) {
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
scoped_ptr<FakeDownloadItem> items[
DownloadPathReservationTracker::kMaxUniqueFiles + 1];
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::UNIQUIFY;
bool create_directory = false;
// Create |kMaxUniqueFiles + 1| reservations for |path|. The first reservation
// will have no uniquifier. The |kMaxUniqueFiles| remaining reservations do.
for (int i = 0; i <= DownloadPathReservationTracker::kMaxUniqueFiles; i++) {
base::FilePath reserved_path;
base::FilePath expected_path;
bool verified = false;
if (i > 0) {
expected_path =
path.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", i));
} else {
expected_path = path;
}
items[i].reset(CreateDownloadItem(i));
EXPECT_FALSE(IsPathInUse(expected_path));
CallGetReservedPath(
items[i].get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(expected_path));
EXPECT_EQ(expected_path.value(), reserved_path.value());
EXPECT_TRUE(verified);
}
// The next reservation for |path| will fail to be unique.
scoped_ptr<FakeDownloadItem> item(
CreateDownloadItem(DownloadPathReservationTracker::kMaxUniqueFiles + 1));
base::FilePath reserved_path;
bool verified = true;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_FALSE(verified);
EXPECT_EQ(path.value(), reserved_path.value());
item->SetState(DownloadItem::COMPLETE);
for (int i = 0; i <= DownloadPathReservationTracker::kMaxUniqueFiles; i++) {
items[i]->SetState(DownloadItem::COMPLETE);
}
}
// If the target directory is unwriteable, then callback should be notified that
// verification failed.
TEST_F(DownloadPathReservationTrackerTest, UnwriteableDirectory) {
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
base::FilePath dir(path.DirName());
ASSERT_FALSE(IsPathInUse(path));
{
// Scope for PermissionRestorer
file_util::PermissionRestorer restorer(dir);
EXPECT_TRUE(file_util::MakeFileUnwritable(dir));
base::FilePath reserved_path;
bool verified = true;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
// Verification fails.
EXPECT_FALSE(verified);
EXPECT_EQ(path.BaseName().value(), reserved_path.BaseName().value());
}
item->SetState(DownloadItem::COMPLETE);
}
// If the default download directory doesn't exist, then it should be
// created. But only if we are actually going to create the download path there.
TEST_F(DownloadPathReservationTrackerTest, CreateDefaultDownloadPath) {
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo/foo.txt")));
base::FilePath dir(path.DirName());
ASSERT_FALSE(base::DirectoryExists(dir));
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
{
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath reserved_path;
bool verified = true;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
// Verification fails because the directory doesn't exist.
EXPECT_FALSE(verified);
item->SetState(DownloadItem::COMPLETE);
}
ASSERT_FALSE(IsPathInUse(path));
{
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath reserved_path;
bool verified = true;
set_default_download_path(dir);
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
// Verification succeeds because the directory is created.
EXPECT_TRUE(verified);
EXPECT_TRUE(base::DirectoryExists(dir));
item->SetState(DownloadItem::COMPLETE);
}
}
// If the target path of the download item changes, the reservation should be
// updated to match.
TEST_F(DownloadPathReservationTrackerTest, UpdatesToTargetPath) {
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo.txt")));
ASSERT_FALSE(IsPathInUse(path));
base::FilePath reserved_path;
bool verified = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(verified);
EXPECT_EQ(path.value(), reserved_path.value());
// The target path is initially empty. If an OnDownloadUpdated() is issued in
// this state, we shouldn't lose the reservation.
ASSERT_EQ(base::FilePath::StringType(), item->GetTargetFilePath().value());
item->UpdateObservers();
message_loop_.RunUntilIdle();
EXPECT_TRUE(IsPathInUse(path));
// If the target path changes, we should update the reservation to match.
base::FilePath new_target_path(
GetPathInDownloadsDirectory(FILE_PATH_LITERAL("bar.txt")));
ASSERT_FALSE(IsPathInUse(new_target_path));
EXPECT_CALL(*item, GetTargetFilePath())
.WillRepeatedly(ReturnRef(new_target_path));
item->UpdateObservers();
message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
EXPECT_TRUE(IsPathInUse(new_target_path));
// Destroying the item should release the reservation.
item->SetState(DownloadItem::COMPLETE);
item.reset();
message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(new_target_path));
}
// Tests for long name truncation. On other platforms automatic truncation
// is not performed (yet).
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
TEST_F(DownloadPathReservationTrackerTest, BasicTruncation) {
int real_max_length =
file_util::GetMaximumPathComponentLength(default_download_path());
ASSERT_NE(-1, real_max_length);
// TODO(kinaba): the current implementation leaves spaces for appending
// ".crdownload". So take it into account. Should be removed in the future.
const size_t max_length = real_max_length - 11;
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(GetLongNamePathInDownloadsDirectory(
max_length, FILE_PATH_LITERAL(".txt")));
ASSERT_FALSE(IsPathInUse(path));
base::FilePath reserved_path;
bool verified = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(reserved_path));
EXPECT_TRUE(verified);
// The file name length is truncated to max_length.
EXPECT_EQ(max_length, reserved_path.BaseName().value().size());
// But the extension is kept unchanged.
EXPECT_EQ(path.Extension(), reserved_path.Extension());
item->SetState(DownloadItem::COMPLETE);
}
TEST_F(DownloadPathReservationTrackerTest, TruncationConflict) {
int real_max_length =
file_util::GetMaximumPathComponentLength(default_download_path());
ASSERT_NE(-1, real_max_length);
const size_t max_length = real_max_length - 11;
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(GetLongNamePathInDownloadsDirectory(
max_length, FILE_PATH_LITERAL(".txt")));
base::FilePath path0(GetLongNamePathInDownloadsDirectory(
max_length - 4, FILE_PATH_LITERAL(".txt")));
base::FilePath path1(GetLongNamePathInDownloadsDirectory(
max_length - 8, FILE_PATH_LITERAL(" (1).txt")));
base::FilePath path2(GetLongNamePathInDownloadsDirectory(
max_length - 8, FILE_PATH_LITERAL(" (2).txt")));
ASSERT_FALSE(IsPathInUse(path));
// "aaa...aaaaaaa.txt" (truncated path) and
// "aaa...aaa (1).txt" (truncated and first uniquification try) exists.
// "aaa...aaa (2).txt" should be used.
ASSERT_EQ(0, file_util::WriteFile(path0, "", 0));
ASSERT_EQ(0, file_util::WriteFile(path1, "", 0));
base::FilePath reserved_path;
bool verified = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::UNIQUIFY;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
EXPECT_TRUE(IsPathInUse(reserved_path));
EXPECT_TRUE(verified);
EXPECT_EQ(path2, reserved_path);
item->SetState(DownloadItem::COMPLETE);
}
TEST_F(DownloadPathReservationTrackerTest, TruncationFail) {
int real_max_length =
file_util::GetMaximumPathComponentLength(default_download_path());
ASSERT_NE(-1, real_max_length);
const size_t max_length = real_max_length - 11;
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
base::FilePath path(GetPathInDownloadsDirectory(
(FILE_PATH_LITERAL("a.") +
base::FilePath::StringType(max_length, 'b')).c_str()));
ASSERT_FALSE(IsPathInUse(path));
base::FilePath reserved_path;
bool verified = false;
DownloadPathReservationTracker::FilenameConflictAction conflict_action =
DownloadPathReservationTracker::OVERWRITE;
bool create_directory = false;
CallGetReservedPath(
item.get(),
path,
create_directory,
conflict_action,
&reserved_path,
&verified);
// We cannot truncate a path with very long extension.
EXPECT_FALSE(verified);
item->SetState(DownloadItem::COMPLETE);
}
#endif
| [
"[email protected]"
] | |
766f0c9ef81ecf272efc2d6d12408bc074277607 | 27b4b5e3ed16b47588a182af40c601d9a930a4ba | /side.cpp | 80d5ceda986b700ad95cceab82ef6085c073272e | [] | no_license | awtcode/dylink_static_member | 829414ad51b7a744032e1787195c3644066d8604 | 0d861a9664659b9b97cb1d97d0c00b8b2b10e707 | refs/heads/master | 2020-03-25T13:52:12.567609 | 2018-08-07T09:04:30 | 2018-08-07T09:04:30 | 143,846,746 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 732 | cpp | #include "header.h"
#include "emscripten.h"
#include <dlfcn.h>
#include <stdio.h>
EMSCRIPTEN_KEEPALIVE int x = 123;
EMSCRIPTEN_KEEPALIVE int global::value = 7;
extern "C" {
void loadlib();
}
extern bool sidey2(int i);
typedef bool (*sideyPODfunc)(int num);
EMSCRIPTEN_KEEPALIVE bool sidey(int i) {
loadlib();
void* lib_handle = dlopen("liblib.so", RTLD_NOW);
if (lib_handle == NULL) {
printf("Could not load lib!!!\n");
return false;
} else {
printf("lib loaded!!!\n");
sideyPODfunc onefunc = (sideyPODfunc)dlsym(lib_handle, "sidey2");
printf("sidey: sidey2: %d\n", (bool)onefunc(5));
}
//return global::value == i;
return true;
} | [
"[email protected]"
] | |
c2e24ee5c41680654a2de0f7132de0572d2ef2a4 | 7189b85150a21412598291fa29896423a27e434a | /chrome/browser/chromeos/login/screens/update_required_screen.cc | ff00a92752bcdcaa31975b4e8d6b7110c9424022 | [
"BSD-3-Clause"
] | permissive | Cicko/chromium | 328a49cbfa25e7e4e9f27e4510f2f81ab6410384 | 63c6b9d55f6b866d3aa9719dab956ef7940c1dab | refs/heads/master | 2022-11-09T17:04:16.402973 | 2020-02-03T15:21:47 | 2020-02-03T15:21:47 | 238,001,913 | 1 | 0 | BSD-3-Clause | 2020-02-03T15:49:33 | 2020-02-03T15:49:32 | null | UTF-8 | C++ | false | false | 11,016 | cc | // Copyright (c) 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 "chrome/browser/chromeos/login/screens/update_required_screen.h"
#include <algorithm>
#include <utility>
#include "ash/public/cpp/login_screen.h"
#include "ash/public/cpp/system_tray.h"
#include "base/bind.h"
#include "base/time/default_clock.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/chromeos/login/error_screens_histogram_helper.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/ui/login_display.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h"
#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_state_handler.h"
#include "ui/chromeos/devicetype_utils.h"
namespace {
constexpr char kUserActionSelectNetworkButtonClicked[] = "select-network";
constexpr char kUserActionUpdateButtonClicked[] = "update";
constexpr char kUserActionAcceptUpdateOverCellular[] = "update-accept-cellular";
constexpr char kUserActionRejectUpdateOverCellular[] = "update-reject-cellular";
// Delay before showing error message if captive portal is detected.
// We wait for this delay to let captive portal to perform redirect and show
// its login page before error message appears.
constexpr const base::TimeDelta kDelayErrorMessage =
base::TimeDelta::FromSeconds(10);
} // namespace
namespace chromeos {
UpdateRequiredScreen::UpdateRequiredScreen(UpdateRequiredView* view,
ErrorScreen* error_screen)
: BaseScreen(UpdateRequiredView::kScreenId),
view_(view),
error_screen_(error_screen),
histogram_helper_(
std::make_unique<ErrorScreensHistogramHelper>("UpdateRequired")),
version_updater_(std::make_unique<VersionUpdater>(this)),
network_state_helper_(std::make_unique<login::NetworkStateHelper>()),
clock_(base::DefaultClock::GetInstance()) {
error_message_delay_ = kDelayErrorMessage;
if (view_)
view_->Bind(this);
}
UpdateRequiredScreen::~UpdateRequiredScreen() {
UnsubscribeNetworkNotification();
if (view_)
view_->Unbind();
}
void UpdateRequiredScreen::OnViewDestroyed(UpdateRequiredView* view) {
if (view_ == view)
view_ = nullptr;
}
void UpdateRequiredScreen::Show() {
ash::LoginScreen::Get()->SetAllowLoginAsGuest(false);
RefreshNetworkState();
SubscribeNetworkNotification();
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
view_->SetEnterpriseAndDeviceName(connector->GetEnterpriseDisplayDomain(),
ui::GetChromeOSDeviceName());
is_shown_ = true;
if (first_time_shown_) {
first_time_shown_ = false;
if (view_) {
view_->SetUIState(UpdateRequiredView::UPDATE_REQUIRED_MESSAGE);
view_->Show();
}
}
version_updater_->GetEolInfo(base::BindOnce(
&UpdateRequiredScreen::OnGetEolInfo, weak_factory_.GetWeakPtr()));
}
void UpdateRequiredScreen::OnGetEolInfo(
const chromeos::UpdateEngineClient::EolInfo& info) {
// TODO(crbug.com/1020616) : Handle if the device is left on this screen
// for long enough to reach Eol.
if (!info.eol_date.is_null() && info.eol_date <= clock_->Now()) {
EnsureScreenIsShown();
if (view_)
view_->SetUIState(UpdateRequiredView::EOL_REACHED);
}
}
void UpdateRequiredScreen::Hide() {
if (view_)
view_->Hide();
is_shown_ = false;
UnsubscribeNetworkNotification();
}
void UpdateRequiredScreen::OnUserAction(const std::string& action_id) {
if (action_id == kUserActionSelectNetworkButtonClicked) {
OnSelectNetworkButtonClicked();
} else if (action_id == kUserActionUpdateButtonClicked) {
OnUpdateButtonClicked();
} else if (action_id == kUserActionAcceptUpdateOverCellular) {
version_updater_->SetUpdateOverCellularOneTimePermission();
} else if (action_id == kUserActionRejectUpdateOverCellular) {
version_updater_->RejectUpdateOverCellular();
version_updater_->StartExitUpdate(VersionUpdater::Result::UPDATE_ERROR);
} else {
BaseScreen::OnUserAction(action_id);
}
}
void UpdateRequiredScreen::NetworkConnectionStateChanged(
const NetworkState* network) {
RefreshNetworkState();
}
void UpdateRequiredScreen::DefaultNetworkChanged(const NetworkState* network) {
RefreshNetworkState();
}
void UpdateRequiredScreen::RefreshNetworkState() {
if (!view_)
return;
view_->SetIsConnected(network_state_helper_->IsConnected());
}
void UpdateRequiredScreen::RefreshView(
const VersionUpdater::UpdateInfo& update_info) {
if (!view_)
return;
if (update_info.requires_permission_for_cellular) {
view_->SetUIState(UpdateRequiredView::UPDATE_NEED_PERMISSION);
waiting_for_permission_ = true;
} else if (waiting_for_permission_) {
// Return UI state after getting permission.
view_->SetUIState(UpdateRequiredView::UPDATE_PROCESS);
waiting_for_permission_ = false;
}
view_->SetUpdateProgressUnavailable(update_info.progress_unavailable);
view_->SetUpdateProgressValue(update_info.progress);
view_->SetUpdateProgressMessage(update_info.progress_message);
view_->SetEstimatedTimeLeftVisible(update_info.show_estimated_time_left);
view_->SetEstimatedTimeLeft(update_info.estimated_time_left_in_secs);
}
void UpdateRequiredScreen::SubscribeNetworkNotification() {
if (!is_network_subscribed_) {
is_network_subscribed_ = true;
NetworkHandler::Get()->network_state_handler()->AddObserver(this,
FROM_HERE);
}
}
void UpdateRequiredScreen::UnsubscribeNetworkNotification() {
if (is_network_subscribed_) {
is_network_subscribed_ = false;
NetworkHandler::Get()->network_state_handler()->RemoveObserver(this,
FROM_HERE);
}
}
void UpdateRequiredScreen::OnSelectNetworkButtonClicked() {
ash::SystemTray::Get()->ShowNetworkDetailedViewBubble(
true /* show_by_click */);
}
void UpdateRequiredScreen::OnUpdateButtonClicked() {
if (is_updating_now_)
return;
is_updating_now_ = true;
if (view_)
view_->SetUIState(UpdateRequiredView::UPDATE_PROCESS);
version_updater_->StartNetworkCheck();
}
void UpdateRequiredScreen::OnWaitForRebootTimeElapsed() {
EnsureScreenIsShown();
if (view_)
view_->SetUIState(UpdateRequiredView::UPDATE_COMPLETED_NEED_REBOOT);
}
void UpdateRequiredScreen::PrepareForUpdateCheck() {
error_message_timer_.Stop();
error_screen_->HideCaptivePortal();
connect_request_subscription_.reset();
if (version_updater_->update_info().state ==
VersionUpdater::State::STATE_ERROR)
HideErrorMessage();
}
void UpdateRequiredScreen::ShowErrorMessage() {
error_message_timer_.Stop();
is_shown_ = false;
connect_request_subscription_ = error_screen_->RegisterConnectRequestCallback(
base::BindRepeating(&UpdateRequiredScreen::OnConnectRequested,
weak_factory_.GetWeakPtr()));
error_screen_->SetUIState(NetworkError::UI_STATE_UPDATE);
error_screen_->SetParentScreen(UpdateRequiredView::kScreenId);
error_screen_->SetHideCallback(base::BindRepeating(
&UpdateRequiredScreen::OnErrorScreenHidden, weak_factory_.GetWeakPtr()));
error_screen_->SetIsPersistentError(true /* is_persistent */);
error_screen_->Show();
histogram_helper_->OnErrorShow(error_screen_->GetErrorState());
}
void UpdateRequiredScreen::UpdateErrorMessage(
const NetworkPortalDetector::CaptivePortalStatus status,
const NetworkError::ErrorState& error_state,
const std::string& network_name) {
error_screen_->SetErrorState(error_state, network_name);
if (status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL) {
if (is_first_portal_notification_) {
is_first_portal_notification_ = false;
error_screen_->FixCaptivePortal();
}
}
}
void UpdateRequiredScreen::DelayErrorMessage() {
if (error_message_timer_.IsRunning())
return;
error_message_timer_.Start(FROM_HERE, error_message_delay_, this,
&UpdateRequiredScreen::ShowErrorMessage);
}
void UpdateRequiredScreen::SetErrorMessageDelayForTesting(
const base::TimeDelta& delay) {
error_message_delay_ = delay;
}
void UpdateRequiredScreen::UpdateInfoChanged(
const VersionUpdater::UpdateInfo& update_info) {
switch (update_info.status.current_operation()) {
case update_engine::Operation::CHECKING_FOR_UPDATE:
case update_engine::Operation::ATTEMPTING_ROLLBACK:
case update_engine::Operation::DISABLED:
case update_engine::Operation::IDLE:
break;
case update_engine::Operation::UPDATE_AVAILABLE:
case update_engine::Operation::DOWNLOADING:
case update_engine::Operation::VERIFYING:
case update_engine::Operation::FINALIZING:
case update_engine::Operation::NEED_PERMISSION_TO_UPDATE:
EnsureScreenIsShown();
break;
case update_engine::Operation::UPDATED_NEED_REBOOT:
EnsureScreenIsShown();
waiting_for_reboot_ = true;
version_updater_->RebootAfterUpdate();
break;
case update_engine::Operation::ERROR:
case update_engine::Operation::REPORTING_ERROR_EVENT:
version_updater_->StartExitUpdate(VersionUpdater::Result::UPDATE_ERROR);
break;
default:
NOTREACHED();
}
RefreshView(update_info);
}
void UpdateRequiredScreen::FinishExitUpdate(VersionUpdater::Result result) {
if (waiting_for_reboot_)
return;
is_updating_now_ = false;
if (view_)
view_->SetUIState(UpdateRequiredView::UPDATE_ERROR);
}
VersionUpdater* UpdateRequiredScreen::GetVersionUpdaterForTesting() {
return version_updater_.get();
}
void UpdateRequiredScreen::SetClockForTesting(base::Clock* clock) {
clock_ = clock;
}
void UpdateRequiredScreen::EnsureScreenIsShown() {
if (is_shown_ || !view_)
return;
is_shown_ = true;
histogram_helper_->OnScreenShow();
view_->Show();
}
void UpdateRequiredScreen::HideErrorMessage() {
error_screen_->Hide();
if (view_)
view_->Show();
histogram_helper_->OnErrorHide();
}
void UpdateRequiredScreen::OnConnectRequested() {
if (version_updater_->update_info().state ==
VersionUpdater::State::STATE_ERROR) {
LOG(WARNING) << "Hiding error message since AP was reselected";
version_updater_->StartUpdateCheck();
}
}
void UpdateRequiredScreen::OnErrorScreenHidden() {
error_screen_->SetParentScreen(OobeScreen::SCREEN_UNKNOWN);
// Return to the default state.
error_screen_->SetIsPersistentError(false /* is_persistent */);
Show();
}
} // namespace chromeos
| [
"[email protected]"
] | |
d6dde51f87e0c784f562eec5ee15fa4ab799635a | fef30dd6a425dbbccf1d93d3c2985e23da3005bc | /Week04-Recurrence/598D - Igor In the Museum.cpp | 59840bf8d94e08125cab6b1d5f186bb1657cfa9d | [
"MIT"
] | permissive | AAlab1819/SutedjaTheHoPing-01082170006 | ada3ef3340eb69d88149a9ae9186151c1aab5c4c | 01aba17a1d667297e26379c762f3662d269f7cf5 | refs/heads/master | 2020-03-27T14:58:53.031749 | 2018-11-14T09:20:42 | 2018-11-14T09:20:42 | 146,690,961 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,263 | cpp | #include <bits/stdc++.h>
using namespace std;
int ans = 0;
int keyCount = 0;
char museumSize[1000][1000];
int answer[1000000] = {0};
int key[1000][1000] = {0};
int maxX, maxY;
void floodFill(int x, int y)
{
if(x < 0 || x >= maxX || y < 0 || y >= maxY) return;
if(key[x][y] != 0) return;
if(museumSize[x][y] == '*')
{
ans++;
return;
}
key[x][y] = keyCount;
floodFill(x-1, y);
floodFill(x+1, y);
floodFill(x, y-1);
floodFill(x, y+1);
return;
}
int main()
{
int testCase, testRow, testCol;
cin >> maxX >> maxY >> testCase;
for(int i = 0; i < maxX; i++)
{
for(int j = 0; j < maxY; j++)
{
cin >> museumSize[i][j];
}
}
for(int i = 0; i < maxX; i++)
{
for(int j = 0; j < maxY; j++)
{
if(museumSize[i][j] == '.' && key[i][j] == 0)
{
keyCount++;
ans = 0;
floodFill(i,j);
answer[keyCount] = ans;
}
}
}
for(int x = 0; x < testCase; x++)
{
cin >> testRow >> testCol;
cout << answer[key[testRow-1][testCol-1]] << endl;
}
return 0;
}
| [
"[email protected]"
] | |
63c6f0c370760afa20e07f196694aebb86cf70f4 | 1a7b2722de0092fbee548d9d15649438e95e178c | /build-radar24-Desktop-Release/moc_qcustomplot.cpp | 704e12a0760c4833bd9c3f7e1693be86028e6cab | [] | no_license | kimphg/rasPi | f82145fc76d7b71a91bcf0e20d185db14fe2e7c5 | f16ba38e57398f9da44cad7716a8f392244926ea | refs/heads/master | 2021-07-13T19:55:14.976334 | 2020-10-30T13:54:51 | 2020-10-30T13:54:51 | 74,934,939 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 240,534 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'qcustomplot.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.11.3)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../Radar24/qcustomplot/qcustomplot.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#include <QtCore/QList>
#include <QtCore/QVector>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'qcustomplot.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.11.3. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_QCPScatterStyle_t {
QByteArrayData data[20];
char stringdata0[209];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPScatterStyle_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPScatterStyle_t qt_meta_stringdata_QCPScatterStyle = {
{
QT_MOC_LITERAL(0, 0, 15), // "QCPScatterStyle"
QT_MOC_LITERAL(1, 16, 12), // "ScatterShape"
QT_MOC_LITERAL(2, 29, 6), // "ssNone"
QT_MOC_LITERAL(3, 36, 5), // "ssDot"
QT_MOC_LITERAL(4, 42, 7), // "ssCross"
QT_MOC_LITERAL(5, 50, 6), // "ssPlus"
QT_MOC_LITERAL(6, 57, 8), // "ssCircle"
QT_MOC_LITERAL(7, 66, 6), // "ssDisc"
QT_MOC_LITERAL(8, 73, 8), // "ssSquare"
QT_MOC_LITERAL(9, 82, 9), // "ssDiamond"
QT_MOC_LITERAL(10, 92, 6), // "ssStar"
QT_MOC_LITERAL(11, 99, 10), // "ssTriangle"
QT_MOC_LITERAL(12, 110, 18), // "ssTriangleInverted"
QT_MOC_LITERAL(13, 129, 13), // "ssCrossSquare"
QT_MOC_LITERAL(14, 143, 12), // "ssPlusSquare"
QT_MOC_LITERAL(15, 156, 13), // "ssCrossCircle"
QT_MOC_LITERAL(16, 170, 12), // "ssPlusCircle"
QT_MOC_LITERAL(17, 183, 7), // "ssPeace"
QT_MOC_LITERAL(18, 191, 8), // "ssPixmap"
QT_MOC_LITERAL(19, 200, 8) // "ssCustom"
},
"QCPScatterStyle\0ScatterShape\0ssNone\0"
"ssDot\0ssCross\0ssPlus\0ssCircle\0ssDisc\0"
"ssSquare\0ssDiamond\0ssStar\0ssTriangle\0"
"ssTriangleInverted\0ssCrossSquare\0"
"ssPlusSquare\0ssCrossCircle\0ssPlusCircle\0"
"ssPeace\0ssPixmap\0ssCustom"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPScatterStyle[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 18, 18,
// enum data: key, value
2, uint(QCPScatterStyle::ssNone),
3, uint(QCPScatterStyle::ssDot),
4, uint(QCPScatterStyle::ssCross),
5, uint(QCPScatterStyle::ssPlus),
6, uint(QCPScatterStyle::ssCircle),
7, uint(QCPScatterStyle::ssDisc),
8, uint(QCPScatterStyle::ssSquare),
9, uint(QCPScatterStyle::ssDiamond),
10, uint(QCPScatterStyle::ssStar),
11, uint(QCPScatterStyle::ssTriangle),
12, uint(QCPScatterStyle::ssTriangleInverted),
13, uint(QCPScatterStyle::ssCrossSquare),
14, uint(QCPScatterStyle::ssPlusSquare),
15, uint(QCPScatterStyle::ssCrossCircle),
16, uint(QCPScatterStyle::ssPlusCircle),
17, uint(QCPScatterStyle::ssPeace),
18, uint(QCPScatterStyle::ssPixmap),
19, uint(QCPScatterStyle::ssCustom),
0 // eod
};
QT_INIT_METAOBJECT const QMetaObject QCPScatterStyle::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPScatterStyle.data,
qt_meta_data_QCPScatterStyle, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPPainter_t {
QByteArrayData data[7];
char stringdata0[85];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPPainter_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPPainter_t qt_meta_stringdata_QCPPainter = {
{
QT_MOC_LITERAL(0, 0, 10), // "QCPPainter"
QT_MOC_LITERAL(1, 11, 11), // "PainterMode"
QT_MOC_LITERAL(2, 23, 9), // "pmDefault"
QT_MOC_LITERAL(3, 33, 12), // "pmVectorized"
QT_MOC_LITERAL(4, 46, 11), // "pmNoCaching"
QT_MOC_LITERAL(5, 58, 13), // "pmNonCosmetic"
QT_MOC_LITERAL(6, 72, 12) // "PainterModes"
},
"QCPPainter\0PainterMode\0pmDefault\0"
"pmVectorized\0pmNoCaching\0pmNonCosmetic\0"
"PainterModes"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPPainter[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
2, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x1, 4, 22,
6, 0x1, 4, 30,
// enum data: key, value
2, uint(QCPPainter::pmDefault),
3, uint(QCPPainter::pmVectorized),
4, uint(QCPPainter::pmNoCaching),
5, uint(QCPPainter::pmNonCosmetic),
2, uint(QCPPainter::pmDefault),
3, uint(QCPPainter::pmVectorized),
4, uint(QCPPainter::pmNoCaching),
5, uint(QCPPainter::pmNonCosmetic),
0 // eod
};
QT_INIT_METAOBJECT const QMetaObject QCPPainter::staticMetaObject = {
{ &QPainter::staticMetaObject, qt_meta_stringdata_QCPPainter.data,
qt_meta_data_QCPPainter, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPLayer_t {
QByteArrayData data[8];
char stringdata0[82];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayer_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayer_t qt_meta_stringdata_QCPLayer = {
{
QT_MOC_LITERAL(0, 0, 8), // "QCPLayer"
QT_MOC_LITERAL(1, 9, 10), // "parentPlot"
QT_MOC_LITERAL(2, 20, 12), // "QCustomPlot*"
QT_MOC_LITERAL(3, 33, 4), // "name"
QT_MOC_LITERAL(4, 38, 5), // "index"
QT_MOC_LITERAL(5, 44, 8), // "children"
QT_MOC_LITERAL(6, 53, 20), // "QList<QCPLayerable*>"
QT_MOC_LITERAL(7, 74, 7) // "visible"
},
"QCPLayer\0parentPlot\0QCustomPlot*\0name\0"
"index\0children\0QList<QCPLayerable*>\0"
"visible"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayer[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
5, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x00095009,
3, QMetaType::QString, 0x00095001,
4, QMetaType::Int, 0x00095001,
5, 0x80000000 | 6, 0x00095009,
7, QMetaType::Bool, 0x00095103,
0 // eod
};
void QCPLayer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCustomPlot* >(); break;
case 3:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QList<QCPLayerable*> >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayer *_t = static_cast<QCPLayer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCustomPlot**>(_v) = _t->parentPlot(); break;
case 1: *reinterpret_cast< QString*>(_v) = _t->name(); break;
case 2: *reinterpret_cast< int*>(_v) = _t->index(); break;
case 3: *reinterpret_cast< QList<QCPLayerable*>*>(_v) = _t->children(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->visible(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayer *_t = static_cast<QCPLayer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 4: _t->setVisible(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
QT_INIT_METAOBJECT const QMetaObject QCPLayer::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPLayer.data,
qt_meta_data_QCPLayer, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayer::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayer::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayer.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPLayer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPLayerable_t {
QByteArrayData data[13];
char stringdata0[135];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayerable_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayerable_t qt_meta_stringdata_QCPLayerable = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPLayerable"
QT_MOC_LITERAL(1, 13, 12), // "layerChanged"
QT_MOC_LITERAL(2, 26, 0), // ""
QT_MOC_LITERAL(3, 27, 9), // "QCPLayer*"
QT_MOC_LITERAL(4, 37, 8), // "newLayer"
QT_MOC_LITERAL(5, 46, 8), // "setLayer"
QT_MOC_LITERAL(6, 55, 5), // "layer"
QT_MOC_LITERAL(7, 61, 7), // "visible"
QT_MOC_LITERAL(8, 69, 10), // "parentPlot"
QT_MOC_LITERAL(9, 80, 12), // "QCustomPlot*"
QT_MOC_LITERAL(10, 93, 15), // "parentLayerable"
QT_MOC_LITERAL(11, 109, 13), // "QCPLayerable*"
QT_MOC_LITERAL(12, 123, 11) // "antialiased"
},
"QCPLayerable\0layerChanged\0\0QCPLayer*\0"
"newLayer\0setLayer\0layer\0visible\0"
"parentPlot\0QCustomPlot*\0parentLayerable\0"
"QCPLayerable*\0antialiased"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayerable[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
5, 30, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 24, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
5, 1, 27, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
// slots: parameters
QMetaType::Bool, 0x80000000 | 3, 6,
// properties: name, type, flags
7, QMetaType::Bool, 0x00095103,
8, 0x80000000 | 9, 0x00095009,
10, 0x80000000 | 11, 0x00095009,
6, 0x80000000 | 3, 0x0049510b,
12, QMetaType::Bool, 0x00095103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0 // eod
};
void QCPLayerable::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPLayerable *_t = static_cast<QCPLayerable *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->layerChanged((*reinterpret_cast< QCPLayer*(*)>(_a[1]))); break;
case 1: { bool _r = _t->setLayer((*reinterpret_cast< QCPLayer*(*)>(_a[1])));
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = std::move(_r); } break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayer* >(); break;
}
break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayer* >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPLayerable::*)(QCPLayer * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPLayerable::layerChanged)) {
*result = 0;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 3:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayer* >(); break;
case 2:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayerable* >(); break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCustomPlot* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayerable *_t = static_cast<QCPLayerable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< bool*>(_v) = _t->visible(); break;
case 1: *reinterpret_cast< QCustomPlot**>(_v) = _t->parentPlot(); break;
case 2: *reinterpret_cast< QCPLayerable**>(_v) = _t->parentLayerable(); break;
case 3: *reinterpret_cast< QCPLayer**>(_v) = _t->layer(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->antialiased(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayerable *_t = static_cast<QCPLayerable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setVisible(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setLayer(*reinterpret_cast< QCPLayer**>(_v)); break;
case 4: _t->setAntialiased(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCPLayerable::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPLayerable.data,
qt_meta_data_QCPLayerable, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayerable::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayerable::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayerable.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPLayerable::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPLayerable::layerChanged(QCPLayer * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
struct qt_meta_stringdata_QCPMarginGroup_t {
QByteArrayData data[1];
char stringdata0[15];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPMarginGroup_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPMarginGroup_t qt_meta_stringdata_QCPMarginGroup = {
{
QT_MOC_LITERAL(0, 0, 14) // "QCPMarginGroup"
},
"QCPMarginGroup"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPMarginGroup[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void QCPMarginGroup::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPMarginGroup::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPMarginGroup.data,
qt_meta_data_QCPMarginGroup, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPMarginGroup::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPMarginGroup::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPMarginGroup.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPMarginGroup::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLayoutElement_t {
QByteArrayData data[14];
char stringdata0[151];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayoutElement_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayoutElement_t qt_meta_stringdata_QCPLayoutElement = {
{
QT_MOC_LITERAL(0, 0, 16), // "QCPLayoutElement"
QT_MOC_LITERAL(1, 17, 6), // "layout"
QT_MOC_LITERAL(2, 24, 10), // "QCPLayout*"
QT_MOC_LITERAL(3, 35, 4), // "rect"
QT_MOC_LITERAL(4, 40, 9), // "outerRect"
QT_MOC_LITERAL(5, 50, 7), // "margins"
QT_MOC_LITERAL(6, 58, 8), // "QMargins"
QT_MOC_LITERAL(7, 67, 14), // "minimumMargins"
QT_MOC_LITERAL(8, 82, 11), // "minimumSize"
QT_MOC_LITERAL(9, 94, 11), // "maximumSize"
QT_MOC_LITERAL(10, 106, 11), // "UpdatePhase"
QT_MOC_LITERAL(11, 118, 13), // "upPreparation"
QT_MOC_LITERAL(12, 132, 9), // "upMargins"
QT_MOC_LITERAL(13, 142, 8) // "upLayout"
},
"QCPLayoutElement\0layout\0QCPLayout*\0"
"rect\0outerRect\0margins\0QMargins\0"
"minimumMargins\0minimumSize\0maximumSize\0"
"UpdatePhase\0upPreparation\0upMargins\0"
"upLayout"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayoutElement[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
7, 14, // properties
1, 35, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x00095009,
3, QMetaType::QRect, 0x00095001,
4, QMetaType::QRect, 0x00095103,
5, 0x80000000 | 6, 0x0009510b,
7, 0x80000000 | 6, 0x0009510b,
8, QMetaType::QSize, 0x00095103,
9, QMetaType::QSize, 0x00095103,
// enums: name, flags, count, data
10, 0x0, 3, 39,
// enum data: key, value
11, uint(QCPLayoutElement::upPreparation),
12, uint(QCPLayoutElement::upMargins),
13, uint(QCPLayoutElement::upLayout),
0 // eod
};
void QCPLayoutElement::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayout* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayoutElement *_t = static_cast<QCPLayoutElement *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPLayout**>(_v) = _t->layout(); break;
case 1: *reinterpret_cast< QRect*>(_v) = _t->rect(); break;
case 2: *reinterpret_cast< QRect*>(_v) = _t->outerRect(); break;
case 3: *reinterpret_cast< QMargins*>(_v) = _t->margins(); break;
case 4: *reinterpret_cast< QMargins*>(_v) = _t->minimumMargins(); break;
case 5: *reinterpret_cast< QSize*>(_v) = _t->minimumSize(); break;
case 6: *reinterpret_cast< QSize*>(_v) = _t->maximumSize(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayoutElement *_t = static_cast<QCPLayoutElement *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 2: _t->setOuterRect(*reinterpret_cast< QRect*>(_v)); break;
case 3: _t->setMargins(*reinterpret_cast< QMargins*>(_v)); break;
case 4: _t->setMinimumMargins(*reinterpret_cast< QMargins*>(_v)); break;
case 5: _t->setMinimumSize(*reinterpret_cast< QSize*>(_v)); break;
case 6: _t->setMaximumSize(*reinterpret_cast< QSize*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
QT_INIT_METAOBJECT const QMetaObject QCPLayoutElement::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPLayoutElement.data,
qt_meta_data_QCPLayoutElement, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayoutElement::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayoutElement::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayoutElement.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPLayoutElement::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPLayout_t {
QByteArrayData data[1];
char stringdata0[10];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayout_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayout_t qt_meta_stringdata_QCPLayout = {
{
QT_MOC_LITERAL(0, 0, 9) // "QCPLayout"
},
"QCPLayout"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayout[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void QCPLayout::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPLayout::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPLayout.data,
qt_meta_data_QCPLayout, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayout::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayout::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayout.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPLayout::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLayoutGrid_t {
QByteArrayData data[8];
char stringdata0[113];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayoutGrid_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayoutGrid_t qt_meta_stringdata_QCPLayoutGrid = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPLayoutGrid"
QT_MOC_LITERAL(1, 14, 8), // "rowCount"
QT_MOC_LITERAL(2, 23, 11), // "columnCount"
QT_MOC_LITERAL(3, 35, 20), // "columnStretchFactors"
QT_MOC_LITERAL(4, 56, 13), // "QList<double>"
QT_MOC_LITERAL(5, 70, 17), // "rowStretchFactors"
QT_MOC_LITERAL(6, 88, 13), // "columnSpacing"
QT_MOC_LITERAL(7, 102, 10) // "rowSpacing"
},
"QCPLayoutGrid\0rowCount\0columnCount\0"
"columnStretchFactors\0QList<double>\0"
"rowStretchFactors\0columnSpacing\0"
"rowSpacing"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayoutGrid[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
6, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Int, 0x00095001,
2, QMetaType::Int, 0x00095001,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 4, 0x0009510b,
6, QMetaType::Int, 0x00095103,
7, QMetaType::Int, 0x00095103,
0 // eod
};
void QCPLayoutGrid::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 3:
case 2:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QList<double> >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayoutGrid *_t = static_cast<QCPLayoutGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< int*>(_v) = _t->rowCount(); break;
case 1: *reinterpret_cast< int*>(_v) = _t->columnCount(); break;
case 2: *reinterpret_cast< QList<double>*>(_v) = _t->columnStretchFactors(); break;
case 3: *reinterpret_cast< QList<double>*>(_v) = _t->rowStretchFactors(); break;
case 4: *reinterpret_cast< int*>(_v) = _t->columnSpacing(); break;
case 5: *reinterpret_cast< int*>(_v) = _t->rowSpacing(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayoutGrid *_t = static_cast<QCPLayoutGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 2: _t->setColumnStretchFactors(*reinterpret_cast< QList<double>*>(_v)); break;
case 3: _t->setRowStretchFactors(*reinterpret_cast< QList<double>*>(_v)); break;
case 4: _t->setColumnSpacing(*reinterpret_cast< int*>(_v)); break;
case 5: _t->setRowSpacing(*reinterpret_cast< int*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
QT_INIT_METAOBJECT const QMetaObject QCPLayoutGrid::staticMetaObject = {
{ &QCPLayout::staticMetaObject, qt_meta_stringdata_QCPLayoutGrid.data,
qt_meta_data_QCPLayoutGrid, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayoutGrid::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayoutGrid::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayoutGrid.stringdata0))
return static_cast<void*>(this);
return QCPLayout::qt_metacast(_clname);
}
int QCPLayoutGrid::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayout::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPLayoutInset_t {
QByteArrayData data[1];
char stringdata0[15];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayoutInset_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayoutInset_t qt_meta_stringdata_QCPLayoutInset = {
{
QT_MOC_LITERAL(0, 0, 14) // "QCPLayoutInset"
},
"QCPLayoutInset"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayoutInset[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void QCPLayoutInset::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPLayoutInset::staticMetaObject = {
{ &QCPLayout::staticMetaObject, qt_meta_stringdata_QCPLayoutInset.data,
qt_meta_data_QCPLayoutInset, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayoutInset::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayoutInset::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayoutInset.stringdata0))
return static_cast<void*>(this);
return QCPLayout::qt_metacast(_clname);
}
int QCPLayoutInset::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayout::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLineEnding_t {
QByteArrayData data[12];
char stringdata0[124];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLineEnding_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLineEnding_t qt_meta_stringdata_QCPLineEnding = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPLineEnding"
QT_MOC_LITERAL(1, 14, 11), // "EndingStyle"
QT_MOC_LITERAL(2, 26, 6), // "esNone"
QT_MOC_LITERAL(3, 33, 11), // "esFlatArrow"
QT_MOC_LITERAL(4, 45, 12), // "esSpikeArrow"
QT_MOC_LITERAL(5, 58, 11), // "esLineArrow"
QT_MOC_LITERAL(6, 70, 6), // "esDisc"
QT_MOC_LITERAL(7, 77, 8), // "esSquare"
QT_MOC_LITERAL(8, 86, 9), // "esDiamond"
QT_MOC_LITERAL(9, 96, 5), // "esBar"
QT_MOC_LITERAL(10, 102, 9), // "esHalfBar"
QT_MOC_LITERAL(11, 112, 11) // "esSkewedBar"
},
"QCPLineEnding\0EndingStyle\0esNone\0"
"esFlatArrow\0esSpikeArrow\0esLineArrow\0"
"esDisc\0esSquare\0esDiamond\0esBar\0"
"esHalfBar\0esSkewedBar"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLineEnding[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 10, 18,
// enum data: key, value
2, uint(QCPLineEnding::esNone),
3, uint(QCPLineEnding::esFlatArrow),
4, uint(QCPLineEnding::esSpikeArrow),
5, uint(QCPLineEnding::esLineArrow),
6, uint(QCPLineEnding::esDisc),
7, uint(QCPLineEnding::esSquare),
8, uint(QCPLineEnding::esDiamond),
9, uint(QCPLineEnding::esBar),
10, uint(QCPLineEnding::esHalfBar),
11, uint(QCPLineEnding::esSkewedBar),
0 // eod
};
QT_INIT_METAOBJECT const QMetaObject QCPLineEnding::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPLineEnding.data,
qt_meta_data_QCPLineEnding, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPGrid_t {
QByteArrayData data[7];
char stringdata0[89];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPGrid_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPGrid_t qt_meta_stringdata_QCPGrid = {
{
QT_MOC_LITERAL(0, 0, 7), // "QCPGrid"
QT_MOC_LITERAL(1, 8, 14), // "subGridVisible"
QT_MOC_LITERAL(2, 23, 18), // "antialiasedSubGrid"
QT_MOC_LITERAL(3, 42, 19), // "antialiasedZeroLine"
QT_MOC_LITERAL(4, 62, 3), // "pen"
QT_MOC_LITERAL(5, 66, 10), // "subGridPen"
QT_MOC_LITERAL(6, 77, 11) // "zeroLinePen"
},
"QCPGrid\0subGridVisible\0antialiasedSubGrid\0"
"antialiasedZeroLine\0pen\0subGridPen\0"
"zeroLinePen"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPGrid[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
6, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Bool, 0x00095103,
2, QMetaType::Bool, 0x00095103,
3, QMetaType::Bool, 0x00095103,
4, QMetaType::QPen, 0x00095103,
5, QMetaType::QPen, 0x00095103,
6, QMetaType::QPen, 0x00095103,
0 // eod
};
void QCPGrid::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPGrid *_t = static_cast<QCPGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< bool*>(_v) = _t->subGridVisible(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->antialiasedSubGrid(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->antialiasedZeroLine(); break;
case 3: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 4: *reinterpret_cast< QPen*>(_v) = _t->subGridPen(); break;
case 5: *reinterpret_cast< QPen*>(_v) = _t->zeroLinePen(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPGrid *_t = static_cast<QCPGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setSubGridVisible(*reinterpret_cast< bool*>(_v)); break;
case 1: _t->setAntialiasedSubGrid(*reinterpret_cast< bool*>(_v)); break;
case 2: _t->setAntialiasedZeroLine(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 4: _t->setSubGridPen(*reinterpret_cast< QPen*>(_v)); break;
case 5: _t->setZeroLinePen(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPGrid::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPGrid.data,
qt_meta_data_QCPGrid, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPGrid::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPGrid::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPGrid.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPGrid::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPAxis_t {
QByteArrayData data[97];
char stringdata0[1196];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxis_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxis_t qt_meta_stringdata_QCPAxis = {
{
QT_MOC_LITERAL(0, 0, 7), // "QCPAxis"
QT_MOC_LITERAL(1, 8, 12), // "ticksRequest"
QT_MOC_LITERAL(2, 21, 0), // ""
QT_MOC_LITERAL(3, 22, 12), // "rangeChanged"
QT_MOC_LITERAL(4, 35, 8), // "QCPRange"
QT_MOC_LITERAL(5, 44, 8), // "newRange"
QT_MOC_LITERAL(6, 53, 8), // "oldRange"
QT_MOC_LITERAL(7, 62, 16), // "scaleTypeChanged"
QT_MOC_LITERAL(8, 79, 18), // "QCPAxis::ScaleType"
QT_MOC_LITERAL(9, 98, 9), // "scaleType"
QT_MOC_LITERAL(10, 108, 16), // "selectionChanged"
QT_MOC_LITERAL(11, 125, 24), // "QCPAxis::SelectableParts"
QT_MOC_LITERAL(12, 150, 5), // "parts"
QT_MOC_LITERAL(13, 156, 17), // "selectableChanged"
QT_MOC_LITERAL(14, 174, 12), // "setScaleType"
QT_MOC_LITERAL(15, 187, 4), // "type"
QT_MOC_LITERAL(16, 192, 8), // "setRange"
QT_MOC_LITERAL(17, 201, 5), // "range"
QT_MOC_LITERAL(18, 207, 18), // "setSelectableParts"
QT_MOC_LITERAL(19, 226, 15), // "selectableParts"
QT_MOC_LITERAL(20, 242, 16), // "setSelectedParts"
QT_MOC_LITERAL(21, 259, 13), // "selectedParts"
QT_MOC_LITERAL(22, 273, 8), // "axisType"
QT_MOC_LITERAL(23, 282, 8), // "AxisType"
QT_MOC_LITERAL(24, 291, 8), // "axisRect"
QT_MOC_LITERAL(25, 300, 12), // "QCPAxisRect*"
QT_MOC_LITERAL(26, 313, 9), // "ScaleType"
QT_MOC_LITERAL(27, 323, 12), // "scaleLogBase"
QT_MOC_LITERAL(28, 336, 13), // "rangeReversed"
QT_MOC_LITERAL(29, 350, 9), // "autoTicks"
QT_MOC_LITERAL(30, 360, 13), // "autoTickCount"
QT_MOC_LITERAL(31, 374, 14), // "autoTickLabels"
QT_MOC_LITERAL(32, 389, 12), // "autoTickStep"
QT_MOC_LITERAL(33, 402, 12), // "autoSubTicks"
QT_MOC_LITERAL(34, 415, 5), // "ticks"
QT_MOC_LITERAL(35, 421, 10), // "tickLabels"
QT_MOC_LITERAL(36, 432, 16), // "tickLabelPadding"
QT_MOC_LITERAL(37, 449, 13), // "tickLabelType"
QT_MOC_LITERAL(38, 463, 9), // "LabelType"
QT_MOC_LITERAL(39, 473, 13), // "tickLabelFont"
QT_MOC_LITERAL(40, 487, 14), // "tickLabelColor"
QT_MOC_LITERAL(41, 502, 17), // "tickLabelRotation"
QT_MOC_LITERAL(42, 520, 13), // "tickLabelSide"
QT_MOC_LITERAL(43, 534, 9), // "LabelSide"
QT_MOC_LITERAL(44, 544, 14), // "dateTimeFormat"
QT_MOC_LITERAL(45, 559, 12), // "dateTimeSpec"
QT_MOC_LITERAL(46, 572, 12), // "Qt::TimeSpec"
QT_MOC_LITERAL(47, 585, 12), // "numberFormat"
QT_MOC_LITERAL(48, 598, 15), // "numberPrecision"
QT_MOC_LITERAL(49, 614, 8), // "tickStep"
QT_MOC_LITERAL(50, 623, 10), // "tickVector"
QT_MOC_LITERAL(51, 634, 15), // "QVector<double>"
QT_MOC_LITERAL(52, 650, 16), // "tickVectorLabels"
QT_MOC_LITERAL(53, 667, 16), // "QVector<QString>"
QT_MOC_LITERAL(54, 684, 12), // "tickLengthIn"
QT_MOC_LITERAL(55, 697, 13), // "tickLengthOut"
QT_MOC_LITERAL(56, 711, 12), // "subTickCount"
QT_MOC_LITERAL(57, 724, 15), // "subTickLengthIn"
QT_MOC_LITERAL(58, 740, 16), // "subTickLengthOut"
QT_MOC_LITERAL(59, 757, 7), // "basePen"
QT_MOC_LITERAL(60, 765, 7), // "tickPen"
QT_MOC_LITERAL(61, 773, 10), // "subTickPen"
QT_MOC_LITERAL(62, 784, 9), // "labelFont"
QT_MOC_LITERAL(63, 794, 10), // "labelColor"
QT_MOC_LITERAL(64, 805, 5), // "label"
QT_MOC_LITERAL(65, 811, 12), // "labelPadding"
QT_MOC_LITERAL(66, 824, 7), // "padding"
QT_MOC_LITERAL(67, 832, 6), // "offset"
QT_MOC_LITERAL(68, 839, 15), // "SelectableParts"
QT_MOC_LITERAL(69, 855, 21), // "selectedTickLabelFont"
QT_MOC_LITERAL(70, 877, 17), // "selectedLabelFont"
QT_MOC_LITERAL(71, 895, 22), // "selectedTickLabelColor"
QT_MOC_LITERAL(72, 918, 18), // "selectedLabelColor"
QT_MOC_LITERAL(73, 937, 15), // "selectedBasePen"
QT_MOC_LITERAL(74, 953, 15), // "selectedTickPen"
QT_MOC_LITERAL(75, 969, 18), // "selectedSubTickPen"
QT_MOC_LITERAL(76, 988, 11), // "lowerEnding"
QT_MOC_LITERAL(77, 1000, 13), // "QCPLineEnding"
QT_MOC_LITERAL(78, 1014, 11), // "upperEnding"
QT_MOC_LITERAL(79, 1026, 4), // "grid"
QT_MOC_LITERAL(80, 1031, 8), // "QCPGrid*"
QT_MOC_LITERAL(81, 1040, 6), // "atLeft"
QT_MOC_LITERAL(82, 1047, 7), // "atRight"
QT_MOC_LITERAL(83, 1055, 5), // "atTop"
QT_MOC_LITERAL(84, 1061, 8), // "atBottom"
QT_MOC_LITERAL(85, 1070, 9), // "AxisTypes"
QT_MOC_LITERAL(86, 1080, 8), // "ltNumber"
QT_MOC_LITERAL(87, 1089, 10), // "ltDateTime"
QT_MOC_LITERAL(88, 1100, 8), // "lsInside"
QT_MOC_LITERAL(89, 1109, 9), // "lsOutside"
QT_MOC_LITERAL(90, 1119, 8), // "stLinear"
QT_MOC_LITERAL(91, 1128, 13), // "stLogarithmic"
QT_MOC_LITERAL(92, 1142, 14), // "SelectablePart"
QT_MOC_LITERAL(93, 1157, 6), // "spNone"
QT_MOC_LITERAL(94, 1164, 6), // "spAxis"
QT_MOC_LITERAL(95, 1171, 12), // "spTickLabels"
QT_MOC_LITERAL(96, 1184, 11) // "spAxisLabel"
},
"QCPAxis\0ticksRequest\0\0rangeChanged\0"
"QCPRange\0newRange\0oldRange\0scaleTypeChanged\0"
"QCPAxis::ScaleType\0scaleType\0"
"selectionChanged\0QCPAxis::SelectableParts\0"
"parts\0selectableChanged\0setScaleType\0"
"type\0setRange\0range\0setSelectableParts\0"
"selectableParts\0setSelectedParts\0"
"selectedParts\0axisType\0AxisType\0"
"axisRect\0QCPAxisRect*\0ScaleType\0"
"scaleLogBase\0rangeReversed\0autoTicks\0"
"autoTickCount\0autoTickLabels\0autoTickStep\0"
"autoSubTicks\0ticks\0tickLabels\0"
"tickLabelPadding\0tickLabelType\0LabelType\0"
"tickLabelFont\0tickLabelColor\0"
"tickLabelRotation\0tickLabelSide\0"
"LabelSide\0dateTimeFormat\0dateTimeSpec\0"
"Qt::TimeSpec\0numberFormat\0numberPrecision\0"
"tickStep\0tickVector\0QVector<double>\0"
"tickVectorLabels\0QVector<QString>\0"
"tickLengthIn\0tickLengthOut\0subTickCount\0"
"subTickLengthIn\0subTickLengthOut\0"
"basePen\0tickPen\0subTickPen\0labelFont\0"
"labelColor\0label\0labelPadding\0padding\0"
"offset\0SelectableParts\0selectedTickLabelFont\0"
"selectedLabelFont\0selectedTickLabelColor\0"
"selectedLabelColor\0selectedBasePen\0"
"selectedTickPen\0selectedSubTickPen\0"
"lowerEnding\0QCPLineEnding\0upperEnding\0"
"grid\0QCPGrid*\0atLeft\0atRight\0atTop\0"
"atBottom\0AxisTypes\0ltNumber\0ltDateTime\0"
"lsInside\0lsOutside\0stLinear\0stLogarithmic\0"
"SelectablePart\0spNone\0spAxis\0spTickLabels\0"
"spAxisLabel"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxis[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
10, 14, // methods
52, 94, // properties
7, 302, // enums/sets
0, 0, // constructors
0, // flags
6, // signalCount
// signals: name, argc, parameters, tag, flags
1, 0, 64, 2, 0x06 /* Public */,
3, 1, 65, 2, 0x06 /* Public */,
3, 2, 68, 2, 0x06 /* Public */,
7, 1, 73, 2, 0x06 /* Public */,
10, 1, 76, 2, 0x06 /* Public */,
13, 1, 79, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
14, 1, 82, 2, 0x0a /* Public */,
16, 1, 85, 2, 0x0a /* Public */,
18, 1, 88, 2, 0x0a /* Public */,
20, 1, 91, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void,
QMetaType::Void, 0x80000000 | 4, 5,
QMetaType::Void, 0x80000000 | 4, 0x80000000 | 4, 5, 6,
QMetaType::Void, 0x80000000 | 8, 9,
QMetaType::Void, 0x80000000 | 11, 12,
QMetaType::Void, 0x80000000 | 11, 12,
// slots: parameters
QMetaType::Void, 0x80000000 | 8, 15,
QMetaType::Void, 0x80000000 | 4, 17,
QMetaType::Void, 0x80000000 | 11, 19,
QMetaType::Void, 0x80000000 | 11, 21,
// properties: name, type, flags
22, 0x80000000 | 23, 0x00095009,
24, 0x80000000 | 25, 0x00095009,
9, 0x80000000 | 26, 0x0049510b,
27, QMetaType::Double, 0x00095103,
17, 0x80000000 | 4, 0x0049510b,
28, QMetaType::Bool, 0x00095103,
29, QMetaType::Bool, 0x00095103,
30, QMetaType::Int, 0x00095103,
31, QMetaType::Bool, 0x00095103,
32, QMetaType::Bool, 0x00095103,
33, QMetaType::Bool, 0x00095103,
34, QMetaType::Bool, 0x00095103,
35, QMetaType::Bool, 0x00095103,
36, QMetaType::Int, 0x00095103,
37, 0x80000000 | 38, 0x0009510b,
39, QMetaType::QFont, 0x00095103,
40, QMetaType::QColor, 0x00095103,
41, QMetaType::Double, 0x00095103,
42, 0x80000000 | 43, 0x0009510b,
44, QMetaType::QString, 0x00095103,
45, 0x80000000 | 46, 0x0009510b,
47, QMetaType::QString, 0x00095103,
48, QMetaType::Int, 0x00095103,
49, QMetaType::Double, 0x00095103,
50, 0x80000000 | 51, 0x0009510b,
52, 0x80000000 | 53, 0x0009510b,
54, QMetaType::Int, 0x00095103,
55, QMetaType::Int, 0x00095103,
56, QMetaType::Int, 0x00095103,
57, QMetaType::Int, 0x00095103,
58, QMetaType::Int, 0x00095103,
59, QMetaType::QPen, 0x00095103,
60, QMetaType::QPen, 0x00095103,
61, QMetaType::QPen, 0x00095103,
62, QMetaType::QFont, 0x00095103,
63, QMetaType::QColor, 0x00095103,
64, QMetaType::QString, 0x00095103,
65, QMetaType::Int, 0x00095103,
66, QMetaType::Int, 0x00095103,
67, QMetaType::Int, 0x00095103,
21, 0x80000000 | 68, 0x0049510b,
19, 0x80000000 | 68, 0x0049510b,
69, QMetaType::QFont, 0x00095103,
70, QMetaType::QFont, 0x00095103,
71, QMetaType::QColor, 0x00095103,
72, QMetaType::QColor, 0x00095103,
73, QMetaType::QPen, 0x00095103,
74, QMetaType::QPen, 0x00095103,
75, QMetaType::QPen, 0x00095103,
76, 0x80000000 | 77, 0x0009510b,
78, 0x80000000 | 77, 0x0009510b,
79, 0x80000000 | 80, 0x00095009,
// properties: notify_signal_id
0,
0,
3,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
// enums: name, flags, count, data
23, 0x1, 4, 330,
85, 0x1, 4, 338,
38, 0x0, 2, 346,
43, 0x0, 2, 350,
26, 0x0, 2, 354,
92, 0x1, 4, 358,
68, 0x1, 4, 366,
// enum data: key, value
81, uint(QCPAxis::atLeft),
82, uint(QCPAxis::atRight),
83, uint(QCPAxis::atTop),
84, uint(QCPAxis::atBottom),
81, uint(QCPAxis::atLeft),
82, uint(QCPAxis::atRight),
83, uint(QCPAxis::atTop),
84, uint(QCPAxis::atBottom),
86, uint(QCPAxis::ltNumber),
87, uint(QCPAxis::ltDateTime),
88, uint(QCPAxis::lsInside),
89, uint(QCPAxis::lsOutside),
90, uint(QCPAxis::stLinear),
91, uint(QCPAxis::stLogarithmic),
93, uint(QCPAxis::spNone),
94, uint(QCPAxis::spAxis),
95, uint(QCPAxis::spTickLabels),
96, uint(QCPAxis::spAxisLabel),
93, uint(QCPAxis::spNone),
94, uint(QCPAxis::spAxis),
95, uint(QCPAxis::spTickLabels),
96, uint(QCPAxis::spAxisLabel),
0 // eod
};
void QCPAxis::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAxis *_t = static_cast<QCPAxis *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->ticksRequest(); break;
case 1: _t->rangeChanged((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 2: _t->rangeChanged((*reinterpret_cast< const QCPRange(*)>(_a[1])),(*reinterpret_cast< const QCPRange(*)>(_a[2]))); break;
case 3: _t->scaleTypeChanged((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 4: _t->selectionChanged((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 5: _t->selectableChanged((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 6: _t->setScaleType((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 7: _t->setRange((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 8: _t->setSelectableParts((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 9: _t->setSelectedParts((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPAxis::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::ticksRequest)) {
*result = 0;
return;
}
}
{
using _t = void (QCPAxis::*)(const QCPRange & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::rangeChanged)) {
*result = 1;
return;
}
}
{
using _t = void (QCPAxis::*)(const QCPRange & , const QCPRange & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::rangeChanged)) {
*result = 2;
return;
}
}
{
using _t = void (QCPAxis::*)(QCPAxis::ScaleType );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::scaleTypeChanged)) {
*result = 3;
return;
}
}
{
using _t = void (QCPAxis::*)(const QCPAxis::SelectableParts & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::selectionChanged)) {
*result = 4;
return;
}
}
{
using _t = void (QCPAxis::*)(const QCPAxis::SelectableParts & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::selectableChanged)) {
*result = 5;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxisRect* >(); break;
case 51:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPGrid* >(); break;
case 25:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QVector<QString> >(); break;
case 24:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QVector<double> >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAxis *_t = static_cast<QCPAxis *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast<int*>(_v) = QFlag(_t->axisType()); break;
case 1: *reinterpret_cast< QCPAxisRect**>(_v) = _t->axisRect(); break;
case 2: *reinterpret_cast< ScaleType*>(_v) = _t->scaleType(); break;
case 3: *reinterpret_cast< double*>(_v) = _t->scaleLogBase(); break;
case 4: *reinterpret_cast< QCPRange*>(_v) = _t->range(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->rangeReversed(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->autoTicks(); break;
case 7: *reinterpret_cast< int*>(_v) = _t->autoTickCount(); break;
case 8: *reinterpret_cast< bool*>(_v) = _t->autoTickLabels(); break;
case 9: *reinterpret_cast< bool*>(_v) = _t->autoTickStep(); break;
case 10: *reinterpret_cast< bool*>(_v) = _t->autoSubTicks(); break;
case 11: *reinterpret_cast< bool*>(_v) = _t->ticks(); break;
case 12: *reinterpret_cast< bool*>(_v) = _t->tickLabels(); break;
case 13: *reinterpret_cast< int*>(_v) = _t->tickLabelPadding(); break;
case 14: *reinterpret_cast< LabelType*>(_v) = _t->tickLabelType(); break;
case 15: *reinterpret_cast< QFont*>(_v) = _t->tickLabelFont(); break;
case 16: *reinterpret_cast< QColor*>(_v) = _t->tickLabelColor(); break;
case 17: *reinterpret_cast< double*>(_v) = _t->tickLabelRotation(); break;
case 18: *reinterpret_cast< LabelSide*>(_v) = _t->tickLabelSide(); break;
case 19: *reinterpret_cast< QString*>(_v) = _t->dateTimeFormat(); break;
case 20: *reinterpret_cast< Qt::TimeSpec*>(_v) = _t->dateTimeSpec(); break;
case 21: *reinterpret_cast< QString*>(_v) = _t->numberFormat(); break;
case 22: *reinterpret_cast< int*>(_v) = _t->numberPrecision(); break;
case 23: *reinterpret_cast< double*>(_v) = _t->tickStep(); break;
case 24: *reinterpret_cast< QVector<double>*>(_v) = _t->tickVector(); break;
case 25: *reinterpret_cast< QVector<QString>*>(_v) = _t->tickVectorLabels(); break;
case 26: *reinterpret_cast< int*>(_v) = _t->tickLengthIn(); break;
case 27: *reinterpret_cast< int*>(_v) = _t->tickLengthOut(); break;
case 28: *reinterpret_cast< int*>(_v) = _t->subTickCount(); break;
case 29: *reinterpret_cast< int*>(_v) = _t->subTickLengthIn(); break;
case 30: *reinterpret_cast< int*>(_v) = _t->subTickLengthOut(); break;
case 31: *reinterpret_cast< QPen*>(_v) = _t->basePen(); break;
case 32: *reinterpret_cast< QPen*>(_v) = _t->tickPen(); break;
case 33: *reinterpret_cast< QPen*>(_v) = _t->subTickPen(); break;
case 34: *reinterpret_cast< QFont*>(_v) = _t->labelFont(); break;
case 35: *reinterpret_cast< QColor*>(_v) = _t->labelColor(); break;
case 36: *reinterpret_cast< QString*>(_v) = _t->label(); break;
case 37: *reinterpret_cast< int*>(_v) = _t->labelPadding(); break;
case 38: *reinterpret_cast< int*>(_v) = _t->padding(); break;
case 39: *reinterpret_cast< int*>(_v) = _t->offset(); break;
case 40: *reinterpret_cast<int*>(_v) = QFlag(_t->selectedParts()); break;
case 41: *reinterpret_cast<int*>(_v) = QFlag(_t->selectableParts()); break;
case 42: *reinterpret_cast< QFont*>(_v) = _t->selectedTickLabelFont(); break;
case 43: *reinterpret_cast< QFont*>(_v) = _t->selectedLabelFont(); break;
case 44: *reinterpret_cast< QColor*>(_v) = _t->selectedTickLabelColor(); break;
case 45: *reinterpret_cast< QColor*>(_v) = _t->selectedLabelColor(); break;
case 46: *reinterpret_cast< QPen*>(_v) = _t->selectedBasePen(); break;
case 47: *reinterpret_cast< QPen*>(_v) = _t->selectedTickPen(); break;
case 48: *reinterpret_cast< QPen*>(_v) = _t->selectedSubTickPen(); break;
case 49: *reinterpret_cast< QCPLineEnding*>(_v) = _t->lowerEnding(); break;
case 50: *reinterpret_cast< QCPLineEnding*>(_v) = _t->upperEnding(); break;
case 51: *reinterpret_cast< QCPGrid**>(_v) = _t->grid(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAxis *_t = static_cast<QCPAxis *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 2: _t->setScaleType(*reinterpret_cast< ScaleType*>(_v)); break;
case 3: _t->setScaleLogBase(*reinterpret_cast< double*>(_v)); break;
case 4: _t->setRange(*reinterpret_cast< QCPRange*>(_v)); break;
case 5: _t->setRangeReversed(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setAutoTicks(*reinterpret_cast< bool*>(_v)); break;
case 7: _t->setAutoTickCount(*reinterpret_cast< int*>(_v)); break;
case 8: _t->setAutoTickLabels(*reinterpret_cast< bool*>(_v)); break;
case 9: _t->setAutoTickStep(*reinterpret_cast< bool*>(_v)); break;
case 10: _t->setAutoSubTicks(*reinterpret_cast< bool*>(_v)); break;
case 11: _t->setTicks(*reinterpret_cast< bool*>(_v)); break;
case 12: _t->setTickLabels(*reinterpret_cast< bool*>(_v)); break;
case 13: _t->setTickLabelPadding(*reinterpret_cast< int*>(_v)); break;
case 14: _t->setTickLabelType(*reinterpret_cast< LabelType*>(_v)); break;
case 15: _t->setTickLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 16: _t->setTickLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 17: _t->setTickLabelRotation(*reinterpret_cast< double*>(_v)); break;
case 18: _t->setTickLabelSide(*reinterpret_cast< LabelSide*>(_v)); break;
case 19: _t->setDateTimeFormat(*reinterpret_cast< QString*>(_v)); break;
case 20: _t->setDateTimeSpec(*reinterpret_cast< Qt::TimeSpec*>(_v)); break;
case 21: _t->setNumberFormat(*reinterpret_cast< QString*>(_v)); break;
case 22: _t->setNumberPrecision(*reinterpret_cast< int*>(_v)); break;
case 23: _t->setTickStep(*reinterpret_cast< double*>(_v)); break;
case 24: _t->setTickVector(*reinterpret_cast< QVector<double>*>(_v)); break;
case 25: _t->setTickVectorLabels(*reinterpret_cast< QVector<QString>*>(_v)); break;
case 26: _t->setTickLengthIn(*reinterpret_cast< int*>(_v)); break;
case 27: _t->setTickLengthOut(*reinterpret_cast< int*>(_v)); break;
case 28: _t->setSubTickCount(*reinterpret_cast< int*>(_v)); break;
case 29: _t->setSubTickLengthIn(*reinterpret_cast< int*>(_v)); break;
case 30: _t->setSubTickLengthOut(*reinterpret_cast< int*>(_v)); break;
case 31: _t->setBasePen(*reinterpret_cast< QPen*>(_v)); break;
case 32: _t->setTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 33: _t->setSubTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 34: _t->setLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 35: _t->setLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 36: _t->setLabel(*reinterpret_cast< QString*>(_v)); break;
case 37: _t->setLabelPadding(*reinterpret_cast< int*>(_v)); break;
case 38: _t->setPadding(*reinterpret_cast< int*>(_v)); break;
case 39: _t->setOffset(*reinterpret_cast< int*>(_v)); break;
case 40: _t->setSelectedParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 41: _t->setSelectableParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 42: _t->setSelectedTickLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 43: _t->setSelectedLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 44: _t->setSelectedTickLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 45: _t->setSelectedLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 46: _t->setSelectedBasePen(*reinterpret_cast< QPen*>(_v)); break;
case 47: _t->setSelectedTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 48: _t->setSelectedSubTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 49: _t->setLowerEnding(*reinterpret_cast< QCPLineEnding*>(_v)); break;
case 50: _t->setUpperEnding(*reinterpret_cast< QCPLineEnding*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCPAxis::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPAxis.data,
qt_meta_data_QCPAxis, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAxis::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAxis::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAxis.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPAxis::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 10)
qt_static_metacall(this, _c, _id, _a);
_id -= 10;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 10)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 10;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 52;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 52;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 52;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 52;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 52;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 52;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAxis::ticksRequest()
{
QMetaObject::activate(this, &staticMetaObject, 0, nullptr);
}
// SIGNAL 1
void QCPAxis::rangeChanged(const QCPRange & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPAxis::rangeChanged(const QCPRange & _t1, const QCPRange & _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
// SIGNAL 3
void QCPAxis::scaleTypeChanged(QCPAxis::ScaleType _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 3, _a);
}
// SIGNAL 4
void QCPAxis::selectionChanged(const QCPAxis::SelectableParts & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 4, _a);
}
// SIGNAL 5
void QCPAxis::selectableChanged(const QCPAxis::SelectableParts & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 5, _a);
}
struct qt_meta_stringdata_QCPAbstractPlottable_t {
QByteArrayData data[19];
char stringdata0[228];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAbstractPlottable_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAbstractPlottable_t qt_meta_stringdata_QCPAbstractPlottable = {
{
QT_MOC_LITERAL(0, 0, 20), // "QCPAbstractPlottable"
QT_MOC_LITERAL(1, 21, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 38, 0), // ""
QT_MOC_LITERAL(3, 39, 8), // "selected"
QT_MOC_LITERAL(4, 48, 17), // "selectableChanged"
QT_MOC_LITERAL(5, 66, 10), // "selectable"
QT_MOC_LITERAL(6, 77, 13), // "setSelectable"
QT_MOC_LITERAL(7, 91, 11), // "setSelected"
QT_MOC_LITERAL(8, 103, 4), // "name"
QT_MOC_LITERAL(9, 108, 15), // "antialiasedFill"
QT_MOC_LITERAL(10, 124, 19), // "antialiasedScatters"
QT_MOC_LITERAL(11, 144, 20), // "antialiasedErrorBars"
QT_MOC_LITERAL(12, 165, 3), // "pen"
QT_MOC_LITERAL(13, 169, 11), // "selectedPen"
QT_MOC_LITERAL(14, 181, 5), // "brush"
QT_MOC_LITERAL(15, 187, 13), // "selectedBrush"
QT_MOC_LITERAL(16, 201, 7), // "keyAxis"
QT_MOC_LITERAL(17, 209, 8), // "QCPAxis*"
QT_MOC_LITERAL(18, 218, 9) // "valueAxis"
},
"QCPAbstractPlottable\0selectionChanged\0"
"\0selected\0selectableChanged\0selectable\0"
"setSelectable\0setSelected\0name\0"
"antialiasedFill\0antialiasedScatters\0"
"antialiasedErrorBars\0pen\0selectedPen\0"
"brush\0selectedBrush\0keyAxis\0QCPAxis*\0"
"valueAxis"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAbstractPlottable[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
12, 46, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
4, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
7, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, QMetaType::Bool, 5,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, QMetaType::Bool, 3,
// properties: name, type, flags
8, QMetaType::QString, 0x00095103,
9, QMetaType::Bool, 0x00095103,
10, QMetaType::Bool, 0x00095103,
11, QMetaType::Bool, 0x00095103,
12, QMetaType::QPen, 0x00095103,
13, QMetaType::QPen, 0x00095103,
14, QMetaType::QBrush, 0x00095103,
15, QMetaType::QBrush, 0x00095103,
16, 0x80000000 | 17, 0x0009510b,
18, 0x80000000 | 17, 0x0009510b,
5, QMetaType::Bool, 0x00495103,
3, QMetaType::Bool, 0x00495103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0 // eod
};
void QCPAbstractPlottable::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAbstractPlottable *_t = static_cast<QCPAbstractPlottable *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 2: _t->setSelectable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 3: _t->setSelected((*reinterpret_cast< bool(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPAbstractPlottable::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractPlottable::selectionChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QCPAbstractPlottable::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractPlottable::selectableChanged)) {
*result = 1;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 9:
case 8:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAbstractPlottable *_t = static_cast<QCPAbstractPlottable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = _t->name(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->antialiasedFill(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->antialiasedScatters(); break;
case 3: *reinterpret_cast< bool*>(_v) = _t->antialiasedErrorBars(); break;
case 4: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 5: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 6: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 7: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
case 8: *reinterpret_cast< QCPAxis**>(_v) = _t->keyAxis(); break;
case 9: *reinterpret_cast< QCPAxis**>(_v) = _t->valueAxis(); break;
case 10: *reinterpret_cast< bool*>(_v) = _t->selectable(); break;
case 11: *reinterpret_cast< bool*>(_v) = _t->selected(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAbstractPlottable *_t = static_cast<QCPAbstractPlottable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setName(*reinterpret_cast< QString*>(_v)); break;
case 1: _t->setAntialiasedFill(*reinterpret_cast< bool*>(_v)); break;
case 2: _t->setAntialiasedScatters(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setAntialiasedErrorBars(*reinterpret_cast< bool*>(_v)); break;
case 4: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 5: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 6: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 7: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 8: _t->setKeyAxis(*reinterpret_cast< QCPAxis**>(_v)); break;
case 9: _t->setValueAxis(*reinterpret_cast< QCPAxis**>(_v)); break;
case 10: _t->setSelectable(*reinterpret_cast< bool*>(_v)); break;
case 11: _t->setSelected(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCPAbstractPlottable::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPAbstractPlottable.data,
qt_meta_data_QCPAbstractPlottable, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAbstractPlottable::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAbstractPlottable::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAbstractPlottable.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPAbstractPlottable::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 12;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 12;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 12;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 12;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 12;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 12;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAbstractPlottable::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPAbstractPlottable::selectableChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCPAbstractItem_t {
QByteArrayData data[11];
char stringdata0[139];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAbstractItem_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAbstractItem_t qt_meta_stringdata_QCPAbstractItem = {
{
QT_MOC_LITERAL(0, 0, 15), // "QCPAbstractItem"
QT_MOC_LITERAL(1, 16, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 33, 0), // ""
QT_MOC_LITERAL(3, 34, 8), // "selected"
QT_MOC_LITERAL(4, 43, 17), // "selectableChanged"
QT_MOC_LITERAL(5, 61, 10), // "selectable"
QT_MOC_LITERAL(6, 72, 13), // "setSelectable"
QT_MOC_LITERAL(7, 86, 11), // "setSelected"
QT_MOC_LITERAL(8, 98, 14), // "clipToAxisRect"
QT_MOC_LITERAL(9, 113, 12), // "clipAxisRect"
QT_MOC_LITERAL(10, 126, 12) // "QCPAxisRect*"
},
"QCPAbstractItem\0selectionChanged\0\0"
"selected\0selectableChanged\0selectable\0"
"setSelectable\0setSelected\0clipToAxisRect\0"
"clipAxisRect\0QCPAxisRect*"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAbstractItem[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
4, 46, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
4, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
7, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, QMetaType::Bool, 5,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, QMetaType::Bool, 3,
// properties: name, type, flags
8, QMetaType::Bool, 0x00095103,
9, 0x80000000 | 10, 0x0009510b,
5, QMetaType::Bool, 0x00495103,
3, QMetaType::Bool, 0x00495103,
// properties: notify_signal_id
0,
0,
1,
0,
0 // eod
};
void QCPAbstractItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAbstractItem *_t = static_cast<QCPAbstractItem *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 2: _t->setSelectable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 3: _t->setSelected((*reinterpret_cast< bool(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPAbstractItem::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractItem::selectionChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QCPAbstractItem::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractItem::selectableChanged)) {
*result = 1;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxisRect* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAbstractItem *_t = static_cast<QCPAbstractItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< bool*>(_v) = _t->clipToAxisRect(); break;
case 1: *reinterpret_cast< QCPAxisRect**>(_v) = _t->clipAxisRect(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->selectable(); break;
case 3: *reinterpret_cast< bool*>(_v) = _t->selected(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAbstractItem *_t = static_cast<QCPAbstractItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setClipToAxisRect(*reinterpret_cast< bool*>(_v)); break;
case 1: _t->setClipAxisRect(*reinterpret_cast< QCPAxisRect**>(_v)); break;
case 2: _t->setSelectable(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setSelected(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCPAbstractItem::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPAbstractItem.data,
qt_meta_data_QCPAbstractItem, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAbstractItem::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAbstractItem::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAbstractItem.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPAbstractItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAbstractItem::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPAbstractItem::selectableChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCustomPlot_t {
QByteArrayData data[57];
char stringdata0[801];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCustomPlot_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCustomPlot_t qt_meta_stringdata_QCustomPlot = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCustomPlot"
QT_MOC_LITERAL(1, 12, 16), // "mouseDoubleClick"
QT_MOC_LITERAL(2, 29, 0), // ""
QT_MOC_LITERAL(3, 30, 12), // "QMouseEvent*"
QT_MOC_LITERAL(4, 43, 5), // "event"
QT_MOC_LITERAL(5, 49, 10), // "mousePress"
QT_MOC_LITERAL(6, 60, 9), // "mouseMove"
QT_MOC_LITERAL(7, 70, 12), // "mouseRelease"
QT_MOC_LITERAL(8, 83, 10), // "mouseWheel"
QT_MOC_LITERAL(9, 94, 12), // "QWheelEvent*"
QT_MOC_LITERAL(10, 107, 14), // "plottableClick"
QT_MOC_LITERAL(11, 122, 21), // "QCPAbstractPlottable*"
QT_MOC_LITERAL(12, 144, 9), // "plottable"
QT_MOC_LITERAL(13, 154, 20), // "plottableDoubleClick"
QT_MOC_LITERAL(14, 175, 9), // "itemClick"
QT_MOC_LITERAL(15, 185, 16), // "QCPAbstractItem*"
QT_MOC_LITERAL(16, 202, 4), // "item"
QT_MOC_LITERAL(17, 207, 15), // "itemDoubleClick"
QT_MOC_LITERAL(18, 223, 9), // "axisClick"
QT_MOC_LITERAL(19, 233, 8), // "QCPAxis*"
QT_MOC_LITERAL(20, 242, 4), // "axis"
QT_MOC_LITERAL(21, 247, 23), // "QCPAxis::SelectablePart"
QT_MOC_LITERAL(22, 271, 4), // "part"
QT_MOC_LITERAL(23, 276, 15), // "axisDoubleClick"
QT_MOC_LITERAL(24, 292, 11), // "legendClick"
QT_MOC_LITERAL(25, 304, 10), // "QCPLegend*"
QT_MOC_LITERAL(26, 315, 6), // "legend"
QT_MOC_LITERAL(27, 322, 22), // "QCPAbstractLegendItem*"
QT_MOC_LITERAL(28, 345, 17), // "legendDoubleClick"
QT_MOC_LITERAL(29, 363, 10), // "titleClick"
QT_MOC_LITERAL(30, 374, 13), // "QCPPlotTitle*"
QT_MOC_LITERAL(31, 388, 5), // "title"
QT_MOC_LITERAL(32, 394, 16), // "titleDoubleClick"
QT_MOC_LITERAL(33, 411, 22), // "selectionChangedByUser"
QT_MOC_LITERAL(34, 434, 12), // "beforeReplot"
QT_MOC_LITERAL(35, 447, 11), // "afterReplot"
QT_MOC_LITERAL(36, 459, 11), // "rescaleAxes"
QT_MOC_LITERAL(37, 471, 21), // "onlyVisiblePlottables"
QT_MOC_LITERAL(38, 493, 11), // "deselectAll"
QT_MOC_LITERAL(39, 505, 6), // "replot"
QT_MOC_LITERAL(40, 512, 28), // "QCustomPlot::RefreshPriority"
QT_MOC_LITERAL(41, 541, 15), // "refreshPriority"
QT_MOC_LITERAL(42, 557, 8), // "viewport"
QT_MOC_LITERAL(43, 566, 10), // "background"
QT_MOC_LITERAL(44, 577, 16), // "backgroundScaled"
QT_MOC_LITERAL(45, 594, 20), // "backgroundScaledMode"
QT_MOC_LITERAL(46, 615, 19), // "Qt::AspectRatioMode"
QT_MOC_LITERAL(47, 635, 10), // "plotLayout"
QT_MOC_LITERAL(48, 646, 14), // "QCPLayoutGrid*"
QT_MOC_LITERAL(49, 661, 24), // "autoAddPlottableToLegend"
QT_MOC_LITERAL(50, 686, 18), // "selectionTolerance"
QT_MOC_LITERAL(51, 705, 20), // "noAntialiasingOnDrag"
QT_MOC_LITERAL(52, 726, 19), // "multiSelectModifier"
QT_MOC_LITERAL(53, 746, 20), // "Qt::KeyboardModifier"
QT_MOC_LITERAL(54, 767, 15), // "LayerInsertMode"
QT_MOC_LITERAL(55, 783, 8), // "limBelow"
QT_MOC_LITERAL(56, 792, 8) // "limAbove"
},
"QCustomPlot\0mouseDoubleClick\0\0"
"QMouseEvent*\0event\0mousePress\0mouseMove\0"
"mouseRelease\0mouseWheel\0QWheelEvent*\0"
"plottableClick\0QCPAbstractPlottable*\0"
"plottable\0plottableDoubleClick\0itemClick\0"
"QCPAbstractItem*\0item\0itemDoubleClick\0"
"axisClick\0QCPAxis*\0axis\0QCPAxis::SelectablePart\0"
"part\0axisDoubleClick\0legendClick\0"
"QCPLegend*\0legend\0QCPAbstractLegendItem*\0"
"legendDoubleClick\0titleClick\0QCPPlotTitle*\0"
"title\0titleDoubleClick\0selectionChangedByUser\0"
"beforeReplot\0afterReplot\0rescaleAxes\0"
"onlyVisiblePlottables\0deselectAll\0"
"replot\0QCustomPlot::RefreshPriority\0"
"refreshPriority\0viewport\0background\0"
"backgroundScaled\0backgroundScaledMode\0"
"Qt::AspectRatioMode\0plotLayout\0"
"QCPLayoutGrid*\0autoAddPlottableToLegend\0"
"selectionTolerance\0noAntialiasingOnDrag\0"
"multiSelectModifier\0Qt::KeyboardModifier\0"
"LayerInsertMode\0limBelow\0limAbove"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCustomPlot[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
23, 14, // methods
9, 214, // properties
1, 241, // enums/sets
0, 0, // constructors
0, // flags
18, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 129, 2, 0x06 /* Public */,
5, 1, 132, 2, 0x06 /* Public */,
6, 1, 135, 2, 0x06 /* Public */,
7, 1, 138, 2, 0x06 /* Public */,
8, 1, 141, 2, 0x06 /* Public */,
10, 2, 144, 2, 0x06 /* Public */,
13, 2, 149, 2, 0x06 /* Public */,
14, 2, 154, 2, 0x06 /* Public */,
17, 2, 159, 2, 0x06 /* Public */,
18, 3, 164, 2, 0x06 /* Public */,
23, 3, 171, 2, 0x06 /* Public */,
24, 3, 178, 2, 0x06 /* Public */,
28, 3, 185, 2, 0x06 /* Public */,
29, 2, 192, 2, 0x06 /* Public */,
32, 2, 197, 2, 0x06 /* Public */,
33, 0, 202, 2, 0x06 /* Public */,
34, 0, 203, 2, 0x06 /* Public */,
35, 0, 204, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
36, 1, 205, 2, 0x0a /* Public */,
36, 0, 208, 2, 0x2a /* Public | MethodCloned */,
38, 0, 209, 2, 0x0a /* Public */,
39, 1, 210, 2, 0x0a /* Public */,
39, 0, 213, 2, 0x2a /* Public | MethodCloned */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 9, 4,
QMetaType::Void, 0x80000000 | 11, 0x80000000 | 3, 12, 4,
QMetaType::Void, 0x80000000 | 11, 0x80000000 | 3, 12, 4,
QMetaType::Void, 0x80000000 | 15, 0x80000000 | 3, 16, 4,
QMetaType::Void, 0x80000000 | 15, 0x80000000 | 3, 16, 4,
QMetaType::Void, 0x80000000 | 19, 0x80000000 | 21, 0x80000000 | 3, 20, 22, 4,
QMetaType::Void, 0x80000000 | 19, 0x80000000 | 21, 0x80000000 | 3, 20, 22, 4,
QMetaType::Void, 0x80000000 | 25, 0x80000000 | 27, 0x80000000 | 3, 26, 16, 4,
QMetaType::Void, 0x80000000 | 25, 0x80000000 | 27, 0x80000000 | 3, 26, 16, 4,
QMetaType::Void, 0x80000000 | 3, 0x80000000 | 30, 4, 31,
QMetaType::Void, 0x80000000 | 3, 0x80000000 | 30, 4, 31,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 37,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, 0x80000000 | 40, 41,
QMetaType::Void,
// properties: name, type, flags
42, QMetaType::QRect, 0x00095103,
43, QMetaType::QPixmap, 0x00095103,
44, QMetaType::Bool, 0x00095103,
45, 0x80000000 | 46, 0x0009510b,
47, 0x80000000 | 48, 0x00095009,
49, QMetaType::Bool, 0x00095103,
50, QMetaType::Int, 0x00095103,
51, QMetaType::Bool, 0x00095103,
52, 0x80000000 | 53, 0x0009510b,
// enums: name, flags, count, data
54, 0x0, 2, 245,
// enum data: key, value
55, uint(QCustomPlot::limBelow),
56, uint(QCustomPlot::limAbove),
0 // eod
};
void QCustomPlot::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCustomPlot *_t = static_cast<QCustomPlot *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->mouseDoubleClick((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 1: _t->mousePress((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 2: _t->mouseMove((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 3: _t->mouseRelease((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 4: _t->mouseWheel((*reinterpret_cast< QWheelEvent*(*)>(_a[1]))); break;
case 5: _t->plottableClick((*reinterpret_cast< QCPAbstractPlottable*(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 6: _t->plottableDoubleClick((*reinterpret_cast< QCPAbstractPlottable*(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 7: _t->itemClick((*reinterpret_cast< QCPAbstractItem*(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 8: _t->itemDoubleClick((*reinterpret_cast< QCPAbstractItem*(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 9: _t->axisClick((*reinterpret_cast< QCPAxis*(*)>(_a[1])),(*reinterpret_cast< QCPAxis::SelectablePart(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 10: _t->axisDoubleClick((*reinterpret_cast< QCPAxis*(*)>(_a[1])),(*reinterpret_cast< QCPAxis::SelectablePart(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 11: _t->legendClick((*reinterpret_cast< QCPLegend*(*)>(_a[1])),(*reinterpret_cast< QCPAbstractLegendItem*(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 12: _t->legendDoubleClick((*reinterpret_cast< QCPLegend*(*)>(_a[1])),(*reinterpret_cast< QCPAbstractLegendItem*(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 13: _t->titleClick((*reinterpret_cast< QMouseEvent*(*)>(_a[1])),(*reinterpret_cast< QCPPlotTitle*(*)>(_a[2]))); break;
case 14: _t->titleDoubleClick((*reinterpret_cast< QMouseEvent*(*)>(_a[1])),(*reinterpret_cast< QCPPlotTitle*(*)>(_a[2]))); break;
case 15: _t->selectionChangedByUser(); break;
case 16: _t->beforeReplot(); break;
case 17: _t->afterReplot(); break;
case 18: _t->rescaleAxes((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 19: _t->rescaleAxes(); break;
case 20: _t->deselectAll(); break;
case 21: _t->replot((*reinterpret_cast< QCustomPlot::RefreshPriority(*)>(_a[1]))); break;
case 22: _t->replot(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 5:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractPlottable* >(); break;
}
break;
case 6:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractPlottable* >(); break;
}
break;
case 7:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractItem* >(); break;
}
break;
case 8:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractItem* >(); break;
}
break;
case 9:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis* >(); break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::SelectablePart >(); break;
}
break;
case 10:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis* >(); break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::SelectablePart >(); break;
}
break;
case 11:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractLegendItem* >(); break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLegend* >(); break;
}
break;
case 12:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractLegendItem* >(); break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLegend* >(); break;
}
break;
case 13:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPPlotTitle* >(); break;
}
break;
case 14:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPPlotTitle* >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCustomPlot::*)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseDoubleClick)) {
*result = 0;
return;
}
}
{
using _t = void (QCustomPlot::*)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mousePress)) {
*result = 1;
return;
}
}
{
using _t = void (QCustomPlot::*)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseMove)) {
*result = 2;
return;
}
}
{
using _t = void (QCustomPlot::*)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseRelease)) {
*result = 3;
return;
}
}
{
using _t = void (QCustomPlot::*)(QWheelEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseWheel)) {
*result = 4;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPAbstractPlottable * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::plottableClick)) {
*result = 5;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPAbstractPlottable * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::plottableDoubleClick)) {
*result = 6;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPAbstractItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::itemClick)) {
*result = 7;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPAbstractItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::itemDoubleClick)) {
*result = 8;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPAxis * , QCPAxis::SelectablePart , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::axisClick)) {
*result = 9;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPAxis * , QCPAxis::SelectablePart , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::axisDoubleClick)) {
*result = 10;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPLegend * , QCPAbstractLegendItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::legendClick)) {
*result = 11;
return;
}
}
{
using _t = void (QCustomPlot::*)(QCPLegend * , QCPAbstractLegendItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::legendDoubleClick)) {
*result = 12;
return;
}
}
{
using _t = void (QCustomPlot::*)(QMouseEvent * , QCPPlotTitle * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::titleClick)) {
*result = 13;
return;
}
}
{
using _t = void (QCustomPlot::*)(QMouseEvent * , QCPPlotTitle * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::titleDoubleClick)) {
*result = 14;
return;
}
}
{
using _t = void (QCustomPlot::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::selectionChangedByUser)) {
*result = 15;
return;
}
}
{
using _t = void (QCustomPlot::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::beforeReplot)) {
*result = 16;
return;
}
}
{
using _t = void (QCustomPlot::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::afterReplot)) {
*result = 17;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 4:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayoutGrid* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCustomPlot *_t = static_cast<QCustomPlot *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QRect*>(_v) = _t->viewport(); break;
case 1: *reinterpret_cast< QPixmap*>(_v) = _t->background(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->backgroundScaled(); break;
case 3: *reinterpret_cast< Qt::AspectRatioMode*>(_v) = _t->backgroundScaledMode(); break;
case 4: *reinterpret_cast< QCPLayoutGrid**>(_v) = _t->plotLayout(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->autoAddPlottableToLegend(); break;
case 6: *reinterpret_cast< int*>(_v) = _t->selectionTolerance(); break;
case 7: *reinterpret_cast< bool*>(_v) = _t->noAntialiasingOnDrag(); break;
case 8: *reinterpret_cast< Qt::KeyboardModifier*>(_v) = _t->multiSelectModifier(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCustomPlot *_t = static_cast<QCustomPlot *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setViewport(*reinterpret_cast< QRect*>(_v)); break;
case 1: _t->setBackground(*reinterpret_cast< QPixmap*>(_v)); break;
case 2: _t->setBackgroundScaled(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setBackgroundScaledMode(*reinterpret_cast< Qt::AspectRatioMode*>(_v)); break;
case 5: _t->setAutoAddPlottableToLegend(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setSelectionTolerance(*reinterpret_cast< int*>(_v)); break;
case 7: _t->setNoAntialiasingOnDrag(*reinterpret_cast< bool*>(_v)); break;
case 8: _t->setMultiSelectModifier(*reinterpret_cast< Qt::KeyboardModifier*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCustomPlot::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_QCustomPlot.data,
qt_meta_data_QCustomPlot, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCustomPlot::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCustomPlot::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCustomPlot.stringdata0))
return static_cast<void*>(this);
return QWidget::qt_metacast(_clname);
}
int QCustomPlot::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 23)
qt_static_metacall(this, _c, _id, _a);
_id -= 23;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 23)
qt_static_metacall(this, _c, _id, _a);
_id -= 23;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 9;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCustomPlot::mouseDoubleClick(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCustomPlot::mousePress(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCustomPlot::mouseMove(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
// SIGNAL 3
void QCustomPlot::mouseRelease(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 3, _a);
}
// SIGNAL 4
void QCustomPlot::mouseWheel(QWheelEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 4, _a);
}
// SIGNAL 5
void QCustomPlot::plottableClick(QCPAbstractPlottable * _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 5, _a);
}
// SIGNAL 6
void QCustomPlot::plottableDoubleClick(QCPAbstractPlottable * _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 6, _a);
}
// SIGNAL 7
void QCustomPlot::itemClick(QCPAbstractItem * _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 7, _a);
}
// SIGNAL 8
void QCustomPlot::itemDoubleClick(QCPAbstractItem * _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 8, _a);
}
// SIGNAL 9
void QCustomPlot::axisClick(QCPAxis * _t1, QCPAxis::SelectablePart _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 9, _a);
}
// SIGNAL 10
void QCustomPlot::axisDoubleClick(QCPAxis * _t1, QCPAxis::SelectablePart _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 10, _a);
}
// SIGNAL 11
void QCustomPlot::legendClick(QCPLegend * _t1, QCPAbstractLegendItem * _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 11, _a);
}
// SIGNAL 12
void QCustomPlot::legendDoubleClick(QCPLegend * _t1, QCPAbstractLegendItem * _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 12, _a);
}
// SIGNAL 13
void QCustomPlot::titleClick(QMouseEvent * _t1, QCPPlotTitle * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 13, _a);
}
// SIGNAL 14
void QCustomPlot::titleDoubleClick(QMouseEvent * _t1, QCPPlotTitle * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 14, _a);
}
// SIGNAL 15
void QCustomPlot::selectionChangedByUser()
{
QMetaObject::activate(this, &staticMetaObject, 15, nullptr);
}
// SIGNAL 16
void QCustomPlot::beforeReplot()
{
QMetaObject::activate(this, &staticMetaObject, 16, nullptr);
}
// SIGNAL 17
void QCustomPlot::afterReplot()
{
QMetaObject::activate(this, &staticMetaObject, 17, nullptr);
}
struct qt_meta_stringdata_QCPColorGradient_t {
QByteArrayData data[17];
char stringdata0[164];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorGradient_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorGradient_t qt_meta_stringdata_QCPColorGradient = {
{
QT_MOC_LITERAL(0, 0, 16), // "QCPColorGradient"
QT_MOC_LITERAL(1, 17, 18), // "ColorInterpolation"
QT_MOC_LITERAL(2, 36, 5), // "ciRGB"
QT_MOC_LITERAL(3, 42, 5), // "ciHSV"
QT_MOC_LITERAL(4, 48, 14), // "GradientPreset"
QT_MOC_LITERAL(5, 63, 11), // "gpGrayscale"
QT_MOC_LITERAL(6, 75, 5), // "gpHot"
QT_MOC_LITERAL(7, 81, 6), // "gpCold"
QT_MOC_LITERAL(8, 88, 7), // "gpNight"
QT_MOC_LITERAL(9, 96, 7), // "gpCandy"
QT_MOC_LITERAL(10, 104, 11), // "gpGeography"
QT_MOC_LITERAL(11, 116, 5), // "gpIon"
QT_MOC_LITERAL(12, 122, 9), // "gpThermal"
QT_MOC_LITERAL(13, 132, 7), // "gpPolar"
QT_MOC_LITERAL(14, 140, 10), // "gpSpectrum"
QT_MOC_LITERAL(15, 151, 5), // "gpJet"
QT_MOC_LITERAL(16, 157, 6) // "gpHues"
},
"QCPColorGradient\0ColorInterpolation\0"
"ciRGB\0ciHSV\0GradientPreset\0gpGrayscale\0"
"gpHot\0gpCold\0gpNight\0gpCandy\0gpGeography\0"
"gpIon\0gpThermal\0gpPolar\0gpSpectrum\0"
"gpJet\0gpHues"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorGradient[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
2, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 2, 22,
4, 0x0, 12, 26,
// enum data: key, value
2, uint(QCPColorGradient::ciRGB),
3, uint(QCPColorGradient::ciHSV),
5, uint(QCPColorGradient::gpGrayscale),
6, uint(QCPColorGradient::gpHot),
7, uint(QCPColorGradient::gpCold),
8, uint(QCPColorGradient::gpNight),
9, uint(QCPColorGradient::gpCandy),
10, uint(QCPColorGradient::gpGeography),
11, uint(QCPColorGradient::gpIon),
12, uint(QCPColorGradient::gpThermal),
13, uint(QCPColorGradient::gpPolar),
14, uint(QCPColorGradient::gpSpectrum),
15, uint(QCPColorGradient::gpJet),
16, uint(QCPColorGradient::gpHues),
0 // eod
};
QT_INIT_METAOBJECT const QMetaObject QCPColorGradient::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPColorGradient.data,
qt_meta_data_QCPColorGradient, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAxisRect_t {
QByteArrayData data[8];
char stringdata0[118];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxisRect_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxisRect_t qt_meta_stringdata_QCPAxisRect = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPAxisRect"
QT_MOC_LITERAL(1, 12, 10), // "background"
QT_MOC_LITERAL(2, 23, 16), // "backgroundScaled"
QT_MOC_LITERAL(3, 40, 20), // "backgroundScaledMode"
QT_MOC_LITERAL(4, 61, 19), // "Qt::AspectRatioMode"
QT_MOC_LITERAL(5, 81, 9), // "rangeDrag"
QT_MOC_LITERAL(6, 91, 16), // "Qt::Orientations"
QT_MOC_LITERAL(7, 108, 9) // "rangeZoom"
},
"QCPAxisRect\0background\0backgroundScaled\0"
"backgroundScaledMode\0Qt::AspectRatioMode\0"
"rangeDrag\0Qt::Orientations\0rangeZoom"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxisRect[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
5, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPixmap, 0x00095103,
2, QMetaType::Bool, 0x00095103,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 6, 0x0009510b,
7, 0x80000000 | 6, 0x0009510b,
0 // eod
};
void QCPAxisRect::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPAxisRect *_t = static_cast<QCPAxisRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPixmap*>(_v) = _t->background(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->backgroundScaled(); break;
case 2: *reinterpret_cast< Qt::AspectRatioMode*>(_v) = _t->backgroundScaledMode(); break;
case 3: *reinterpret_cast< Qt::Orientations*>(_v) = _t->rangeDrag(); break;
case 4: *reinterpret_cast< Qt::Orientations*>(_v) = _t->rangeZoom(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAxisRect *_t = static_cast<QCPAxisRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setBackground(*reinterpret_cast< QPixmap*>(_v)); break;
case 1: _t->setBackgroundScaled(*reinterpret_cast< bool*>(_v)); break;
case 2: _t->setBackgroundScaledMode(*reinterpret_cast< Qt::AspectRatioMode*>(_v)); break;
case 3: _t->setRangeDrag(*reinterpret_cast< Qt::Orientations*>(_v)); break;
case 4: _t->setRangeZoom(*reinterpret_cast< Qt::Orientations*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPAxisRect::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPAxisRect.data,
qt_meta_data_QCPAxisRect, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAxisRect::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAxisRect::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAxisRect.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPAxisRect::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPAbstractLegendItem_t {
QByteArrayData data[14];
char stringdata0[174];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAbstractLegendItem_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAbstractLegendItem_t qt_meta_stringdata_QCPAbstractLegendItem = {
{
QT_MOC_LITERAL(0, 0, 21), // "QCPAbstractLegendItem"
QT_MOC_LITERAL(1, 22, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 39, 0), // ""
QT_MOC_LITERAL(3, 40, 8), // "selected"
QT_MOC_LITERAL(4, 49, 17), // "selectableChanged"
QT_MOC_LITERAL(5, 67, 10), // "selectable"
QT_MOC_LITERAL(6, 78, 13), // "setSelectable"
QT_MOC_LITERAL(7, 92, 11), // "setSelected"
QT_MOC_LITERAL(8, 104, 12), // "parentLegend"
QT_MOC_LITERAL(9, 117, 10), // "QCPLegend*"
QT_MOC_LITERAL(10, 128, 4), // "font"
QT_MOC_LITERAL(11, 133, 9), // "textColor"
QT_MOC_LITERAL(12, 143, 12), // "selectedFont"
QT_MOC_LITERAL(13, 156, 17) // "selectedTextColor"
},
"QCPAbstractLegendItem\0selectionChanged\0"
"\0selected\0selectableChanged\0selectable\0"
"setSelectable\0setSelected\0parentLegend\0"
"QCPLegend*\0font\0textColor\0selectedFont\0"
"selectedTextColor"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAbstractLegendItem[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
7, 46, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
4, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
7, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, QMetaType::Bool, 5,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, QMetaType::Bool, 3,
// properties: name, type, flags
8, 0x80000000 | 9, 0x00095009,
10, QMetaType::QFont, 0x00095103,
11, QMetaType::QColor, 0x00095103,
12, QMetaType::QFont, 0x00095103,
13, QMetaType::QColor, 0x00095103,
5, QMetaType::Bool, 0x00495103,
3, QMetaType::Bool, 0x00495103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0,
1,
0 // eod
};
void QCPAbstractLegendItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAbstractLegendItem *_t = static_cast<QCPAbstractLegendItem *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 2: _t->setSelectable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 3: _t->setSelected((*reinterpret_cast< bool(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPAbstractLegendItem::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractLegendItem::selectionChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QCPAbstractLegendItem::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractLegendItem::selectableChanged)) {
*result = 1;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLegend* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAbstractLegendItem *_t = static_cast<QCPAbstractLegendItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPLegend**>(_v) = _t->parentLegend(); break;
case 1: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 2: *reinterpret_cast< QColor*>(_v) = _t->textColor(); break;
case 3: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 4: *reinterpret_cast< QColor*>(_v) = _t->selectedTextColor(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->selectable(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->selected(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAbstractLegendItem *_t = static_cast<QCPAbstractLegendItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 1: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 2: _t->setTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 3: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 4: _t->setSelectedTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 5: _t->setSelectable(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setSelected(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCPAbstractLegendItem::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPAbstractLegendItem.data,
qt_meta_data_QCPAbstractLegendItem, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAbstractLegendItem::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAbstractLegendItem::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAbstractLegendItem.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPAbstractLegendItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAbstractLegendItem::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPAbstractLegendItem::selectableChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCPPlottableLegendItem_t {
QByteArrayData data[1];
char stringdata0[23];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPPlottableLegendItem_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPPlottableLegendItem_t qt_meta_stringdata_QCPPlottableLegendItem = {
{
QT_MOC_LITERAL(0, 0, 22) // "QCPPlottableLegendItem"
},
"QCPPlottableLegendItem"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPPlottableLegendItem[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void QCPPlottableLegendItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPPlottableLegendItem::staticMetaObject = {
{ &QCPAbstractLegendItem::staticMetaObject, qt_meta_stringdata_QCPPlottableLegendItem.data,
qt_meta_data_QCPPlottableLegendItem, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPPlottableLegendItem::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPPlottableLegendItem::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPPlottableLegendItem.stringdata0))
return static_cast<void*>(this);
return QCPAbstractLegendItem::qt_metacast(_clname);
}
int QCPPlottableLegendItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractLegendItem::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLegend_t {
QByteArrayData data[27];
char stringdata0[358];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLegend_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLegend_t qt_meta_stringdata_QCPLegend = {
{
QT_MOC_LITERAL(0, 0, 9), // "QCPLegend"
QT_MOC_LITERAL(1, 10, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 27, 0), // ""
QT_MOC_LITERAL(3, 28, 26), // "QCPLegend::SelectableParts"
QT_MOC_LITERAL(4, 55, 5), // "parts"
QT_MOC_LITERAL(5, 61, 17), // "selectableChanged"
QT_MOC_LITERAL(6, 79, 18), // "setSelectableParts"
QT_MOC_LITERAL(7, 98, 15), // "SelectableParts"
QT_MOC_LITERAL(8, 114, 15), // "selectableParts"
QT_MOC_LITERAL(9, 130, 16), // "setSelectedParts"
QT_MOC_LITERAL(10, 147, 13), // "selectedParts"
QT_MOC_LITERAL(11, 161, 9), // "borderPen"
QT_MOC_LITERAL(12, 171, 5), // "brush"
QT_MOC_LITERAL(13, 177, 4), // "font"
QT_MOC_LITERAL(14, 182, 9), // "textColor"
QT_MOC_LITERAL(15, 192, 8), // "iconSize"
QT_MOC_LITERAL(16, 201, 15), // "iconTextPadding"
QT_MOC_LITERAL(17, 217, 13), // "iconBorderPen"
QT_MOC_LITERAL(18, 231, 17), // "selectedBorderPen"
QT_MOC_LITERAL(19, 249, 21), // "selectedIconBorderPen"
QT_MOC_LITERAL(20, 271, 13), // "selectedBrush"
QT_MOC_LITERAL(21, 285, 12), // "selectedFont"
QT_MOC_LITERAL(22, 298, 17), // "selectedTextColor"
QT_MOC_LITERAL(23, 316, 14), // "SelectablePart"
QT_MOC_LITERAL(24, 331, 6), // "spNone"
QT_MOC_LITERAL(25, 338, 11), // "spLegendBox"
QT_MOC_LITERAL(26, 350, 7) // "spItems"
},
"QCPLegend\0selectionChanged\0\0"
"QCPLegend::SelectableParts\0parts\0"
"selectableChanged\0setSelectableParts\0"
"SelectableParts\0selectableParts\0"
"setSelectedParts\0selectedParts\0borderPen\0"
"brush\0font\0textColor\0iconSize\0"
"iconTextPadding\0iconBorderPen\0"
"selectedBorderPen\0selectedIconBorderPen\0"
"selectedBrush\0selectedFont\0selectedTextColor\0"
"SelectablePart\0spNone\0spLegendBox\0"
"spItems"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLegend[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
14, 46, // properties
2, 102, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
5, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
9, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
// slots: parameters
QMetaType::Void, 0x80000000 | 7, 8,
QMetaType::Void, 0x80000000 | 7, 10,
// properties: name, type, flags
11, QMetaType::QPen, 0x00095103,
12, QMetaType::QBrush, 0x00095103,
13, QMetaType::QFont, 0x00095103,
14, QMetaType::QColor, 0x00095103,
15, QMetaType::QSize, 0x00095103,
16, QMetaType::Int, 0x00095103,
17, QMetaType::QPen, 0x00095103,
8, 0x80000000 | 7, 0x0049510b,
10, 0x80000000 | 7, 0x0049510b,
18, QMetaType::QPen, 0x00095103,
19, QMetaType::QPen, 0x00095103,
20, QMetaType::QBrush, 0x00095103,
21, QMetaType::QFont, 0x00095103,
22, QMetaType::QColor, 0x00095103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
// enums: name, flags, count, data
23, 0x1, 3, 110,
7, 0x1, 3, 116,
// enum data: key, value
24, uint(QCPLegend::spNone),
25, uint(QCPLegend::spLegendBox),
26, uint(QCPLegend::spItems),
24, uint(QCPLegend::spNone),
25, uint(QCPLegend::spLegendBox),
26, uint(QCPLegend::spItems),
0 // eod
};
void QCPLegend::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPLegend *_t = static_cast<QCPLegend *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< QCPLegend::SelectableParts(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< QCPLegend::SelectableParts(*)>(_a[1]))); break;
case 2: _t->setSelectableParts((*reinterpret_cast< const SelectableParts(*)>(_a[1]))); break;
case 3: _t->setSelectedParts((*reinterpret_cast< const SelectableParts(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPLegend::*)(QCPLegend::SelectableParts );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPLegend::selectionChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QCPLegend::*)(QCPLegend::SelectableParts );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPLegend::selectableChanged)) {
*result = 1;
return;
}
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLegend *_t = static_cast<QCPLegend *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->borderPen(); break;
case 1: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 2: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 3: *reinterpret_cast< QColor*>(_v) = _t->textColor(); break;
case 4: *reinterpret_cast< QSize*>(_v) = _t->iconSize(); break;
case 5: *reinterpret_cast< int*>(_v) = _t->iconTextPadding(); break;
case 6: *reinterpret_cast< QPen*>(_v) = _t->iconBorderPen(); break;
case 7: *reinterpret_cast<int*>(_v) = QFlag(_t->selectableParts()); break;
case 8: *reinterpret_cast<int*>(_v) = QFlag(_t->selectedParts()); break;
case 9: *reinterpret_cast< QPen*>(_v) = _t->selectedBorderPen(); break;
case 10: *reinterpret_cast< QPen*>(_v) = _t->selectedIconBorderPen(); break;
case 11: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
case 12: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 13: *reinterpret_cast< QColor*>(_v) = _t->selectedTextColor(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLegend *_t = static_cast<QCPLegend *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 2: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 3: _t->setTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 4: _t->setIconSize(*reinterpret_cast< QSize*>(_v)); break;
case 5: _t->setIconTextPadding(*reinterpret_cast< int*>(_v)); break;
case 6: _t->setIconBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 7: _t->setSelectableParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 8: _t->setSelectedParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 9: _t->setSelectedBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 10: _t->setSelectedIconBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 11: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 12: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 13: _t->setSelectedTextColor(*reinterpret_cast< QColor*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCPLegend::staticMetaObject = {
{ &QCPLayoutGrid::staticMetaObject, qt_meta_stringdata_QCPLegend.data,
qt_meta_data_QCPLegend, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLegend::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLegend::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLegend.stringdata0))
return static_cast<void*>(this);
return QCPLayoutGrid::qt_metacast(_clname);
}
int QCPLegend::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutGrid::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 14;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPLegend::selectionChanged(QCPLegend::SelectableParts _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPLegend::selectableChanged(QCPLegend::SelectableParts _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCPPlotTitle_t {
QByteArrayData data[13];
char stringdata0[146];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPPlotTitle_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPPlotTitle_t qt_meta_stringdata_QCPPlotTitle = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPPlotTitle"
QT_MOC_LITERAL(1, 13, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 30, 0), // ""
QT_MOC_LITERAL(3, 31, 8), // "selected"
QT_MOC_LITERAL(4, 40, 17), // "selectableChanged"
QT_MOC_LITERAL(5, 58, 10), // "selectable"
QT_MOC_LITERAL(6, 69, 13), // "setSelectable"
QT_MOC_LITERAL(7, 83, 11), // "setSelected"
QT_MOC_LITERAL(8, 95, 4), // "text"
QT_MOC_LITERAL(9, 100, 4), // "font"
QT_MOC_LITERAL(10, 105, 9), // "textColor"
QT_MOC_LITERAL(11, 115, 12), // "selectedFont"
QT_MOC_LITERAL(12, 128, 17) // "selectedTextColor"
},
"QCPPlotTitle\0selectionChanged\0\0selected\0"
"selectableChanged\0selectable\0setSelectable\0"
"setSelected\0text\0font\0textColor\0"
"selectedFont\0selectedTextColor"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPPlotTitle[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
7, 46, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
4, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
7, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, QMetaType::Bool, 5,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, QMetaType::Bool, 3,
// properties: name, type, flags
8, QMetaType::QString, 0x00095103,
9, QMetaType::QFont, 0x00095103,
10, QMetaType::QColor, 0x00095103,
11, QMetaType::QFont, 0x00095103,
12, QMetaType::QColor, 0x00095103,
5, QMetaType::Bool, 0x00495103,
3, QMetaType::Bool, 0x00495103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
1,
0,
0 // eod
};
void QCPPlotTitle::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPPlotTitle *_t = static_cast<QCPPlotTitle *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 2: _t->setSelectable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 3: _t->setSelected((*reinterpret_cast< bool(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPPlotTitle::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPPlotTitle::selectionChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QCPPlotTitle::*)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPPlotTitle::selectableChanged)) {
*result = 1;
return;
}
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPPlotTitle *_t = static_cast<QCPPlotTitle *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = _t->text(); break;
case 1: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 2: *reinterpret_cast< QColor*>(_v) = _t->textColor(); break;
case 3: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 4: *reinterpret_cast< QColor*>(_v) = _t->selectedTextColor(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->selectable(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->selected(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPPlotTitle *_t = static_cast<QCPPlotTitle *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setText(*reinterpret_cast< QString*>(_v)); break;
case 1: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 2: _t->setTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 3: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 4: _t->setSelectedTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 5: _t->setSelectable(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setSelected(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
QT_INIT_METAOBJECT const QMetaObject QCPPlotTitle::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPPlotTitle.data,
qt_meta_data_QCPPlotTitle, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPPlotTitle::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPPlotTitle::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPPlotTitle.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPPlotTitle::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPPlotTitle::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPPlotTitle::selectableChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCPColorScaleAxisRectPrivate_t {
QByteArrayData data[7];
char stringdata0[128];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorScaleAxisRectPrivate_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorScaleAxisRectPrivate_t qt_meta_stringdata_QCPColorScaleAxisRectPrivate = {
{
QT_MOC_LITERAL(0, 0, 28), // "QCPColorScaleAxisRectPrivate"
QT_MOC_LITERAL(1, 29, 20), // "axisSelectionChanged"
QT_MOC_LITERAL(2, 50, 0), // ""
QT_MOC_LITERAL(3, 51, 24), // "QCPAxis::SelectableParts"
QT_MOC_LITERAL(4, 76, 13), // "selectedParts"
QT_MOC_LITERAL(5, 90, 21), // "axisSelectableChanged"
QT_MOC_LITERAL(6, 112, 15) // "selectableParts"
},
"QCPColorScaleAxisRectPrivate\0"
"axisSelectionChanged\0\0QCPAxis::SelectableParts\0"
"selectedParts\0axisSelectableChanged\0"
"selectableParts"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorScaleAxisRectPrivate[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 1, 24, 2, 0x09 /* Protected */,
5, 1, 27, 2, 0x09 /* Protected */,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 6,
0 // eod
};
void QCPColorScaleAxisRectPrivate::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPColorScaleAxisRectPrivate *_t = static_cast<QCPColorScaleAxisRectPrivate *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->axisSelectionChanged((*reinterpret_cast< QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 1: _t->axisSelectableChanged((*reinterpret_cast< QCPAxis::SelectableParts(*)>(_a[1]))); break;
default: ;
}
}
}
QT_INIT_METAOBJECT const QMetaObject QCPColorScaleAxisRectPrivate::staticMetaObject = {
{ &QCPAxisRect::staticMetaObject, qt_meta_stringdata_QCPColorScaleAxisRectPrivate.data,
qt_meta_data_QCPColorScaleAxisRectPrivate, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPColorScaleAxisRectPrivate::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPColorScaleAxisRectPrivate::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPColorScaleAxisRectPrivate.stringdata0))
return static_cast<void*>(this);
return QCPAxisRect::qt_metacast(_clname);
}
int QCPColorScaleAxisRectPrivate::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAxisRect::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 2)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 2;
}
return _id;
}
struct qt_meta_stringdata_QCPColorScale_t {
QByteArrayData data[23];
char stringdata0[278];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorScale_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorScale_t qt_meta_stringdata_QCPColorScale = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPColorScale"
QT_MOC_LITERAL(1, 14, 16), // "dataRangeChanged"
QT_MOC_LITERAL(2, 31, 0), // ""
QT_MOC_LITERAL(3, 32, 8), // "QCPRange"
QT_MOC_LITERAL(4, 41, 8), // "newRange"
QT_MOC_LITERAL(5, 50, 20), // "dataScaleTypeChanged"
QT_MOC_LITERAL(6, 71, 18), // "QCPAxis::ScaleType"
QT_MOC_LITERAL(7, 90, 9), // "scaleType"
QT_MOC_LITERAL(8, 100, 15), // "gradientChanged"
QT_MOC_LITERAL(9, 116, 16), // "QCPColorGradient"
QT_MOC_LITERAL(10, 133, 11), // "newGradient"
QT_MOC_LITERAL(11, 145, 12), // "setDataRange"
QT_MOC_LITERAL(12, 158, 9), // "dataRange"
QT_MOC_LITERAL(13, 168, 16), // "setDataScaleType"
QT_MOC_LITERAL(14, 185, 11), // "setGradient"
QT_MOC_LITERAL(15, 197, 8), // "gradient"
QT_MOC_LITERAL(16, 206, 4), // "type"
QT_MOC_LITERAL(17, 211, 17), // "QCPAxis::AxisType"
QT_MOC_LITERAL(18, 229, 13), // "dataScaleType"
QT_MOC_LITERAL(19, 243, 5), // "label"
QT_MOC_LITERAL(20, 249, 8), // "barWidth"
QT_MOC_LITERAL(21, 258, 9), // "rangeDrag"
QT_MOC_LITERAL(22, 268, 9) // "rangeZoom"
},
"QCPColorScale\0dataRangeChanged\0\0"
"QCPRange\0newRange\0dataScaleTypeChanged\0"
"QCPAxis::ScaleType\0scaleType\0"
"gradientChanged\0QCPColorGradient\0"
"newGradient\0setDataRange\0dataRange\0"
"setDataScaleType\0setGradient\0gradient\0"
"type\0QCPAxis::AxisType\0dataScaleType\0"
"label\0barWidth\0rangeDrag\0rangeZoom"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorScale[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
6, 14, // methods
8, 62, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
3, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 44, 2, 0x06 /* Public */,
5, 1, 47, 2, 0x06 /* Public */,
8, 1, 50, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
11, 1, 53, 2, 0x0a /* Public */,
13, 1, 56, 2, 0x0a /* Public */,
14, 1, 59, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 10,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 12,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 15,
// properties: name, type, flags
16, 0x80000000 | 17, 0x0009510b,
12, 0x80000000 | 3, 0x0049510b,
18, 0x80000000 | 6, 0x0049510b,
15, 0x80000000 | 9, 0x0049510b,
19, QMetaType::QString, 0x00095103,
20, QMetaType::Int, 0x00095103,
21, QMetaType::Bool, 0x00095103,
22, QMetaType::Bool, 0x00095103,
// properties: notify_signal_id
0,
0,
1,
2,
0,
0,
0,
0,
0 // eod
};
void QCPColorScale::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPColorScale *_t = static_cast<QCPColorScale *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->dataRangeChanged((*reinterpret_cast< QCPRange(*)>(_a[1]))); break;
case 1: _t->dataScaleTypeChanged((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 2: _t->gradientChanged((*reinterpret_cast< QCPColorGradient(*)>(_a[1]))); break;
case 3: _t->setDataRange((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 4: _t->setDataScaleType((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 5: _t->setGradient((*reinterpret_cast< const QCPColorGradient(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPColorScale::*)(QCPRange );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorScale::dataRangeChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QCPColorScale::*)(QCPAxis::ScaleType );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorScale::dataScaleTypeChanged)) {
*result = 1;
return;
}
}
{
using _t = void (QCPColorScale::*)(QCPColorGradient );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorScale::gradientChanged)) {
*result = 2;
return;
}
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPColorScale *_t = static_cast<QCPColorScale *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPAxis::AxisType*>(_v) = _t->type(); break;
case 1: *reinterpret_cast< QCPRange*>(_v) = _t->dataRange(); break;
case 2: *reinterpret_cast< QCPAxis::ScaleType*>(_v) = _t->dataScaleType(); break;
case 3: *reinterpret_cast< QCPColorGradient*>(_v) = _t->gradient(); break;
case 4: *reinterpret_cast< QString*>(_v) = _t->label(); break;
case 5: *reinterpret_cast< int*>(_v) = _t->barWidth(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->rangeDrag(); break;
case 7: *reinterpret_cast< bool*>(_v) = _t->rangeZoom(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPColorScale *_t = static_cast<QCPColorScale *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setType(*reinterpret_cast< QCPAxis::AxisType*>(_v)); break;
case 1: _t->setDataRange(*reinterpret_cast< QCPRange*>(_v)); break;
case 2: _t->setDataScaleType(*reinterpret_cast< QCPAxis::ScaleType*>(_v)); break;
case 3: _t->setGradient(*reinterpret_cast< QCPColorGradient*>(_v)); break;
case 4: _t->setLabel(*reinterpret_cast< QString*>(_v)); break;
case 5: _t->setBarWidth(*reinterpret_cast< int*>(_v)); break;
case 6: _t->setRangeDrag(*reinterpret_cast< bool*>(_v)); break;
case 7: _t->setRangeZoom(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
static const QMetaObject * const qt_meta_extradata_QCPColorScale[] = {
&QCPAxis::staticMetaObject,
nullptr
};
QT_INIT_METAOBJECT const QMetaObject QCPColorScale::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPColorScale.data,
qt_meta_data_QCPColorScale, qt_static_metacall, qt_meta_extradata_QCPColorScale, nullptr}
};
const QMetaObject *QCPColorScale::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPColorScale::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPColorScale.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPColorScale::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 6)
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 6)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 6;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 8;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPColorScale::dataRangeChanged(QCPRange _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPColorScale::dataScaleTypeChanged(QCPAxis::ScaleType _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPColorScale::gradientChanged(QCPColorGradient _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
struct qt_meta_stringdata_QCPGraph_t {
QByteArrayData data[23];
char stringdata0[251];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPGraph_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPGraph_t qt_meta_stringdata_QCPGraph = {
{
QT_MOC_LITERAL(0, 0, 8), // "QCPGraph"
QT_MOC_LITERAL(1, 9, 9), // "lineStyle"
QT_MOC_LITERAL(2, 19, 9), // "LineStyle"
QT_MOC_LITERAL(3, 29, 12), // "scatterStyle"
QT_MOC_LITERAL(4, 42, 15), // "QCPScatterStyle"
QT_MOC_LITERAL(5, 58, 9), // "errorType"
QT_MOC_LITERAL(6, 68, 9), // "ErrorType"
QT_MOC_LITERAL(7, 78, 8), // "errorPen"
QT_MOC_LITERAL(8, 87, 12), // "errorBarSize"
QT_MOC_LITERAL(9, 100, 18), // "errorBarSkipSymbol"
QT_MOC_LITERAL(10, 119, 16), // "channelFillGraph"
QT_MOC_LITERAL(11, 136, 9), // "QCPGraph*"
QT_MOC_LITERAL(12, 146, 16), // "adaptiveSampling"
QT_MOC_LITERAL(13, 163, 6), // "lsNone"
QT_MOC_LITERAL(14, 170, 6), // "lsLine"
QT_MOC_LITERAL(15, 177, 10), // "lsStepLeft"
QT_MOC_LITERAL(16, 188, 11), // "lsStepRight"
QT_MOC_LITERAL(17, 200, 12), // "lsStepCenter"
QT_MOC_LITERAL(18, 213, 9), // "lsImpulse"
QT_MOC_LITERAL(19, 223, 6), // "etNone"
QT_MOC_LITERAL(20, 230, 5), // "etKey"
QT_MOC_LITERAL(21, 236, 7), // "etValue"
QT_MOC_LITERAL(22, 244, 6) // "etBoth"
},
"QCPGraph\0lineStyle\0LineStyle\0scatterStyle\0"
"QCPScatterStyle\0errorType\0ErrorType\0"
"errorPen\0errorBarSize\0errorBarSkipSymbol\0"
"channelFillGraph\0QCPGraph*\0adaptiveSampling\0"
"lsNone\0lsLine\0lsStepLeft\0lsStepRight\0"
"lsStepCenter\0lsImpulse\0etNone\0etKey\0"
"etValue\0etBoth"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPGraph[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
8, 14, // properties
2, 38, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 6, 0x0009510b,
7, QMetaType::QPen, 0x00095103,
8, QMetaType::Double, 0x00095103,
9, QMetaType::Bool, 0x00095103,
10, 0x80000000 | 11, 0x0009510b,
12, QMetaType::Bool, 0x00095103,
// enums: name, flags, count, data
2, 0x0, 6, 46,
6, 0x0, 4, 58,
// enum data: key, value
13, uint(QCPGraph::lsNone),
14, uint(QCPGraph::lsLine),
15, uint(QCPGraph::lsStepLeft),
16, uint(QCPGraph::lsStepRight),
17, uint(QCPGraph::lsStepCenter),
18, uint(QCPGraph::lsImpulse),
19, uint(QCPGraph::etNone),
20, uint(QCPGraph::etKey),
21, uint(QCPGraph::etValue),
22, uint(QCPGraph::etBoth),
0 // eod
};
void QCPGraph::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 6:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPGraph* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPGraph *_t = static_cast<QCPGraph *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< LineStyle*>(_v) = _t->lineStyle(); break;
case 1: *reinterpret_cast< QCPScatterStyle*>(_v) = _t->scatterStyle(); break;
case 2: *reinterpret_cast< ErrorType*>(_v) = _t->errorType(); break;
case 3: *reinterpret_cast< QPen*>(_v) = _t->errorPen(); break;
case 4: *reinterpret_cast< double*>(_v) = _t->errorBarSize(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->errorBarSkipSymbol(); break;
case 6: *reinterpret_cast< QCPGraph**>(_v) = _t->channelFillGraph(); break;
case 7: *reinterpret_cast< bool*>(_v) = _t->adaptiveSampling(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPGraph *_t = static_cast<QCPGraph *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setLineStyle(*reinterpret_cast< LineStyle*>(_v)); break;
case 1: _t->setScatterStyle(*reinterpret_cast< QCPScatterStyle*>(_v)); break;
case 2: _t->setErrorType(*reinterpret_cast< ErrorType*>(_v)); break;
case 3: _t->setErrorPen(*reinterpret_cast< QPen*>(_v)); break;
case 4: _t->setErrorBarSize(*reinterpret_cast< double*>(_v)); break;
case 5: _t->setErrorBarSkipSymbol(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setChannelFillGraph(*reinterpret_cast< QCPGraph**>(_v)); break;
case 7: _t->setAdaptiveSampling(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
QT_INIT_METAOBJECT const QMetaObject QCPGraph::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPGraph.data,
qt_meta_data_QCPGraph, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPGraph::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPGraph::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPGraph.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPGraph::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 8;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPCurve_t {
QByteArrayData data[5];
char stringdata0[58];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPCurve_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPCurve_t qt_meta_stringdata_QCPCurve = {
{
QT_MOC_LITERAL(0, 0, 8), // "QCPCurve"
QT_MOC_LITERAL(1, 9, 12), // "scatterStyle"
QT_MOC_LITERAL(2, 22, 15), // "QCPScatterStyle"
QT_MOC_LITERAL(3, 38, 9), // "lineStyle"
QT_MOC_LITERAL(4, 48, 9) // "LineStyle"
},
"QCPCurve\0scatterStyle\0QCPScatterStyle\0"
"lineStyle\0LineStyle"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPCurve[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
2, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, 0x80000000 | 4, 0x0009510b,
0 // eod
};
void QCPCurve::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPCurve *_t = static_cast<QCPCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPScatterStyle*>(_v) = _t->scatterStyle(); break;
case 1: *reinterpret_cast< LineStyle*>(_v) = _t->lineStyle(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPCurve *_t = static_cast<QCPCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setScatterStyle(*reinterpret_cast< QCPScatterStyle*>(_v)); break;
case 1: _t->setLineStyle(*reinterpret_cast< LineStyle*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPCurve::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPCurve.data,
qt_meta_data_QCPCurve, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPCurve::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPCurve::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPCurve.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPCurve::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPBarsGroup_t {
QByteArrayData data[4];
char stringdata0[45];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPBarsGroup_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPBarsGroup_t qt_meta_stringdata_QCPBarsGroup = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPBarsGroup"
QT_MOC_LITERAL(1, 13, 11), // "spacingType"
QT_MOC_LITERAL(2, 25, 11), // "SpacingType"
QT_MOC_LITERAL(3, 37, 7) // "spacing"
},
"QCPBarsGroup\0spacingType\0SpacingType\0"
"spacing"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPBarsGroup[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
2, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, QMetaType::Double, 0x00095103,
0 // eod
};
void QCPBarsGroup::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPBarsGroup *_t = static_cast<QCPBarsGroup *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< SpacingType*>(_v) = _t->spacingType(); break;
case 1: *reinterpret_cast< double*>(_v) = _t->spacing(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPBarsGroup *_t = static_cast<QCPBarsGroup *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setSpacingType(*reinterpret_cast< SpacingType*>(_v)); break;
case 1: _t->setSpacing(*reinterpret_cast< double*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPBarsGroup::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPBarsGroup.data,
qt_meta_data_QCPBarsGroup, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPBarsGroup::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPBarsGroup::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPBarsGroup.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPBarsGroup::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPBars_t {
QByteArrayData data[13];
char stringdata0[135];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPBars_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPBars_t qt_meta_stringdata_QCPBars = {
{
QT_MOC_LITERAL(0, 0, 7), // "QCPBars"
QT_MOC_LITERAL(1, 8, 5), // "width"
QT_MOC_LITERAL(2, 14, 9), // "widthType"
QT_MOC_LITERAL(3, 24, 9), // "WidthType"
QT_MOC_LITERAL(4, 34, 9), // "barsGroup"
QT_MOC_LITERAL(5, 44, 13), // "QCPBarsGroup*"
QT_MOC_LITERAL(6, 58, 9), // "baseValue"
QT_MOC_LITERAL(7, 68, 8), // "barBelow"
QT_MOC_LITERAL(8, 77, 8), // "QCPBars*"
QT_MOC_LITERAL(9, 86, 8), // "barAbove"
QT_MOC_LITERAL(10, 95, 10), // "wtAbsolute"
QT_MOC_LITERAL(11, 106, 15), // "wtAxisRectRatio"
QT_MOC_LITERAL(12, 122, 12) // "wtPlotCoords"
},
"QCPBars\0width\0widthType\0WidthType\0"
"barsGroup\0QCPBarsGroup*\0baseValue\0"
"barBelow\0QCPBars*\0barAbove\0wtAbsolute\0"
"wtAxisRectRatio\0wtPlotCoords"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPBars[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
6, 14, // properties
1, 32, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Double, 0x00095103,
2, 0x80000000 | 3, 0x0009510b,
4, 0x80000000 | 5, 0x0009510b,
6, QMetaType::Double, 0x00095103,
7, 0x80000000 | 8, 0x00095009,
9, 0x80000000 | 8, 0x00095009,
// enums: name, flags, count, data
3, 0x0, 3, 36,
// enum data: key, value
10, uint(QCPBars::wtAbsolute),
11, uint(QCPBars::wtAxisRectRatio),
12, uint(QCPBars::wtPlotCoords),
0 // eod
};
void QCPBars::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 5:
case 4:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPBars* >(); break;
case 2:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPBarsGroup* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPBars *_t = static_cast<QCPBars *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< double*>(_v) = _t->width(); break;
case 1: *reinterpret_cast< WidthType*>(_v) = _t->widthType(); break;
case 2: *reinterpret_cast< QCPBarsGroup**>(_v) = _t->barsGroup(); break;
case 3: *reinterpret_cast< double*>(_v) = _t->baseValue(); break;
case 4: *reinterpret_cast< QCPBars**>(_v) = _t->barBelow(); break;
case 5: *reinterpret_cast< QCPBars**>(_v) = _t->barAbove(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPBars *_t = static_cast<QCPBars *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setWidth(*reinterpret_cast< double*>(_v)); break;
case 1: _t->setWidthType(*reinterpret_cast< WidthType*>(_v)); break;
case 2: _t->setBarsGroup(*reinterpret_cast< QCPBarsGroup**>(_v)); break;
case 3: _t->setBaseValue(*reinterpret_cast< double*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
QT_INIT_METAOBJECT const QMetaObject QCPBars::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPBars.data,
qt_meta_data_QCPBars, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPBars::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPBars::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPBars.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPBars::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPStatisticalBox_t {
QByteArrayData data[16];
char stringdata0[181];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPStatisticalBox_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPStatisticalBox_t qt_meta_stringdata_QCPStatisticalBox = {
{
QT_MOC_LITERAL(0, 0, 17), // "QCPStatisticalBox"
QT_MOC_LITERAL(1, 18, 3), // "key"
QT_MOC_LITERAL(2, 22, 7), // "minimum"
QT_MOC_LITERAL(3, 30, 13), // "lowerQuartile"
QT_MOC_LITERAL(4, 44, 6), // "median"
QT_MOC_LITERAL(5, 51, 13), // "upperQuartile"
QT_MOC_LITERAL(6, 65, 7), // "maximum"
QT_MOC_LITERAL(7, 73, 8), // "outliers"
QT_MOC_LITERAL(8, 82, 15), // "QVector<double>"
QT_MOC_LITERAL(9, 98, 5), // "width"
QT_MOC_LITERAL(10, 104, 12), // "whiskerWidth"
QT_MOC_LITERAL(11, 117, 10), // "whiskerPen"
QT_MOC_LITERAL(12, 128, 13), // "whiskerBarPen"
QT_MOC_LITERAL(13, 142, 9), // "medianPen"
QT_MOC_LITERAL(14, 152, 12), // "outlierStyle"
QT_MOC_LITERAL(15, 165, 15) // "QCPScatterStyle"
},
"QCPStatisticalBox\0key\0minimum\0"
"lowerQuartile\0median\0upperQuartile\0"
"maximum\0outliers\0QVector<double>\0width\0"
"whiskerWidth\0whiskerPen\0whiskerBarPen\0"
"medianPen\0outlierStyle\0QCPScatterStyle"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPStatisticalBox[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
13, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Double, 0x00095103,
2, QMetaType::Double, 0x00095103,
3, QMetaType::Double, 0x00095103,
4, QMetaType::Double, 0x00095103,
5, QMetaType::Double, 0x00095103,
6, QMetaType::Double, 0x00095103,
7, 0x80000000 | 8, 0x0009510b,
9, QMetaType::Double, 0x00095103,
10, QMetaType::Double, 0x00095103,
11, QMetaType::QPen, 0x00095103,
12, QMetaType::QPen, 0x00095103,
13, QMetaType::QPen, 0x00095103,
14, 0x80000000 | 15, 0x0009510b,
0 // eod
};
void QCPStatisticalBox::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 6:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QVector<double> >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPStatisticalBox *_t = static_cast<QCPStatisticalBox *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< double*>(_v) = _t->key(); break;
case 1: *reinterpret_cast< double*>(_v) = _t->minimum(); break;
case 2: *reinterpret_cast< double*>(_v) = _t->lowerQuartile(); break;
case 3: *reinterpret_cast< double*>(_v) = _t->median(); break;
case 4: *reinterpret_cast< double*>(_v) = _t->upperQuartile(); break;
case 5: *reinterpret_cast< double*>(_v) = _t->maximum(); break;
case 6: *reinterpret_cast< QVector<double>*>(_v) = _t->outliers(); break;
case 7: *reinterpret_cast< double*>(_v) = _t->width(); break;
case 8: *reinterpret_cast< double*>(_v) = _t->whiskerWidth(); break;
case 9: *reinterpret_cast< QPen*>(_v) = _t->whiskerPen(); break;
case 10: *reinterpret_cast< QPen*>(_v) = _t->whiskerBarPen(); break;
case 11: *reinterpret_cast< QPen*>(_v) = _t->medianPen(); break;
case 12: *reinterpret_cast< QCPScatterStyle*>(_v) = _t->outlierStyle(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPStatisticalBox *_t = static_cast<QCPStatisticalBox *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setKey(*reinterpret_cast< double*>(_v)); break;
case 1: _t->setMinimum(*reinterpret_cast< double*>(_v)); break;
case 2: _t->setLowerQuartile(*reinterpret_cast< double*>(_v)); break;
case 3: _t->setMedian(*reinterpret_cast< double*>(_v)); break;
case 4: _t->setUpperQuartile(*reinterpret_cast< double*>(_v)); break;
case 5: _t->setMaximum(*reinterpret_cast< double*>(_v)); break;
case 6: _t->setOutliers(*reinterpret_cast< QVector<double>*>(_v)); break;
case 7: _t->setWidth(*reinterpret_cast< double*>(_v)); break;
case 8: _t->setWhiskerWidth(*reinterpret_cast< double*>(_v)); break;
case 9: _t->setWhiskerPen(*reinterpret_cast< QPen*>(_v)); break;
case 10: _t->setWhiskerBarPen(*reinterpret_cast< QPen*>(_v)); break;
case 11: _t->setMedianPen(*reinterpret_cast< QPen*>(_v)); break;
case 12: _t->setOutlierStyle(*reinterpret_cast< QCPScatterStyle*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
QT_INIT_METAOBJECT const QMetaObject QCPStatisticalBox::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPStatisticalBox.data,
qt_meta_data_QCPStatisticalBox, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPStatisticalBox::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPStatisticalBox::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPStatisticalBox.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPStatisticalBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 13;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPColorMap_t {
QByteArrayData data[25];
char stringdata0[334];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorMap_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorMap_t qt_meta_stringdata_QCPColorMap = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPColorMap"
QT_MOC_LITERAL(1, 12, 16), // "dataRangeChanged"
QT_MOC_LITERAL(2, 29, 0), // ""
QT_MOC_LITERAL(3, 30, 8), // "QCPRange"
QT_MOC_LITERAL(4, 39, 8), // "newRange"
QT_MOC_LITERAL(5, 48, 20), // "dataScaleTypeChanged"
QT_MOC_LITERAL(6, 69, 18), // "QCPAxis::ScaleType"
QT_MOC_LITERAL(7, 88, 9), // "scaleType"
QT_MOC_LITERAL(8, 98, 15), // "gradientChanged"
QT_MOC_LITERAL(9, 114, 16), // "QCPColorGradient"
QT_MOC_LITERAL(10, 131, 11), // "newGradient"
QT_MOC_LITERAL(11, 143, 12), // "setDataRange"
QT_MOC_LITERAL(12, 156, 9), // "dataRange"
QT_MOC_LITERAL(13, 166, 16), // "setDataScaleType"
QT_MOC_LITERAL(14, 183, 11), // "setGradient"
QT_MOC_LITERAL(15, 195, 8), // "gradient"
QT_MOC_LITERAL(16, 204, 16), // "updateLegendIcon"
QT_MOC_LITERAL(17, 221, 22), // "Qt::TransformationMode"
QT_MOC_LITERAL(18, 244, 13), // "transformMode"
QT_MOC_LITERAL(19, 258, 9), // "thumbSize"
QT_MOC_LITERAL(20, 268, 13), // "dataScaleType"
QT_MOC_LITERAL(21, 282, 11), // "interpolate"
QT_MOC_LITERAL(22, 294, 13), // "tightBoundary"
QT_MOC_LITERAL(23, 308, 10), // "colorScale"
QT_MOC_LITERAL(24, 319, 14) // "QCPColorScale*"
},
"QCPColorMap\0dataRangeChanged\0\0QCPRange\0"
"newRange\0dataScaleTypeChanged\0"
"QCPAxis::ScaleType\0scaleType\0"
"gradientChanged\0QCPColorGradient\0"
"newGradient\0setDataRange\0dataRange\0"
"setDataScaleType\0setGradient\0gradient\0"
"updateLegendIcon\0Qt::TransformationMode\0"
"transformMode\0thumbSize\0dataScaleType\0"
"interpolate\0tightBoundary\0colorScale\0"
"QCPColorScale*"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorMap[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
9, 14, // methods
6, 86, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
3, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 59, 2, 0x06 /* Public */,
5, 1, 62, 2, 0x06 /* Public */,
8, 1, 65, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
11, 1, 68, 2, 0x0a /* Public */,
13, 1, 71, 2, 0x0a /* Public */,
14, 1, 74, 2, 0x0a /* Public */,
16, 2, 77, 2, 0x0a /* Public */,
16, 1, 82, 2, 0x2a /* Public | MethodCloned */,
16, 0, 85, 2, 0x2a /* Public | MethodCloned */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 10,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 12,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 15,
QMetaType::Void, 0x80000000 | 17, QMetaType::QSize, 18, 19,
QMetaType::Void, 0x80000000 | 17, 18,
QMetaType::Void,
// properties: name, type, flags
12, 0x80000000 | 3, 0x0049510b,
20, 0x80000000 | 6, 0x0049510b,
15, 0x80000000 | 9, 0x0049510b,
21, QMetaType::Bool, 0x00095103,
22, QMetaType::Bool, 0x00095103,
23, 0x80000000 | 24, 0x0009510b,
// properties: notify_signal_id
0,
1,
2,
0,
0,
0,
0 // eod
};
void QCPColorMap::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPColorMap *_t = static_cast<QCPColorMap *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->dataRangeChanged((*reinterpret_cast< QCPRange(*)>(_a[1]))); break;
case 1: _t->dataScaleTypeChanged((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 2: _t->gradientChanged((*reinterpret_cast< QCPColorGradient(*)>(_a[1]))); break;
case 3: _t->setDataRange((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 4: _t->setDataScaleType((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 5: _t->setGradient((*reinterpret_cast< const QCPColorGradient(*)>(_a[1]))); break;
case 6: _t->updateLegendIcon((*reinterpret_cast< Qt::TransformationMode(*)>(_a[1])),(*reinterpret_cast< const QSize(*)>(_a[2]))); break;
case 7: _t->updateLegendIcon((*reinterpret_cast< Qt::TransformationMode(*)>(_a[1]))); break;
case 8: _t->updateLegendIcon(); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QCPColorMap::*)(QCPRange );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorMap::dataRangeChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QCPColorMap::*)(QCPAxis::ScaleType );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorMap::dataScaleTypeChanged)) {
*result = 1;
return;
}
}
{
using _t = void (QCPColorMap::*)(QCPColorGradient );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorMap::gradientChanged)) {
*result = 2;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 5:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPColorScale* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPColorMap *_t = static_cast<QCPColorMap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPRange*>(_v) = _t->dataRange(); break;
case 1: *reinterpret_cast< QCPAxis::ScaleType*>(_v) = _t->dataScaleType(); break;
case 2: *reinterpret_cast< QCPColorGradient*>(_v) = _t->gradient(); break;
case 3: *reinterpret_cast< bool*>(_v) = _t->interpolate(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->tightBoundary(); break;
case 5: *reinterpret_cast< QCPColorScale**>(_v) = _t->colorScale(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPColorMap *_t = static_cast<QCPColorMap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setDataRange(*reinterpret_cast< QCPRange*>(_v)); break;
case 1: _t->setDataScaleType(*reinterpret_cast< QCPAxis::ScaleType*>(_v)); break;
case 2: _t->setGradient(*reinterpret_cast< QCPColorGradient*>(_v)); break;
case 3: _t->setInterpolate(*reinterpret_cast< bool*>(_v)); break;
case 4: _t->setTightBoundary(*reinterpret_cast< bool*>(_v)); break;
case 5: _t->setColorScale(*reinterpret_cast< QCPColorScale**>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
static const QMetaObject * const qt_meta_extradata_QCPColorMap[] = {
&QCPAxis::staticMetaObject,
nullptr
};
QT_INIT_METAOBJECT const QMetaObject QCPColorMap::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPColorMap.data,
qt_meta_data_QCPColorMap, qt_static_metacall, qt_meta_extradata_QCPColorMap, nullptr}
};
const QMetaObject *QCPColorMap::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPColorMap::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPColorMap.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPColorMap::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 9)
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 9)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 9;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPColorMap::dataRangeChanged(QCPRange _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPColorMap::dataScaleTypeChanged(QCPAxis::ScaleType _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPColorMap::gradientChanged(QCPColorGradient _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
struct qt_meta_stringdata_QCPFinancial_t {
QByteArrayData data[11];
char stringdata0[125];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPFinancial_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPFinancial_t qt_meta_stringdata_QCPFinancial = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPFinancial"
QT_MOC_LITERAL(1, 13, 10), // "chartStyle"
QT_MOC_LITERAL(2, 24, 10), // "ChartStyle"
QT_MOC_LITERAL(3, 35, 5), // "width"
QT_MOC_LITERAL(4, 41, 10), // "twoColored"
QT_MOC_LITERAL(5, 52, 13), // "brushPositive"
QT_MOC_LITERAL(6, 66, 13), // "brushNegative"
QT_MOC_LITERAL(7, 80, 11), // "penPositive"
QT_MOC_LITERAL(8, 92, 11), // "penNegative"
QT_MOC_LITERAL(9, 104, 6), // "csOhlc"
QT_MOC_LITERAL(10, 111, 13) // "csCandlestick"
},
"QCPFinancial\0chartStyle\0ChartStyle\0"
"width\0twoColored\0brushPositive\0"
"brushNegative\0penPositive\0penNegative\0"
"csOhlc\0csCandlestick"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPFinancial[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
7, 14, // properties
1, 35, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, QMetaType::Double, 0x00095103,
4, QMetaType::Bool, 0x00095103,
5, QMetaType::QBrush, 0x00095103,
6, QMetaType::QBrush, 0x00095103,
7, QMetaType::QPen, 0x00095103,
8, QMetaType::QPen, 0x00095103,
// enums: name, flags, count, data
2, 0x0, 2, 39,
// enum data: key, value
9, uint(QCPFinancial::csOhlc),
10, uint(QCPFinancial::csCandlestick),
0 // eod
};
void QCPFinancial::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPFinancial *_t = static_cast<QCPFinancial *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< ChartStyle*>(_v) = _t->chartStyle(); break;
case 1: *reinterpret_cast< double*>(_v) = _t->width(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->twoColored(); break;
case 3: *reinterpret_cast< QBrush*>(_v) = _t->brushPositive(); break;
case 4: *reinterpret_cast< QBrush*>(_v) = _t->brushNegative(); break;
case 5: *reinterpret_cast< QPen*>(_v) = _t->penPositive(); break;
case 6: *reinterpret_cast< QPen*>(_v) = _t->penNegative(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPFinancial *_t = static_cast<QCPFinancial *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setChartStyle(*reinterpret_cast< ChartStyle*>(_v)); break;
case 1: _t->setWidth(*reinterpret_cast< double*>(_v)); break;
case 2: _t->setTwoColored(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setBrushPositive(*reinterpret_cast< QBrush*>(_v)); break;
case 4: _t->setBrushNegative(*reinterpret_cast< QBrush*>(_v)); break;
case 5: _t->setPenPositive(*reinterpret_cast< QPen*>(_v)); break;
case 6: _t->setPenNegative(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPFinancial::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPFinancial.data,
qt_meta_data_QCPFinancial, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPFinancial::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPFinancial::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPFinancial.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPFinancial::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemStraightLine_t {
QByteArrayData data[3];
char stringdata0[36];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemStraightLine_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemStraightLine_t qt_meta_stringdata_QCPItemStraightLine = {
{
QT_MOC_LITERAL(0, 0, 19), // "QCPItemStraightLine"
QT_MOC_LITERAL(1, 20, 3), // "pen"
QT_MOC_LITERAL(2, 24, 11) // "selectedPen"
},
"QCPItemStraightLine\0pen\0selectedPen"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemStraightLine[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
2, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
0 // eod
};
void QCPItemStraightLine::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemStraightLine *_t = static_cast<QCPItemStraightLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemStraightLine *_t = static_cast<QCPItemStraightLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemStraightLine::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemStraightLine.data,
qt_meta_data_QCPItemStraightLine, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemStraightLine::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemStraightLine::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemStraightLine.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemStraightLine::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemLine_t {
QByteArrayData data[6];
char stringdata0[52];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemLine_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemLine_t qt_meta_stringdata_QCPItemLine = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPItemLine"
QT_MOC_LITERAL(1, 12, 3), // "pen"
QT_MOC_LITERAL(2, 16, 11), // "selectedPen"
QT_MOC_LITERAL(3, 28, 4), // "head"
QT_MOC_LITERAL(4, 33, 13), // "QCPLineEnding"
QT_MOC_LITERAL(5, 47, 4) // "tail"
},
"QCPItemLine\0pen\0selectedPen\0head\0"
"QCPLineEnding\0tail"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemLine[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 4, 0x0009510b,
0 // eod
};
void QCPItemLine::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemLine *_t = static_cast<QCPItemLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QCPLineEnding*>(_v) = _t->head(); break;
case 3: *reinterpret_cast< QCPLineEnding*>(_v) = _t->tail(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemLine *_t = static_cast<QCPItemLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setHead(*reinterpret_cast< QCPLineEnding*>(_v)); break;
case 3: _t->setTail(*reinterpret_cast< QCPLineEnding*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemLine::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemLine.data,
qt_meta_data_QCPItemLine, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemLine::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemLine::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemLine.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemLine::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemCurve_t {
QByteArrayData data[6];
char stringdata0[53];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemCurve_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemCurve_t qt_meta_stringdata_QCPItemCurve = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPItemCurve"
QT_MOC_LITERAL(1, 13, 3), // "pen"
QT_MOC_LITERAL(2, 17, 11), // "selectedPen"
QT_MOC_LITERAL(3, 29, 4), // "head"
QT_MOC_LITERAL(4, 34, 13), // "QCPLineEnding"
QT_MOC_LITERAL(5, 48, 4) // "tail"
},
"QCPItemCurve\0pen\0selectedPen\0head\0"
"QCPLineEnding\0tail"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemCurve[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 4, 0x0009510b,
0 // eod
};
void QCPItemCurve::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemCurve *_t = static_cast<QCPItemCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QCPLineEnding*>(_v) = _t->head(); break;
case 3: *reinterpret_cast< QCPLineEnding*>(_v) = _t->tail(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemCurve *_t = static_cast<QCPItemCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setHead(*reinterpret_cast< QCPLineEnding*>(_v)); break;
case 3: _t->setTail(*reinterpret_cast< QCPLineEnding*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemCurve::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemCurve.data,
qt_meta_data_QCPItemCurve, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemCurve::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemCurve::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemCurve.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemCurve::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemRect_t {
QByteArrayData data[5];
char stringdata0[48];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemRect_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemRect_t qt_meta_stringdata_QCPItemRect = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPItemRect"
QT_MOC_LITERAL(1, 12, 3), // "pen"
QT_MOC_LITERAL(2, 16, 11), // "selectedPen"
QT_MOC_LITERAL(3, 28, 5), // "brush"
QT_MOC_LITERAL(4, 34, 13) // "selectedBrush"
},
"QCPItemRect\0pen\0selectedPen\0brush\0"
"selectedBrush"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemRect[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::QBrush, 0x00095103,
4, QMetaType::QBrush, 0x00095103,
0 // eod
};
void QCPItemRect::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemRect *_t = static_cast<QCPItemRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 3: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemRect *_t = static_cast<QCPItemRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 3: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemRect::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemRect.data,
qt_meta_data_QCPItemRect, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemRect::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemRect::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemRect.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemRect::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemText_t {
QByteArrayData data[16];
char stringdata0[163];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemText_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemText_t qt_meta_stringdata_QCPItemText = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPItemText"
QT_MOC_LITERAL(1, 12, 5), // "color"
QT_MOC_LITERAL(2, 18, 13), // "selectedColor"
QT_MOC_LITERAL(3, 32, 3), // "pen"
QT_MOC_LITERAL(4, 36, 11), // "selectedPen"
QT_MOC_LITERAL(5, 48, 5), // "brush"
QT_MOC_LITERAL(6, 54, 13), // "selectedBrush"
QT_MOC_LITERAL(7, 68, 4), // "font"
QT_MOC_LITERAL(8, 73, 12), // "selectedFont"
QT_MOC_LITERAL(9, 86, 4), // "text"
QT_MOC_LITERAL(10, 91, 17), // "positionAlignment"
QT_MOC_LITERAL(11, 109, 13), // "Qt::Alignment"
QT_MOC_LITERAL(12, 123, 13), // "textAlignment"
QT_MOC_LITERAL(13, 137, 8), // "rotation"
QT_MOC_LITERAL(14, 146, 7), // "padding"
QT_MOC_LITERAL(15, 154, 8) // "QMargins"
},
"QCPItemText\0color\0selectedColor\0pen\0"
"selectedPen\0brush\0selectedBrush\0font\0"
"selectedFont\0text\0positionAlignment\0"
"Qt::Alignment\0textAlignment\0rotation\0"
"padding\0QMargins"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemText[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
13, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QColor, 0x00095103,
2, QMetaType::QColor, 0x00095103,
3, QMetaType::QPen, 0x00095103,
4, QMetaType::QPen, 0x00095103,
5, QMetaType::QBrush, 0x00095103,
6, QMetaType::QBrush, 0x00095103,
7, QMetaType::QFont, 0x00095103,
8, QMetaType::QFont, 0x00095103,
9, QMetaType::QString, 0x00095103,
10, 0x80000000 | 11, 0x0009510b,
12, 0x80000000 | 11, 0x0009510b,
13, QMetaType::Double, 0x00095103,
14, 0x80000000 | 15, 0x0009510b,
0 // eod
};
void QCPItemText::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemText *_t = static_cast<QCPItemText *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QColor*>(_v) = _t->color(); break;
case 1: *reinterpret_cast< QColor*>(_v) = _t->selectedColor(); break;
case 2: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 3: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 4: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 5: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
case 6: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 7: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 8: *reinterpret_cast< QString*>(_v) = _t->text(); break;
case 9: *reinterpret_cast< Qt::Alignment*>(_v) = _t->positionAlignment(); break;
case 10: *reinterpret_cast< Qt::Alignment*>(_v) = _t->textAlignment(); break;
case 11: *reinterpret_cast< double*>(_v) = _t->rotation(); break;
case 12: *reinterpret_cast< QMargins*>(_v) = _t->padding(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemText *_t = static_cast<QCPItemText *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setColor(*reinterpret_cast< QColor*>(_v)); break;
case 1: _t->setSelectedColor(*reinterpret_cast< QColor*>(_v)); break;
case 2: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 3: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 4: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 5: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 6: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 7: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 8: _t->setText(*reinterpret_cast< QString*>(_v)); break;
case 9: _t->setPositionAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
case 10: _t->setTextAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
case 11: _t->setRotation(*reinterpret_cast< double*>(_v)); break;
case 12: _t->setPadding(*reinterpret_cast< QMargins*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemText::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemText.data,
qt_meta_data_QCPItemText, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemText::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemText::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemText.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemText::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 13;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemEllipse_t {
QByteArrayData data[5];
char stringdata0[51];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemEllipse_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemEllipse_t qt_meta_stringdata_QCPItemEllipse = {
{
QT_MOC_LITERAL(0, 0, 14), // "QCPItemEllipse"
QT_MOC_LITERAL(1, 15, 3), // "pen"
QT_MOC_LITERAL(2, 19, 11), // "selectedPen"
QT_MOC_LITERAL(3, 31, 5), // "brush"
QT_MOC_LITERAL(4, 37, 13) // "selectedBrush"
},
"QCPItemEllipse\0pen\0selectedPen\0brush\0"
"selectedBrush"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemEllipse[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::QBrush, 0x00095103,
4, QMetaType::QBrush, 0x00095103,
0 // eod
};
void QCPItemEllipse::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemEllipse *_t = static_cast<QCPItemEllipse *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 3: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemEllipse *_t = static_cast<QCPItemEllipse *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 3: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemEllipse::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemEllipse.data,
qt_meta_data_QCPItemEllipse, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemEllipse::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemEllipse::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemEllipse.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemEllipse::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemPixmap_t {
QByteArrayData data[9];
char stringdata0[122];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemPixmap_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemPixmap_t qt_meta_stringdata_QCPItemPixmap = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPItemPixmap"
QT_MOC_LITERAL(1, 14, 6), // "pixmap"
QT_MOC_LITERAL(2, 21, 6), // "scaled"
QT_MOC_LITERAL(3, 28, 15), // "aspectRatioMode"
QT_MOC_LITERAL(4, 44, 19), // "Qt::AspectRatioMode"
QT_MOC_LITERAL(5, 64, 18), // "transformationMode"
QT_MOC_LITERAL(6, 83, 22), // "Qt::TransformationMode"
QT_MOC_LITERAL(7, 106, 3), // "pen"
QT_MOC_LITERAL(8, 110, 11) // "selectedPen"
},
"QCPItemPixmap\0pixmap\0scaled\0aspectRatioMode\0"
"Qt::AspectRatioMode\0transformationMode\0"
"Qt::TransformationMode\0pen\0selectedPen"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemPixmap[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
6, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPixmap, 0x00095103,
2, QMetaType::Bool, 0x00095103,
3, 0x80000000 | 4, 0x00095009,
5, 0x80000000 | 6, 0x00095009,
7, QMetaType::QPen, 0x00095103,
8, QMetaType::QPen, 0x00095103,
0 // eod
};
void QCPItemPixmap::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemPixmap *_t = static_cast<QCPItemPixmap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPixmap*>(_v) = _t->pixmap(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->scaled(); break;
case 2: *reinterpret_cast< Qt::AspectRatioMode*>(_v) = _t->aspectRatioMode(); break;
case 3: *reinterpret_cast< Qt::TransformationMode*>(_v) = _t->transformationMode(); break;
case 4: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 5: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemPixmap *_t = static_cast<QCPItemPixmap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPixmap(*reinterpret_cast< QPixmap*>(_v)); break;
case 1: _t->setScaled(*reinterpret_cast< bool*>(_v)); break;
case 4: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 5: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemPixmap::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemPixmap.data,
qt_meta_data_QCPItemPixmap, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemPixmap::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemPixmap::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemPixmap.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemPixmap::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemTracer_t {
QByteArrayData data[17];
char stringdata0[156];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemTracer_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemTracer_t qt_meta_stringdata_QCPItemTracer = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPItemTracer"
QT_MOC_LITERAL(1, 14, 3), // "pen"
QT_MOC_LITERAL(2, 18, 11), // "selectedPen"
QT_MOC_LITERAL(3, 30, 5), // "brush"
QT_MOC_LITERAL(4, 36, 13), // "selectedBrush"
QT_MOC_LITERAL(5, 50, 4), // "size"
QT_MOC_LITERAL(6, 55, 5), // "style"
QT_MOC_LITERAL(7, 61, 11), // "TracerStyle"
QT_MOC_LITERAL(8, 73, 5), // "graph"
QT_MOC_LITERAL(9, 79, 9), // "QCPGraph*"
QT_MOC_LITERAL(10, 89, 8), // "graphKey"
QT_MOC_LITERAL(11, 98, 13), // "interpolating"
QT_MOC_LITERAL(12, 112, 6), // "tsNone"
QT_MOC_LITERAL(13, 119, 6), // "tsPlus"
QT_MOC_LITERAL(14, 126, 11), // "tsCrosshair"
QT_MOC_LITERAL(15, 138, 8), // "tsCircle"
QT_MOC_LITERAL(16, 147, 8) // "tsSquare"
},
"QCPItemTracer\0pen\0selectedPen\0brush\0"
"selectedBrush\0size\0style\0TracerStyle\0"
"graph\0QCPGraph*\0graphKey\0interpolating\0"
"tsNone\0tsPlus\0tsCrosshair\0tsCircle\0"
"tsSquare"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemTracer[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
9, 14, // properties
1, 41, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::QBrush, 0x00095103,
4, QMetaType::QBrush, 0x00095103,
5, QMetaType::Double, 0x00095103,
6, 0x80000000 | 7, 0x0009510b,
8, 0x80000000 | 9, 0x0009510b,
10, QMetaType::Double, 0x00095103,
11, QMetaType::Bool, 0x00095103,
// enums: name, flags, count, data
7, 0x0, 5, 45,
// enum data: key, value
12, uint(QCPItemTracer::tsNone),
13, uint(QCPItemTracer::tsPlus),
14, uint(QCPItemTracer::tsCrosshair),
15, uint(QCPItemTracer::tsCircle),
16, uint(QCPItemTracer::tsSquare),
0 // eod
};
void QCPItemTracer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 6:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPGraph* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPItemTracer *_t = static_cast<QCPItemTracer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 3: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
case 4: *reinterpret_cast< double*>(_v) = _t->size(); break;
case 5: *reinterpret_cast< TracerStyle*>(_v) = _t->style(); break;
case 6: *reinterpret_cast< QCPGraph**>(_v) = _t->graph(); break;
case 7: *reinterpret_cast< double*>(_v) = _t->graphKey(); break;
case 8: *reinterpret_cast< bool*>(_v) = _t->interpolating(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemTracer *_t = static_cast<QCPItemTracer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 3: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 4: _t->setSize(*reinterpret_cast< double*>(_v)); break;
case 5: _t->setStyle(*reinterpret_cast< TracerStyle*>(_v)); break;
case 6: _t->setGraph(*reinterpret_cast< QCPGraph**>(_v)); break;
case 7: _t->setGraphKey(*reinterpret_cast< double*>(_v)); break;
case 8: _t->setInterpolating(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemTracer::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemTracer.data,
qt_meta_data_QCPItemTracer, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemTracer::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemTracer::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemTracer.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemTracer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 9;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemBracket_t {
QByteArrayData data[6];
char stringdata0[57];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemBracket_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemBracket_t qt_meta_stringdata_QCPItemBracket = {
{
QT_MOC_LITERAL(0, 0, 14), // "QCPItemBracket"
QT_MOC_LITERAL(1, 15, 3), // "pen"
QT_MOC_LITERAL(2, 19, 11), // "selectedPen"
QT_MOC_LITERAL(3, 31, 6), // "length"
QT_MOC_LITERAL(4, 38, 5), // "style"
QT_MOC_LITERAL(5, 44, 12) // "BracketStyle"
},
"QCPItemBracket\0pen\0selectedPen\0length\0"
"style\0BracketStyle"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemBracket[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::Double, 0x00095103,
4, 0x80000000 | 5, 0x0009510b,
0 // eod
};
void QCPItemBracket::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemBracket *_t = static_cast<QCPItemBracket *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< double*>(_v) = _t->length(); break;
case 3: *reinterpret_cast< BracketStyle*>(_v) = _t->style(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemBracket *_t = static_cast<QCPItemBracket *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setLength(*reinterpret_cast< double*>(_v)); break;
case 3: _t->setStyle(*reinterpret_cast< BracketStyle*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject QCPItemBracket::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemBracket.data,
qt_meta_data_QCPItemBracket, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemBracket::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemBracket::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemBracket.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemBracket::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
| [
"[email protected]"
] | |
7dce3de425fdcee13483351dd91259a0ea095b48 | 2da78138f1e76fc90d2c36e68f680104001a8d1c | /include/Usb.h | 4c23e7e211c63e11e53b5b5080297826e9976ded | [] | no_license | chriscottingham/armbase | 134472e24e054c342a8bc661d8f91805bad18769 | 31cb23e70b6daf7791b7f56cb0df8dbd3ad0367b | refs/heads/master | 2023-06-22T19:55:14.662461 | 2021-07-26T05:21:44 | 2021-07-26T05:21:44 | 387,533,729 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 246 | h | /*
* Usb.h
*
* Created on: Jul 25, 2021
* Author: becomingguru
*/
#ifndef USB_H_
#define USB_H_
class Usb {
public:
Usb() {
// enable HSE and PLL
// USBCLK == 48mhz
// must use crystal
}
virtual ~Usb();
};
#endif /* USB_H_ */
| [
"[email protected]"
] | |
b3be23b4e2cf2d4c307f31d562e328d156d64493 | 85b9ce4fb88972d9b86dce594ae4fb3acfcd0a4b | /build/Android/Preview/Global Pot/app/src/main/include/Fuse.Controls.Navigator.NavPage.h | 0d7e39d8d00d303f0a4afedab0536bc386db8acf | [] | no_license | bgirr/Global-Pot_App | 16431a99e26f1c60dc16223fb388d9fd525cb5fa | c96c5a8fb95acde66fc286bcd9a5cdf160ba8b1b | refs/heads/master | 2021-01-09T06:29:18.255583 | 2017-02-21T23:27:47 | 2017-02-21T23:27:47 | 80,985,681 | 0 | 0 | null | 2017-02-21T23:27:48 | 2017-02-05T10:29:14 | C++ | UTF-8 | C++ | false | false | 1,071 | h | // This file was generated based on C:\Users\EliteBook-User\AppData\Local\Fusetools\Packages\Fuse.Controls.Navigation\0.44.1\$.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Object.h>
namespace g{namespace Fuse{namespace Controls{struct Navigator__NavPage;}}}
namespace g{namespace Fuse{struct Visual;}}
namespace g{
namespace Fuse{
namespace Controls{
// private sealed class Navigator.NavPage :1382
// {
uType* Navigator__NavPage_typeof();
void Navigator__NavPage__ctor__fn(Navigator__NavPage* __this);
void Navigator__NavPage__CopyFrom_fn(Navigator__NavPage* __this, Navigator__NavPage* o);
void Navigator__NavPage__New1_fn(Navigator__NavPage** __retval);
void Navigator__NavPage__Reset_fn(Navigator__NavPage* __this);
struct Navigator__NavPage : uObject
{
uStrong<uString*> Parameter;
uStrong<uString*> Path;
uStrong< ::g::Fuse::Visual*> Visual;
void ctor_();
void CopyFrom(Navigator__NavPage* o);
void Reset();
static Navigator__NavPage* New1();
};
// }
}}} // ::g::Fuse::Controls
| [
"[email protected]"
] | |
32cb3bcf559c6aedc1d3ac0a5cb10693030910ba | 12f89e55b9c1e408eb413c5d1510c8786bdf82ae | /bigger-greater/bigger-greater.cpp | 7b057db364ba4e78e8b347fb4d9972e1561a8c30 | [] | no_license | e-zhang/hackerrank | 519ec4b9b814eed8db40c04675b9700134837323 | b2ca2680b22787e3446a45e0d0362e08349d82ee | refs/heads/master | 2021-01-10T12:27:37.563948 | 2016-02-23T21:54:55 | 2016-02-23T21:54:55 | 48,349,161 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,236 | cpp | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
void lexicographicNext( string& word )
{
if( word.empty() || word.size() < 2 )
{
word = "no answer";
return;
}
int i = word.size() - 2;
// find the largest index from the end where all the indices after are in descending order
while( i >= 0 && word[i] >= word[i+1] ) --i;
// everything is in descending order, so no more permutations
if( i < 0 )
{
word = "no answer";
return;
}
// so we know the index to be increased, so now we find the index of the next greater value
int j = word.size() - 1;
while( j >= i && word[i] >= word[j] ) --j;
if( j < i )
{
word = "no answer";
return;
}
// now we can swap i and j, we know since i and j are the smallest left
char tmp = word[i];
word[i] = word[j];
word[j] = tmp;
// now we reverse the descending indices to be in ascending
std::reverse( word.begin() + i + 1, word.end() );
}
int main()
{
int t;
cin >> t;
for( int i = 0; i < t; ++i )
{
string s;
cin >> s;
lexicographicNext( s );
cout << s << endl;
}
}
| [
"[email protected]"
] | |
39d07542e30e96fb4e5c9757ba61e4c4c274baa1 | b5e2f65f372c471f0901d3f5c361e2e90dd14cf9 | /Framework/MetroidGameContent/SamusAnimation.h | 4c36c346d441b96c68a5899e3c1c17166d724c4d | [] | no_license | tonykhoapro/Metroid | e6f9089d3b0334126184749dc7e93ade07ed0dc8 | 569e497342f352fef9f4d8240d13c667b7079c76 | refs/heads/master | 2021-05-10T21:55:13.100817 | 2018-01-20T15:52:01 | 2018-01-20T15:52:01 | 118,242,865 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,204 | h | #pragma once
#include "GameFramework\GameComponent\AnimationController.h"
class MetroidCharacter;
class SamusAnimation : public AnimationController
{
public:
SamusAnimation();
virtual ~SamusAnimation();
virtual void OnSpawn() override;
virtual void Update() override;
virtual void LateUpdate() override;
inline void Idle();
inline void Run();
inline void Roll();
inline void Jump();
inline void Rotate();
inline void AimUp();
inline void ShootUp();
inline void RunShootForward();
inline void JumpShootUp();
inline void JumpShootForward();
inline void RunShootUp();
void LockCurrentState(bool locked);
Vec2 playerVelocity;
Animation* idle;
Animation* run;
Animation* jump;
Animation* roll;
Animation* rotate;
Animation* aimup;
Animation* shootup;
Animation* runshootforward;
Animation* jumpshootup;
Animation* jumpshootforward;
Animation* runshootup;
float maxJumpSpeed;
float jumpSpeed;
double jumpTime;
bool stateLocked;
SimulatePhysics* physic;
MetroidCharacter* Samus;
friend class MetroidCharacter;
void (SamusAnimation::*RollFunc)();
void SamusAnimation::Roll_0();
void SamusAnimation::Roll_1();
void EnableRolling();
Vec2 RollingBodySize;
};
| [
"TONY@DESKTOP-3IOI83V"
] | TONY@DESKTOP-3IOI83V |
2cb17fe41965aa4a7c6a5f38a3248826e16d8060 | c1a27f6c8f1595b0f595b03ecf026e6121ac1ab4 | /BackupSystem/Trimming.h | 8c828bdf946b4676c7815f7730bfd99d4413e88b | [] | no_license | aogavrilov/Backups | 1e82a7e3d3f2e51b6adacb849f209e0befc334a5 | 6ac5f0dcd42aa141c529360321f8223f04e54d06 | refs/heads/master | 2023-01-13T20:16:45.551109 | 2020-11-27T20:22:25 | 2020-11-27T20:22:25 | 305,348,216 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,334 | h | //
// Created by Alexey on 20.10.2020.
//
#ifndef BACKUPS_TRIMMING_H
#define BACKUPS_TRIMMING_H
using namespace std;
#include <vector>
#include "Backup.h"
class Trimming{
protected:
Backup backup;
public:
Trimming(Backup backup) : backup(backup){};
virtual vector<bool> FilterPointsForRemove();
Backup Trim();
Backup Trim(vector<bool> DeletingPositions);
Backup AutoTrim();
vector<bool> bools;
};
class PointsTrimmingByCount : public Trimming{
int count;
public:
PointsTrimmingByCount(Backup backup, size_t count) : Trimming(backup), count(count){};
vector<bool> FilterPointsForRemove() override ;
};
class PointsTrimmingByDate : public Trimming{
tm* Date;
public:
PointsTrimmingByDate(Backup backup, tm* Date) : Trimming(backup), Date(Date){};
vector<bool> FilterPointsForRemove() override;
};
class PointsTrimmingByShape : public Trimming{
size_t shape;
public:
PointsTrimmingByShape(Backup backup, size_t shape) : Trimming(backup), shape(shape){};
vector<bool> FilterPointsForRemove() override;
};
class TrimmingMixed {
Backup backup;
vector<Trimming*> politics;
public:
TrimmingMixed(Backup backup, vector<Trimming*> politics) : backup(backup), politics(politics){
}
Backup Trim(PointLimits limit);
};
#endif //BACKUPS_TRIMMING_H
| [
"[email protected]"
] | |
0006ab04b28c334050812633bc6645f24896bcdf | e61f5b7a23c3b1ca014e4809e487e95a65fc3e2c | /Source/BansheePhysX/Source/BsPhysXBoxCollider.cpp | ffe440e5fe66393d1a75c76c53918252bc099f73 | [] | no_license | ketoo/BansheeEngine | 83568cb22f2997162905223013f3f6d73ae4227e | 1ce5ec1bb46329695dd7cc13c0556b5bf7278e39 | refs/heads/master | 2021-01-02T08:49:09.416072 | 2017-08-01T15:46:42 | 2017-08-01T15:46:42 | 99,069,699 | 1 | 0 | null | 2017-08-02T03:48:06 | 2017-08-02T03:48:06 | null | UTF-8 | C++ | false | false | 1,638 | cpp | //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
#include "BsPhysXBoxCollider.h"
#include "BsPhysX.h"
#include "PxPhysics.h"
#include "BsFPhysXCollider.h"
using namespace physx;
namespace bs
{
PhysXBoxCollider::PhysXBoxCollider(PxPhysics* physx, const Vector3& position, const Quaternion& rotation,
const Vector3& extents)
:mExtents(extents)
{
PxBoxGeometry geometry(extents.x, extents.y, extents.z);
PxShape* shape = physx->createShape(geometry, *gPhysX().getDefaultMaterial(), true);
shape->setLocalPose(toPxTransform(position, rotation));
shape->userData = this;
mInternal = bs_new<FPhysXCollider>(shape);
applyGeometry();
}
PhysXBoxCollider::~PhysXBoxCollider()
{
bs_delete(mInternal);
}
void PhysXBoxCollider::setScale(const Vector3& scale)
{
BoxCollider::setScale(scale);
applyGeometry();
}
void PhysXBoxCollider::setExtents(const Vector3& extents)
{
mExtents = extents;
applyGeometry();
}
Vector3 PhysXBoxCollider::getExtents() const
{
return mExtents;
}
void PhysXBoxCollider::applyGeometry()
{
PxBoxGeometry geometry(std::max(0.01f, mExtents.x * mScale.x),
std::max(0.01f, mExtents.y * mScale.y), std::max(0.01f, mExtents.z * mScale.z));
getInternal()->_getShape()->setGeometry(geometry);
}
FPhysXCollider* PhysXBoxCollider::getInternal() const
{
return static_cast<FPhysXCollider*>(mInternal);
}
} | [
"[email protected]"
] | |
61e72403031bc7480741c7316d48266bf25362f3 | fef58dcd0c1434724a0a0a82e4c84ae906200289 | /usages/0xF5ED37F54CD4D52E.cpp | 492b4c14b1b8a53131413d678fd27d4c3d70eebe | [] | no_license | DottieDot/gta5-additional-nativedb-data | a8945d29a60c04dc202f180e947cbdb3e0842ace | aea92b8b66833f063f391cb86cbcf4d58e1d7da3 | refs/heads/main | 2023-06-14T08:09:24.230253 | 2021-07-11T20:43:48 | 2021-07-11T20:43:48 | 380,364,689 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 399 | cpp | // am_cp_collection.ysc @ L9480
void func_174()
{
int iVar0;
iVar0 = 0;
while (iVar0 < Local_151.f_709)
{
if (HUD::DOES_BLIP_EXIST(vLocal_134[iVar0 /*3*/]))
{
HUD::REMOVE_BLIP(&(vLocal_134[iVar0 /*3*/]));
GRAPHICS::DELETE_CHECKPOINT(vLocal_134[iVar0 /*3*/].f_1);
}
iVar0++;
}
iVar0 = 0;
while (iVar0 < 4)
{
iLocal_124[iVar0] = 0;
iVar0++;
}
} | [
"[email protected]"
] | |
f0fd839430aaf758f5cce1fb8f3194126126394d | 023f436215c061f452a3d29d0b3e6a39c2c2c667 | /C++/RacingCarClassBase.cpp | 88b49b9d08e7a44f0beb73832fa810a07ddf0cc7 | [] | no_license | LeeHwangLae/GitStudyTest | 1d74b55ac7590393992de303e8739e307a1245d1 | 3ef963c95b7385158e07689f98b12e8844de1d1b | refs/heads/master | 2020-12-24T07:28:42.214905 | 2016-08-23T16:17:23 | 2016-08-23T16:17:23 | 58,366,010 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,255 | cpp | #include <iostream>
using namespace std;
namespace CAR_CONST
{
enum MyEnum
{
ID_LEN = 20,
MAX_SPD=200,
FUEL_STEP=2,
ACC_STEP=10,
BRK_STEP=10
};
}
class Car
{
private:
char gamerID[CAR_CONST::ID_LEN];
int fuelGauge;
int curSpeed;
public:
void InitMembers(char*ID, int fuel);
void ShowCarState(); //상태정보
void Accel(); //엑셀, 속도증가
void Break(); //브레이크, 속도감소
};
void Car::InitMembers(char*ID, int fuel)
{
strcpy(gamerID, ID);
fuelGauge = fuel;
curSpeed = 0;
}
void Car::ShowCarState()
{
cout << "소유자ID: " << gamerID << endl;
cout << "연료량: " << fuelGauge << endl;
cout << "현재속도: " << curSpeed << "km/s" << endl << endl;
}
void Car::Accel()
{
if (fuelGauge <= 0)
return;
else
fuelGauge -= CAR_CONST::FUEL_STEP;
if ((curSpeed + CAR_CONST::ACC_STEP) >= CAR_CONST::MAX_SPD)
{
curSpeed = CAR_CONST::MAX_SPD;
return;
}
curSpeed += CAR_CONST::ACC_STEP;
}
void Car::Break()
{
if (curSpeed < CAR_CONST::BRK_STEP)
{
curSpeed = 0;
return;
}
curSpeed -= CAR_CONST::BRK_STEP;
}
int main()
{
Car run99;
run99.InitMembers("run99", 100);
run99.Accel();
run99.Accel();
run99.Accel();
run99.ShowCarState();
run99.Break();
run99.ShowCarState();
return 0;
} | [
"[email protected]"
] | |
981a096fc73d7cd78d35081db9bd5a51ae42846a | 3605efd8f98f1927f142a36aa8511a26d6e5c575 | /src-arduino/xbee/XBee.ino | 49901e70a2f71a0d828990654e83a6371f3c5f7d | [] | no_license | lavirott/iot-com-tutorials | d0f08d8d0c4d3622d958efce0c7608b4efe74578 | fb2b739066aa63db49560a0c3ed180b7549335d7 | refs/heads/master | 2020-04-12T09:49:47.184345 | 2019-03-22T07:28:12 | 2019-03-22T07:28:12 | 162,409,548 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 562 | ino | #include <multiprotocolShield.h>
#include <Wire.h>
#include <MCP23008.h>
char buffer[51] = {0x7E, 0x00, 0x2F, 0x00, 0xE1, 0x00, 0x13, 0xA2, 0x00, 0x40, 0xE4, 0x04, 0x3F, 0x00, 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x66, 0x72, 0x6F, 0x6D, 0x20, 0x4E, 0x6F, 0x64, 0x65, 0x2D, 0x52, 0x45, 0x44, 0x21, 0x20, 0x49, 0x74, 0x27, 0x73, 0x20, 0x41, 0x72, 0x64, 0x75, 0x69, 0x6E, 0x6F, 0x2E, 0x2E, 0x2E, 0X78};
void setup() {
socket0.ON();
delay(100);
socket0.setMUX();
Serial.begin(9600);
delay(1000);
}
void loop() {
Serial.print(buffer);
delay(2000);
}
| [
"[email protected]"
] | |
0b72ac34dd3cb8daeb4189a73bcff7021a33a5a8 | ae392a6e5a9996b06df427f1e22e8e4357fc2faf | /src/libwalletqt/PendingTransaction.h | 34576cbca65cd88c564a2b2979f3aa56972fbe9b | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | trublud/kickasscoingui | 6cf5d3f58daf0186bfa00ccc58fe6dafa5e148e1 | 74ac40e5ffed0a83585f09a5b2653eec7b8c3af2 | refs/heads/master | 2020-06-19T15:58:32.629286 | 2019-07-13T23:31:00 | 2019-07-13T23:31:00 | 196,773,529 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,351 | h | // Copyright (c) 2014-2019, The KickAssCoin Project
//
// 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.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef PENDINGTRANSACTION_H
#define PENDINGTRANSACTION_H
#include <QObject>
#include <QList>
#include <QVariant>
#include <wallet/api/wallet2_api.h>
//namespace KickAssCoin {
//class PendingTransaction;
//}
class PendingTransaction : public QObject
{
Q_OBJECT
Q_PROPERTY(Status status READ status)
Q_PROPERTY(QString errorString READ errorString)
Q_PROPERTY(quint64 amount READ amount)
Q_PROPERTY(quint64 dust READ dust)
Q_PROPERTY(quint64 fee READ fee)
Q_PROPERTY(QStringList txid READ txid)
Q_PROPERTY(quint64 txCount READ txCount)
Q_PROPERTY(QList<QVariant> subaddrIndices READ subaddrIndices)
public:
enum Status {
Status_Ok = KickAssCoin::PendingTransaction::Status_Ok,
Status_Error = KickAssCoin::PendingTransaction::Status_Error,
Status_Critical = KickAssCoin::PendingTransaction::Status_Critical
};
Q_ENUM(Status)
enum Priority {
Priority_Low = KickAssCoin::PendingTransaction::Priority_Low,
Priority_Medium = KickAssCoin::PendingTransaction::Priority_Medium,
Priority_High = KickAssCoin::PendingTransaction::Priority_High
};
Q_ENUM(Priority)
Status status() const;
QString errorString() const;
Q_INVOKABLE bool commit();
quint64 amount() const;
quint64 dust() const;
quint64 fee() const;
QStringList txid() const;
quint64 txCount() const;
QList<QVariant> subaddrIndices() const;
Q_INVOKABLE void setFilename(const QString &fileName);
private:
explicit PendingTransaction(KickAssCoin::PendingTransaction * pt, QObject *parent = 0);
private:
friend class Wallet;
KickAssCoin::PendingTransaction * m_pimpl;
QString m_fileName;
};
#endif // PENDINGTRANSACTION_H
| [
"[email protected]"
] | |
e57074accd8cc21f71a285254d158a13b0319576 | ef6ba4bfd67da540fd8b65124c96158b60f185dd | /04_PlanetInvader/meshfield.h | f42fedb12af3ffa51bc3d3900d67dcbbb8665f8f | [] | no_license | eisuke1222/ESfile | 91d0c7f20aebded38149597380fbc0ccfbc2b194 | 74f4cd3e520981051336053cd04e04d2d1fd7615 | refs/heads/master | 2020-04-27T20:30:56.204189 | 2019-03-18T04:34:24 | 2019-03-18T04:34:24 | 174,650,195 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 2,308 | h | //=============================================================================
//
// メッシュフィールド処理 [meshfield.h]
// Author : Eisuke Sakagawa
//
//=============================================================================
#ifndef _MESHFIELD_H_
#define _MESHFIELD_H_
//*****************************************************************************
// ヘッダファイルのインクルード
//*****************************************************************************
#include "main.h" // メイン
#include "mesh3d.h" // メッシュ3D
//*****************************************************************************
// マクロ定義
//*****************************************************************************
#define MAX_MESHFIELD_TEXTURE (2) // テクスチャ最大数
#define MESHFIELD_SIZE_X (30) // 大きさ(X)
#define MESHFIELD_SIZE_Y (30) // 大きさ(Y)
//*****************************************************************************
// クラス定義
//*****************************************************************************
class CMeshField : public CMesh3D
{// メッシュフィールド(親:CMesh3D)
public:
typedef enum
{// フィールドタイプ
MESHFIELDTYPE_O = 0, // 海
MESHFIELDTYPE_G, // 陸
MESHFIELDTYPE_MAX
}MESHFIELDTYPE;
CMeshField(); // コンストラクタ
~CMeshField(); // デストラクタ
static HRESULT Load(void); // ロード
static void Unload(void); // アンロード
static CMeshField *Create(MESHTYPE meshType, D3DXVECTOR3 num, D3DXVECTOR3 pos, D3DXVECTOR3 rot, D3DXVECTOR3 size, D3DXCOLOR col, D3DXVECTOR2 TexUV, MESHFIELDTYPE meshfieldType, MESHTEX meshTex); // 生成
HRESULT Init(MESHTYPE meshType, D3DXVECTOR3 num, D3DXVECTOR3 pos, D3DXVECTOR3 rot, D3DXVECTOR3 size, D3DXCOLOR col, D3DXVECTOR2 TexUV, MESHFIELDTYPE meshfieldType, MESHTEX meshTex); // 初期化処理
void Uninit(void); // 終了処理
void Update(void); // 更新処理
void Draw(void); // 描画処理
private:
static LPDIRECT3DTEXTURE9 m_pTexture[MAX_MESHFIELD_TEXTURE]; // テクスチャ情報へのポインタ
static D3DXVECTOR2 m_posUV; // UV位置
MESHFIELDTYPE m_meshfieldType; // フィールドタイプ
protected:
};
#endif | [
"[email protected]"
] | |
364e704cf0dbec608b6df1c1e2c0deec045a598f | 748705e88fc2decb21871dcdacb7392037412c7c | /C++练习/test11-19完成对整数和小数的排序,接口中传入缺省参数(排序规则)/test11-19完成对整数和小数的排序,接口中传入缺省参数(排序规则)/main2.cpp | cfea8789a0c55a5e78c63cbfa83081e6b9601581 | [] | no_license | YangXxin1/persistence | 96ebe1d79e4b179cd3c03fcf5becaa30d7c0e659 | 79916f63576a1fdb5849a8f799696c0ea31036ec | refs/heads/master | 2022-12-06T05:23:48.117569 | 2020-09-02T10:07:44 | 2020-09-02T10:07:44 | 178,318,682 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 952 | cpp | #include <iostream>
using namespace std;
void InsertSort(int * src, int n)
{
int i, j;
int tmp;
for (i = 1; i < n; ++i)
{
tmp = src[i];
for (j = i; j > 0 && src[j - 1] > tmp; --j)
{
src[j] = src[j - 1];
}
src[j] = tmp;
}
}
void shellSort(int* src, int n)
{
int i, j, k;
int gap;
int tmp;
for (gap = n / 2; gap; gap /= 2)
{
for (k = 0; k < gap; ++k)
{
//²åÈëÅÅÐò
for (i = gap + k; i < n; i += gap)
{
tmp = src[i];
for (j = i; j >= gap && src[j - gap] > tmp; j -= gap)
{
src[j] = src[j - gap];
}
src[j] = tmp;
}
}
}
}
void Sort(int * src, int n, int flag = 0)
{
switch (flag)
{
case 0:
InsertSort(src, n);
break;
case 1:
shellSort(src, n);
break;
}
}
int main()
{
int src[11] = { 1, 3, 6, 7, 9, 2, 4, 8, 10, 5, 11 };
//Sort(src, 11);
Sort(src, 11, 1);
for (auto & i : src)
{
cout << i << ' ';
}
cout << endl;
system("pause");
return 0;
} | [
"[email protected]"
] | |
d89453c5eb25525818bb0f93af6296a74b14472e | 3fc84a7fe3cb00d26e971394744fb8af058a46c0 | /Project-qt+chartDirector/chartdir_cpp_win64/ChartDirector/cppdemo/hbarmeterorientation/hbarmeterorientation.cpp | 3a9ad41e1c53f511881a88397a185d3b0f0ee752 | [
"IJG"
] | permissive | BIbiLion/LSWuqiankun | 5f344954b7dafec85d342766f0a3a8cb4961dd42 | 6257db4a3b11612c9b0419ae71104f8dfe33b8e9 | refs/heads/master | 2020-12-24T07:36:08.033393 | 2017-02-03T01:35:14 | 2017-02-03T01:35:14 | 59,795,750 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,406 | cpp | #include "chartdir.h"
void createChart(int chartIndex, const char *filename)
{
// The value to display on the meter
double value = 75.35;
// The bar colors for the meters
int barColor[] = {0x0088ff, 0x00cc00, 0x8833dd, 0xff8800};
// Create a LinearMeter object of size 260 x 80 pixels with very light grey (0xeeeeee)
// backgruond and a light grey (0xccccccc) 3-pixel thick rounded frame
LinearMeter *m = new LinearMeter(260, 80, 0xeeeeee, 0xcccccc);
m->setRoundedFrame(Chart::Transparent);
m->setThickFrame(3);
// This example demonstrates putting the text labels at the top or bottom. This is by setting
// the label alignment, as well as the scale, color scale and label positions.
int alignment[] = {Chart::Top, Chart::Top, Chart::Bottom, Chart::Bottom};
int meterYPos[] = {24, 24, 36, 36};
int labelYPos[] = {65, 65, 16, 16};
int colorScalePos[] = {48, 48, 27, 27};
// Set the scale region
m->setMeter(18, meterYPos[chartIndex], 222, 20, alignment[chartIndex]);
// Set meter scale from 0 - 100, with a tick every 10 units
m->setScale(0, 100, 10);
// Add a 5-pixel thick smooth color scale
double smoothColorScale[] = {0, 0x0000ff, 25, 0x0088ff, 50, 0x00ff00, 75, 0xdddd00, 100,
0xff0000};
m->addColorScale(DoubleArray(smoothColorScale, (int)(sizeof(smoothColorScale) / sizeof(
smoothColorScale[0]))), colorScalePos[chartIndex], 5);
// Add a bar from 0 to value with glass effect and 4 pixel rounded corners
m->addBar(0, value, barColor[chartIndex], Chart::glassEffect(Chart::NormalGlare, Chart::Top), 4)
;
//
// In this example, some charts have the "Temperauture" label on the left side and the value
// readout on the right side, and some charts have the reverse
//
if (chartIndex % 2 == 0) {
// Add a label on the left side using 8pt Arial Bold font
m->addText(15, labelYPos[chartIndex], "Temperature C", "arialbd.ttf", 8, Chart::TextColor,
Chart::Left);
// Add a text box on the right side. Display the value using white (0xffffff) 8pt Arial Bold
// font on a black (0x000000) background with depressed rounded border.
TextBox *t = m->addText(240, labelYPos[chartIndex], m->formatValue(value, "2"), "arial.ttf",
8, 0xffffff, Chart::Right);
t->setBackground(0x000000, 0x000000, -1);
t->setRoundedCorners(3);
} else {
// Add a label on the right side using 8pt Arial Bold font
m->addText(243, labelYPos[chartIndex], "Temperature C", "arialbd.ttf", 8, Chart::TextColor,
Chart::Right);
// Add a text box on the left side. Display the value using white (0xffffff) 8pt Arial Bold
// font on a black (0x000000) background with depressed rounded border.
TextBox *t = m->addText(18, labelYPos[chartIndex], m->formatValue(value, "2"), "arial.ttf",
8, 0xffffff, Chart::Left);
t->setBackground(0x000000, 0x000000, -1);
t->setRoundedCorners(3);
}
// Output the chart
m->makeChart(filename);
//free up resources
delete m;
}
int main(int argc, char *argv[])
{
createChart(0, "hbarmeterorientation0.png");
createChart(1, "hbarmeterorientation1.png");
createChart(2, "hbarmeterorientation2.png");
createChart(3, "hbarmeterorientation3.png");
return 0;
}
| [
"[email protected]"
] | |
e5592301c52b64fd90090b716669846545e96cd6 | 5f2316f5894a1cd4a0fc5d40e1dc90f6f5021dce | /Publications/DPC++/Ch14_common_parallel_patterns/fig_14_17_nd_range_reduction.cpp | 7e9fda2d00b4ed70f2341172ebc55c6544c2be88 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | citian-intel/oneAPI-samples | 0cf4dda959e7356bd7c4f5eca2eaec7be07d6666 | 5a497758b16224555ff18fb3bbe8932a1e962251 | refs/heads/master | 2023-08-13T22:26:12.370147 | 2021-10-08T16:35:22 | 2021-10-08T16:35:22 | 297,386,964 | 0 | 0 | MIT | 2020-09-21T15:47:33 | 2020-09-21T15:47:32 | null | UTF-8 | C++ | false | false | 1,101 | cpp | // Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: MIT
#include <CL/sycl.hpp>
#include <cstdio>
#include <numeric>
using namespace sycl;
using namespace sycl::ONEAPI;
int main() {
using memory_order = sycl::ONEAPI::memory_order;
using memory_scope = sycl::ONEAPI::memory_scope;
constexpr size_t N = 16;
constexpr size_t B = 4;
queue Q;
int* data = malloc_shared<int>(N, Q);
int* sum = malloc_shared<int>(1, Q);
std::iota(data, data + N, 1);
*sum = 0;
Q.parallel_for(nd_range<1>{N, B}, [=](nd_item<1> it) {
int i = it.get_global_id(0);
int group_sum = reduce(it.get_group(), data[i], sycl::ONEAPI::plus<>());
if (it.get_local_id(0) == 0) {
atomic_ref<
int,
memory_order::relaxed,
memory_scope::system,
access::address_space::global_space>(*sum) += group_sum;
}
}).wait();
std::cout << "sum = " << *sum << "\n";
bool passed = (*sum == ((N * (N + 1)) / 2));
std::cout << ((passed) ? "SUCCESS" : "FAILURE") << "\n";
free(sum, Q);
free(data, Q);
return (passed) ? 0 : 1;
}
| [
"[email protected]"
] | |
c49ee0176103ee6c3eb498c5bd05e741405e6cbd | fa5b582ea330470071c36f8aa0269b4a79ba211e | /src/main/avikodak/sites/codechef/contest/qbit15/qbit04.h | f959bf098a4c4da6df159c752ee0f1e657d82407 | [] | no_license | umairsajid/algos_v2 | a5cb68a9163cb5483e7b5bd410acbd38115db423 | a3aea98a698b9723693dcb23794be09fbc4e7cd5 | refs/heads/master | 2020-12-26T00:36:12.711989 | 2015-12-17T05:34:11 | 2015-12-17T05:34:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,489 | h | /****************************************************************************************************************************************************
* File Name : qbit04.h
* File Location : /home/avikodak/Desktop/projects/algos_v2/src/main/avikodak/sites/codechef/contest/qbit15/qbit04.h
* Created on : 15-Oct-2015 :: 6:59:05 pm
* Author : avikodak
* Testing Status : Tested
* URL : https://www.codechef.com/QBIT15/problems/QBIT04
****************************************************************************************************************************************************/
/****************************************************************************************************************************************************/
/* NAMESPACE DECLARATION AND IMPORTS */
/****************************************************************************************************************************************************/
using namespace std;
using namespace __gnu_cxx;
/****************************************************************************************************************************************************/
/* INCLUDES */
/****************************************************************************************************************************************************/
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>
#include <hash_map>
#include <stack>
#include <queue>
#include <limits.h>
#include <stdint.h>
#include <iomanip>
#include <lib/constants/constants.h>
#include <lib/ds/commonds.h>
#include <lib/ds/linkedlistds.h>
#include <lib/ds/graphds.h>
#include <lib/ds/mathds.h>
#include <lib/ds/treeds.h>
#include <lib/utils/arrayutil.h>
#include <lib/utils/avltreeutil.h>
#include <lib/utils/bplustreeutil.h>
#include <lib/utils/btreeutil.h>
#include <lib/utils/commonutil.h>
#include <lib/utils/dillutil.h>
#include <lib/utils/graphutil.h>
#include <lib/utils/mathutil.h>
#include <lib/utils/redblacktreeutil.h>
#include <lib/utils/sillutil.h>
#include <lib/utils/treeutil.h>
#include <lib/utils/twofourtreeutil.h>
/****************************************************************************************************************************************************/
/* USER DEFINED CONSTANTS */
/****************************************************************************************************************************************************/
/****************************************************************************************************************************************************/
/* MAIN CODE START */
/****************************************************************************************************************************************************/
#ifndef QBIT04_H_
#define QBIT04_H_
//Tested
void printResults(){
unsigned int testCases,size;
long long int input,sum;
scanf("%u",&testCases);
while(testCases--){
scanf("%lld",&size);
sum = 0;
for(unsigned int counter = 0;counter < size;counter++){
scanf("%lld",&input);
sum += input;
}
if(sum > 0 && sum%size == 0){
printf("%lld\n",sum/size);
}else{
printf("-1\n");
}
}
}
#endif /* QBIT04_H_ */
/****************************************************************************************************************************************************/
/* MAIN CODE END */
/****************************************************************************************************************************************************/
| [
"[email protected]"
] | |
907bf3ada8475e18c2b859d1e42755430132cbfd | 607e69f9e4440ef3ab9c33b7b6e85e95b5e982fb | /deps/museum/6.0.1/art/runtime/base/histogram.h | 1dbc6595bd233c155c8d9b8bba9ebed634702e0f | [
"Apache-2.0"
] | permissive | simpleton/profilo | 8bda2ebf057036a55efd4dea1564b1f114229d1a | 91ef4ba1a8316bad2b3080210316dfef4761e180 | refs/heads/master | 2023-03-12T13:34:27.037783 | 2018-04-24T22:45:58 | 2018-04-24T22:45:58 | 125,419,173 | 0 | 0 | Apache-2.0 | 2018-03-15T19:54:00 | 2018-03-15T19:54:00 | null | UTF-8 | C++ | false | false | 4,558 | h | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ART_RUNTIME_BASE_HISTOGRAM_H_
#define ART_RUNTIME_BASE_HISTOGRAM_H_
#include <museum/6.0.1/external/libcxx/vector>
#include <museum/6.0.1/external/libcxx/string>
#include <museum/6.0.1/art/runtime/base/logging.h>
namespace facebook { namespace museum { namespace MUSEUM_VERSION { namespace art {
// Creates a data histogram for a better understanding of statistical data.
// Histogram analysis goes beyond simple mean and standard deviation to provide
// percentiles values, describing where the $% of the input data lies.
// Designed to be simple and used with timing logger in art.
template <class Value> class Histogram {
const double kAdjust;
const size_t kInitialBucketCount;
public:
class CumulativeData {
friend class Histogram<Value>;
std::vector<uint64_t> freq_;
std::vector<double> perc_;
};
// Used by the cumulative timing logger to search the histogram set using for an existing split
// with the same name using CumulativeLogger::HistogramComparator.
explicit Histogram(const char* name);
// This is the expected constructor when creating new Histograms.
Histogram(const char* name, Value initial_bucket_width, size_t max_buckets = 100);
void AddValue(Value);
void AdjustAndAddValue(Value); // Add a value after dividing it by kAdjust.
// Builds the cumulative distribution function from the frequency data.
// Accumulative summation of frequencies.
// cumulative_freq[i] = sum(frequency[j] : 0 < j < i )
// Accumulative summation of percentiles; which is the frequency / SampleSize
// cumulative_perc[i] = sum(frequency[j] / SampleSize : 0 < j < i )
void CreateHistogram(CumulativeData* data) const;
// Reset the cumulative values, next time CreateHistogram is called it will recreate the cache.
void Reset();
double Mean() const;
double Variance() const;
double Percentile(double per, const CumulativeData& data) const;
void PrintConfidenceIntervals(std::ostream& os, double interval,
const CumulativeData& data) const;
void PrintBins(std::ostream& os, const CumulativeData& data) const;
void DumpBins(std::ostream& os) const;
Value GetRange(size_t bucket_idx) const;
size_t GetBucketCount() const;
uint64_t SampleSize() const {
return sample_size_;
}
Value Sum() const {
return sum_;
}
Value AdjustedSum() const {
return sum_ * kAdjust;
}
Value Min() const {
return min_value_added_;
}
Value Max() const {
return max_value_added_;
}
const std::string& Name() const {
return name_;
}
private:
void Initialize();
size_t FindBucket(Value val) const;
void BucketiseValue(Value val);
// Add more buckets to the histogram to fill in a new value that exceeded
// the max_read_value_.
void GrowBuckets(Value val);
std::string name_;
// Maximum number of buckets.
const size_t max_buckets_;
// Number of samples placed in histogram.
size_t sample_size_;
// Width of the bucket range. The lower the value is the more accurate
// histogram percentiles are. Grows adaptively when we hit max buckets.
Value bucket_width_;
// How many occurrences of values fall within a bucket at index i where i covers the range
// starting at min_ + i * bucket_width_ with size bucket_size_.
std::vector<uint32_t> frequency_;
// Summation of all the elements inputed by the user.
Value sum_;
// Minimum value that can fit in the histogram. Fixed to zero for now.
Value min_;
// Maximum value that can fit in the histogram, grows adaptively.
Value max_;
// Summation of the values entered. Used to calculate variance.
Value sum_of_squares_;
// Maximum value entered in the histogram.
Value min_value_added_;
// Minimum value entered in the histogram.
Value max_value_added_;
DISALLOW_COPY_AND_ASSIGN(Histogram);
};
} } } } // namespace facebook::museum::MUSEUM_VERSION::art
#endif // ART_RUNTIME_BASE_HISTOGRAM_H_
| [
"[email protected]"
] | |
1e09821d3208339891c684245ac764e867daa037 | 56ee04007eac69701f0bb4421046eb558b24f6d6 | /abc187/d.cpp | 99bdd5a67d6331727d373dca44b84b90dbc886bb | [] | no_license | tsuba3/atcoder | e5789515d96079a386843f744f0cf594ec663a24 | d397e98686cae982b431c098ec288d2994c33152 | refs/heads/master | 2021-07-01T21:31:45.429120 | 2021-02-20T13:40:24 | 2021-02-20T13:40:24 | 224,573,527 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,461 | cpp | /* _
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||_ \
| | \\\ - /'| | |
| \_| `\`---'// |_/ |
\ .-\__ `-. -'__/-. /
___`. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' _> \"".
| | : `- \`. ;`. _/; .'/ / .' ; |
\ \ `-. \_\_`. _.'_/_/ -' _.' /
===========`-.`___`-.__\ \___ /__.-'_.'_.-'================
Please give me AC.
*/
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <bitset>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <chrono>
#include <random>
using namespace std;
using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define print2(x, y) cout << (x) << ' ' << (y) << '\n'
#define print3(x, y, z) cout << (x) << ' ' << (y) << ' ' << (z) << '\n'
#define printn(v) rep(i, (v).size() - 1) cout << (v)[i] << ' '; cout << (v)[n - 1] << '\n';
#ifdef ONLINE_JUDGE
#define debug(x)
#define debug2(x, y)
#define debug3(x, y, z)
#define dbg(v)
#else
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
#endif
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;
template<typename T> T gcd(T a, T b) {
if (a < b) return gcd(b, a);
T r;
while ((r = a % b)) {
a = b;
b = r;
}
return b;
}
template<typename T> T lcm(const T a, const T b) {
return a / gcd(a, b) * b;
}
template<typename T> bool chmin(T& a, const T& b) {
if (a > b) return a = b, true; else return false;
}
template<typename T> bool chmax(T& a, const T& b) {
if (a < b) return a = b, true; else return false;
}
// End of template.
int main() {
cout << fixed << setprecision(15);
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(nullptr);
int n;
int64 d[200200];
int64 aoki = 0;
cin >> n;
rep(i, n) {
int64 a, b;
cin >> a >> b;
aoki += a;
d[i] = a + b + a;
}
sort(begin(d), begin(d) + n);
int ans = 0;
for (int i = n - 1; i >= 0; --i) {
ans += 1;
aoki -= d[i];
if (aoki < 0) {
print(ans);
return 0;
}
}
return 0;
}
/*
_
__| | ___ _ __ _ __
/ _` | / __| '_ \| '_ \
| (_| || (__| |_) | |_) |
\__,_(_)___| .__/| .__/
|_| |_|
*/
| [
"[email protected]"
] | |
b5687d24bd9394b9621e6d42ca7af6aab84cacc0 | 0e98b34801d429bca8020e2a7b73944350ac6f0e | /C+.0406/C+.0406/数据库连接池.cpp | 2d5d1bd9c7873f62994793969380d316903f2765 | [] | no_license | STong01/-2 | a3759734210e3dec7ff97c1e8e7b2c694ca376ee | 546d2e6b02c789e146b07e72e8e738fdaebcf827 | refs/heads/master | 2021-02-03T21:22:14.152907 | 2020-07-21T06:56:52 | 2020-07-21T06:56:52 | 243,542,337 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 495 | cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
set<string> pool;
string id, con;
int maxSize = 0;
for (int i = 0; i < n; ++i)
{
cin >> id >> con;
if (con == "connect")
pool.insert(id);
else if (con == "disconnect")
pool.erase(id);
int size = pool.size();
maxSize = max(maxSize, size);
}
cout << maxSize << endl;
}
system("pause");
return 0;
} | [
"[email protected]"
] | |
96fb74b595bce7f400939f1a98727f3046f1745f | ee1423adcd4bfeb2703464996171d103542bad09 | /dali-core/dali-core-HEAD-5d42e5d/automated-tests/dali-test-suite/images/utc-Dali-Image.cpp | 119ed7eabee8013fa8ba16ac426febca10d0ddba | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-flora-1.1"
] | permissive | sak0909/Dali | 26ac61a521ab1de26a7156c51afd3cc839cb705a | 0b383fc316b8b57afcf9a9e8bac6e24a4ba36e49 | refs/heads/master | 2020-12-30T12:10:51.930311 | 2017-05-16T21:56:24 | 2017-05-16T21:57:14 | 91,505,804 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 35,669 | cpp | //
// Copyright (c) 2014 Samsung Electronics Co., Ltd.
//
// Licensed under the Flora License, Version 1.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://floralicense.org/license/
//
// 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 <iostream>
#include <algorithm>
#include <stdlib.h>
#include <tet_api.h>
#include <dali/public-api/dali-core.h>
#include <dali/public-api/images/image.h>
#include <dali/public-api/images/image-attributes.h>
#include <dali-test-suite-utils.h>
#include <test-native-image.h>
using namespace Dali;
static void Startup();
static void Cleanup();
extern "C" {
void (*tet_startup)() = Startup;
void (*tet_cleanup)() = Cleanup;
}
static const char* gTestImageFilename = "icon_wrt.png";
enum {
POSITIVE_TC_IDX = 0x01,
NEGATIVE_TC_IDX,
};
#define MAX_NUMBER_OF_TESTS 10000
extern "C" {
struct tet_testlist tet_testlist[MAX_NUMBER_OF_TESTS];
}
TEST_FUNCTION( UtcDaliImageNew01, POSITIVE_TC_IDX ); // 01
TEST_FUNCTION( UtcDaliImageNew02, POSITIVE_TC_IDX ); // 02
TEST_FUNCTION( UtcDaliImageNew03, POSITIVE_TC_IDX ); // 03
TEST_FUNCTION( UtcDaliImageNewWithPolicies01, POSITIVE_TC_IDX ); // 04
TEST_FUNCTION( UtcDaliImageNewWithPolicies02, POSITIVE_TC_IDX ); // 05
TEST_FUNCTION( UtcDaliImageNewWithPolicies03, POSITIVE_TC_IDX ); // 06
TEST_FUNCTION( UtcDaliImageNewWithPolicies04, POSITIVE_TC_IDX ); // 07
TEST_FUNCTION( UtcDaliImageNewDistanceField, POSITIVE_TC_IDX ); // 08
TEST_FUNCTION( UtcDaliImageNewDistanceFieldWithPolicies01, POSITIVE_TC_IDX ); // 09
TEST_FUNCTION( UtcDaliImageNewDistanceFieldWithPolicies02, POSITIVE_TC_IDX ); // 10
TEST_FUNCTION( UtcDaliImageNewDistanceFieldWithPolicies03, POSITIVE_TC_IDX ); // 11
TEST_FUNCTION( UtcDaliImageNewDistanceFieldWithPolicies04, POSITIVE_TC_IDX ); // 12
TEST_FUNCTION( UtcDaliImageNewDistanceFieldWithAttributes, POSITIVE_TC_IDX ); // 13
TEST_FUNCTION( UtcDaliImageNewDistanceFieldWithAttrandPol, POSITIVE_TC_IDX ); // 14
TEST_FUNCTION( UtcDaliImageDownCast, POSITIVE_TC_IDX ); // 15
TEST_FUNCTION( UtcDaliImageGetImageSize, POSITIVE_TC_IDX ); // 16
TEST_FUNCTION( UtcDaliImageGetFilename, POSITIVE_TC_IDX ); // 17
TEST_FUNCTION( UtcDaliImageGetLoadingState01, POSITIVE_TC_IDX ); // 18
TEST_FUNCTION( UtcDaliImageGetLoadingState02, POSITIVE_TC_IDX ); // 19
TEST_FUNCTION( UtcDaliImageGetReleasePolicy, POSITIVE_TC_IDX ); // 20
TEST_FUNCTION( UtcDaliImageGetLoadPolicy, POSITIVE_TC_IDX ); // 21
TEST_FUNCTION( UtcDaliImageSignalLoadingFinished, POSITIVE_TC_IDX ); // 22
TEST_FUNCTION( UtcDaliImageSignalUploaded, POSITIVE_TC_IDX ); // 23
TEST_FUNCTION( UtcDaliImageDiscard01, POSITIVE_TC_IDX ); // 24
TEST_FUNCTION( UtcDaliImageDiscard02, POSITIVE_TC_IDX ); // 25
TEST_FUNCTION( UtcDaliImageDiscard03, POSITIVE_TC_IDX ); // 26
// Called only once before first test is run.
static void Startup()
{
}
// Called only once after last test is run
static void Cleanup()
{
}
// 1.1
static void UtcDaliImageNew01()
{
TestApplication application;
tet_infoline("UtcDaliImageNew01 - Image::New(const std::string&)");
// invoke default handle constructor
Image image;
DALI_TEST_CHECK( !image );
// initialise handle
image = Image::New(gTestImageFilename);
DALI_TEST_CHECK( image );
}
// 1.2
static void UtcDaliImageNew02()
{
TestApplication application;
tet_infoline("UtcDaliImageNew02 - Image::New(const std::string&, const ImageAttributes&)");
// invoke default handle constructor
Image image;
DALI_TEST_CHECK( !image );
// initialise handle
Dali::ImageAttributes imageAttributes;
imageAttributes.SetSize(128, 256);
imageAttributes.SetScalingMode(Dali::ImageAttributes::FitHeight);
image = Image::New(gTestImageFilename, imageAttributes);
DALI_TEST_CHECK( image );
}
// 1.3
static void UtcDaliImageNew03()
{
TestApplication application;
tet_infoline("UtcDaliImageNew03 - Image::New(NativeImage&)");
// invoke default handle constructor
Image image;
TestNativeImagePointer nativeImage = TestNativeImage::New(16, 16);
DALI_TEST_CHECK( !image );
// initialise handle
image = Image::New(*(nativeImage.Get()));
DALI_TEST_CHECK( image );
}
// 1.4
static void UtcDaliImageNewWithPolicies01()
{
TestApplication application;
// testing delayed loading
tet_infoline("UtcDaliImageNewWithPolicies01 - Load image with LoadPolicy::OnDemand, ReleasePolicy::Never");
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
Image image = Image::New(gTestImageFilename, Image::OnDemand, Image::Never);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading only when actor added to stage
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
// testing ReleasePolicy::Never
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// never discard texture
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
}
// 1.5
static void UtcDaliImageNewWithPolicies02()
{
TestApplication application;
// testing resource deletion when taken off stage
tet_infoline("UtcDaliImageNewWithPolicies02 - Load image with LoadPolicy::OnDemand, ReleasePolicy::Unused");
Image image = Image::New(gTestImageFilename, Image::OnDemand, Image::Unused);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading only when actor added to stage
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
// testing ReleasePolicy::Unused
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// discard texture when actor comes off stage
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( application.GetGlAbstraction().CheckTextureDeleted(23) );
}
// 1.6
static void UtcDaliImageNewWithPolicies03()
{
TestApplication application;
// load immediately -> resource deletion when taken off stage -> put actor back on stage -> load resource again
tet_infoline("UtcDaliImageNewWithPolicies03 - Load image with LoadPolicy::Immediate, ReleasePolicy::Unused");
Image image = Image::New(gTestImageFilename, Image::Immediate, Image::Unused);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading immediately
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
// testing ReleasePolicy::Unused
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// discard texture when actor comes off stage
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( application.GetGlAbstraction().CheckTextureDeleted(23) );
// check load request when actor added back to stage
application.GetPlatform().ResetTrace();
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
}
// 1.7
static void UtcDaliImageNewWithPolicies04()
{
TestApplication application;
// load immediately, don't release texture when off stage
tet_infoline("UtcDaliImageNewWithPolicies03 - Load image with LoadPolicy::Immediate, ReleasePolicy::Never");
Image image = Image::New(gTestImageFilename, Image::Immediate, Image::Never);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading immediately
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
// testing ReleasePolicy::Never
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// texture is not discarded
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// no load request when actor added back to stage
application.GetPlatform().ResetTrace();
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
}
// 1.8
static void UtcDaliImageNewDistanceField()
{
TestApplication application;
tet_infoline("UtcDaliImageNewDistanceField - Image::NewDistanceField(const std::string&)");
// invoke default handle constructor
Image image;
DALI_TEST_CHECK( !image );
// initialise handle
image = Image::NewDistanceField(gTestImageFilename);
DALI_TEST_CHECK( image );
}
// 1.9
static void UtcDaliImageNewDistanceFieldWithPolicies01()
{
TestApplication application;
// testing delayed loading
tet_infoline("UtcDaliImageNewDistanceFieldWithPolicies01 - Load image with LoadPolicy::OnDemand, ReleasePolicy::Never");
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
Image image = Image::NewDistanceField(gTestImageFilename, Image::OnDemand, Image::Never);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading only when actor added to stage
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
// testing ReleasePolicy::Never
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// never discard texture
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
}
// 1.10
static void UtcDaliImageNewDistanceFieldWithPolicies02()
{
TestApplication application;
// testing resource deletion when taken off stage
tet_infoline("UtcDaliImageNewDistanceFieldWithPolicies02 - Load image with LoadPolicy::OnDemand, ReleasePolicy::Unused");
Image image = Image::NewDistanceField(gTestImageFilename, Image::OnDemand, Image::Unused);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading only when actor added to stage
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
// testing ReleasePolicy::Unused
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// discard texture when actor comes off stage
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( application.GetGlAbstraction().CheckTextureDeleted(23) );
}
// 1.11
static void UtcDaliImageNewDistanceFieldWithPolicies03()
{
TestApplication application;
// load immediately -> resource deletion when taken off stage -> put actor back on stage -> load resource again
tet_infoline("UtcDaliImageNewDistanceFieldWithPolicies03 - Load image with LoadPolicy::Immediate, ReleasePolicy::Unused");
Image image = Image::NewDistanceField(gTestImageFilename, Image::Immediate, Image::Unused);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading immediately
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
// testing ReleasePolicy::Unused
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// discard texture when actor comes off stage
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( application.GetGlAbstraction().CheckTextureDeleted(23) );
// check load request when actor added back to stage
application.GetPlatform().ResetTrace();
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
}
// 1.12
static void UtcDaliImageNewDistanceFieldWithPolicies04()
{
TestApplication application;
// load immediately, don't release texture when off stage
tet_infoline("UtcDaliImageNewDistanceFieldWithPolicies04 - Load image with LoadPolicy::Immediate, ReleasePolicy::Never");
Image image = Image::NewDistanceField(gTestImageFilename, Image::Immediate, Image::Never);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading immediately
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
// testing ReleasePolicy::Never
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// texture is not discarded
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// no load request when actor added back to stage
application.GetPlatform().ResetTrace();
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
}
// 1.13
static void UtcDaliImageNewDistanceFieldWithAttributes()
{
TestApplication application;
tet_infoline("UtcDaliImageNewDistanceFieldWithAttributes - Image::NewDistanceField(const std::string&, const ImageAttributes& attributes)");
// invoke default handle constructor
Image image;
Dali::ImageAttributes imageAttributes = Dali::ImageAttributes::NewDistanceField(6.0f, 12);
DALI_TEST_CHECK( !image );
// initialise handle
image = Image::NewDistanceField(gTestImageFilename, imageAttributes);
DALI_TEST_CHECK( image );
}
// 1.14
static void UtcDaliImageNewDistanceFieldWithAttrandPol()
{
TestApplication application;
tet_infoline("UtcDaliImageNewDistanceFieldWithAttrandPol - Load image with LoadPolicy::OnDemand, ReleasePolicy::Unused");
Dali::ImageAttributes imageAttributes = Dali::ImageAttributes::NewDistanceField(6.0f, 12);
Image image = Image::NewDistanceField(gTestImageFilename, imageAttributes, Image::OnDemand, Image::Unused);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
// request file loading only when actor added to stage
DALI_TEST_CHECK( !application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
// testing ReleasePolicy::Unused
// fake loading image
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( !application.GetGlAbstraction().CheckTextureDeleted(23) );
// discard texture when actor comes off stage
Stage::GetCurrent().Remove(actor);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK ( application.GetGlAbstraction().CheckTextureDeleted(23) );
}
// 1.15
static void UtcDaliImageDownCast()
{
TestApplication application;
tet_infoline("Testing Dali::Image::DownCast()");
Image image = Image::New(gTestImageFilename);
BaseHandle object(image);
Image image2 = Image::DownCast(object);
DALI_TEST_CHECK(image2);
Image image3 = DownCast< Image >(object);
DALI_TEST_CHECK(image3);
BaseHandle unInitializedObject;
Image image4 = Image::DownCast(unInitializedObject);
DALI_TEST_CHECK(!image4);
Image image5 = DownCast< Image >(unInitializedObject);
DALI_TEST_CHECK(!image5);
}
// 1.16
static void UtcDaliImageGetImageSize()
{
TestApplication application;
TestPlatformAbstraction& platform = application.GetPlatform();
tet_infoline("UtcDaliImageGetImageSize - Image::GetImageSize()");
Vector2 testSize(8.0f, 16.0f);
platform.SetClosestImageSize(testSize);
Vector2 size = Image::GetImageSize(gTestImageFilename);
DALI_TEST_CHECK( application.GetPlatform().GetTrace().FindMethod("GetClosestImageSize"));
DALI_TEST_EQUALS( size, testSize, TEST_LOCATION);
}
// 1.17
static void UtcDaliImageGetFilename()
{
TestApplication application;
tet_infoline("UtcDaliImageGetFilename");
// invoke default handle constructor
Image image;
DALI_TEST_CHECK( !image );
// initialise handle
image = Image::New(gTestImageFilename);
DALI_TEST_EQUALS( image.GetFilename(), gTestImageFilename, TEST_LOCATION);
}
// 1.18
static void UtcDaliImageGetLoadingState01()
{
TestApplication application;
tet_infoline("UtcDaliImageGetLoadingState01");
Image image = Image::New(gTestImageFilename);
DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoading);
application.SendNotification();
application.Render(16);
// simulate load success
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
// Test state == ResourceLoadingSucceeded
DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoadingSucceeded);
}
// 1.19
static void UtcDaliImageGetLoadingState02()
{
TestApplication application;
tet_infoline("UtcDaliImageGetLoadingState02");
// invoke default handle constructor
Image image;
DALI_TEST_CHECK( !image );
// initialise handle
image = Image::New(gTestImageFilename);
// Test state == ResourceLoading
DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoading);
application.SendNotification();
application.Render(16);
// simulate load failure
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
if(request)
{
application.GetPlatform().SetResourceLoadFailed(request->GetId(), Integration::FailureUnknown);
}
application.Render(16);
application.SendNotification();
// Test state == ResourceLoadingFailed
DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoadingFailed);
}
// 1.20
static void UtcDaliImageGetReleasePolicy()
{
TestApplication application;
tet_infoline("UtcDaliImageGetReleasePolicy");
Image image = Image::New(gTestImageFilename, Image::Immediate, Image::Unused);
DALI_TEST_CHECK( image );
DALI_TEST_CHECK( Image::Unused == image.GetReleasePolicy() );
}
// 1.21
static void UtcDaliImageGetLoadPolicy()
{
TestApplication application;
tet_infoline("UtcDaliImageGetLoadPolicy");
Image image = Image::New(gTestImageFilename, Image::OnDemand, Image::Never);
DALI_TEST_CHECK( image );
DALI_TEST_CHECK( Image::OnDemand == image.GetLoadPolicy());
}
static bool SignalLoadFlag = false;
static void SignalLoadHandler(Image image)
{
tet_infoline("Received image load finished signal");
SignalLoadFlag = true;
}
static bool SignalUploadedFlag = false;
static void SignalUploadedHandler(Image image)
{
tet_infoline("Received image uploaded signal");
SignalUploadedFlag = true;
}
// 1.22
static void UtcDaliImageSignalLoadingFinished()
{
TestApplication application;
tet_infoline("UtcDaliImageSignalLoadingFinished");
SignalLoadFlag = false;
Image image = Image::New(gTestImageFilename);
image.LoadingFinishedSignal().Connect( SignalLoadHandler );
application.SendNotification();
application.Render(16);
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true)));
}
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK( SignalLoadFlag == true );
}
// 1.23
static void UtcDaliImageSignalUploaded()
{
TestApplication application;
tet_infoline("UtcDaliImageSignalUploaded - Image::SignalUploaded()");
// set up image in fake platform abstraction
Vector2 testSize(80.0f, 80.0f);
application.GetPlatform().SetClosestImageSize(testSize);
Image image = Image::New(gTestImageFilename);
image.LoadingFinishedSignal().Connect( SignalLoadHandler );
// Load image
application.SendNotification();
application.Render(16);
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
image.UploadedSignal().Connect( SignalUploadedHandler );
Dali::ImageActor imageActor = ImageActor::New(image);
Stage::GetCurrent().Add(imageActor);
imageActor.SetSize(80, 80);
imageActor.SetVisible(true);
application.SendNotification();
application.Render(0);
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK( SignalLoadFlag == true );
DALI_TEST_CHECK( SignalUploadedFlag == true );
SignalLoadFlag = false;
SignalUploadedFlag = false;
image.Reload();
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 160, 160, 160, 160);
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK( SignalLoadFlag == true );
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
DALI_TEST_CHECK( SignalUploadedFlag == true );
}
// 1.24
static void UtcDaliImageDiscard01()
{
TestApplication application;
tet_infoline("UtcDaliImageDiscard01 - no actors");
{
Image image = Image::New(gTestImageFilename);
// Load image
application.SendNotification();
application.Render(16);
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
} // Drop image handle
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
// Shouldn't have been sent to GL...
const std::vector<GLuint>& texIds = application.GetGlAbstraction().GetNextTextureIds();
DALI_TEST_CHECK( texIds.size() == 1 );
DALI_TEST_CHECK( texIds[0] == 23 );
}
// 1.25
static void UtcDaliImageDiscard02()
{
TestApplication application;
tet_infoline("UtcDaliImageDiscard02 - one actor, tests TextureCache::DiscardTexture");
{
{
ImageActor actor;
{
Image image = Image::New(gTestImageFilename);
actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
} // lose image handle, actor should still keep one
application.SendNotification();
application.Render(16);
Stage::GetCurrent().Remove(actor);
application.SendNotification();
application.Render(16);
} // lose actor
application.SendNotification();
application.Render(16);
}
// Cleanup
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
// texture should have been removed:
DALI_TEST_CHECK( application.GetGlAbstraction().CheckTextureDeleted( 23 ));
}
// 1.26
static void UtcDaliImageDiscard03()
{
TestApplication application;
tet_infoline("UtcDaliImageDiscard03 - one actor, tests TextureCache::RemoveObserver");
Image image = Image::New(gTestImageFilename);
ImageActor actor = ImageActor::New(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render(16);
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)
{
application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
}
application.Render(16);
application.SendNotification();
application.SendNotification();
application.Render(16);
const std::vector<GLuint>& texIds = application.GetGlAbstraction().GetNextTextureIds();
DALI_TEST_CHECK( texIds.size() == 0 );
const std::vector<GLuint>& boundTexIds = application.GetGlAbstraction().GetBoundTextures();
DALI_TEST_CHECK( boundTexIds[0] == 23 );
Stage::GetCurrent().Remove(actor);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16); // Should remove image renderer
// Test what?!
}
| [
"[email protected]"
] | |
9f9a20bd2f60ecddec11a7fa9f97a846ca8725cc | f81b774e5306ac01d2c6c1289d9e01b5264aae70 | /content/common/service_manager/service_manager_connection_impl.cc | d1cad99be3a53640d5d035b3c28f9be9b805887f | [
"BSD-3-Clause"
] | permissive | waaberi/chromium | a4015160d8460233b33fe1304e8fd9960a3650a9 | 6549065bd785179608f7b8828da403f3ca5f7aab | refs/heads/master | 2022-12-13T03:09:16.887475 | 2020-09-05T20:29:36 | 2020-09-05T20:29:36 | 293,153,821 | 1 | 1 | BSD-3-Clause | 2020-09-05T21:02:50 | 2020-09-05T21:02:49 | null | UTF-8 | C++ | false | false | 13,787 | cc | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/common/service_manager/service_manager_connection_impl.h"
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/task/current_thread.h"
#include "base/thread_annotations.h"
#include "base/threading/thread_checker.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_receiver.h"
#include "services/service_manager/public/mojom/constants.mojom.h"
#include "services/service_manager/public/mojom/interface_provider.mojom.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "content/public/android/content_jni_headers/ServiceManagerConnectionImpl_jni.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/mojom/connector.mojom.h"
#endif
namespace content {
namespace {
base::LazyInstance<std::unique_ptr<ServiceManagerConnection>>::Leaky
g_connection_for_process = LAZY_INSTANCE_INITIALIZER;
ServiceManagerConnection::Factory* service_manager_connection_factory = nullptr;
} // namespace
// A ref-counted object which owns the IO thread state of a
// ServiceManagerConnectionImpl. This includes Service and ServiceFactory
// bindings.
class ServiceManagerConnectionImpl::IOThreadContext
: public base::RefCountedThreadSafe<IOThreadContext>,
public service_manager::Service {
public:
IOThreadContext(
mojo::PendingReceiver<service_manager::mojom::Service> service_receiver,
scoped_refptr<base::SequencedTaskRunner> io_task_runner,
mojo::PendingReceiver<service_manager::mojom::Connector>
connector_receiver)
: pending_service_receiver_(std::move(service_receiver)),
io_task_runner_(io_task_runner),
pending_connector_receiver_(std::move(connector_receiver)) {
// This will be reattached by any of the IO thread functions on first call.
io_thread_checker_.DetachFromThread();
}
void SetDefaultServiceRequestHandler(
const ServiceManagerConnection::DefaultServiceRequestHandler& handler) {
DCHECK(!started_);
default_request_handler_ = handler;
}
// Safe to call from any thread.
void Start(base::OnceClosure stop_callback) {
DCHECK(!started_);
started_ = true;
callback_task_runner_ = base::ThreadTaskRunnerHandle::Get();
stop_callback_ = std::move(stop_callback);
io_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&IOThreadContext::StartOnIOThread, this));
}
void Stop() {
io_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&IOThreadContext::StopOnIOThread, this));
}
// Safe to call from whichever thread called Start() (or may have called
// Start()). Must be called before IO thread shutdown.
void ShutDown() {
if (!started_)
return;
bool posted = io_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&IOThreadContext::ShutDownOnIOThread, this));
DCHECK(posted);
}
void AddServiceRequestHandler(const std::string& name,
const ServiceRequestHandler& handler) {
AddServiceRequestHandlerWithCallback(
name,
base::BindRepeating(&WrapServiceRequestHandlerNoCallback, handler));
}
void AddServiceRequestHandlerWithCallback(
const std::string& name,
const ServiceRequestHandlerWithCallback& handler) {
io_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&ServiceManagerConnectionImpl::IOThreadContext::
AddServiceRequestHandlerOnIoThread,
this, name, handler));
}
private:
friend class base::RefCountedThreadSafe<IOThreadContext>;
class MessageLoopObserver : public base::CurrentThread::DestructionObserver {
public:
explicit MessageLoopObserver(base::WeakPtr<IOThreadContext> context)
: context_(context) {
base::CurrentThread::Get()->AddDestructionObserver(this);
}
~MessageLoopObserver() override {
base::CurrentThread::Get()->RemoveDestructionObserver(this);
}
void ShutDown() {
if (!is_active_)
return;
// The call into |context_| below may reenter ShutDown(), hence we set
// |is_active_| to false here.
is_active_ = false;
if (context_)
context_->ShutDownOnIOThread();
delete this;
}
private:
void WillDestroyCurrentMessageLoop() override {
DCHECK(is_active_);
ShutDown();
}
bool is_active_ = true;
base::WeakPtr<IOThreadContext> context_;
DISALLOW_COPY_AND_ASSIGN(MessageLoopObserver);
};
~IOThreadContext() override {}
static void WrapServiceRequestHandlerNoCallback(
const ServiceRequestHandler& handler,
mojo::PendingReceiver<service_manager::mojom::Service> receiver,
CreatePackagedServiceInstanceCallback callback) {
handler.Run(std::move(receiver));
std::move(callback).Run(base::GetCurrentProcId());
}
void StartOnIOThread() {
// Should bind |io_thread_checker_| to the context's thread.
DCHECK(io_thread_checker_.CalledOnValidThread());
service_receiver_ = std::make_unique<service_manager::ServiceReceiver>(
this, std::move(pending_service_receiver_));
service_receiver_->GetConnector()->BindConnectorReceiver(
std::move(pending_connector_receiver_));
// MessageLoopObserver owns itself.
message_loop_observer_ =
new MessageLoopObserver(weak_factory_.GetWeakPtr());
}
void StopOnIOThread() {
request_handlers_.clear();
}
void ShutDownOnIOThread() {
DCHECK(io_thread_checker_.CalledOnValidThread());
weak_factory_.InvalidateWeakPtrs();
// Note that this method may be invoked by MessageLoopObserver observing
// MessageLoop destruction. In that case, this call to ShutDown is
// effectively a no-op. In any case it's safe.
if (message_loop_observer_) {
message_loop_observer_->ShutDown();
message_loop_observer_ = nullptr;
}
// Resetting the ServiceContext below may otherwise release the last
// reference to this IOThreadContext. We keep it alive until the stack
// unwinds.
scoped_refptr<IOThreadContext> keepalive(this);
service_receiver_.reset();
StopOnIOThread();
}
void AddServiceRequestHandlerOnIoThread(
const std::string& name,
const ServiceRequestHandlerWithCallback& handler) {
DCHECK(io_thread_checker_.CalledOnValidThread());
auto result = request_handlers_.insert(std::make_pair(name, handler));
DCHECK(result.second) << "ServiceRequestHandler for " << name
<< " already exists.";
}
/////////////////////////////////////////////////////////////////////////////
// service_manager::Service implementation
void OnBindInterface(const service_manager::BindSourceInfo& source_info,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) override {}
void CreatePackagedServiceInstance(
const std::string& service_name,
mojo::PendingReceiver<service_manager::mojom::Service> receiver,
CreatePackagedServiceInstanceCallback callback) override {
DCHECK(io_thread_checker_.CalledOnValidThread());
auto it = request_handlers_.find(service_name);
if (it == request_handlers_.end()) {
if (default_request_handler_) {
callback_task_runner_->PostTask(
FROM_HERE, base::BindOnce(default_request_handler_, service_name,
std::move(receiver)));
} else {
LOG(ERROR) << "Can't create service " << service_name
<< ". No handler found.";
}
std::move(callback).Run(base::nullopt);
} else {
it->second.Run(std::move(receiver), std::move(callback));
}
}
void OnDisconnected() override {
callback_task_runner_->PostTask(FROM_HERE, std::move(stop_callback_));
}
base::ThreadChecker io_thread_checker_;
bool started_ = false;
ServiceManagerConnection::DefaultServiceRequestHandler
default_request_handler_;
// Temporary state established on construction and consumed on the IO thread
// once the connection is started.
mojo::PendingReceiver<service_manager::mojom::Service>
pending_service_receiver_;
scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
mojo::PendingReceiver<service_manager::mojom::Connector>
pending_connector_receiver_;
// TaskRunner on which to run our owner's callbacks, i.e. the ones passed to
// Start().
scoped_refptr<base::SequencedTaskRunner> callback_task_runner_;
// Callback to run if the service is stopped by the service manager.
base::OnceClosure stop_callback_;
std::unique_ptr<service_manager::ServiceReceiver> service_receiver_;
// Not owned.
MessageLoopObserver* message_loop_observer_ = nullptr;
std::map<std::string, ServiceRequestHandlerWithCallback> request_handlers_;
base::WeakPtrFactory<IOThreadContext> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(IOThreadContext);
};
#if defined(OS_ANDROID)
// static
jint JNI_ServiceManagerConnectionImpl_GetConnectorMessagePipeHandle(
JNIEnv* env) {
DCHECK(ServiceManagerConnection::GetForProcess());
mojo::PendingRemote<service_manager::mojom::Connector> connector_remote;
ServiceManagerConnection::GetForProcess()
->GetConnector()
->BindConnectorReceiver(
connector_remote.InitWithNewPipeAndPassReceiver());
return connector_remote.PassPipe().release().value();
}
#endif
////////////////////////////////////////////////////////////////////////////////
// ServiceManagerConnection, public:
// static
void ServiceManagerConnection::SetForProcess(
std::unique_ptr<ServiceManagerConnection> connection) {
DCHECK(!g_connection_for_process.Get());
g_connection_for_process.Get() = std::move(connection);
}
// static
ServiceManagerConnection* ServiceManagerConnection::GetForProcess() {
return g_connection_for_process.Get().get();
}
// static
void ServiceManagerConnection::DestroyForProcess() {
// This joins the service manager controller thread.
g_connection_for_process.Get().reset();
}
// static
void ServiceManagerConnection::SetFactoryForTest(Factory* factory) {
DCHECK(!g_connection_for_process.Get());
service_manager_connection_factory = factory;
}
// static
std::unique_ptr<ServiceManagerConnection> ServiceManagerConnection::Create(
mojo::PendingReceiver<service_manager::mojom::Service> receiver,
scoped_refptr<base::SequencedTaskRunner> io_task_runner) {
if (service_manager_connection_factory)
return service_manager_connection_factory->Run();
return std::make_unique<ServiceManagerConnectionImpl>(std::move(receiver),
io_task_runner);
}
ServiceManagerConnection::~ServiceManagerConnection() {}
////////////////////////////////////////////////////////////////////////////////
// ServiceManagerConnectionImpl, public:
ServiceManagerConnectionImpl::ServiceManagerConnectionImpl(
mojo::PendingReceiver<service_manager::mojom::Service> receiver,
scoped_refptr<base::SequencedTaskRunner> io_task_runner) {
mojo::PendingReceiver<service_manager::mojom::Connector> connector_receiver;
connector_ = service_manager::Connector::Create(&connector_receiver);
context_ = new IOThreadContext(std::move(receiver), io_task_runner,
std::move(connector_receiver));
}
ServiceManagerConnectionImpl::~ServiceManagerConnectionImpl() {
context_->ShutDown();
}
////////////////////////////////////////////////////////////////////////////////
// ServiceManagerConnectionImpl, ServiceManagerConnection implementation:
void ServiceManagerConnectionImpl::Start() {
context_->Start(
base::BindOnce(&ServiceManagerConnectionImpl::OnConnectionLost,
weak_factory_.GetWeakPtr()));
}
void ServiceManagerConnectionImpl::Stop() {
context_->Stop();
}
service_manager::Connector* ServiceManagerConnectionImpl::GetConnector() {
return connector_.get();
}
void ServiceManagerConnectionImpl::SetConnectionLostClosure(
base::OnceClosure closure) {
connection_lost_handler_ = std::move(closure);
}
void ServiceManagerConnectionImpl::AddServiceRequestHandler(
const std::string& name,
const ServiceRequestHandler& handler) {
context_->AddServiceRequestHandler(name, handler);
}
void ServiceManagerConnectionImpl::AddServiceRequestHandlerWithCallback(
const std::string& name,
const ServiceRequestHandlerWithCallback& handler) {
context_->AddServiceRequestHandlerWithCallback(name, handler);
}
void ServiceManagerConnectionImpl::SetDefaultServiceRequestHandler(
const DefaultServiceRequestHandler& handler) {
context_->SetDefaultServiceRequestHandler(handler);
}
void ServiceManagerConnectionImpl::OnConnectionLost() {
if (!connection_lost_handler_.is_null())
std::move(connection_lost_handler_).Run();
}
void ServiceManagerConnectionImpl::GetInterface(
service_manager::mojom::InterfaceProvider* provider,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle request_handle) {
provider->GetInterface(interface_name, std::move(request_handle));
}
} // namespace content
| [
"[email protected]"
] | |
9a8661d74c8781d15c69970f3a18e7de6e558e33 | 0f732387ddd27d25996bf092e1368c3bad1da62e | /Stack/main.cpp | 0697afdfda8ae33e337cea6291b9a7a36b7c401a | [] | no_license | abdelrahmaneltohamy/data-structure | f462a0d815c8af34af4c6f0b7097aa5c9e9cc084 | e0da5fcfd078f0e39560e655aab5ef3cb781d45d | refs/heads/master | 2022-05-28T13:10:57.053175 | 2020-04-27T12:15:50 | 2020-04-27T12:15:50 | 259,306,010 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,224 | cpp | #include <iostream>
using namespace std;
template <class StackElemType>
class Stack {
public:
Stack(int Size)
{
if(Size<1)
throw"cannot construct an empty stack";
stackArray = new StackElemType[Size];
arraySize = Size;
topIndex = -1; // Point at no where in the array
}
Stack(StackElemType value, int intial_size)
{
if(intial_size<1)
throw"cannot construct an empty stack";
stackArray = new StackElemType[intial_size];
arraySize = intial_size;
topIndex = -1;
for(int i=0;i<arraySize;i++)
{
push(value);
}
}
void push(StackElemType value)
{
if (topIndex >= arraySize - 1)
{
throw"reached max of array";
}
else
{
topIndex++;
stackArray[topIndex] = value;
}
}
StackElemType& pop()
{
if (topIndex < 0)
throw"stack is empty";
else
{
return stackArray[topIndex--];
}
}
StackElemType& top()
{
if (topIndex < 0)
throw"stack is empty";
else
{
return stackArray[topIndex];
}
}
bool isEmpty()
{
if(topIndex==-1)
return true;
else
return false;
}
bool isFull()
{
if(topIndex==arraySize-1)
return true;
else
return false;
}
~Stack()
{
delete[] stackArray;
}
int Size()
{
return topIndex+1;
}
private:
StackElemType* stackArray;
int arraySize;
int topIndex;
};
int main()
{
Stack<int> mystack(20,30);
int mm=mystack.top();
cout<<mm<<endl<<mystack.Size()<<endl;
while(!mystack.isEmpty())
{
mm=mystack.pop();
cout<<mm<<" ";
}
cout<<endl;
Stack<int> mystack2(10);
mystack2.push(3);
mystack2.push(4);
mystack2.push(5);
try
{
while(!mystack2.isEmpty())
{
mm=mystack2.pop();
cout<<endl<<mm<<" ";
}
}
catch (char const* hh)
{
cout<<endl<<hh;
}
return 0;
}
| [
"[email protected]"
] | |
bb84d14479e0d62b13fe0d9c4c8f98a1a555c13d | 8124ed12e1c37d204f697f35e941e007b330535e | /TestWork_2/B.2.cpp | 8eea323b0d70f6ac1af2ced7a4f9089799a3ec59 | [] | no_license | Alexkkir/Sphere-Algorithms | 28c9010d26746a113c2a07a40f11b91f987486dc | 8c360b3d7222f67dbbd7a134b54395e6a95469a2 | refs/heads/master | 2022-12-18T22:59:28.465737 | 2020-09-18T10:08:12 | 2020-09-18T10:08:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 402 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
multiset<long long> S;
int N, K;
long long a;
cin >> N >> K;
for(int i = 0; i < N; ++i) {
cin >> a;
if(S.size() < K)
S.insert(a);
else
if(a > *(S.begin())) {
S.erase(S.begin());
S.insert(a);
}
}
for(auto it = S.rbegin(); it != S.rend(); ++it)
cout << *(it) << '\n';
} | [
"[email protected]"
] | |
81dc22244fdc5b03b610f3951de1a7a23fd5d97f | df19cfb9c58cfd620ca033421f29f52bb8c69511 | /DevMathvector.h | 17c81daec42348baedf042f2fc4cdb02a96fa17c | [] | no_license | devanob/SolarSystem | c987e5084581b34bb28c161c2a8ebc948e1b370a | 623e336d4dd35ee4dd38cb644ad07b5721a73987 | refs/heads/master | 2020-07-12T05:11:14.144938 | 2019-09-07T17:11:59 | 2019-09-07T17:11:59 | 204,727,045 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,780 | h | #ifndef DevMathVECTOR_H
#define DevMathVECTOR_H
#include <vector>
#include <utility>
#include <algorithm>
#include <stdexcept>
#include <mutex>
namespace DevMath {
class generic_error : public std::exception{
public:
generic_error(){
this->error_mssg =(char*)"Error:Unknown";
}
generic_error(const char* mssg){
this->error_mssg = (char*)mssg;
}
char* error_mssg;
unsigned int error_code;
virtual const char* what() const throw(){
return (const char*) this->error_mssg;
}
};
class EmptyVectorOperation : public generic_error{
public:
EmptyVectorOperation():generic_error((char*)"Exception Error: Operation On Empty Vector"){
}
}; // throws an exception when operations are done on an empty vector
class VectorOperationUnevenLength : public generic_error {
public:
VectorOperationUnevenLength():generic_error((char*)"Exception Error: Even Vector Pair Operation"){
}
};
class IndexOutOfBound : generic_error {
public:
IndexOutOfBound():generic_error((char*)"Exception Error:Index Out Of Bound"){
}
};
template <class type>
class vector {
public:
// mutex function
std::mutex& getMutexLock(); //gets the internel mutex
void lock_vector_mut() ; // lock the internel mutex
void unlock_vector_mut();
bool try_lock_mut ();
//unlock the internel mutex
vector(const vector& vector_); // contructors
vector(vector&& vector_); // move contructor
template <class seperate_type>
vector(const DevMath::vector<seperate_type>& vector_);
template <class seperate_type>
vector(DevMath::vector<seperate_type>&& vector_);
vector();
vector(const unsigned int& intial_size);
//-------------------------------------------------
template <class seperate_type>
inline DevMath::vector<type>& operator=(const DevMath::vector<seperate_type>& vector_);
inline DevMath::vector<type>& operator=(const DevMath::vector<type>& vector_); // copy operator and move operator
template <class seperate_type>
inline DevMath::vector<type>& operator=(DevMath::vector<seperate_type>&& vector_);
inline DevMath::vector<type>& operator=(DevMath::vector<type>&& vector_);
template <class c_type>
inline void assign(const vector<c_type>& vector_);
template <class c_type>
inline void assign(vector<c_type>&&);
//---------------------------------------------------
inline type& operator[](const unsigned int& index); // push pack values//resize
inline const type& operator[](const unsigned int& index) const;
inline void push_back(const type& var);
inline void resize(const unsigned int& size);
inline void clear();
inline const type* data_ptr() const;
inline const std::vector<type>& data_vector() const;
//-------------------------------------------------------------------------
//
template <class c_type>
bool operator==(const vector<c_type>& vector_) const;
template <class c_type>
bool operator!=(const vector<c_type>& vector_) const;
template <class vector_type>
type operator*(const vector<vector_type>& vector_);
vector<type> operator/(const type& divider) const; // vector arthimetic
DevMath::vector<type>& operator/=(const type& divider);
vector<type> operator*(const type& divider) const;
DevMath::vector<type>& operator*=(const type& divider);
template <class vector_type>
vector<type> operator+(const DevMath::vector<vector_type>& vector_) const;
template <class vector_type>
vector<type>& operator+(DevMath::vector<vector_type>&& vector_) const;
template <class vector_type>
DevMath::vector<type>& operator+=(const DevMath::vector<vector_type>& vector_);
template <class vector_type>
DevMath::vector<type>& operator+=(DevMath::vector<vector_type>&& vector_);
unsigned int size() const;
//-------------------------------------------------------------------GENERAL-
template <class vector_type>
type dot(const vector<vector_type>& vector_);
type normVec(unsigned int& norm_count);
type length_n();
type* ptr_vec();
private:
std::mutex vector_lock;
std::vector<type> data;
};
template <class type>
void swap(DevMath::vector<type>& vector1, DevMath::vector<type>& vector2);
template <class type_matrix>
vector<type_matrix> operator*(const type_matrix& numoper, const DevMath::vector<type_matrix>& vec1);
}
template <class type>
DevMath::vector<type>::vector()
{
}
template <class type>
DevMath::vector<type>::vector(const vector& vector_)
{
this->data = vector_.data;
}
template <class type>
template <class seperate_type>
DevMath::vector<type>::vector(const DevMath::vector<seperate_type>& vector_)
{
try {
assign(vector_);
}
catch (std::exception& except) {
throw std::runtime_error("Error Assigning Vector Defualt Contructor");
}
}
template <class type>
template <class seperate_type>
DevMath::vector<type>::vector(DevMath::vector<seperate_type>&& vector_)
{
try {
assign(std::move(vector_));
}
catch (std::exception& except) {
throw std::runtime_error("Error In Vector Assignment in Vector Defualt Contructor-Move");
}
}
template <class type>
DevMath::vector<type>::vector(vector&& vector_)
{
data = std::move(vector_.data);
}
template <class type>
DevMath::vector<type>& DevMath::vector<type>::operator=(const DevMath::vector<type>& vector_)
{
data = vector_.data;
return *this;
}
template <class type>
template <class seperate_type>
DevMath::vector<type>& DevMath::vector<type>::operator=(const DevMath::vector<seperate_type>& vector_)
{
try {
assign(vector_);
}
catch (std::exception& except) {
throw std::runtime_error("Error In Vector Assignment in Vector Operator= ");
}
return *this;
}
template <class type>
DevMath::vector<type>& DevMath::vector<type>::operator=(DevMath::vector<type>&& vector_)
{
try {
assign(std::move(vector_));
}
catch (std::exception& except) {
throw std::runtime_error("Error In Vector Assignment in Vector Operator=move ");
}
return *this;
}
template <class type>
template <class seperate_type>
DevMath::vector<type>& DevMath::vector<type>::operator=(DevMath::vector<seperate_type>&& vector_)
{
try {
assign(std::move(vector_));
}
catch (std::exception& except) {
throw std::runtime_error("Error In Vector Assignment in Vector Operator=move ");
}
return *this;
}
template <class type>
type& DevMath::vector<type>::operator[](const unsigned int& index)
{
if (data.size() == 0 || index >= data.size() || index < 0) {
throw IndexOutOfBound();
}
return data[index];
}
template <class type>
const type& DevMath::vector<type>::operator[](const unsigned int& index) const
{
if (data.size() == 0 || index >= data.size() || index < 0)
IndexOutOfBound();
return data[index];
}
template <class type>
void DevMath::vector<type>::push_back(const type& var)
{
data.push_back(var);
}
template <class type>
DevMath::vector<type>::vector(const unsigned int& intial_size)
{
data.resize(intial_size);
}
template <class type>
DevMath::vector<type> DevMath::vector<type>::operator/(const type& divider) const
{
if (data.size() == 0)
throw EmptyVectorOperation();
else {
const unsigned int& size_vector = data.size();
DevMath::vector<type> temp = *this;
for (unsigned int i = 0; i < size_vector; i++) {
temp.data[i] /= divider;
}
return std::move(temp);
}
}
template <class type>
DevMath::vector<type>& DevMath::vector<type>::operator/=(const type& divider)
{
if (data.size() == 0)
throw EmptyVectorOperation();
else {
const unsigned int& size_vector = data.size();
for (unsigned int i = 0; i < size_vector; i++) {
data[i] /= divider;
}
}
return *this;
}
template <class type>
DevMath::vector<type>& DevMath::vector<type>::operator*=(const type& divider)
{
if (data.size() == 0)
throw EmptyVectorOperation();
else {
const unsigned int& size_vector = data.size();
for (unsigned int i = 0; i < size_vector; i++) {
data[i] *= divider;
}
}
return *this;
}
template <class type>
DevMath::vector<type> DevMath::vector<type>::operator*(const type& divider) const
{
if (data.size() == 0)
throw EmptyVectorOperation();
else {
const unsigned int& size_vector = data.size();
DevMath::vector<type> temp = *this;
for (unsigned int i = 0; i < size_vector; i++) {
temp.data[i] *= divider;
}
return std::move(temp);
}
}
template <class type>
template <class vector_type>
DevMath::vector<type> DevMath::vector<type>::operator+(const DevMath::vector<vector_type>& vector_) const
{
if (vector_.data.size() != data.size()) {
throw VectorOperationUnevenLength();
}
else {
const unsigned int& data_size = vector_.data.size();
DevMath::vector<type> temp(data_size);
for (unsigned int i = 0; i < data_size; i++) {
temp.data[i] = vector_.data[i] + data[i];
};
return std::move(temp);
}
}
template <class type>
template <class vector_type>
DevMath::vector<type>& DevMath::vector<type>::operator+(DevMath::vector<vector_type>&& vector_) const
{
if (vector_.data.size() != data.size()) {
throw VectorOperationUnevenLength();
}
else {
const unsigned int& data_size = vector_.data.size();
for (unsigned int i = 0; i < data_size; i++) {
vector_.data[i] += data[i];
};
return vector_;
}
}
template <class type>
template <class vector_type>
DevMath::vector<type>& DevMath::vector<type>::operator+=(const vector<vector_type>& vector_)
{
if (vector_.data.size() != data.size()) {
throw VectorOperationUnevenLength();
}
else {
const unsigned int& data_size = vector_.data.size();
for (unsigned int i = 0; i < data_size; i++) {
data[i] += vector_.data[i];
};
}
return *this;
}
template <class type>
template <class vector_type>
DevMath::vector<type>& DevMath::vector<type>::operator+=(vector<vector_type>&& vector_)
{
if (vector_.data.size() != data.size()) {
throw VectorOperationUnevenLength();
}
else {
unsigned int data_size = vector_.data.size();
for (unsigned int i = 0; i < data_size; i++) {
data[i] += vector_.data[i];
};
}
return *this;
}
template <class type>
void DevMath::vector<type>::resize(const unsigned int& size)
{
data.resize(size);
}
template <class type>
void DevMath::swap(DevMath::vector<type>& vector1, DevMath::vector<type>& vector2)
{
DevMath::vector<type> temp(std::move(vector1));
vector1 = std::move(vector2);
vector2 = std::move(temp);
}
template <class type>
std::mutex& DevMath::vector<type>::getMutexLock()
{
return vector_lock;
}
template <class type>
unsigned int DevMath::vector<type>::size() const
{
return this->data.size();
}
template<class type>
type DevMath::vector<type>::normVec(unsigned int &norm_count)
{
type norm_count_dim = type(0);
}
template<class type>
type DevMath::vector<type>::length_n()
{
type sqrted_val;
for (unsigned int i = 0; i < this->data.size(); i++){
sqrted_val+= std::pow(data[i],2);
}
return std::sqrt(sqrted_val);
}
template<class type>
type *DevMath::vector<type>::ptr_vec()
{
return data.data();
}
template <class type>
template <class vector_type>
type DevMath::vector<type>::dot(const vector<vector_type>& vector_)
{
type dot_product = 0;
if (vector_.size() != this->size())
throw VectorOperationUnevenLength();
for (unsigned int i = 0; i < vector_.size(); i++) {
dot_product += vector_[i] * data[i];
}
return std::move(dot_product);
}
template <class type>
template <class vector_type>
type DevMath::vector<type>::operator*(const vector<vector_type>& vector_)
{
type dot_product = 0;
if (vector_.size() != this->size())
throw VectorOperationUnevenLength();
for (unsigned int i = 0; i < vector_.size(); i++) {
dot_product += vector_[i] * data[i];
}
return std::move(dot_product);
}
template <class type>
template <class c_type>
void DevMath::vector<type>::assign(const vector<c_type>& vector_)
{
if (vector_.size() == 0) {
this->data.clear();
}
else {
try {
this->data.clear();
this->data.assign(vector_.data_vector().begin(), vector_.data_vector().end());
}
catch (std::exception& expt) {
throw std::runtime_error("Unable To Do Such Assignment On DevMathvector<type,c_type>");
}
}
}
template <class type>
template <class c_type>
void DevMath::vector<type>::assign(vector<c_type>&& vector_)
{
if (vector_.size() == 0) {
this->data.clear();
}
else {
try {
this->data = std::move(vector_.data_vector());
}
catch (const std::exception& expt) {
try {
this->data.assign(vector_.data_vector().begin(), vector_.data_vector().end());
vector_.clear();
}
catch (std::exception& expt) {
throw std::runtime_error("Unable To Do Such Assignment On DevMathvector<type,c_type>");
}
}
vector_.clear();
}
}
template <class type>
void DevMath::vector<type>::clear()
{
data.clear();
}
template <class type>
template <class c_type>
bool DevMath::vector<type>::operator==(const vector<c_type>& vector_) const
{
if (vector_.size() != data.size())
return false;
else {
unsigned int dat_size = vector_.size();
for (unsigned int i = 0; i < dat_size; i++) {
if (data[i] != vector_[i])
return false;
}
}
return true;
}
template <class type>
template <class c_type>
bool DevMath::vector<type>::operator!=(const vector<c_type>& vector_) const
{
if (vector_.size() != data.size())
return true;
else {
unsigned int dat_size = vector_.size();
for (unsigned int i = 0; i < dat_size; i++) {
if (data[i] != vector_[i])
return true;
}
}
return false;
}
template <class type_matrix>
DevMath::vector<type_matrix> operator*(const type_matrix& numoper, const DevMath::vector<type_matrix>& vec1)
{
return std::move(vec1 * numoper);
}
template <class type>
const type* DevMath::vector<type>::data_ptr() const
{
return this->data.data();
}
template <class type>
const std::vector<type>& DevMath::vector<type>::data_vector() const
{
return this->data;
}
template<class type>
void DevMath::vector<type>::lock_vector_mut() {
this->vector_lock.lock();
}
template<class type>
void DevMath::vector<type>::unlock_vector_mut() {
this->vector_lock.unlock();
}
template<class type>
bool DevMath::vector<type>::try_lock_mut() {
return this->vector_lock.try_lock();
}
#endif // DevMathVECTOR_H
| [
"[email protected]"
] | |
cba2d6ca76b79476ea72b992f258bb35bcc1dc72 | e37d0e2adfceac661fbd844912d22c25d91f3cc0 | /CPP-Programming-Principles/chapter04-computation/ex21_search_score.cpp | 53e1262e8ca597d5426fa76ce7bffe1ab77a29cb | [] | no_license | mikechen66/CPP-Programming | 7638927918f59302264f40bbca4ffbfe17398ec6 | c49d6d197cad3735d60351434192938c95f8abe7 | refs/heads/main | 2023-07-11T20:27:12.236223 | 2021-08-26T08:50:37 | 2021-08-26T08:50:37 | 384,588,683 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,198 | cpp | #include "../text_lib/std_lib_facilities.h"
int main()
{
// Accept name value pairs, store them in vectors, print them in the end.
vector<string> names;
vector<int> scores;
string name = "";
int score = 0;
bool end = false;
bool repeat = false;
while (!end) {
cout << "Enter a name and a value:\n";
cin >> name >> score;
if (name == "NoName" && score == 0)
end = true;
else {
for (string n : names)
if (n == name)
repeat = true;
if (repeat) {
cout << "Error: duplicate name\n";
repeat = false;
} else {
names.push_back(name);
scores.push_back(score);
}
}
}
int query = 0;
cout << "Which score would you like to look up?\n";
cin >> query;
vector<string> matches;
for (int i = 0; i < names.size(); ++i)
if (scores[i] == query)
matches.push_back(names[i]);
if (matches.size() > 0)
for (string m : matches)
cout << m << '\n';
else
cout << "score not found\n";
}
| [
"[email protected]"
] | |
151be93d32cd64d5c962f4a9f496744a3f46d0cf | 24402270bbae693e18316e7519e4043261d7e9f5 | /PAT-Advanced-1029.cpp | 9be100df1a5c7a2345f0a97da94f2719603ada73 | [] | no_license | Lemon-XQ/PAT-Advanced | e240a69a65c0af5ebe83fd1144af3c86ff6ee60c | 4a32066b4781315960e58e108b2d1466d44a0a73 | refs/heads/master | 2020-03-29T18:15:04.105405 | 2018-10-04T16:14:00 | 2018-10-04T16:14:00 | 150,201,653 | 2 | 0 | null | null | null | null | GB18030 | C++ | false | false | 749 | cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int INF=0x7fffffff;
#define size 200001
int arr[size];
int main(){
int N1,N2,i=0,j=0;
scanf("%d",&N1);
for(int i=0;i<N1;i++){
scanf("%d",&arr[i]);
}
arr[N1]=INF;
scanf("%d",&N2);
int mid=(N1+N2-1)/2,count=0,num;
scanf("%d",&num);
for(count=0;count<mid;count++){// 遍历arr所有数,排序到中位数为止
if(num>arr[i]) i++;// 找到插入的地方
else{
j++;
if(j<N2) scanf("%d",&num);
else if(j==N2) num=INF;
else break;
}
}
cout<<min(arr[i],num)<<endl;
// for(int j=i;j<N+i;j++){
// scanf("%d",&arr[j]);
// }
// sort(arr,arr+N+i);// 最后一个测试点MLE
// cout<<arr[(N+i-1)/2]<<endl;
return 0;
}
| [
"[email protected]"
] | |
0ae7ae770fa107ec496a54dde53e9731519b1635 | 3cc1cd3909fb054fd5501017235858a3e926b5b7 | /src/resqml2_2/CmpLineFeature.cpp | 354d1b4d8c3c5659f020693493205f459152bedc | [
"GPL-1.0-or-later",
"LicenseRef-scancode-proprietary-license",
"BSL-1.0",
"Apache-2.0"
] | permissive | mpoudret/fesapi | 3a264639ff0c1faa07d4ff113f222bedca0c232a | 5aff682d8e707d4682a0d8674b5f6353be24ed55 | refs/heads/master | 2021-06-23T11:34:44.920100 | 2021-03-15T15:26:14 | 2021-03-15T15:26:14 | 152,227,959 | 0 | 0 | Apache-2.0 | 2018-10-09T09:54:04 | 2018-10-09T09:54:04 | null | UTF-8 | C++ | false | false | 2,170 | cpp | /*-----------------------------------------------------------------------
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"; you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-----------------------------------------------------------------------*/
#include "CmpLineFeature.h"
using namespace std;
using namespace RESQML2_2_NS;
using namespace gsoap_eml2_3;
const char* CmpLineFeature::XML_NS = "resqml22";
CmpLineFeature::CmpLineFeature(COMMON_NS::DataObjectRepository* repo, const std::string & guid, const std::string & title,
int nearestShotPointIndicesIncrement, int firstNearestShotPointIndex, unsigned int nearestShotPointCount)
{
if (repo == nullptr) {
throw invalid_argument("The soap context cannot be null.");
}
gsoapProxy2_3 = soap_new_resqml22__CmpLineFeature(repo->getGsoapContext());
_resqml22__CmpLineFeature* cmpLine = static_cast<_resqml22__CmpLineFeature*>(gsoapProxy2_3);
eml23__IntegerLatticeArray* nearestShotPointIndices = soap_new_eml23__IntegerLatticeArray(gsoapProxy2_3->soap);
nearestShotPointIndices->StartValue = firstNearestShotPointIndex;
nearestShotPointIndices->Offset.push_back(soap_new_eml23__IntegerConstantArray(gsoapProxy2_3->soap));
nearestShotPointIndices->Offset[0]->Count = nearestShotPointCount - 1;
nearestShotPointIndices->Offset[0]->Value = nearestShotPointIndicesIncrement;
cmpLine->NearestShotPointIndices = nearestShotPointIndices;
initMandatoryMetadata();
setMetadata(guid, title, "", -1, "", "", -1, "");
repo->addOrReplaceDataObject(this);
}
| [
"[email protected]"
] | |
81579646f273e3626b3d180bd262fa407ddfe97f | c67459b3e834e044db19e8d58e460ec69713e503 | /include/polynomial/Polynomial.h | d18ecfc3761c6f514dc07a3d5b5260896c589cde | [] | no_license | levistovall/dog-ate-loaf | 17db38c011b8c48dac29c5a64c3239ec3ad72174 | 100d6536f5a88876d898412a0c65ad81c016f9b3 | refs/heads/master | 2021-04-27T12:51:26.388838 | 2019-05-05T20:01:58 | 2019-05-05T20:01:58 | 122,427,876 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,102 | h | #ifndef POLYNOMIAL_H_
#define POLYNOMIAL_H_
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <typeinfo>
#include <initializer_list>
#include "Rational.h"
/*
* The class template Polynomial<T> can represent a sum of products of scalars and variables
* of any order but cannot represent anything with a polynomial in the denominator.
* It achieves this by inheriting std::map<std::map<std::string, T>, T>, which might be more
* helpfully represented as std::map<std::map<VARIABLE_NAME, DEGREE>, COEFFICIENT>
*/
template<typename T>
class Polynomial : public std::map<std::map<std::string, T>, T>
{
public:
/*
* Plain ol' constructor
*/
Polynomial();
/*
* This constructor uses an initializer list which is available courtesy of
* std::map so that polynomials can be constructed in a *relatively* concise way
* as opposed to being built term by term
*/
Polynomial(std::initializer_list<std::pair<const std::map<std::string, T>, T>> il);
/*
* The method addTerm takes a term, e.g. a(x^2)(y^3) and adds it to
* this Polynomial, adding a to the coefficient of a like term if it exists,
* deleting the like term if the existing coefficient is -a, or creating a new
* key-value pairing if a like term did not previously exist
*/
void addTerm(const std::pair<std::map<std::string, T>, T> &term);
/*
* The method getProductOfTwoTerms takes two pairings of coefficients
* to variable-degree maps and returns a product. For example, the two terms
* could respectively represent 6(x^2) and 2(x)(y^2). In that case this method
* would return a term to represent 12(x^3)(y^2).
*/
static std::pair<std::map<std::string, T>, T> getProductOfTwoTerms(
const std::pair<std::map<std::string, T>, T> &term1,
const std::pair<std::map<std::string, T>, T> &term2);
std::string toString() const;
/*
* Returns as a Polynomial the value of this Polynomial when evaluated when its variables
* corresponding to the keys of the map varNameToValueMap have the values specified by the
* values of the same map.
* For example, if the Polynomial was x + y + 1 then passing a map {{x : 5}} to this
* method would yield the Polynomial y + 6. If the map {{x : 3}, {y : 2}} were
* passed instead, this method would yield a Polynomial with only a constant term, 6.
*/
Polynomial<T> evaluateWithVariableValues(std::map<std::string, T> varNameToValueMap);
/*
* The method containsVariable determines whether this Polynomial has
* any terms with a variable that has the name passed as varName
*/
bool containsVariable(std::string varName);
};
/*
* This operator achieves scalar multiplication of a Polynomial
*/
template<typename T1, typename T2>
auto operator*(const T1 &scalar, const Polynomial<T2> &p) -> Polynomial<decltype(T1{} * T2{})>
{
Polynomial<decltype(T1{} * T2{})> scalarMultiple;
typename std::map<std::map<std::string, T2>, T2>::const_iterator p_it;
/*
* iterate over the terms in the polynomial, get the product with the scalar,
* and add the result to the returned polynomial
*/
for(p_it = p.begin(); p_it != p.end(); p_it++)
{
std::pair<std::map<std::string, decltype(T1{} * T2{})>, decltype(T1{} * T2{})> multipliedTerm;
multipliedTerm.first = p_it->first;
multipliedTerm.second = p_it->second * scalar;
scalarMultiple.addTerm(multipliedTerm);
}
return scalarMultiple;
}
/*
* This operator achieves scalar multiplication of Polynomial in the opposite order
* to the above
*/
template<typename T1, typename T2>
auto operator*(const Polynomial<T1> &p, const T2 &scalar) -> Polynomial<decltype(T1{} * T2{})>
{
return scalar * p;
}
/*
* This operator achieves multiplication of two polynomials
*/
template<typename T1, typename T2>
auto operator*(const Polynomial<T1> &p, const Polynomial<T2> &q) -> Polynomial<decltype(T1{} * T2{})>
{
Polynomial<decltype(T1{} * T2{})> product;
typename std::map<std::map<std::string, T1>, T1>::const_iterator p_it;
typename std::map<std::map<std::string, T2>, T2>::const_iterator q_it;
/*
* Iterate over the first polynomial
*/
for(p_it = p.begin(); p_it != p.end(); p_it++)
{
/*
* For every term in the first polynomial,
* iterate over all the terms in the second polynomial
*/
std::map<std::string, decltype(T1{} * T2{})> variableOrderMap;
for(q_it = q.begin(); q_it != q.end(); q_it++)
{
/*
* Get the product of the current term of the first polynomial
* with the current term of the second polynomial.
*/
std::pair<std::map<std::string, decltype(T1{} * T2{})>, decltype(T1{} * T2{})> termProduct =
Polynomial<decltype(T1{} * T2{})>::getProductOfTwoTerms(*p_it, *q_it);
/*
* Add it to the polynomial which will be returned.
*/
product.addTerm(termProduct);
}
}
return product;
}
/*
* This operator achieves addition of two polynomials.
*/
template<typename T1, typename T2>
auto operator+(const Polynomial<T1> &p, const Polynomial<T2> &q) -> Polynomial<decltype(T1{} * T2{})>
{
/*
* Make a new polynomial to return.
*/
Polynomial<decltype(T1{} * T2{})> sum;
/*
* Add all terms from the first polynomial.
*/
typename std::map<std::map<std::string, T1>, T1>::const_iterator p_it;
for(p_it = p.begin(); p_it != p.end(); p_it++)
{
sum.addTerm(*p_it);
}
/*
* Add all terms from the second polynomial.
*/
typename std::map<std::map<std::string, T2>, T2>::const_iterator q_it;
for(q_it = q.begin(); q_it != q.end(); q_it++)
{
sum.addTerm(*q_it);
}
return sum;
}
/*
* This operator achieves subtraction from polynomial of another
*/
template<typename T1, typename T2>
auto operator-(const Polynomial<T1> &p, const Polynomial<T2> &q) -> Polynomial<decltype(T1{} * T2{})>
{
return p + (-1 * q);
}
/*
* This operator allows ostreams to handle Polynomials
*/
template<typename T>
std::ostream &operator<<(std::ostream &out, Polynomial<T> const &p)
{
out << p.toString();
return out;
}
#endif
| [
"[email protected]"
] | |
ff87ab58cd18081dbc29a2694ef88aca6c8aa14c | ba4db75b9d1f08c6334bf7b621783759cd3209c7 | /src_main/engine/audio/private/snd_dev_common.h | f32c1741434c029fc28be5b907aa8a7eccffbf8f | [] | no_license | equalent/source-2007 | a27326c6eb1e63899e3b77da57f23b79637060c0 | d07be8d02519ff5c902e1eb6430e028e1b302c8b | refs/heads/master | 2020-03-28T22:46:44.606988 | 2017-03-27T18:05:57 | 2017-03-27T18:05:57 | 149,257,460 | 2 | 0 | null | 2018-09-18T08:52:10 | 2018-09-18T08:52:09 | null | WINDOWS-1252 | C++ | false | false | 2,851 | h | //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Device Common Routines
//
//=====================================================================================//
#ifndef SND_DEV_COMMON_H
#define SND_DEV_COMMON_H
#pragma once
class CAudioDeviceBase : public IAudioDevice
{
public:
virtual bool IsActive( void ) { return false; }
virtual bool Init( void ) { return false; }
virtual void Shutdown( void ) {}
virtual void Pause( void ) {}
virtual void UnPause( void ) {}
virtual float MixDryVolume( void ) { return 0; }
virtual bool Should3DMix( void ) { return m_bSurround; }
virtual void StopAllSounds( void ) {}
virtual int PaintBegin( float, int soundtime, int paintedtime ) { return 0; }
virtual void PaintEnd( void ) {}
virtual void SpatializeChannel( int volume[CCHANVOLUMES/2], int master_vol, const Vector& sourceDir, float gain, float mono );
virtual void ApplyDSPEffects( int idsp, portable_samplepair_t *pbuffront, portable_samplepair_t *pbufrear, portable_samplepair_t *pbufcenter, int samplecount );
virtual int GetOutputPosition( void ) { return 0; }
virtual void ClearBuffer( void ) {}
virtual void UpdateListener( const Vector& position, const Vector& forward, const Vector& right, const Vector& up ) {}
virtual void MixBegin( int sampleCount );
virtual void MixUpsample( int sampleCount, int filtertype );
virtual void Mix8Mono( channel_t *pChannel, char *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
virtual void Mix8Stereo( channel_t *pChannel, char *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
virtual void Mix16Mono( channel_t *pChannel, short *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
virtual void Mix16Stereo( channel_t *pChannel, short *pData, int outputOffset, int inputOffset, fixedint rateScaleFix, int outCount, int timecompress );
virtual void ChannelReset( int entnum, int channelIndex, float distanceMod ) {}
virtual void TransferSamples( int end ) {}
virtual const char *DeviceName( void ) { return NULL; }
virtual int DeviceChannels( void ) { return 0; }
virtual int DeviceSampleBits( void ) { return 0; }
virtual int DeviceSampleBytes( void ) { return 0; }
virtual int DeviceDmaSpeed( void ) { return 1; }
virtual int DeviceSampleCount( void ) { return 0; }
virtual bool IsSurround( void ) { return m_bSurround; }
virtual bool IsSurroundCenter( void ) { return m_bSurroundCenter; }
virtual bool IsHeadphone( void ) { return m_bHeadphone; }
bool m_bSurround;
bool m_bSurroundCenter;
bool m_bHeadphone;
};
#endif // SND_DEV_COMMON_H
| [
"[email protected]"
] | |
609947f631bd738a1d8f790620b7fd37401eef73 | e5c71f0b8488fc6a43ba5b1ca655d202f3350761 | /counting_bits_till_n.cpp | 69b8b343a1833cac489e20ea071eace735023c41 | [] | no_license | Singroha-S/Bit-Manipulation | c564ab1dade33bcb76a5e32ade695536c8f472da | 2aa424fbd9b8b266f187e9547664d09fb0dc6caa | refs/heads/main | 2023-07-13T18:27:41.034158 | 2021-08-30T16:51:24 | 2021-08-30T16:51:24 | 393,628,773 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 381 | cpp | #include<bits/stdc++.h>
using namespace std;
int count(int c)
{
int cnt=0;
while(c)
{
c=c & (c-1);
cnt++;
}
return cnt;
}
void fn(int n)
{
int a[n];
for(int i=0;i<=n;i++)
{
a[i]=count(i);
}
for(int i=0;i<=n;i++)
{
cout<<a[i]<<" ";
}
}
int main()
{
int n;
cin>>n;
fn(n);
return 0;
}
| [
"[email protected]"
] | |
f5237409496c3a653a11282f8f3256c7ea99714d | 19d41c4ae325277636383885388c83dd1555f8cf | /zerojudge/d105.cpp | f2a3dc5a401adf02d34e24c73888b9df545bf258 | [] | no_license | henrytsui000/online-judge | 5fd0f7b5c747fb5bfd5f84fb616b9f7346e8abaf | 337aa1d52d587fb653ceeb8b3ee64668804f5b13 | refs/heads/master | 2022-05-28T13:56:04.705485 | 2022-05-19T13:33:43 | 2022-05-19T13:33:43 | 226,999,858 | 3 | 0 | null | 2022-02-02T03:22:06 | 2019-12-10T01:10:15 | C++ | UTF-8 | C++ | false | false | 521 | cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define endl '\n'
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
using ll = long long;
#define ij i<<','<<j<<": "
ll n,m;
#define MAXN 30
ll dp[30][30];
ll ans=0;
int main(){
IOS;
cin>>n>>m;
rep(i,n)
rep(j,m)
dp[i][j]=0;
dp[0][0]=1;
for(int j=1;j<m+1;j++){
rep(i,n){
dp[i][j]=dp[(i-1+n)%n][j-1]+dp[(i+1)%n][j-1];
}
}
cout<<dp[0][m]<<endl;
return 0;
} | [
"[email protected]"
] | |
c09abbc2c7a46b9d24896ebfb4546ddc7c96226d | 5d83739af703fb400857cecc69aadaf02e07f8d1 | /Archive2/cd/7bc6734eb84d8d/main.cpp | 4bc743e7378c7b07aca9eda535c1146d56cf22e5 | [] | no_license | WhiZTiM/coliru | 3a6c4c0bdac566d1aa1c21818118ba70479b0f40 | 2c72c048846c082f943e6c7f9fa8d94aee76979f | refs/heads/master | 2021-01-01T05:10:33.812560 | 2015-08-24T19:09:22 | 2015-08-24T19:09:22 | 56,789,706 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,107 | cpp |
#include <type_traits>
#include <utility>
#include <iomanip>
#include <iostream>
namespace {
template<class U, class T>
static auto
has_member_f_impl(signed)
-> decltype(
std::declval<T&>().f(std::declval<U&>()),
std::true_type{}
)
;
template<class, class>
static std::false_type
has_member_f_impl(...);
template<class U, class T>
static auto
has_non_member_f_impl(signed)
-> decltype(
f(std::declval<U&>(), std::declval<T&>()),
std::true_type{}
)
;
template<class, class>
static std::false_type
has_non_member_f_impl(...);
} // anonymous namespace
template<class U, class T>
struct has_member_f
: public decltype(has_member_f_impl<U, T>(0))
{};
template<class U, class T>
struct has_non_member_f
: public decltype(has_non_member_f_impl<U, T>(0))
{};
// test
struct B {
template<class T>
void f(T&) {}
};
struct D : public B {};
template<class U, class T>
void f(U&, T&) {}
signed main() {
std::cout
<< std::boolalpha
<< has_member_f<int, D>::value << '\n'
<< has_non_member_f<int, D>::value << '\n'
;
return 0;
}
| [
"francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df"
] | francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df |
644a9aadfdaa900e9328d51c1f3c14c55eef1f33 | c1d39d3b0bcafbb48ba2514afbbbd6d94cb7ffe1 | /source/deps/illa/webp_imagecomposer.cpp | 1fbc0969a7b7e9e0b2d6ea8846c2781603c65018 | [
"IJG",
"MIT"
] | permissive | P4ll/Pictus | c6bb6fbc8014c7de5116380f48f8c1c4016a2c43 | 0e58285b89292d0b221ab4d09911ef439711cc59 | refs/heads/master | 2023-03-16T06:42:12.293939 | 2018-09-13T18:19:30 | 2018-09-13T18:19:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,060 | cpp | #include "webp_imagecomposer.h"
#include "surfacemgr.h"
namespace Img {
void WebpImageComposer::SetCanvasSize(Geom::SizeInt newSize)
{
std::lock_guard<std::mutex> l(m_mutFrames);
m_dims = newSize;
}
void WebpImageComposer::SetBackgroundColor(Img::Color backgroundColor)
{
std::lock_guard<std::mutex> l(m_mutFrames);
m_backgroundColor = backgroundColor;
}
void WebpImageComposer::SetFrameCount(size_t numFrames)
{
std::lock_guard<std::mutex> l(m_mutFrames);
m_numFrames = numFrames;
}
void WebpImageComposer::SendFrame(WebpFrame frame)
{
std::lock_guard<std::mutex> l(m_mutFrames);
m_frames.push_back(frame);
}
WebpImageComposer::WebpImageComposer():
m_currFrame(0),
m_numFrames(0)
{
}
WebpImageComposer::~WebpImageComposer()
{}
Surface::Ptr WebpImageComposer::ComposeCurrentSurface() {
std::lock_guard<std::mutex> l(m_mutFrames);
if (m_frames.empty())
{
return nullptr;
}
if (m_currentSurface == nullptr)
{
m_currentSurface = CreateNewSurface(m_dims, Img::Format::ARGB8888);
}
if (m_frames[m_currFrame].DisposeMethod == WebpDispose::BackgroundColor)
{
m_currentSurface->ClearSurface(m_backgroundColor);
}
if (m_frames[m_currFrame].BlendMethod == WebpBlendMethod::Alpha && m_currFrame > 0)
{
m_currentSurface->BlitSurfaceAlpha(m_frames[m_currFrame].Surface, m_frames[m_currFrame].Offset);
}
else
{
m_currentSurface->CopySurface(m_frames[m_currFrame].Surface, m_frames[m_currFrame].Offset);
}
return m_currentSurface;
}
void WebpImageComposer::OnAdvance() {
std::lock_guard<std::mutex> l(m_mutFrames);
if (m_currFrame + 1 < m_frames.size() && m_currentSurface != nullptr) {
m_currFrame++;
}
else if (m_currFrame + 1 == m_numFrames) {
m_currFrame = 0;
}
}
int WebpImageComposer::OnDelay() {
std::lock_guard<std::mutex> l(m_mutFrames);
if (m_currFrame >= m_frames.size()) {
return 10;
}
return m_frames[m_currFrame].Delay;
}
void WebpImageComposer::OnRestart() {
std::lock_guard<std::mutex> l(m_mutFrames);
m_currFrame = 0;
}
}
| [
"[email protected]"
] | |
3db51f7dc82ccb43de5e403556b26ac23bd1fc91 | 18c5b07a6d4f430eefa1fd12376d66050c22df74 | /moc_filelineedit.cpp | e3ced78e57932e47fa0d5bf6caed44552f30a645 | [] | no_license | KingSann/Project_lemon | 921f13fead3b9f810643dd292b2c1eeeae04a483 | 21b7b8353d24cd431524d849c71f1c29bc595918 | refs/heads/master | 2020-03-20T19:55:42.187457 | 2018-07-10T00:59:14 | 2018-07-10T00:59:14 | 137,661,349 | 0 | 0 | null | 2018-06-17T14:32:08 | 2018-06-17T14:32:08 | null | UTF-8 | C++ | false | false | 3,416 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'filelineedit.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.11.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "filelineedit.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'filelineedit.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.11.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_FileLineEdit_t {
QByteArrayData data[3];
char stringdata0[30];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_FileLineEdit_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_FileLineEdit_t qt_meta_stringdata_FileLineEdit = {
{
QT_MOC_LITERAL(0, 0, 12), // "FileLineEdit"
QT_MOC_LITERAL(1, 13, 15), // "refreshFileList"
QT_MOC_LITERAL(2, 29, 0) // ""
},
"FileLineEdit\0refreshFileList\0"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_FileLineEdit[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
1, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 0, 19, 2, 0x0a /* Public */,
// slots: parameters
QMetaType::Void,
0 // eod
};
void FileLineEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
FileLineEdit *_t = static_cast<FileLineEdit *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->refreshFileList(); break;
default: ;
}
}
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject FileLineEdit::staticMetaObject = {
{ &QLineEdit::staticMetaObject, qt_meta_stringdata_FileLineEdit.data,
qt_meta_data_FileLineEdit, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *FileLineEdit::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *FileLineEdit::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_FileLineEdit.stringdata0))
return static_cast<void*>(this);
return QLineEdit::qt_metacast(_clname);
}
int FileLineEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QLineEdit::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 1)
qt_static_metacall(this, _c, _id, _a);
_id -= 1;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 1)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 1;
}
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
| [
"[email protected]"
] | |
fedb8c9cb5b71e578ad0fd5a381aac47835c6202 | 238edf5919d6653e0c63552229ac9f48e33ba274 | /AccountData v2/testUserClass.cpp | 6d295fc767dee813f4150dbe38a2abe337a5e6d2 | [] | no_license | elnasty/222_A1 | 9a5b22cb282df9e5185c47250362b8a0fc0247de | 99b9fbd29da3888ed83389045bab122aa3e38d92 | refs/heads/master | 2021-05-05T00:32:17.041262 | 2018-02-21T02:47:01 | 2018-02-21T02:47:01 | 119,502,345 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,294 | cpp | #include "User.cpp"
int main ()
{
//Testing constructors
User user;
User user1 ("S12345", "abc123", "abc.gmail.com");
User user2 ("54321", "12345", "maybenot.gmail.com");
//Test mutators
user2.setStaffID ("setala");
user2.setPwd("setpw");
user2.setEmail("set.gmail.com");
user2.setAccLock (true);
//Test Accessors
cout<< user2.getStaffID() << '\t'
<< user2.getPwd() << '\t'
<< user2.getEmail() << '\t';
if (user2.getAccLock () == true)
cout << "Locked";
else
cout << "Unlocked";
cout << endl;
cout<< user1.getStaffID() << '\t'
<< user1.getPwd() << '\t'
<< user1.getEmail() << '\t';
if (user1.getAccLock () == true)
cout << "Locked";
else
cout << "Unlocked";
cout << endl;
cout<< user.getStaffID() << '\t'
<< user.getPwd() << '\t'
<< user.getEmail() << '\t';
if (user.getAccLock () == true)
cout << "Locked";
else
cout << "Unlocked";
cout << endl;
//Testing if user is empty
if (strcmp (user.getStaffID(), "") == 0)
cout << "Empty" << '\t';
if (strcmp (user.getPwd(), "") == 0)
cout << "Empty" << '\t';
if (strcmp (user.getEmail(), "") == 0)
cout << "Empty" << endl;
if (user.isEmpty())
cout << "This user is not allocated!" << endl;
}
| [
"Dell@Dell-PC"
] | Dell@Dell-PC |
57d0b081f9845d474554012875fcf47c73a36b88 | c57819bebe1a3e1d305ae0cb869cdcc48c7181d1 | /src/qt/src/3rdparty/webkit/Source/WebCore/bridge/jni/JavaMethodJobject.cpp | 2f2802ca0c244f09954338c20610d51125216e65 | [
"BSD-2-Clause",
"LGPL-2.1-only",
"LGPL-2.0-only",
"Qt-LGPL-exception-1.1",
"LicenseRef-scancode-generic-exception",
"GPL-3.0-only",
"GPL-1.0-or-later",
"GFDL-1.3-only",
"BSD-3-Clause"
] | permissive | blowery/phantomjs | 255829570e90a28d1cd597192e20314578ef0276 | f929d2b04a29ff6c3c5b47cd08a8f741b1335c72 | refs/heads/master | 2023-04-08T01:22:35.426692 | 2012-10-11T17:43:24 | 2012-10-11T17:43:24 | 6,177,895 | 1 | 0 | BSD-3-Clause | 2023-04-03T23:09:40 | 2012-10-11T17:39:25 | C++ | UTF-8 | C++ | false | false | 5,893 | cpp | /*
* Copyright (C) 2003, 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
* Copyright 2010, The Android Open Source Project
*
* 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "JavaMethodJobject.h"
#if ENABLE(JAVA_BRIDGE)
#include "JavaString.h"
#if USE(JSC)
#include <runtime/JSObject.h>
#include <runtime/ScopeChain.h>
#endif
#include <wtf/text/StringBuilder.h>
using namespace JSC;
using namespace JSC::Bindings;
JavaMethodJobject::JavaMethodJobject(JNIEnv* env, jobject aMethod)
{
// Get return type name
jstring returnTypeName = 0;
if (jobject returnType = callJNIMethod<jobject>(aMethod, "getReturnType", "()Ljava/lang/Class;")) {
returnTypeName = static_cast<jstring>(callJNIMethod<jobject>(returnType, "getName", "()Ljava/lang/String;"));
if (!returnTypeName)
returnTypeName = env->NewStringUTF("<Unknown>");
env->DeleteLocalRef(returnType);
}
m_returnTypeClassName = JavaString(env, returnTypeName);
m_returnType = javaTypeFromClassName(m_returnTypeClassName.utf8());
env->DeleteLocalRef(returnTypeName);
// Get method name
jstring methodName = static_cast<jstring>(callJNIMethod<jobject>(aMethod, "getName", "()Ljava/lang/String;"));
if (!methodName)
methodName = env->NewStringUTF("<Unknown>");
m_name = JavaString(env, methodName);
env->DeleteLocalRef(methodName);
// Get parameters
if (jarray jparameters = static_cast<jarray>(callJNIMethod<jobject>(aMethod, "getParameterTypes", "()[Ljava/lang/Class;"))) {
unsigned int numParams = env->GetArrayLength(jparameters);
for (unsigned int i = 0; i < numParams; i++) {
jobject aParameter = env->GetObjectArrayElement(static_cast<jobjectArray>(jparameters), i);
jstring parameterName = static_cast<jstring>(callJNIMethod<jobject>(aParameter, "getName", "()Ljava/lang/String;"));
if (!parameterName)
parameterName = env->NewStringUTF("<Unknown>");
m_parameters.append(JavaString(env, parameterName).impl());
env->DeleteLocalRef(aParameter);
env->DeleteLocalRef(parameterName);
}
env->DeleteLocalRef(jparameters);
}
// Created lazily.
m_signature = 0;
jclass modifierClass = env->FindClass("java/lang/reflect/Modifier");
int modifiers = callJNIMethod<jint>(aMethod, "getModifiers", "()I");
m_isStatic = static_cast<bool>(callJNIStaticMethod<jboolean>(modifierClass, "isStatic", "(I)Z", modifiers));
env->DeleteLocalRef(modifierClass);
}
JavaMethodJobject::~JavaMethodJobject()
{
if (m_signature)
fastFree(m_signature);
}
// JNI method signatures use '/' between components of a class name, but
// we get '.' between components from the reflection API.
static void appendClassName(StringBuilder& builder, const char* className)
{
#if USE(JSC)
ASSERT(JSLock::lockCount() > 0);
#endif
char* c = fastStrDup(className);
char* result = c;
while (*c) {
if (*c == '.')
*c = '/';
c++;
}
builder.append(result);
fastFree(result);
}
const char* JavaMethodJobject::signature() const
{
if (!m_signature) {
#if USE(JSC)
JSLock lock(SilenceAssertionsOnly);
#endif
StringBuilder signatureBuilder;
signatureBuilder.append('(');
for (unsigned int i = 0; i < m_parameters.size(); i++) {
CString javaClassName = parameterAt(i).utf8();
JavaType type = javaTypeFromClassName(javaClassName.data());
if (type == JavaTypeArray)
appendClassName(signatureBuilder, javaClassName.data());
else {
signatureBuilder.append(signatureFromJavaType(type));
if (type == JavaTypeObject) {
appendClassName(signatureBuilder, javaClassName.data());
signatureBuilder.append(';');
}
}
}
signatureBuilder.append(')');
const char* returnType = m_returnTypeClassName.utf8();
if (m_returnType == JavaTypeArray)
appendClassName(signatureBuilder, returnType);
else {
signatureBuilder.append(signatureFromJavaType(m_returnType));
if (m_returnType == JavaTypeObject) {
appendClassName(signatureBuilder, returnType);
signatureBuilder.append(';');
}
}
String signatureString = signatureBuilder.toString();
m_signature = fastStrDup(signatureString.utf8().data());
}
return m_signature;
}
#endif // ENABLE(JAVA_BRIDGE)
| [
"[email protected]"
] | |
0e4179c98bf628a506bad7106e61ea646b598f32 | d90566c011088f1815e70d58445a52d8479135b5 | /udpserver/udpserver/main.cpp | 0f46857017d53c7f6c07f2a9ee9b961f279f9421 | [] | no_license | lordstone/Trial_TCPIP_server_client | 91b3063adef0e3791ab9ee59f8c75d0ad633556a | 0af420d0b29067472ef10cf99400e22664a4db8f | refs/heads/master | 2021-01-10T07:35:12.561790 | 2016-03-27T04:35:42 | 2016-03-27T04:35:42 | 54,806,887 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,492 | cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <iostream>
#include <netdb.h>
#define BUFSIZE 2048
#define CUSTOM_SERVER_PORT 9292
#define CUSTOM_CLIENT_PORT 2929
using namespace std;
void error(const char * msg){
perror(msg);
exit(1);
}
int startUdpServer(){
// this is the main func for udp server
// start creating socket obj
int socket_fd = socket(AF_INET, SOCK_STREAM, 0);
if(socket_fd < 0){
error("Cannot create socket");
}
// define sockaddr_in struct
struct sockaddr_in socket_addr;
// set the mem to be all 0
memset((char *)&socket_addr, 0, sizeof(socket_addr));
socket_addr.sin_family = AF_INET;
socket_addr.sin_port = htons(CUSTOM_SERVER_PORT); // 9292 picked at random
socket_addr.sin_addr.s_addr = htonl(INADDR_ANY);
cout << "Now we are to bind ... " << endl;
//now we try to bind it
if(bind(socket_fd, (struct sockaddr *) &socket_addr, sizeof(socket_addr)) < 0){
error("Cannot bind");
}
//time to process incoming msg
// never exits, keep recving
int recvlen; /* # bytes received */
unsigned char buf[BUFSIZE]; /* receive buffer */
struct sockaddr_in remaddr; /* remote address */
socklen_t addrlen = sizeof(remaddr); /* length of addresses */
for (;;) {
recvlen = recvfrom(socket_fd, buf, BUFSIZE, 0, (struct sockaddr *)&remaddr, &addrlen);
if(recvlen < 0){
error("recvfrom error. Exiting...");
}
printf("received %d bytes\n", recvlen);
if (recvlen > 0) {
buf[recvlen] = 0;
printf("received message: \"%s\"\n", buf);
}
}
/* never exits */
return 0;
}
int startUdpClient(){
// define necessary vars to get host
struct hostent * myhost;
char * host = "127.0.0.1";
int n;
cout << "Getting host..." << endl;
// get the host
myhost = gethostbyname(host);
if(!myhost){
error("Cannot obtain the address;");
}
// define sockaddr
struct sockaddr_in servaddr;
// reset the whole servaddr obj
memset((char*)&servaddr, 0, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(0);
// now copy the addr to it
memcpy((void*)&servaddr.sin_addr, myhost->h_addr_list[0], myhost->h_length);
cout << "Now type in the message:";
char msg[256];
fgets(msg,255,stdin);
if(msg[0] == 'e'){
cout << "Exiting on demand..." << endl;
exit(0);
}
cout << "Now try to send" << endl;
//defined socket fd
int socket_fd = socket(AF_INET, SOCK_STREAM, 0);
//now we try to bind it
if(bind(socket_fd, (struct sockaddr *) &servaddr, sizeof(servaddr)) < 0){
error("Cannot bind");
}
// set up serv port no
servaddr.sin_port = htons(CUSTOM_SERVER_PORT);
cout << "Just before sendto" << endl;
// now send the message through UDP
if(sendto(socket_fd, msg, strlen(msg), 0, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0){
error("Send failed");
}
cout << "Seems sendto succeeded... Exiting" << endl;
return 0;
}
int main(int argc, char * argv[])
{
cout << "Parsing args module" << endl;
if(argc != 2){
error("Wrong arg count, Exiting");
}
// cout << "argv1:" << argv[1] << endl;
if(argv[1][0] == 's'){
cout << "Entering Server Mode..." << endl;
int statusCode = startUdpServer();
}else if(argv[1][0] == 'c'){
cout << "Entering Client Mode..." << endl;
int statusCode = startUdpClient();
}else{
error("Error in argument. Exiting");
}
return 0;
}
| [
"[email protected]"
] | |
82465516e53ab94951fdf7eb231788aaaf6bdb5d | 8ce8354aaf1e39e278ffc0bab22e57675d3c4a90 | /libbsn/test/test_configuration.h | 3076de0c253052fe00be9e3c45e4302ce902fb35 | [] | no_license | rdinizcal/bsn | b82dc2926178320f488b8798e9be3ae0449c0f21 | f51d7e6d30e04847b3d0b3223a63ed723858339e | refs/heads/master | 2022-01-13T00:48:04.861834 | 2019-01-28T18:09:53 | 2019-01-28T18:09:53 | 104,138,457 | 2 | 0 | null | 2019-01-09T20:34:24 | 2017-09-19T23:03:27 | C++ | UTF-8 | C++ | false | false | 5,195 | h | #include <cxxtest/TestSuite.h>
#include <iostream>
#include "bsn/configuration/SensorConfiguration.hpp"
using namespace std;
using namespace bsn::range;
using namespace bsn::configuration;
class SensoConfigurationTestSuite: public CxxTest::TestSuite{
Range l;
Range m1;
Range m2;
Range h1;
Range h2;
array<Range,2> a1;
array<Range,2> a2;
array<Range,3> percentages;
SensorConfiguration s;
public:
void setUp(){
l.setLowerBound(36.5);
l.setUpperBound(37.5);
m1.setLowerBound(33);
m1.setUpperBound(35);
h1.setLowerBound(20);
h1.setUpperBound(32);
m2.setLowerBound(37.6);
m2.setUpperBound(39.0);
h2.setLowerBound(39.1);
h2.setUpperBound(43.0);
percentages = {Range(0,0.2), Range(0.21,0.65), Range(0.66,1.0)};
a1 = {m1, m2};
a2 = {h1, h2};
}
void test_constructor() {
cout << "Testando configurações do sensor" << endl;
cout << "\tTestando construtor:\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(1, s.getId());
}
void test_unknow_value() {
cout << "\tTestando avaliação sinal unknow\n";
TS_ASSERT_EQUALS(s.evaluateNumber(44), -1);
TS_ASSERT_EQUALS(s.evaluateNumber(10), -1);
}
void test_getDisplacement_normal() {
cout << "\tTestando metodo getDisplacement em ordem\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 5, "crescent"), 0.5 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 10, "crescent"), 1 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 0, "crescent"), 0 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 7.5, "crescent"), 0.75 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 2.5, "crescent"), 0.25 );
}
void test_getDisplacement_inverse() {
cout << "\tTestando metodo getDisplacement com logica decrescente\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 5, "decrescent"), 0.5 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 10, "decrescent"), 0 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 0, "decrescent"), 1 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 7.5, "decrescent"), 0.25 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 2.5, "decrescent"), 0.75 );
}
void test_getDisplacement_medium() {
cout << "\tTestando metodo getDisplacement com logica mediana\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 5, "medium"), 0.0 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 10, "medium"), 1 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 0, "medium"), 1 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 7.5, "medium"), 0.50 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(0,10), 2.5, "medium"), 0.50 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(36.5,37.5), 37.0, "medium"), 0 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(36.5,37.5), 36.5, "medium"), 1 );
TS_ASSERT_EQUALS(s.getDisplacement( Range(36.5,37.5), 37.5, "medium"), 1 );
}
void test_getDisplacement_invalid_argument() {
cout << "\tTestando metodo getDisplacement com argumentos inválidos\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_THROWS(s.getDisplacement( Range(0,10), 5, "kjflakj"), std::invalid_argument);
}
void test_low() {
cout << "\tTestando avaliação sinal low\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.evaluateNumber(37),0);
TS_ASSERT_EQUALS(s.evaluateNumber(37.5), 0.2);
TS_ASSERT_EQUALS(s.evaluateNumber(36.5), 0.2);
TS_ASSERT_EQUALS(s.evaluateNumber(36.75), 0.1);
}
void test_medium0() {
cout << "\tTestando avaliação sinal medium0\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.evaluateNumber(33), 0.65);
TS_ASSERT_EQUALS(s.evaluateNumber(35), 0.21);
}
void test_medium1() {
cout << "\tTestando avaliação sinal medium1\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.evaluateNumber(37.6), 0.21);
TS_ASSERT_EQUALS(s.evaluateNumber(39), 0.65);
}
void test_high0() {
cout << "\tTestando avaliação sinal high0\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.evaluateNumber(20), 1);
TS_ASSERT_EQUALS(s.evaluateNumber(32), 0.66);
}
void test_high1() {
cout << "\tTestando avaliação sinal high1\n";
SensorConfiguration s(1,l,a1,a2,percentages);
TS_ASSERT_EQUALS(s.evaluateNumber(39.1), 0.66);
TS_ASSERT_EQUALS(s.evaluateNumber(43), 1.0);
}
};
| [
"[email protected]"
] | |
8d1c0028a2547aa0f52df101a09379c3f8aa0cc2 | f7aadc17e9dd13d4d5bc27cd3bd99c1f6c1e362c | /source/server/api_listener_impl.h | 2e260666a8f19e1279a5ccf4b3a42136364972ce | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | lizan/envoy | c185b7658f685c0ed922e8c47292679bc3d04ecd | eb28b196a3fb82e98bdf349f503c80aa7e4c8c53 | refs/heads/master | 2023-03-16T21:27:22.454259 | 2023-03-11T00:02:52 | 2023-03-11T00:02:52 | 76,685,528 | 2 | 3 | Apache-2.0 | 2020-10-24T07:36:03 | 2016-12-16T21:03:55 | C++ | UTF-8 | C++ | false | false | 9,854 | h | #pragma once
#include <memory>
#include <ostream>
#include "envoy/config/core/v3/base.pb.h"
#include "envoy/config/listener/v3/listener.pb.h"
#include "envoy/network/connection.h"
#include "envoy/network/filter.h"
#include "envoy/network/socket.h"
#include "envoy/server/api_listener.h"
#include "envoy/server/filter_config.h"
#include "envoy/server/instance.h"
#include "envoy/server/listener_manager.h"
#include "envoy/stats/scope.h"
#include "source/common/common/empty_string.h"
#include "source/common/common/logger.h"
#include "source/common/http/conn_manager_impl.h"
#include "source/common/init/manager_impl.h"
#include "source/common/network/socket_impl.h"
#include "source/common/stream_info/stream_info_impl.h"
#include "source/server/factory_context_impl.h"
namespace Envoy {
namespace Server {
/**
* Base class all ApiListeners.
*/
class ApiListenerImplBase : public ApiListener,
public Network::DrainDecision,
Logger::Loggable<Logger::Id::http> {
public:
// TODO(junr03): consider moving Envoy Mobile's SyntheticAddressImpl to Envoy in order to return
// that rather than this semi-real one.
const Network::Address::InstanceConstSharedPtr& address() const { return address_; }
// ApiListener
absl::string_view name() const override { return name_; }
// Network::DrainDecision
// TODO(junr03): hook up draining to listener state management.
bool drainClose() const override { return false; }
Common::CallbackHandlePtr addOnDrainCloseCb(DrainCloseCb) const override {
IS_ENVOY_BUG("Unexpected call to addOnDrainCloseCb");
return nullptr;
}
protected:
ApiListenerImplBase(const envoy::config::listener::v3::Listener& config, Server::Instance& server,
const std::string& name);
// Synthetic class that acts as a stub Network::ReadFilterCallbacks.
// TODO(junr03): if we are able to separate the Network Filter aspects of the
// Http::ConnectionManagerImpl from the http management aspects of it, it is possible we would not
// need this and the SyntheticConnection stub anymore.
class SyntheticReadCallbacks : public Network::ReadFilterCallbacks {
public:
SyntheticReadCallbacks(ApiListenerImplBase& parent)
: parent_(parent), connection_(SyntheticConnection(*this)) {}
// Network::ReadFilterCallbacks
void continueReading() override { IS_ENVOY_BUG("Unexpected call to continueReading"); }
void injectReadDataToFilterChain(Buffer::Instance&, bool) override {
IS_ENVOY_BUG("Unexpected call to injectReadDataToFilterChain");
}
bool startUpstreamSecureTransport() override {
IS_ENVOY_BUG("Unexpected call to startUpstreamSecureTransport");
return false;
}
Upstream::HostDescriptionConstSharedPtr upstreamHost() override { return nullptr; }
void upstreamHost(Upstream::HostDescriptionConstSharedPtr) override {
IS_ENVOY_BUG("Unexpected call to upstreamHost");
}
Network::Connection& connection() override { return connection_; }
const Network::Socket& socket() override { PANIC("not implemented"); }
// Synthetic class that acts as a stub for the connection backing the
// Network::ReadFilterCallbacks.
class SyntheticConnection : public Network::Connection {
public:
SyntheticConnection(SyntheticReadCallbacks& parent)
: parent_(parent),
connection_info_provider_(std::make_shared<Network::ConnectionInfoSetterImpl>(
parent.parent_.address_, parent.parent_.address_)),
stream_info_(parent_.parent_.factory_context_.timeSource(), connection_info_provider_),
options_(std::make_shared<std::vector<Network::Socket::OptionConstSharedPtr>>()) {}
void raiseConnectionEvent(Network::ConnectionEvent event);
// Network::FilterManager
void addWriteFilter(Network::WriteFilterSharedPtr) override {
IS_ENVOY_BUG("Unexpected function call");
}
void addFilter(Network::FilterSharedPtr) override {
IS_ENVOY_BUG("Unexpected function call");
}
void addReadFilter(Network::ReadFilterSharedPtr) override {
IS_ENVOY_BUG("Unexpected function call");
}
void removeReadFilter(Network::ReadFilterSharedPtr) override {
IS_ENVOY_BUG("Unexpected function call");
}
bool initializeReadFilters() override { return true; }
// Network::Connection
void addConnectionCallbacks(Network::ConnectionCallbacks& cb) override {
callbacks_.push_back(&cb);
}
void removeConnectionCallbacks(Network::ConnectionCallbacks& cb) override {
callbacks_.remove(&cb);
}
void addBytesSentCallback(Network::Connection::BytesSentCb) override {
IS_ENVOY_BUG("Unexpected function call");
}
void enableHalfClose(bool) override { IS_ENVOY_BUG("Unexpected function call"); }
bool isHalfCloseEnabled() const override {
IS_ENVOY_BUG("Unexpected function call");
return false;
}
void close(Network::ConnectionCloseType) override {}
void close(Network::ConnectionCloseType, absl::string_view) override {}
Event::Dispatcher& dispatcher() override {
return parent_.parent_.factory_context_.mainThreadDispatcher();
}
uint64_t id() const override { return 12345; }
void hashKey(std::vector<uint8_t>&) const override {}
std::string nextProtocol() const override { return EMPTY_STRING; }
void noDelay(bool) override { IS_ENVOY_BUG("Unexpected function call"); }
void readDisable(bool) override {}
void detectEarlyCloseWhenReadDisabled(bool) override {
IS_ENVOY_BUG("Unexpected function call");
}
bool readEnabled() const override { return true; }
Network::ConnectionInfoSetter& connectionInfoSetter() override {
return *connection_info_provider_;
}
const Network::ConnectionInfoProvider& connectionInfoProvider() const override {
return *connection_info_provider_;
}
Network::ConnectionInfoProviderSharedPtr connectionInfoProviderSharedPtr() const override {
return connection_info_provider_;
}
absl::optional<Network::Connection::UnixDomainSocketPeerCredentials>
unixSocketPeerCredentials() const override {
return absl::nullopt;
}
void setConnectionStats(const Network::Connection::ConnectionStats&) override {}
Ssl::ConnectionInfoConstSharedPtr ssl() const override { return nullptr; }
absl::string_view requestedServerName() const override { return EMPTY_STRING; }
State state() const override { return Network::Connection::State::Open; }
bool connecting() const override { return false; }
void write(Buffer::Instance&, bool) override { IS_ENVOY_BUG("Unexpected function call"); }
void setBufferLimits(uint32_t) override { IS_ENVOY_BUG("Unexpected function call"); }
uint32_t bufferLimit() const override { return 65000; }
bool aboveHighWatermark() const override { return false; }
const Network::ConnectionSocket::OptionsSharedPtr& socketOptions() const override {
return options_;
}
StreamInfo::StreamInfo& streamInfo() override { return stream_info_; }
const StreamInfo::StreamInfo& streamInfo() const override { return stream_info_; }
void setDelayedCloseTimeout(std::chrono::milliseconds) override {}
absl::string_view transportFailureReason() const override { return EMPTY_STRING; }
absl::string_view localCloseReason() const override { return EMPTY_STRING; }
bool startSecureTransport() override {
IS_ENVOY_BUG("Unexpected function call");
return false;
}
absl::optional<std::chrono::milliseconds> lastRoundTripTime() const override { return {}; }
void configureInitialCongestionWindow(uint64_t, std::chrono::microseconds) override {}
absl::optional<uint64_t> congestionWindowInBytes() const override { return {}; }
// ScopeTrackedObject
void dumpState(std::ostream& os, int) const override { os << "SyntheticConnection"; }
SyntheticReadCallbacks& parent_;
Network::ConnectionInfoSetterSharedPtr connection_info_provider_;
StreamInfo::StreamInfoImpl stream_info_;
Network::ConnectionSocket::OptionsSharedPtr options_;
std::list<Network::ConnectionCallbacks*> callbacks_;
};
ApiListenerImplBase& parent_;
SyntheticConnection connection_;
};
const envoy::config::listener::v3::Listener& config_;
const std::string name_;
Network::Address::InstanceConstSharedPtr address_;
Stats::ScopeSharedPtr global_scope_;
Stats::ScopeSharedPtr listener_scope_;
FactoryContextImpl factory_context_;
SyntheticReadCallbacks read_callbacks_;
};
/**
* ApiListener that provides a handle to inject HTTP calls into Envoy via an
* Http::ConnectionManager. Thus, it provides full access to Envoy's L7 features, e.g HTTP filters.
*/
class HttpApiListener : public ApiListenerImplBase {
public:
HttpApiListener(const envoy::config::listener::v3::Listener& config, Server::Instance& server,
const std::string& name);
// ApiListener
ApiListener::Type type() const override { return ApiListener::Type::HttpApiListener; }
Http::ApiListenerOptRef http() override;
void shutdown() override;
Network::ReadFilterCallbacks& readCallbacksForTest() { return read_callbacks_; }
private:
// Need to store the factory due to the shared_ptrs that need to be kept alive: date provider,
// route config manager, scoped route config manager.
std::function<Http::ApiListenerPtr()> http_connection_manager_factory_;
// Http::ServerConnectionCallbacks is the API surface that this class provides via its handle().
Http::ApiListenerPtr http_connection_manager_;
};
} // namespace Server
} // namespace Envoy
| [
"[email protected]"
] | |
6c3e29c9a5be97924506f16a3dcc1d228768ebc4 | 1d26a2a5761a36279c293403a839536b6de911b7 | /Crow/src/Platform/PlatformAPI.cpp | dd2f01a27c83360e6fe68be0d5cd915b262f82de | [
"Apache-2.0"
] | permissive | quesswho/Crow | 919f97a1ff6a2d5da1d27c774c7a50672ad9ba01 | c57df8fe6dc323acd2c5e7b14b0b65d34b4a6e94 | refs/heads/master | 2020-07-09T17:23:37.081282 | 2020-05-02T22:22:23 | 2020-05-02T22:22:23 | 204,032,891 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,254 | cpp | #include "PlatformAPI.h"
#include "Crow/Application.h"
namespace Crow {
namespace Platform {
ApplicationAPI PlatformAPI::s_ApplicationAPI;
void PlatformAPI::ApplicationAPIInit(ApplicationAPI appApi)
{
switch(appApi)
{
case ApplicationAPI::GLFW:
s_ApplicationAPI = ApplicationAPI::GLFW;
GLFWInit();
MathInit();
break;
case ApplicationAPI::WINDOWS:
CR_WINDOWSERROR();
s_ApplicationAPI = ApplicationAPI::WINDOWS;
WindowsInit();
MathInit();
break;
}
}
void PlatformAPI::GLFWInit()
{
CreateWindowAPI = &GLFWAPIWindow::CreateGLFWWindow;
}
void PlatformAPI::WindowsInit()
{
CreateWindowAPI = &WindowsAPIWindow::CreateWindowsWindow;
}
void PlatformAPI::MathInit()
{
#ifdef CROW_OGL
Math::MATH_COORDINATE::s_MathCoordinateType = Math::MATH_COORDINATE::MATH_COORDINATE_RIGHTHAND;
#elif defined(CROW_DX11)
Math::MATH_COORDINATE::s_MathCoordinateType = Math::MATH_COORDINATE::MATH_COORDINATE_LEFTHAND;
#endif
}
bool PlatformAPI::CheckWindowsError()
{
if (s_ApplicationAPI != ApplicationAPI::WINDOWS)
{
CR_CORE_WARNING("Cannot use a non Windows application for DirectX! Using OpenGL instead.");
return false;
}
return true;
}
}
} | [
"[email protected]"
] | |
c905e9da6f2c33553dbd6bed45248bdb887e2a74 | d7bd0cd8e016fc213ac3e0149487c77e8ef523ba | /Algorithmic_Problem_Solving/rec6_5.cpp | f7db1a222f7a37cbe53e9875d7049d8c2c418bb4 | [] | no_license | Michael98Liu/Competitive-Programming | eafa6fa063efedeec8da10a85ad7a9b8900728b3 | dc5752a1e90bcd3a908e7f307776baf0d349af34 | refs/heads/master | 2021-01-01T20:03:04.073372 | 2019-02-14T15:31:39 | 2019-02-14T15:31:39 | 98,750,625 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 453 | cpp | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int main(){
int t;
int n;
int num;
scanf("%d\n", &t);
for( int i =0; i< t; i++ ){
vector<int> canvas;
scanf("%d\n", &n);
for( int j= 0; j < n; j++ ){
scanf("%d\n", &num);
canvas.push_back(num);
}
int layer = (int)log2(n) -1;
int paint =
printf("%d\n", paint);
}
}
| [
"[email protected]"
] | |
e3f73241cfde8e26693c8e85ac7617aa900280b9 | 9dc7f37e290c03d27172ef211fac548d08ec83c6 | /Testing/testReceiveVideo.cxx | ce326cad6022eaba256b11f445d8eeefe6000c3a | [
"Apache-2.0"
] | permissive | Sunderlandkyl/OpenIGTLinkIO | cd8414ae08add54372e0c6e0facba5984ca3ec48 | 4b792865f07e0dbc812c328176d74c94a5e5983c | refs/heads/master | 2022-11-01T01:09:22.149398 | 2018-01-12T04:03:04 | 2018-01-24T03:08:33 | 120,339,747 | 0 | 0 | null | 2018-02-05T17:45:29 | 2018-02-05T17:45:28 | null | UTF-8 | C++ | false | false | 3,601 | cxx | #include <string>
#include "igtlioLogic.h"
#include "igtlioConnector.h"
#include "vtkTimerLog.h"
#include "vtkImageData.h"
#include "igtlioVideoConverter.h"
#include "vtkMatrix4x4.h"
#include <vtksys/SystemTools.hxx>
#include "igtlioVideoConverter.h"
#include <vtkImageDifference.h>
#include "IGTLIOFixture.h"
#include "igtlioVideoDevice.h"
#include "igtlioSession.h"
#include "igtlMessageDebugFunction.h"
bool compare(vtkSmartPointer<vtkImageData> a, vtkSmartPointer<vtkImageData> b)
{
#if defined(OpenIGTLink_ENABLE_VIDEOSTREAMING)
GenericEncoder * encoder = new VP9Encoder();
GenericDecoder * decoder = new VP9Decoder();
igtlUint8* yuv_a = new igtlUint8[a->GetDimensions()[0]*a->GetDimensions()[1]*3/2];
igtlUint8* rgb_a = new igtlUint8[a->GetDimensions()[0]*a->GetDimensions()[1]*3];
encoder->ConvertRGBToYUV((igtlUint8*)a->GetScalarPointer(), yuv_a, a->GetDimensions()[0], a->GetDimensions()[1]);
decoder->ConvertYUVToRGB(yuv_a, rgb_a, b->GetDimensions()[0], b->GetDimensions()[1]);
int iReturn = memcmp(rgb_a, a->GetScalarPointer(),a->GetDimensions()[0]*a->GetDimensions()[1]*3);// The conversion is not valid. Image is not the same after conversion.
//TestDebugCharArrayCmp(b->GetScalarPointer(),rgb_a,a->GetDimensions()[0]*a->GetDimensions()[1]*3);
int sumError = 0;
for (int i = 0 ; i< a->GetDimensions()[0]*a->GetDimensions()[1];i++)
{
sumError += abs(*((igtlUint8*)rgb_a+i)-*((igtlUint8*)b->GetScalarPointer()+i));
}
delete encoder;
delete decoder;
if (sumError<a->GetDimensions()[0]*a->GetDimensions()[1]) // To do, check the lossless encoding problem. most likely from the RGB and YUV conversion
return true;
#endif
return false;
}
bool compare(igtlio::VideoDevicePointer a, igtlio::VideoDevicePointer b)
{
if (a->GetDeviceName() != b->GetDeviceName())
return false;
if (a->GetDeviceType() != b->GetDeviceType())
return false;
if (!compare(a->GetContent().image, b->GetContent().image))
return false;
return true;
}
int main(int argc, char **argv)
{
ClientServerFixture fixture;
if (!fixture.ConnectClientToServer())
return 1;
if (fixture.Client.Logic->GetNumberOfDevices() != 0)
{
std::cout << "ERROR: Client has devices before they have been added or fundamental error!" << std::endl;
return 1;
}
std::cout << "*** Connection done" << std::endl;
//---------------------------------------------------------------------------
igtlio::VideoDevicePointer videoDevice;
videoDevice = fixture.Server.Session->SendFrame("TestDevice_Image",
fixture.CreateTestImage());
std::cout << "*** Sent message from Server to Client" << std::endl;
//---------------------------------------------------------------------------
if (!fixture.LoopUntilEventDetected(&fixture.Client, igtlio::Logic::NewDeviceEvent))
{
return 1;
}
if (fixture.Client.Logic->GetNumberOfDevices() == 0)
{
std::cout << "FAILURE: No devices received." << std::endl;
return 1;
}
igtlio::VideoDevicePointer receivedDevice;
receivedDevice = igtlio::VideoDevice::SafeDownCast(fixture.Client.Logic->GetDevice(0));
if (!receivedDevice)
{
std::cout << "FAILURE: Non-video device received." << std::endl;
return 1;
}
std::cout << "*** Client received video device." << std::endl;
//---------------------------------------------------------------------------
if (!compare(videoDevice, receivedDevice))
{
std::cout << "FAILURE: frame differs from the one sent from server." << std::endl;
return 1;
}
}
| [
"[email protected]"
] | |
d3152d4f72dd7ba8eaaf88c015b2ef115c6d804c | 51efb0b6dac397477499eed32b4b92dbe1ce18da | /src/p4_main.cpp | c9ad46f6528c163e1b4ee261b1d80d2d6336a427 | [
"MIT"
] | permissive | fneiva2006/supervisory-simulator | eec883e4bbe6f5e7f05d5f0f3757dd3f6f7455d4 | 0e451f35afd111496cf8a25c6a9402a6f95860ea | refs/heads/master | 2022-08-30T04:40:09.294686 | 2020-05-31T15:32:54 | 2020-05-31T15:32:54 | 268,308,425 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 10,006 | cpp | #include "p4_ops.h"
/* Control HANDLES */
HANDLE ghExitEvent = NULL; // Evento encerramento do programa
HANDLE ghExibeOpSem = NULL; // Semáforo liga/desliga módulo
/* OP List HANDLES */
HANDLE ghListaOPMappedFile = NULL; //
HANDLE ghPermissaoLeituraOPSem = NULL;
HANDLE ghPermissaoEscritaOPSem = NULL;
HANDLE ghListaOPMutex = NULL;
/* OP Disk List Handles */
HANDLE ghOPDiskList = NULL;
int main(int argc, char* argv[])
{
setlocale(LC_ALL,"");
/* Adquire Handle de janela de console */
HWND ptr = GetConsoleWindow();
/* Posiciona janela do console em local inicial */
MoveWindow(ptr,670,0,720,400, true);
/* Desativa Botão de Fechar da Janela do Console */
EnableMenuItem(GetSystemMenu(ptr, FALSE), SC_CLOSE,
MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
inicializaObjetosP4();
DWORD indice_leitura = 0; // Posição da lista de Status a ser lida
char *sm_ptr; // Ponteiro auxiliar para captura de mensagens da lista
/* Buffer auxiliar para armazenar as mensagens lidas da lista */
char buffer[TAMANHO_MSG_ORDEM_PRODUCAO+1];
/* Endereço base relativo ao início da lista de status compartilhada em memória */
const char* base_sm_addr = (char*) MapViewOfFile(ghListaOPMappedFile,
FILE_MAP_READ | FILE_MAP_WRITE,
0,
0,
(TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + sizeof(DWORD) );
DWORD* n_entradas_lista = (DWORD*) &base_sm_addr[TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO];
/* Array auxiliar de handles */
HANDLE hSinc[] = { ghExitEvent, ghExibeOpSem };
while(1)
{
/* Aguarda Evento de Encerramento Global ou Estado de Exibição Ligado
(Semaforo de Controle on/off do módulo) */
if(WaitForMultipleObjects(2,hSinc,FALSE,INFINITE) == WAIT_OBJECT_0) break;
/* Aguarda Permissão de Leitura da Lista (Semáforo de Recurso Compartilhado
da lista). Operação com timeout */
if( WaitForSingleObject(ghPermissaoLeituraOPSem,TIMEOUT_MS) == WAIT_TIMEOUT)
{
/* Libera Semaforo de Controle on/off do módulo de Exibição de Mensagens de Status*/
ReleaseSemaphore(ghExibeOpSem,1,NULL); continue;
}
/* Aguarda Condição de exclusão mútua para Leitura da Lista
(Mutex de Recurso Compartilhado da lista). Operação com timeout */
if( WaitForSingleObject(ghListaOPMutex,TIMEOUT_MS) == WAIT_TIMEOUT)
{
/* Libera Semaforo de Controle on/off do módulo de Exibição de Mensagens de Status*/
ReleaseSemaphore(ghExibeOpSem,1,NULL); continue;
}
/* Adquire posição da memória da próxima mensagem da lista ser lida */
sm_ptr = (char*) &base_sm_addr[indice_leitura*TAMANHO_MSG_ORDEM_PRODUCAO];
/* Extrai e salva no buffer mensagem de status localizada no endereço
de memoria obtido anteriormente*/
strncpy(buffer,sm_ptr,TAMANHO_MSG_ORDEM_PRODUCAO);
buffer[TAMANHO_MSG_ORDEM_PRODUCAO] = '\0';
/* Exibe Mensagem Extraída da Lista e a salva em Disco */
salvaOPEmDisco(buffer);
exibeMensagemOP(buffer);
/* Decrementa número de entradas da lista que ainda não foram lidas */
*n_entradas_lista = *n_entradas_lista - 1;
/* Atualiza índice para a leitura da próxima mensagem da lista*/
indice_leitura = (indice_leitura+1)%TAMANHO_LISTA_OP;
/* Libera 1 permissão de escrita na lista */
ReleaseSemaphore(ghPermissaoEscritaOPSem,1,NULL);
/* Libera Mutex de controle do acesso a lista */
ReleaseMutex(ghListaOPMutex);
/* Libera Semaforo de Controle on/off do módulo de Exibição de Mensagens de Status */
ReleaseSemaphore(ghExibeOpSem,1,NULL);
}
FlushFileBuffers(ghOPDiskList);
UnmapViewOfFile(sm_ptr); /* Fecha visão da lista compartilhada em memória */
fechaHandlesP4();
/* Salva copia da lista de OP's em disco */
CopyFile(OP_DISK_LIST,COPIA_OP_DISK_LIST,FALSE);
SetFileAttributes(COPIA_OP_DISK_LIST,FILE_ATTRIBUTE_NORMAL);
return 0;
}
void inicializaObjetosP4(void)
{
/* Control HANDLES */
/* Abre o evento de encerramento global da aplicação */
ghExitEvent = (HANDLE) OpenEvent(EVENT_ALL_ACCESS,FALSE,GLOBAL_EXIT_EVENT);
CheckForError(ghExitEvent);
/* Abre o semaforo de controle on/off do modulo de exibição das mensagens de status*/
ghExibeOpSem = (HANDLE) OpenSemaphore(SEMAPHORE_ALL_ACCESS,FALSE,EXIBE_OP_SEM);
CheckForError(ghExibeOpSem);
/* ----------------------------------------------------------------------- */
/* OP List HANDLES */
/* Abre o handle para a lista de status mapeada em memoria*/
do
{
ghListaOPMappedFile = (HANDLE) OpenFileMapping(FILE_MAP_ALL_ACCESS,FALSE,OP_LIST_MAPPED_FILE);
} while ( ghListaOPMappedFile == INVALID_HANDLE_VALUE);
/* Abre os semaforos de permissao de leitura/escrita da lista de OP's compartilhada em memoria */
do
{
ghPermissaoLeituraOPSem = (HANDLE) OpenSemaphore(SEMAPHORE_ALL_ACCESS,
FALSE,
PERMISSAO_LEITURA_OP_SEM);
ghPermissaoEscritaOPSem = (HANDLE) OpenSemaphore(SEMAPHORE_ALL_ACCESS,
FALSE,
PERMISSAO_ESCRITA_OP_SEM);
} while( ( ghPermissaoLeituraOPSem == INVALID_HANDLE_VALUE) || ( ghPermissaoEscritaOPSem == INVALID_HANDLE_VALUE ));
/* Abre Mutex da Lista em de OP's em Memoria Compartilhada */
do
{
ghListaOPMutex= (HANDLE) OpenMutex(MUTEX_ALL_ACCESS,FALSE, LISTA_OP_MUTEX);
} while(ghListaOPMutex == INVALID_HANDLE_VALUE);
/* OP Disk List Handles */
ghOPDiskList = (HANDLE) CreateFile(OP_DISK_LIST,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_HIDDEN,
NULL);
if(GetLastError() != 0 && GetLastError() != ERROR_ALREADY_EXISTS )
printf("Erro ao abrir lista em disco. Error ID %d\n", GetLastError());
inicializaListaOPEmDisco();
exibeListaOPEmDisco();
}
void fechaHandlesP4(void)
{
/* Fechamento de todos os handles utilizados no código */
/* Control HANDLES */
CloseHandle(ghExitEvent);
CloseHandle(ghExibeOpSem);
/* Status List HANDLES */
CloseHandle(ghListaOPMappedFile);
CloseHandle(ghPermissaoLeituraOPSem);
CloseHandle(ghPermissaoEscritaOPSem);
CloseHandle(ghListaOPMutex);
/* OP Disk List Handles */
CloseHandle(ghOPDiskList);
}
void exibeMensagemOP(const char* msg)
{
MensagemOP_t Mensagem;
static char copia[32];
strcpy(copia,msg);
strcpy(Mensagem.nseq, strtok(copia,"/"));
strcpy(Mensagem.op, strtok(NULL,"/"));
strcpy(Mensagem.tbat, strtok(NULL,"/"));
strcpy(Mensagem.linha, strtok(NULL,"/"));
strcpy(Mensagem.tipo, strtok(NULL,"/"));
strcpy(Mensagem.receita, strtok(NULL,"/"));
printf("NSEQ: %s OP: %s TBAT: %s LINHA: %s TIPO: %s RECEITA: %s\n",
Mensagem.nseq, Mensagem.op, Mensagem.tbat, Mensagem.linha, Mensagem.tipo,
Mensagem.receita);
}
void salvaOPEmDisco(const char* msg)
{
static char buffer[256] = {0};
DWORD bytes_escritos;
DWORD pointer = 0;
DWORD idx_proxima_entrada = 0;
BOOL lista_completa = true;
LockFile(ghOPDiskList,0,0, ( (TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + OVERHEAD_CONTROLE),0);
SetFilePointer(ghOPDiskList,-(LONG) OVERHEAD_CONTROLE,0,FILE_END);
ReadFile(ghOPDiskList,&idx_proxima_entrada,sizeof(DWORD),&bytes_escritos,NULL);
SetFilePointer(ghOPDiskList,idx_proxima_entrada*TAMANHO_MSG_ORDEM_PRODUCAO,0,FILE_BEGIN);
WriteFile(ghOPDiskList,msg,TAMANHO_MSG_ORDEM_PRODUCAO,&bytes_escritos,NULL);
printf("Atribuindo à Entrada %d -> \n\t",idx_proxima_entrada+1);
idx_proxima_entrada = (idx_proxima_entrada+1)%TAMANHO_LISTA_OP;
SetFilePointer(ghOPDiskList,-(LONG) OVERHEAD_CONTROLE,0,FILE_END);
WriteFile(ghOPDiskList,&idx_proxima_entrada,sizeof(DWORD),&bytes_escritos,NULL);
if(idx_proxima_entrada == 0)
WriteFile(ghOPDiskList,&lista_completa,sizeof(BOOL),&bytes_escritos,NULL);
UnlockFile(ghOPDiskList,0,0, ( (TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + OVERHEAD_CONTROLE),0);
}
void inicializaListaOPEmDisco()
{
/* Inicialização do tamanho da lista em disco */
_LARGE_INTEGER liTamanhoListaDisco = {0}, pointer = {0};
liTamanhoListaDisco.LowPart = ( (TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + OVERHEAD_CONTROLE);
/* Valores de campos de controle a serem inicializados */
DWORD init_idx = 0;
BOOL init_lista_completa = 0;
DWORD bytes_escritos = 0;
/* Sob regime de exclusão mútua, escreve valores de incialização nos campos de controle da lista */
LockFile(ghOPDiskList,0,0, ( (TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + OVERHEAD_CONTROLE),0);
if(SetFilePointer(ghOPDiskList,0,0,FILE_END) != liTamanhoListaDisco.LowPart)
{
puts("Lista de OP's em Disco Inexistente. Criando Lista Agora ...");
SetFilePointerEx(ghOPDiskList,liTamanhoListaDisco, &pointer, FILE_BEGIN );
SetEndOfFile(ghOPDiskList);
SetFilePointer(ghOPDiskList,-(LONG) OVERHEAD_CONTROLE,0,FILE_END);
WriteFile(ghOPDiskList,&init_idx,sizeof(DWORD),&bytes_escritos,NULL);
WriteFile(ghOPDiskList,&init_lista_completa,sizeof(BOOL),&bytes_escritos,NULL);
}
UnlockFile(ghOPDiskList,0,0, ( (TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + OVERHEAD_CONTROLE),0);
}
void exibeListaOPEmDisco()
{
char buffer[256];
DWORD bytes_lidos;
DWORD idx_proxima_entrada = 0;
BOOL lista_completa = FALSE;
DWORD i;
LockFile(ghOPDiskList,0,0, ( (TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + OVERHEAD_CONTROLE),0);
SetFilePointer(ghOPDiskList,-(LONG)OVERHEAD_CONTROLE,0,FILE_END);
ReadFile(ghOPDiskList,&idx_proxima_entrada,sizeof(DWORD),&bytes_lidos,NULL);
ReadFile(ghOPDiskList,&lista_completa,sizeof(BOOL),&bytes_lidos,NULL);
if(lista_completa)
{
idx_proxima_entrada = TAMANHO_LISTA_OP;
printf("Lista está completa (%3d Registros)\n\n",idx_proxima_entrada);
}
else
printf("Lista não está completa e contém %3d Registros \n\n",idx_proxima_entrada);
SetFilePointer(ghOPDiskList,0,0,FILE_BEGIN);
for(i = 0; i < idx_proxima_entrada; i++)
{
ReadFile(ghOPDiskList,buffer,TAMANHO_MSG_ORDEM_PRODUCAO,&bytes_lidos,NULL);
buffer[bytes_lidos] = '\0';
if(bytes_lidos == TAMANHO_MSG_ORDEM_PRODUCAO)
{
printf("%3d) ",i+1);
exibeMensagemOP(buffer);
}
}
UnlockFile(ghOPDiskList,0,0, ( (TAMANHO_LISTA_OP*TAMANHO_MSG_ORDEM_PRODUCAO) + OVERHEAD_CONTROLE),0);
puts("");
} | [
"[email protected]"
] | |
1150764899bd035a85eb0f69741020b8950a6389 | 9ecbc437bd1db137d8f6e83b7b4173eb328f60a9 | /gcc-build/i686-pc-linux-gnu/libjava/java/sql/Time.h | 5070468f21da1ac2ff15882032e1c9acbd38e760 | [] | no_license | giraffe/jrate | 7eabe07e79e7633caae6522e9b78c975e7515fe9 | 764bbf973d1de4e38f93ba9b9c7be566f1541e16 | refs/heads/master | 2021-01-10T18:25:37.819466 | 2013-07-20T12:28:23 | 2013-07-20T12:28:23 | 11,545,290 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 766 | h | // DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __java_sql_Time__
#define __java_sql_Time__
#pragma interface
#include <java/util/Date.h>
extern "Java"
{
namespace java
{
namespace sql
{
class Time;
}
namespace text
{
class SimpleDateFormat;
}
}
};
class ::java::sql::Time : public ::java::util::Date
{
public:
static ::java::sql::Time *valueOf (::java::lang::String *);
Time (jint, jint, jint);
Time (jlong);
virtual ::java::lang::String *toString ();
public: // actually package-private
static const jlong serialVersionUID = 8397324403548013681LL;
private:
static ::java::text::SimpleDateFormat *sdf;
public:
static ::java::lang::Class class$;
};
#endif /* __java_sql_Time__ */
| [
"[email protected]"
] | |
3f4ac0c200521f5b1e24aa445c87209ac1240086 | de362ea0a23543fb0a39a9732be3f91958c9e4f9 | /UnderGraduate/bin/debug/moc_DioPortUI.cpp | 8b697a8e6517374fb9346061470116c9c644cff9 | [] | no_license | looklucas/Control | 341aa15d369928a68be932700a781e8cc8c85a37 | 751657b23d4f4ae73ddc8276070ba33bd9724db2 | refs/heads/master | 2022-12-09T21:04:24.786472 | 2019-06-19T06:43:58 | 2019-06-19T06:43:58 | 166,159,719 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,350 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'DioPortUI.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.11.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../../common/DioPortUI.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'DioPortUI.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.11.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_DioPortUI_t {
QByteArrayData data[6];
char stringdata0[48];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_DioPortUI_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_DioPortUI_t qt_meta_stringdata_DioPortUI = {
{
QT_MOC_LITERAL(0, 0, 9), // "DioPortUI"
QT_MOC_LITERAL(1, 10, 12), // "stateChanged"
QT_MOC_LITERAL(2, 23, 0), // ""
QT_MOC_LITERAL(3, 24, 6), // "sender"
QT_MOC_LITERAL(4, 31, 13), // "ButtonClicked"
QT_MOC_LITERAL(5, 45, 2) // "id"
},
"DioPortUI\0stateChanged\0\0sender\0"
"ButtonClicked\0id"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_DioPortUI[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 24, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
4, 1, 27, 2, 0x08 /* Private */,
// signals: parameters
QMetaType::Void, QMetaType::QObjectStar, 3,
// slots: parameters
QMetaType::Void, QMetaType::Int, 5,
0 // eod
};
void DioPortUI::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
DioPortUI *_t = static_cast<DioPortUI *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->stateChanged((*reinterpret_cast< QObject*(*)>(_a[1]))); break;
case 1: _t->ButtonClicked((*reinterpret_cast< int(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (DioPortUI::*)(QObject * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&DioPortUI::stateChanged)) {
*result = 0;
return;
}
}
}
}
QT_INIT_METAOBJECT const QMetaObject DioPortUI::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_DioPortUI.data,
qt_meta_data_DioPortUI, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *DioPortUI::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *DioPortUI::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_DioPortUI.stringdata0))
return static_cast<void*>(this);
return QWidget::qt_metacast(_clname);
}
int DioPortUI::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 2)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 2;
}
return _id;
}
// SIGNAL 0
void DioPortUI::stateChanged(QObject * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
| [
"[email protected]"
] | |
0fbaf8260a39755f49c1eff1d38a0a401da80b4f | d19c27c64206429c3c412b2c87f5d550efbc6a9b | /src/transform/gcx/pathstepexpression.h | 08e6b051de5607f9f18e2eb3585dc5f8db117860 | [
"BSD-3-Clause"
] | permissive | aep/asgaard-aera | 9823b6334cbccc6bc9072aa72be15d9c4061ed06 | 90b021a1ba65d80f19af1689e7c724631cf05ae9 | refs/heads/master | 2021-01-21T08:01:13.494678 | 2012-05-19T14:59:54 | 2012-05-19T14:59:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,268 | h | /*
| Author: Michael Schmidt;
| Gunnar Jehl (multi-step paths/aggregate functions/optimizations)
===========================================================================
===========================================================================
| Software License Agreement (BSD License)
|
| Copyright (c) 2006-2007, Saarland University Database Group
| All rights reserved.
|
| Redistribution and use of this software in source and binary forms,
| with or without modification, are permitted provided that the following
| conditions are met:
|
| * Redistributions of source code must retain the above
| copyright notice, this list of conditions and the
| following disclaimer.
|
| * Redistributions in binary form must reproduce the above
| copyright notice, this list of conditions and the
| following disclaimer in the documentation and/or other
| materials provided with the distribution.
|
| * Neither the name the of Saarland University Database Group nor the names
| of its contributors may be used to endorse or promote products derived
| from this software without specific prior written permission of the
| Saarland University Database Group.
|
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
| POSSIBILITY OF SUCH DAMAGE.
*/
/*! @file
* @brief Header file for pathstepexpression.cpp.
* @details Header file specifying constructors, destructor and functions for pathstepexpression.cpp.
* @author Michael Schmidt
* @author Gunnar Jehl (multi-step paths/aggregate functions/optimizations)
* @version 1.01b
* @license Software License Agreement (BSD License)
*/
#ifndef PATHSTEPEXPRESSION_H
#define PATHSTEPEXPRESSION_H
#include "expression.h"
#include "pathstepattribute.h"
/*! @def WEIGHT_AXIS_CHILD
* @brief Weight definition for axis <tt>child</tt> used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
* @details Weight definition for axis <tt>child</tt> used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
*/
#define WEIGHT_AXIS_CHILD 1
/*! @def WEIGHT_AXIS_DESCENDANT
* @brief Weight definition for axis <tt>descendant</tt> used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
* @details Weight definition for axis <tt>descendant</tt> used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
*/
#define WEIGHT_AXIS_DESCENDANT 3
/*! @def WEIGHT_AXIS_DOS
* @brief Weight definition for axis <tt>dos</tt> used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
* @details Weight definition for axis <tt>dos</tt> used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
*/
#define WEIGHT_AXIS_DOS 3
/*! @def WEIGHT_INNER_NODETEST
* @brief Weight definition for all inner nodetests of a path used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
* @details Weight definition for all inner nodetests used to determine the evaluation order
* of SignOffExpression if more than one appear in a series.
*/
#define WEIGHT_INNER_NODETEST 1
/*! @class PathStepExpression
* @brief Abstract base class for path step expressions.
* @details The base clase defines elements that are common to
* all path step expressions, in particular attributes
* and an axis.
* @author Michael Schmidt
* @author Gunnar Jehl (multi-step paths/aggregate functions/optimizations)
* @version 1.01b
* @license Software License Agreement (BSD License)
*/
class PathStepExpression : public Expression {
public:
/*! @brief Constructor.
* @details Constructor - initializes member variables of the base class.
* @param[in] _type The type of the PathStepExpression (either a tag, star
* text, or node expression).
* @param[in] _axis The axis specification.
* @param[in] _attribute An attribute specification, might be NULL.
*/
PathStepExpression(EXP_TYPE _type, AXIS_TYPE _axis,
PathStepAttribute* _attribute);
/*! @brief Destructor.
* @details Destructor.
*/
virtual ~PathStepExpression();
/*! @brief Returns the axis type.
* @details
* @retval AXIS_TYPE
*/
inline AXIS_TYPE getAxisType() { return axis; }
/*! @brief Sets the axis type.
* @details
* @param[in] _axis The axis type to be specified.
* @retval void
*/
inline void setAxisType(AXIS_TYPE _axis) { axis=_axis; }
/*! @brief Returns the type of the path step expression.
* @details
* @retval NODETEST_TYPE
*/
NODETEST_TYPE getNodeTestType();
/*! @brief Returns the attribute of the path step expression.
* @details The attribute might be NULL (which means true()).
* @retval PathStepAttribute*
*/
inline PathStepAttribute* getAttribute() { return attribute; }
/*! @brief Assigns an attribute to the path step expression.
* @details
* @param[in] _attribute The attribute to be set.
* @retval void
*/
inline void setAttribute(PathStepAttribute* _attribute) { attribute=_attribute; }
/*! @brief Returns true if the path step has an attribute associated.
* @details An example of such an attribute might be "position()=1".
* @pretval bool True if an attribute is associated, false otherwise.
*/
inline bool hasAttribute() { return attribute!=NULL ; }
/*! @brief Returns true if the path step is a tag path step
* @details
* @retval bool
*/
inline bool isTagNodeTest() { return type==et_pathsteptag; }
/*! @brief Returns true if the path step is a star-carrying path step
* @details
* @retval bool
*/
inline bool isStarNodeTest() { return type==et_pathstepstar; }
/*! @brief Returns true if the path step is a node()-carrying path step
* @details
* @retval bool
*/
inline bool isNodeNodeTest() { return type==et_pathstepnode; }
/*! @brief Returns true if the path step is a text()-carrying path step
* @details
* @retval bool
*/
inline bool isTextNodeTest() { return type==et_pathsteptext; }
/*! @brief Returns true if the path step is a descendant-or-self::node()
* path step.
* @details
* @retval bool
*/
inline bool isDosNodeStep() { return axis==at_dos && type==et_pathstepnode; }
/*! @brief Checks syntactical equivalence towards another path step
* @details
* @param[in] ps The path step that is compared to this object.
* @retval bool
*/
bool isSyntacticallyEqualTo(PathStepExpression* ps);
// TODO: document this!!!
unsigned getStepWeight(bool is_last_step);
/*! @brief Checks if this path step matches the passed tag
* @details Abstract method reimplemented in the inherited classes.
* @param[in] tag The tag for which matching is checked.
* @retval bool
*/
virtual bool isMatchingTag(TAG tag)=0;
/*! @brief Prints the path step expression.
* @details Abstract method reimplemented in the inherited classes.
* @param[in] o The output stream to print the path step to.
* @retval void
*/
virtual void print(ostream& o) const=0;
/*! @brief Clones the path step expression.
* @details Abstract method reimplemented in the inherited classes.
* @retval PathStepExpression* The cloned path step expression.
*/
virtual PathStepExpression* clone()=0;
/*! @brief Clones the path step expression while ignoring its attributes.
* @details Abstract method reimplemented in the inherited classes.
* @retval PathStepExpression* The cloned path step expression.
*/
virtual PathStepExpression* cloneWithoutAttributes()=0;
protected:
/*! @var AXIS_TYPE axis
* @brief The axis type of the path step expression.
*/
AXIS_TYPE axis;
/*! @var PathStepAttribute* attribute
* @brief The attribute associated with the path step expression.
* @details NULL is used as an equivalent for attribute true()
*/
PathStepAttribute* attribute;
};
#endif // PATHSTEPEXPRESSION_H
| [
"[email protected]"
] | |
6a8b5e9fcff0205d239ad6e1758f8118f966ccc5 | 2357c9b2e8f30801b45530dbd2f2f54449827a06 | /Bento/src/bento/core/Entity.cpp | fde22c74c88fc11f2d2611b17056cc088b1fb4d3 | [] | no_license | jonathanrpace/BentoCPP | 9c9d7cdfd64918fe518d711f9fa9374652c428f0 | 4e81db3c6c64e6712ec546685f6adba39b64c4c3 | refs/heads/master | 2021-01-17T03:05:10.376561 | 2018-02-16T08:49:55 | 2018-02-16T08:49:55 | 43,240,519 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 120 | cpp | #include "Entity.h"
namespace bento
{
Entity::Entity(std::string _name)
: SceneObject(_name, typeid(Entity))
{
}
} | [
"[email protected]"
] | |
9b5cacbb9deb8b39c364b4d2e95b8bb92e6887e9 | cbbca5fba9870b62c2546642c6bf38d02a19b374 | /Headers/Graphics/ITransform.h | ef5f55ebe0374c5d23099f9ed839cb3c65f5c845 | [] | no_license | jul1278/SimpleComponents | 4383f35d6e7399a22ce540e57870dfb97150d59c | 6e98c96092bb44a83b14435fc9f32a5b1c074c8a | refs/heads/ComponentCollections | 2020-12-11T04:13:28.425645 | 2016-12-13T00:12:12 | 2016-12-13T00:12:12 | 46,651,081 | 0 | 1 | null | 2016-05-08T15:45:26 | 2015-11-22T07:38:29 | C++ | UTF-8 | C++ | false | false | 197 | h | #ifndef ITRANSFORM_H
#define ITRANSFORM_H
struct TransformComponent;
class ITransform
{
public:
virtual ~ITransform() {}
virtual TransformComponent* operator()() = 0;
};
#endif // ITRANSFORM_H | [
"[email protected]"
] | |
9ce36c4026a2d20e8227324a8836982c71f80491 | b8969f45075c86526010d7be0c3129b66baed94e | /Adder.h | 46cdc16eee0b693416fe1fe7db7941de783b85e8 | [] | no_license | Paracefas/interactor-model | 3d34f19ede203c7171cc6bfdfdcdf15689f86596 | d1a40320109cc31ab57c3be0ab1047db7d79af57 | refs/heads/master | 2020-08-07T11:56:42.299962 | 2019-10-11T02:11:24 | 2019-10-11T02:11:24 | 213,440,951 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 103 | h | #pragma once
class Adder
{
int m_count;
public:
Adder();
int Add(int);
int GetCount();
}; | [
"[email protected]"
] | |
f1a7872e43e2438d2ad79693c93b529da2ad43ff | 85cc3a99d62ab295e1015b9d91c70cf3ef5adf72 | /Sparky-core/src/graphics/shaders/Shader.cpp | ef37fc4e9c05384591e34932a2c3fbf247c86274 | [
"Apache-2.0"
] | permissive | JarofJava/Sparky | 9f7376159bab8f19efa52c4d80df094e158a7900 | 78509ab53588368c6182edf43542f05dcdc80293 | refs/heads/master | 2021-01-15T03:43:17.074542 | 2015-11-25T05:50:15 | 2015-11-25T05:50:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,013 | cpp | #include "Shader.h"
#include <GL/glew.h>
namespace sparky { namespace graphics {
Shader::Shader(const char* name, const char* vertSrc, const char* fragSrc)
: m_Name(name), m_VertSrc(vertSrc), m_FragSrc(fragSrc)
{
m_ShaderID = Load(m_VertSrc, m_FragSrc);
}
Shader::Shader(const char* vertPath, const char* fragPath)
: m_Name(vertPath), m_VertPath(vertPath), m_FragPath(fragPath)
{
std::string vertSourceString = read_file(m_VertPath);
std::string fragSourceString = read_file(m_FragPath);
m_VertSrc = vertSourceString.c_str();
m_FragSrc = fragSourceString.c_str();
m_ShaderID = Load(m_VertSrc, m_FragSrc);
}
Shader* Shader::FromFile(const char* vertPath, const char* fragPath)
{
return new Shader(vertPath, fragPath);
}
Shader* Shader::FromSource(const char* vertSrc, const char* fragSrc)
{
return new Shader(vertSrc, vertSrc, fragSrc);
}
Shader* Shader::FromSource(const char* name, const char* vertSrc, const char* fragSrc)
{
return new Shader(name, vertSrc, fragSrc);
}
Shader::~Shader()
{
glDeleteProgram(m_ShaderID);
}
GLuint Shader::Load(const char* vertSrc, const char* fragSrc)
{
GLuint program = glCreateProgram();
GLuint vertex = glCreateShader(GL_VERTEX_SHADER);
GLuint fragment = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(vertex, 1, &vertSrc, NULL);
glCompileShader(vertex);
GLint result;
glGetShaderiv(vertex, GL_COMPILE_STATUS, &result);
if (result == GL_FALSE)
{
GLint length;
glGetShaderiv(vertex, GL_INFO_LOG_LENGTH, &length);
std::vector<char> error(length);
glGetShaderInfoLog(vertex, length, &length, &error[0]);
SPARKY_ERROR("Failed to compile vertex shader!");
SPARKY_ERROR(&error[0]);
SPARKY_ASSERT(false, "Failed to compile vertex shader!");
glDeleteShader(vertex);
return 0;
}
glShaderSource(fragment, 1, &fragSrc, NULL);
glCompileShader(fragment);
glGetShaderiv(fragment, GL_COMPILE_STATUS, &result);
if (result == GL_FALSE)
{
GLint length;
glGetShaderiv(fragment, GL_INFO_LOG_LENGTH, &length);
std::vector<char> error(length);
glGetShaderInfoLog(fragment, length, &length, &error[0]);
SPARKY_ERROR("Failed to compile fragment shader!");
SPARKY_ERROR(&error[0]);
SPARKY_ASSERT(false, "Failed to compile fragment shader!");
glDeleteShader(fragment);
return 0;
}
glAttachShader(program, vertex);
glAttachShader(program, fragment);
glLinkProgram(program);
glValidateProgram(program);
glDeleteShader(vertex);
glDeleteShader(fragment);
return program;
}
GLint Shader::GetUniformLocation(const GLchar* name)
{
GLint result = glGetUniformLocation(m_ShaderID, name);
if (result == -1)
SPARKY_ERROR(m_Name, ": could not find uniform ", name, " in shader!");
return result;
}
void Shader::SetUniform1f(const GLchar* name, float value)
{
glUniform1f(GetUniformLocation(name), value);
}
void Shader::SetUniform1fv(const GLchar* name, float* value, int count)
{
glUniform1fv(GetUniformLocation(name), count, value);
}
void Shader::SetUniform1i(const GLchar* name, int value)
{
glUniform1i(GetUniformLocation(name), value);
}
void Shader::SetUniform1iv(const GLchar* name, int* value, int count)
{
glUniform1iv(GetUniformLocation(name), count, value);
}
void Shader::SetUniform2f(const GLchar* name, const maths::vec2& vector)
{
glUniform2f(GetUniformLocation(name), vector.x, vector.y);
}
void Shader::SetUniform3f(const GLchar* name, const maths::vec3& vector)
{
glUniform3f(GetUniformLocation(name), vector.x, vector.y, vector.z);
}
void Shader::SetUniform4f(const GLchar* name, const maths::vec4& vector)
{
glUniform4f(GetUniformLocation(name), vector.x, vector.y, vector.z, vector.w);
}
void Shader::SetUniformMat4(const GLchar* name, const maths::mat4& matrix)
{
glUniformMatrix4fv(GetUniformLocation(name), 1, GL_FALSE, matrix.elements);
}
void Shader::Bind() const
{
glUseProgram(m_ShaderID);
}
void Shader::Unbind() const
{
glUseProgram(0);
}
} } | [
"[email protected]"
] |
Subsets and Splits