hexsha stringlengths 40 40 | size int64 19 11.4M | ext stringclasses 13 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 3 270 | max_stars_repo_name stringlengths 5 110 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 9 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 270 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 9 | max_issues_count float64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 270 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 9 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 19 11.4M | avg_line_length float64 1.93 229k | max_line_length int64 12 688k | alphanum_fraction float64 0.07 0.99 | matches listlengths 1 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6ad2635b6498c470fb43ffa26e4c8f91d838c749 | 88,075 | cpp | C++ | FEBioStudio/MainWindow.cpp | EMinsight/FEBioStudio | d3e6485610d19217550fb94cb22180bc4bda45f9 | [
"MIT"
] | null | null | null | FEBioStudio/MainWindow.cpp | EMinsight/FEBioStudio | d3e6485610d19217550fb94cb22180bc4bda45f9 | [
"MIT"
] | null | null | null | FEBioStudio/MainWindow.cpp | EMinsight/FEBioStudio | d3e6485610d19217550fb94cb22180bc4bda45f9 | [
"MIT"
] | null | null | null | /*This file is part of the FEBio Studio source code and is licensed under the MIT license
listed below.
See Copyright-FEBio-Studio.txt for details.
Copyright (c) 2021 University of Utah, The Trustees of Columbia University in
the City of New York, and others.
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 "stdafx.h"
#include "MainWindow.h"
#include "ui_mainwindow.h"
#include "GLView.h"
#include "ModelDocument.h"
#include "ModelFileReader.h"
#include <QApplication>
#include <QRegularExpression>
#include <QtCore/QSettings>
#include <QtCore/QDir>
#include <QtCore/QStandardPaths>
#include <QMessageBox>
#include <QDirIterator>
#include <QDesktopServices>
#include <QtCore/QMimeData>
#include <FSCore/FSObject.h>
#include <QtCore/QTimer>
#include <QFileDialog>
#include <QTimer>
#include "DocTemplate.h"
#include "CreatePanel.h"
#include "FileThread.h"
#include "GLHighlighter.h"
#include <QStyleFactory>
#include "DlgAddMeshData.h"
#include "GraphWindow.h"
#include "DlgTimeSettings.h"
#include <PostGL/GLModel.h>
#include "DlgWidgetProps.h"
#include <FEBio/FEBioExport25.h>
#include <FEBio/FEBioExport3.h>
#include "FEBioJob.h"
#include <PostLib/ColorMap.h>
#include <FSCore/FSDir.h>
#include <QInputDialog>
#include <QUuid>
#include "DlgCheck.h"
#include "IconProvider.h"
#include "Logger.h"
#include "SSHHandler.h"
#include "SSHThread.h"
#include "Encrypter.h"
#include "DlgImportXPLT.h"
#include "Commands.h"
#include <XPLTLib/xpltFileReader.h>
#include <MeshTools/GModel.h>
#include "DocManager.h"
#include "PostDocument.h"
#include "ModelDocument.h"
#include "TextDocument.h"
#include "PostSessionFile.h"
#include "units.h"
#include "version.h"
#include <PostLib/FEVTKImport.h>
#include <PostLib/FELSDYNAPlot.h>
#ifdef HAS_QUAZIP
#include "ZipFiles.h"
#endif
#include "welcomePage.h"
#include <PostLib/Palette.h>
extern GLColor col[];
CMainWindow* CResource::m_wnd = nullptr;
void CResource::Init(CMainWindow* wnd) { m_wnd = wnd; }
QIcon CResource::Icon(const QString& iconName)
{
assert(m_wnd);
return CIconProvider::GetIcon(iconName);
}
// create a dark style theme (work in progress)
void darkStyle()
{
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette palette = qApp->palette();
palette.setColor(QPalette::Window, QColor(53, 53, 53));
palette.setColor(QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Base, QColor(30, 30, 30));
palette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
palette.setColor(QPalette::ToolTipBase, Qt::white);
palette.setColor(QPalette::ToolTipText, Qt::black);
palette.setColor(QPalette::Text, Qt::white);
palette.setColor(QPalette::Button, QColor(53, 53, 53));
palette.setColor(QPalette::ButtonText, Qt::white);
palette.setColor(QPalette::BrightText, Qt::red);
palette.setColor(QPalette::Highlight, QColor(51, 153, 255));
palette.setColor(QPalette::HighlightedText, Qt::white);
palette.setColor(QPalette::Disabled, QPalette::Text, Qt::darkGray);
palette.setColor(QPalette::Disabled, QPalette::ButtonText, Qt::darkGray);
palette.setColor(QPalette::Link, QColor("Dodgerblue"));
qApp->setPalette(palette);
qApp->setStyleSheet("QMenu {margin: 2px} QMenu::separator {height: 1px; background: gray; margin-left: 10px; margin-right: 5px;}");
}
CMainWindow* CMainWindow::m_mainWnd = nullptr;
//-----------------------------------------------------------------------------
CMainWindow* CMainWindow::GetInstance()
{
return m_mainWnd;
}
//-----------------------------------------------------------------------------
CMainWindow::CMainWindow(bool reset, QWidget* parent) : QMainWindow(parent), ui(new Ui::CMainWindow)
{
m_mainWnd = this;
#ifdef LINUX
// Set locale to avoid issues with reading and writing feb files in other languages.
std::locale::global(std::locale::classic());
#endif
m_DocManager = new CDocManager(this);
m_fileThread = nullptr;
CResource::Init(this);
setDockOptions(dockOptions() | QMainWindow::AllowNestedDocks | QMainWindow::GroupedDragging);
// update the Post palette to match PreView's
Post::CPaletteManager& PM = Post::CPaletteManager::GetInstance();
Post::CPalette pal("preview");
for (int i = 0; i < GMaterial::MAX_COLORS; ++i)
{
GLColor c = col[i];
GLColor glc(c.r, c.g, c.b);
pal.AddColor(glc);
}
PM.AddPalette(pal);
PM.SetCurrentIndex(PM.Palettes() - 1);
// read the theme option, before we build the UI
readThemeSetting();
// activate dark style
if (ui->m_theme == 1)
{
darkStyle();
// NOTE: I'm not sure if I can set the dark theme before I can create the document.
// Since the bg colors are already set, I need to do this here. Make sure
// the values set here coincide with the values from CDocument::NewDocument
/* VIEW_SETTINGS& v = m_doc->GetViewSettings();
v.m_col1 = GLColor(83, 83, 83);
v.m_col2 = GLColor(128, 128, 128);
v.m_nbgstyle = BG_HORIZONTAL;
*/
GLWidget::set_base_color(GLColor(255, 255, 255));
}
#ifdef LINUX
if(ui->m_theme == 2)
{
qApp->setStyle(QStyleFactory::create("adwaita"));
}
else if(ui->m_theme == 3)
{
qApp->setStyle(QStyleFactory::create("adwaita-dark"));
// VIEW_SETTINGS& v = m_doc->GetViewSettings();
// v.m_col1 = GLColor(83, 83, 83);
// v.m_col2 = GLColor(128, 128, 128);
// v.m_nbgstyle = BG_HORIZONTAL;
GLWidget::set_base_color(GLColor(255, 255, 255));
}
#endif
// Instantiate IconProvider singleton
CIconProvider::Instantiate(usingDarkTheme(), devicePixelRatio());
// setup the GUI
ui->setupUi(this);
// read the settings
if (reset == false)
{
readSettings();
}
// allow drop events
setAcceptDrops(true);
// make sure the file viewer is visible
ui->showFileViewer();
// show the welcome page
ShowWelcomePage();
// update the UI configuration
UpdateUIConfig();
// load templates
TemplateManager::Init();
// Instantiate Logger singleton
CLogger::Instantiate(this);
// Start AutoSave Timer
ui->m_autoSaveTimer = new QTimer(this);
QObject::connect(ui->m_autoSaveTimer, &QTimer::timeout, this, &CMainWindow::autosave);
ui->m_autoSaveTimer->start(ui->m_autoSaveInterval*1000);
// Auto Update Check
if(ui->m_updaterPresent)
{
QObject::connect(&ui->m_updateWidget, &CUpdateWidget::ready, this, &CMainWindow::autoUpdateCheck);
ui->m_updateWidget.checkForUpdate();
}
}
//-----------------------------------------------------------------------------
CMainWindow::~CMainWindow()
{
// delete document
delete m_DocManager;
delete ui;
}
//-----------------------------------------------------------------------------
// get the current theme
int CMainWindow::currentTheme() const
{
return ui->m_theme;
}
//-----------------------------------------------------------------------------
// check for dark theme
bool CMainWindow::usingDarkTheme() const
{
bool dark = currentTheme() == 1 || currentTheme() == 3;
#ifdef __APPLE__
if(!dark)
{
QColor text = qApp->palette().color(QPalette::Text);
dark = (text.red() + text.green() + text.blue())/3 >= 128;
}
#endif
return dark;
}
//-----------------------------------------------------------------------------
// clear command stack on save
bool CMainWindow::clearCommandStackOnSave() const
{
return ui->m_clearUndoOnSave;
}
//-----------------------------------------------------------------------------
// set clear command stack on save
void CMainWindow::setClearCommandStackOnSave(bool b)
{
ui->m_clearUndoOnSave = b;
}
//-----------------------------------------------------------------------------
// set the current theme
void CMainWindow::setCurrentTheme(int n)
{
ui->m_theme = n;
}
//-----------------------------------------------------------------------------
void CMainWindow::UpdateTitle()
{
QString title;
QString projectName = ProjectName();
if (projectName.isEmpty() == false)
{
title = projectName;
}
CGLView* glview = GetGLView();
if (glview->HasRecording())
{
int nrecord = glview->RecordingMode();
switch (nrecord)
{
case VIDEO_MODE::VIDEO_PAUSED : title += " (RECORDING PAUSED)"; break;
case VIDEO_MODE::VIDEO_RECORDING: title += " (RECORDING)"; break;
case VIDEO_MODE::VIDEO_STOPPED : title += " (RECORDING STOPPED)"; break;
}
}
setWindowTitle(title);
}
//-----------------------------------------------------------------------------
//! update the tab's text
void CMainWindow::UpdateTab(CDocument* doc)
{
if (doc == nullptr) return;
int n = ui->tab->findView(doc);
assert(n >= 0);
if (n >= 0)
{
QString file = QString::fromStdString(doc->GetDocTitle());
if (doc->IsModified()) file += "*";
QString path = QString::fromStdString(doc->GetDocFilePath());
if (path.isEmpty() == false) ui->tab->setTabToolTip(n, path); else ui->tab->setTabToolTip(n, "");
CFEBioJob* activeJob = CFEBioJob::GetActiveJob();
if (activeJob && (activeJob->GetDocument() == doc))
{
file += "[running]";
}
ui->tab->setTabText(n, file);
}
ui->fileViewer->Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_clearProject()
{
if (ui->m_project.IsEmpty()) return;
if (QMessageBox::question(this, "Clear Project", "Are you sure you want to clear the current project?\nThis cannot be undone.") == QMessageBox::Yes)
{
ui->m_project.Clear();
ui->fileViewer->Update();
UpdateTitle();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::on_closeProject()
{
ui->m_project.Close();
ui->fileViewer->Update();
UpdateTitle();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_closeFile(const QString& file)
{
CDocument* doc = FindDocument(file.toStdString());
if (doc)
{
CloseView(doc);
ui->fileViewer->Update();
UpdateTitle();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::on_addToProject(const QString& file)
{
ui->m_project.AddFile(file);
ui->fileViewer->Update();
UpdateTitle();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_xmledit_textChanged()
{
QTextDocument* qtxt = ui->xmlEdit->document();
if (qtxt == nullptr) return;
CTextDocument* txtDoc = dynamic_cast<CTextDocument*>(GetDocument());
if (txtDoc && txtDoc->IsValid() && (txtDoc->IsModified() == false))
{
if ((txtDoc->GetText() == qtxt))
{
txtDoc->SetModifiedFlag(qtxt->isModified());
UpdateTab(txtDoc);
}
}
}
//-----------------------------------------------------------------------------
void CMainWindow::on_htmlview_anchorClicked(const QUrl& link)
{
QString ref = link.toString();
if (ref == "#new") on_actionNewModel_triggered();
else if (ref == "#newproject") on_actionNewProject_triggered();
else if (ref == "#open") on_actionOpen_triggered();
else if (ref == "#openproject") on_actionOpenProject_triggered();
else if (ref == "#febio") on_actionFEBioURL_triggered();
else if (ref == "#help") on_actionFEBioResources_triggered();
else if (ref == "#forum") on_actionFEBioForum_triggered();
else if (ref == "#update") on_actionUpdate_triggered();
else
{
string s = ref.toStdString();
const char* sz = s.c_str();
if (strncmp(sz, "#recent_", 8) == 0)
{
int n = atoi(sz + 8);
QStringList recentFiles = GetRecentFileList();
OpenFile(recentFiles.at(n));
}
if (strncmp(sz, "#recentproject_", 15) == 0)
{
int n = atoi(sz + 15);
QStringList recentProjects = GetRecentProjectsList();
OpenFile(recentProjects.at(n));
}
}
}
//-----------------------------------------------------------------------------
// Read a file asynchronously
// doc : the document that is being modified
// fileName : the file name of the file that is read
// fileReader : the object that reads the file's content
// flags : flags indicating what to do after the file is read
void CMainWindow::ReadFile(CDocument* doc, const QString& fileName, FileReader* fileReader, int flags)
{
m_fileQueue.push_back(QueuedFile(doc, fileName, fileReader, flags));
ReadNextFileInQueue();
}
void CMainWindow::OpenFile(const QString& filePath, bool showLoadOptions, bool openExternal)
{
// stop any animation
if (ui->m_isAnimating) ui->postToolBar->CheckPlayButton(false);
if(filePath.startsWith("fbs://"))
{
ui->databasePanel->OpenLink(filePath);
ui->databasePanel->Raise();
return;
}
// convert to native separators
QString fileName = QDir::toNativeSeparators(filePath);
// check to extension to see what to do
QString ext = QFileInfo(fileName).suffix();
if ((ext.compare("fsm", Qt::CaseInsensitive) == 0) ||
(ext.compare("prv", Qt::CaseInsensitive) == 0) ||
(ext.compare("fsprj", Qt::CaseInsensitive) == 0))
{
OpenDocument(fileName);
}
else if ((ext.compare("xplt", Qt::CaseInsensitive) == 0) ||
(ext.compare("vtk" , Qt::CaseInsensitive) == 0) ||
(ext.compare("fsps", Qt::CaseInsensitive) == 0))
{
// load the post file
OpenPostFile(fileName, nullptr, showLoadOptions);
}
else if (ext.compare("feb", Qt::CaseInsensitive) == 0)
{
// ask user if (s)he wants to open the feb as a model or as a file.
QMessageBox box;
box.setText("How would you like to open this file?");
QPushButton* importButton = box.addButton("Import as Model", QMessageBox::AcceptRole);
QPushButton* textButton = box.addButton("Edit as Text", QMessageBox::YesRole);
box.addButton(QMessageBox::Cancel);
box.setDefaultButton(importButton);
box.exec();
if(box.clickedButton() == importButton)
{
// load the feb file
OpenFEModel(fileName);
}
else if(box.clickedButton() == textButton)
{
// open a text editor
OpenFEBioFile(fileName);
}
}
else if ((ext.compare("inp", Qt::CaseInsensitive) == 0) ||
(ext.compare("n" , Qt::CaseInsensitive) == 0))
{
// load the feb file
OpenFEModel(fileName);
}
else if (ext.compare("prj", Qt::CaseInsensitive) == 0)
{
// Extract the project archive and open it
ImportProjectArchive(fileName);
}
else if (ext.compare("fsp", Qt::CaseInsensitive) == 0)
{
OpenProject(fileName);
}
else if (ext.isEmpty() && (openExternal == true))
{
// Assume this is an LSDYNA database
OpenPostFile(fileName, nullptr, showLoadOptions);
}
else if (openExternal)
{
// Open any other files (e.g. log files) with the system's associated program
QDesktopServices::openUrl(QUrl::fromLocalFile(fileName));
// assert(false);
// QMessageBox::critical(this, "FEBio Studio", "Does not compute!");
}
}
//-----------------------------------------------------------------------------
void CMainWindow::ReadFile(QueuedFile& qfile)
{
// if this is a reload, clear the document
if (qfile.m_doc && (qfile.m_flags & QueuedFile::RELOAD_DOCUMENT))
{
qfile.m_doc->Clear();
Update(nullptr, true);
}
// read the file, either threaded or directly
if (qfile.m_flags & QueuedFile::NO_THREAD)
{
bool bret = false;
QString errorString;
if (qfile.m_fileReader == nullptr)
{
AddLogEntry("Don't know how to read file.");
}
else
{
string sfile = qfile.m_fileName.toStdString();
bret = qfile.m_fileReader->Load(sfile.c_str());
std::string err = qfile.m_fileReader->GetErrorMessage();
errorString = QString::fromStdString(err);
}
finishedReadingFile(bret, qfile, errorString);
}
else
{
assert(m_fileThread == nullptr);
m_fileThread = new CFileThread(this, qfile);
m_fileThread->start();
ui->statusBar->showMessage(QString("Reading file %1 ...").arg(qfile.m_fileName));
ui->fileProgress->setValue(0);
ui->statusBar->addPermanentWidget(ui->fileProgress);
ui->fileProgress->show();
AddLogEntry(QString("Reading file %1 ... ").arg(qfile.m_fileName));
QTimer::singleShot(100, this, SLOT(checkFileProgress()));
}
}
//-----------------------------------------------------------------------------
// read a list of files
void CMainWindow::ImportFiles(const QStringList& files)
{
CDocument* doc = GetDocument();
if (doc == nullptr)
{
QMessageBox::critical(this, "Import Files", "No active document.");
return;
}
// set the queue
for (int i = 0; i < files.size(); ++i)
{
QString fileName = files[i];
FileReader* fileReader = CreateFileReader(fileName);
if (fileReader)
{
m_fileQueue.push_back(QueuedFile(doc, fileName, fileReader, 0));
}
else
{
AddLogEntry(QString("Don't know how to read: %1\n").arg(fileName));
if (files.size() == 1)
{
QMessageBox::critical(this, "Import Geometry", "Don't know how to read this file.");
return;
}
}
}
// start the process
ReadNextFileInQueue();
for (int i=0; i<files.count(); ++i)
ui->addToRecentGeomFiles(files[i]);
}
#ifdef HAS_QUAZIP
//-----------------------------------------------------------------------------
// Import Project
void CMainWindow::ImportProjectArchive(const QString& fileName)
{
QFileInfo fileInfo(fileName);
// get the parent directory's name
QString parentDirName = fileInfo.path();
// create folder in which to unzip
QDir parentDir(parentDirName);
parentDir.mkdir(fileInfo.completeBaseName());
QString destDir = parentDirName + "/" + fileInfo.completeBaseName();
// extract files
QStringList extractedFiles = extractAllFiles(fileName, destDir);
// open first .fsprj file
bool found = false;
for(QString str : extractedFiles)
{
if(QFileInfo(str).suffix().compare("fsprj", Qt::CaseInsensitive) == 0)
{
found = true;
OpenDocument(str);
break;
}
}
if(!found)
{
for(QString str : extractedFiles)
{
if(QFileInfo(str).suffix().compare("feb", Qt::CaseInsensitive) == 0)
{
found = true;
OpenFEModel(str);
break;
}
}
}
}
#else
void CMainWindow::ImportProjectArchive(const QString& fileName) {}
#endif
//-----------------------------------------------------------------------------
void CMainWindow::ReadNextFileInQueue()
{
// If a file is being processed, just wait
if (m_fileThread) return;
// make sure we have a file
if (m_fileQueue.empty()) return;
// get the next file name
QueuedFile nextFile = m_fileQueue[0];
// remove the last file that was read
m_fileQueue.erase(m_fileQueue.begin());
// start reading the file
ReadFile(nextFile);
}
//-----------------------------------------------------------------------------
// Open a project
bool CMainWindow::OpenProject(const QString& projectFile)
{
bool b = ui->m_project.Open(projectFile);
if (b == false)
{
QMessageBox::critical(this, "ERROR", "Failed to open the project file.");
return false;
}
ui->fileViewer->Update();
ui->addToRecentProjects(projectFile);
ui->fileViewer->parentWidget()->show();
ui->fileViewer->parentWidget()->raise();
UpdateTitle();
CloseWelcomePage();
return b;
}
//-----------------------------------------------------------------------------
void CMainWindow::OpenDocument(const QString& fileName)
{
QString filePath = QDir::toNativeSeparators(QDir::cleanPath(fileName));
// Stop the timer if it's running
if (ui->m_isAnimating) ui->m_isAnimating = false;
// see if the file is already open
int docs = m_DocManager->Documents();
for (int i = 0; i < docs; ++i)
{
CDocument* doc = m_DocManager->GetDocument(i);
std::string sfile = doc->GetDocFilePath();
QString fileName_i = QString::fromStdString(sfile);
if (filePath == fileName_i)
{
ui->tab->setCurrentIndex(i);
QApplication::alert(this);
return;
}
}
// create a new document
CModelDocument* doc = new CModelDocument(this);
doc->SetDocFilePath(filePath.toStdString());
// we need to make this the active document
CDocument::SetActiveDocument(doc);
// start reading the file
ReadFile(doc, filePath, new ModelFileReader(doc), QueuedFile::NEW_DOCUMENT);
// add file to recent list
ui->addToRecentFiles(filePath);
// Check if there is a more recent autosave of this file
if(doc->loadPriorAutoSave())
{
int answer = QMessageBox::question(this, "FEBio Studio",
"An autosave more recent than this file was found.\n\nWould you like to load it?",
QMessageBox::Yes | QMessageBox::No);
if(answer == QMessageBox::Yes)
{
CModelDocument* docAutoSave = new CModelDocument(this);
ReadFile(docAutoSave, doc->GetAutoSaveFilePath().c_str(), new ModelFileReader(docAutoSave), QueuedFile::AUTO_SAVE_RECOVERY);
}
else
{
int answer2 = QMessageBox::question(this, "FEBio Studio",
"Would you like to delete this autosave?",
QMessageBox::Yes | QMessageBox::No);
if(answer2 == QMessageBox::Yes)
{
QFile autoSave(doc->GetAutoSaveFilePath().c_str());
if(autoSave.exists()) autoSave.remove();
}
}
}
}
//! add a document
void CMainWindow::AddDocument(CDocument* doc)
{
// add it to the doc manager
m_DocManager->AddDocument(doc);
// make it the active one
SetActiveDocument(doc);
// add it to the project
CModelDocument* modelDoc = dynamic_cast<CModelDocument*>(doc);
if (modelDoc && (modelDoc->GetDocFilePath().empty() == false))
{
ui->m_project.AddFile(QString::fromStdString(modelDoc->GetDocFilePath()));
ui->fileViewer->Update();
}
}
//-----------------------------------------------------------------------------
bool compare_filename(const std::string& file1, const std::string& file2)
{
if (file1.size() != file2.size()) return false;
int l = file1.size();
for (int i = 0; i < l; ++i)
{
char c1 = file1[i];
char c2 = file2[i];
if ((c1 == '/') || (c1 == '\\'))
{
if ((c2 != '/') && (c2 != '\\')) return false;
}
else if (c1 != c2) return false;
}
return true;
}
//-----------------------------------------------------------------------------
CDocument* CMainWindow::FindDocument(const std::string& filePath)
{
for (int i = 0; i < m_DocManager->Documents(); ++i)
{
CDocument* doc = m_DocManager->GetDocument(i);
std::string file_i = doc->GetDocFilePath();
if (compare_filename(filePath, file_i)) return doc;
}
return nullptr;
}
//-----------------------------------------------------------------------------
bool CMainWindow::CreateNewProject(QString fileName)
{
// close the existing project
ui->m_project.Close();
// try to create a new project
bool ret = ui->m_project.Save(fileName);
if (ret) ui->addToRecentProjects(fileName);
ui->fileViewer->parentWidget()->show();
ui->fileViewer->parentWidget()->raise();
return ret;
}
//-----------------------------------------------------------------------------
CModelDocument* CMainWindow::CreateNewDocument()
{
CModelDocument* doc = new CModelDocument(this);
doc->SetUnitSystem(ui->m_defaultUnits);
return doc;
}
//-----------------------------------------------------------------------------
//! Open a plot file
void CMainWindow::OpenPostFile(const QString& fileName, CModelDocument* modelDoc, bool showLoadOptions)
{
// see if this file is already open
CPostDocument* doc = dynamic_cast<CPostDocument*>(FindDocument(fileName.toStdString()));
if (doc == nullptr)
{
doc = new CPostDocument(this, modelDoc);
QString ext = QFileInfo(fileName).suffix();
if (ext.compare("xplt", Qt::CaseInsensitive) == 0)
{
xpltFileReader* xplt = new xpltFileReader(doc->GetFEModel());
if (showLoadOptions)
{
CDlgImportXPLT dlg(this);
if (dlg.exec())
{
xplt->SetReadStateFlag(dlg.m_nop);
xplt->SetReadStatesList(dlg.m_item);
}
else
{
delete doc;
return;
}
}
doc->SetFileReader(xplt);
ReadFile(doc, fileName, doc->GetFileReader(), QueuedFile::NEW_DOCUMENT);
// add file to recent list
ui->addToRecentFiles(fileName);
}
else if (ext.compare("vtk", Qt::CaseInsensitive) == 0)
{
Post::FEVTKimport* vtk = new Post::FEVTKimport(doc->GetFEModel());
ReadFile(doc, fileName, vtk, QueuedFile::NEW_DOCUMENT);
}
else if (ext.compare("fsps", Qt::CaseInsensitive) == 0)
{
PostSessionFileReader* fsps = new PostSessionFileReader(doc);
ReadFile(doc, fileName, fsps, QueuedFile::NEW_DOCUMENT);
}
else if (ext.isEmpty())
{
// Assume this is an LSDYNA database
Post::FELSDYNAPlotImport* lsdyna = new Post::FELSDYNAPlotImport(doc->GetFEModel());
ReadFile(doc, fileName, lsdyna, QueuedFile::NEW_DOCUMENT);
}
}
else
{
ReadFile(doc, fileName, doc->GetFileReader(), QueuedFile::RELOAD_DOCUMENT);
}
}
//-----------------------------------------------------------------------------
//! get the mesh mode
int CMainWindow::GetMeshMode()
{
if (ui->buildPanel->IsEditPanelVisible()) return MESH_MODE_SURFACE;
else return MESH_MODE_VOLUME;
}
//-----------------------------------------------------------------------------
void CMainWindow::dragEnterEvent(QDragEnterEvent *e)
{
if (e->mimeData()->hasUrls()) {
e->acceptProposedAction();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::dropEvent(QDropEvent *e)
{
foreach (const QUrl &url, e->mimeData()->urls()) {
QString fileName = url.toLocalFile();
FileReader* fileReader = nullptr;
QFileInfo file(fileName);
// Create a file reader
// NOTE: For FEB files I prefer to open the file as a separate model,
// so I need this hack.
if (file.suffix() != "feb") fileReader = CreateFileReader(fileName);
CDocument* doc = GetDocument();
// make sure we have one
if (fileReader && doc)
{
ReadFile(doc, fileName, fileReader, 0);
}
else {
OpenFile(fileName, false, false);
}
}
}
//-----------------------------------------------------------------------------
void CMainWindow::checkFileProgress()
{
float f = 1.f;
if (m_fileThread) f = m_fileThread->getFileProgress();
else return;
int n = (int)(100.f*f);
ui->fileProgress->setValue(n);
if (f < 1.0f) QTimer::singleShot(100, this, SLOT(checkFileProgress()));
}
//-----------------------------------------------------------------------------
void CMainWindow::on_finishedReadingFile(bool success, const QString& errorString)
{
assert(m_fileThread);
if (m_fileThread == nullptr) return;
QueuedFile qfile = m_fileThread->GetFile();
m_fileThread = nullptr;
finishedReadingFile(success, qfile, errorString);
}
//-----------------------------------------------------------------------------
void CMainWindow::finishedReadingFile(bool success, QueuedFile& file, const QString& errorString)
{
ui->statusBar->clearMessage();
ui->statusBar->removeWidget(ui->fileProgress);
if (success == false)
{
if (m_fileQueue.empty())
{
QString err = QString("Failed reading file :\n%1\n\nERROR: %2").arg(file.m_fileName).arg(errorString);
QMessageBox::critical(this, "FEBio Studio", err);
}
QString err = QString("FAILED:\n%1\n").arg(errorString);
AddLogEntry(err);
// if this was a new document, we need to delete the document
if (file.m_flags & QueuedFile::NEW_DOCUMENT)
{
delete file.m_doc;
}
// reset the active document
CDocument::SetActiveDocument(GetDocument());
return;
}
else
{
if (errorString.isEmpty() == false)
{
if (m_fileQueue.empty())
{
QStringList stringList = errorString.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
QString err = QString("Warnings were generated while reading the file:\n%1\n\n").arg(file.m_fileName);
err += QString("IMPORTANT: The file may NOT have been read in correctly. Please check for errors!\n\n");
err += "WARNINGS:\n";
int n = stringList.size();
if (n > 10) n = 10;
for (int i=0; i<n; ++i)
{
err += QString("%1\n").arg(stringList[i]);
}
if (stringList.size() > n)
{
err += QString("\n(Additional warnings on Output panel)");
}
QMessageBox::information(this, "FEBio Studio", err);
}
AddLogEntry("success!\n");
AddLogEntry("Warnings were generated:\n");
AddLogEntry(errorString);
AddLogEntry("\n");
}
else
{
AddLogEntry("success!\n");
}
// if this was a new document, make it the active one
if (file.m_flags & QueuedFile::NEW_DOCUMENT)
{
CGLDocument* doc = dynamic_cast<CGLDocument*>(file.m_doc); assert(doc);
doc->SetFileReader(file.m_fileReader);
if (doc->GetDocFilePath().empty())
{
doc->SetDocFilePath(file.m_fileName.toStdString());
}
bool b = doc->Initialize();
if (b == false)
{
AddLogEntry("Document initialization failed!\n");
}
AddDocument(doc);
// for fsprj files we set the "project" directory.
FSDir path(file.m_fileName.toStdString());
if (path.fileExt() == "fsprj")
{
FSDir::setMacro("ProjectDir", ".");
}
}
else if (file.m_flags & QueuedFile::RELOAD_DOCUMENT)
{
CDocument* doc = file.m_doc; assert(doc);
bool b = doc->Initialize();
if (b == false)
{
AddLogEntry("File could not be reloaded!\n");
}
SetActiveDocument(file.m_doc);
}
else if (file.m_flags & QueuedFile::AUTO_SAVE_RECOVERY)
{
CGLDocument* doc = dynamic_cast<CGLDocument*>(file.m_doc); assert(doc);
doc->SetFileReader(file.m_fileReader);
bool b = doc->Initialize();
if (b == false)
{
AddLogEntry("Document initialization failed!\n");
}
AddDocument(doc);
// for fsprj files we set the "project" directory.
FSDir path(file.m_fileName.toStdString());
if (path.fileExt() == "fsprj")
{
FSDir::setMacro("ProjectDir", ".");
}
doc->SetDocTitle(doc->GetDocTitle() + " - Recovered");
doc->SetUnsaved();
}
else
{
SetActiveDocument(file.m_doc);
}
}
if (m_fileQueue.empty() == false)
{
ReadNextFileInQueue();
}
else
{
if ((file.m_flags & QueuedFile::RELOAD_DOCUMENT) == 0) Reset();
UpdatePhysicsUi();
UpdateModel();
UpdateToolbar();
UpdatePostToolbar();
Update(nullptr, true);
if (ui->modelViewer) ui->modelViewer->Show();
// If the main window is not active, this will alert the user that the file has been read.
QApplication::alert(this, 0);
}
}
//-----------------------------------------------------------------------------
void CMainWindow::Update(QWidget* psend, bool breset)
{
CDocument* doc = GetDocument();
if (doc == nullptr) return;
UpdateTab(doc);
if (breset)
{
// m_pGLView->OnZoomExtents(0,0);
UpdateModel();
}
// redraw the GL view
RedrawGL();
// update the GL control bar
UpdateGLControlBar();
// Update the command windows
if (ui->buildPanel->isVisible() && (psend != ui->buildPanel)) ui->buildPanel->Update(breset);
// if (m_pCurveEdit->visible() && (m_pCurveEdit != psend)) m_pCurveEdit->Update();
if (ui->meshWnd && ui->meshWnd->isVisible()) ui->meshWnd->Update();
if (ui->postPanel && ui->postPanel->isVisible()) ui->postPanel->Update(breset);
if (ui->timePanel && ui->timePanel->isVisible()) ui->timePanel->Update(breset);
if (ui->measureTool && ui->measureTool->isVisible()) ui->measureTool->Update();
if (ui->planeCutTool && ui->planeCutTool->isVisible()) ui->planeCutTool->Update();
UpdateGraphs(breset);
}
//-----------------------------------------------------------------------------
void CMainWindow::UpdateGraphs(bool breset)
{
// update graph windows
QList<::CGraphWindow*>::iterator it = ui->graphList.begin();
for (int i = 0; i < ui->graphList.size(); ++i, ++it)
{
(*it)->Update(breset);
}
}
//-----------------------------------------------------------------------------
CGLView* CMainWindow::GetGLView()
{
return ui->glw->glview;
}
//-----------------------------------------------------------------------------
CBuildPanel* CMainWindow::GetBuildPanel()
{
return ui->buildPanel;
}
//-----------------------------------------------------------------------------
CCreatePanel* CMainWindow::GetCreatePanel()
{
return ui->buildPanel->CreatePanel();
}
CRepositoryPanel* CMainWindow::GetDatabasePanel()
{
return ui->databasePanel;
}
//-----------------------------------------------------------------------------
//! close the current open project
void CMainWindow::CloseProject()
{
// close all views first
int n = ui->tab->count();
for (int i = 0; i < n; ++i) ui->tab->closeView(0);
}
//-----------------------------------------------------------------------------
//! This function resets the GL View. It is called when creating a new file new
//! (CWnd::OnFileNew) or when opening a file (CWnd::OnFileOpen).
//! \sa CGLView::Reset
void CMainWindow::Reset()
{
// GetGLView()->Reset();
GLHighlighter::ClearHighlights();
GetGLView()->ZoomExtents(false);
}
//-----------------------------------------------------------------------------
//! Get the active document
CDocument* CMainWindow::GetDocument()
{
return ui->tab->getActiveDoc();
}
CGLDocument* CMainWindow::GetGLDocument() { return dynamic_cast<CGLDocument*>(GetDocument()); }
CModelDocument* CMainWindow::GetModelDocument() { return dynamic_cast<CModelDocument*>(GetDocument()); }
CPostDocument* CMainWindow::GetPostDocument() { return dynamic_cast<CPostDocument*>(GetDocument()); }
//-----------------------------------------------------------------------------
// get the document manager
CDocManager* CMainWindow::GetDocManager()
{
return m_DocManager;
}
//-----------------------------------------------------------------------------
bool CMainWindow::maybeSave()
{
// are there any unsaved documents open?
int docs = m_DocManager->Documents();
int unsavedDocs = 0;
for (int i=0; i<docs; ++i)
{
CDocument* doc = m_DocManager->GetDocument(i);
if (doc->IsModified()) unsavedDocs++;
}
if (unsavedDocs > 0)
{
QMessageBox::StandardButton b = QMessageBox::question(this, "", "There are unsaved documents open.\nAre you sure you want to exit?", QMessageBox::Yes | QMessageBox::No);
if (b == QMessageBox::No) return false;
}
return true;
}
bool CMainWindow::maybeSave(CDocument* doc)
{
if (doc && doc->IsModified())
{
QMessageBox::StandardButton b = QMessageBox::question(this, "", "The file was changed. Do you want to save it?", QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
if (b == QMessageBox::Cancel) return false;
if (b == QMessageBox::Yes)
{
on_actionSave_triggered();
}
return true;
}
else return true;
}
void CMainWindow::autosave()
{
for(int i = 0; i < m_DocManager->Documents(); i++)
{
CDocument* doc = m_DocManager->GetDocument(i);
if (doc && doc->IsModified())
{
doc->AutoSaveDocument();
}
}
}
void CMainWindow::autoUpdateCheck(bool update)
{
ui->m_updateAvailable = update;
int n = ui->tab->findView("Welcome");
if (n != -1)
{
ui->tab->getDocument(n)->Activate();
}
}
void CMainWindow::ReportSelection()
{
CModelDocument* doc = GetModelDocument();
if (doc == nullptr) return;
FESelection* sel = doc->GetCurrentSelection();
if ((sel == 0) || (sel->Size() == 0))
{
ClearStatusMessage();
return;
}
GetCreatePanel()->setInput(sel);
int N = sel->Size();
QString msg;
switch (sel->Type())
{
case SELECT_OBJECTS:
{
GObjectSelection& s = dynamic_cast<GObjectSelection&>(*sel);
if (N == 1)
{
GObject* po = s.Object(0);
msg = QString("Object \"%1\" selected (Id = %2)").arg(QString::fromStdString(po->GetName())).arg(po->GetID());
}
else msg = QString("%1 Objects selected").arg(N);
}
break;
case SELECT_PARTS:
{
if (N == 1)
{
GPartSelection& ps = dynamic_cast<GPartSelection&>(*sel);
GPartSelection::Iterator it(&ps);
msg = QString("Part \"%1\" selected (Id = %2)").arg(QString::fromStdString(it->GetName())).arg(it->GetID());
}
else msg = QString("%1 Parts selected").arg(N);
}
break;
case SELECT_SURFACES:
{
if (N == 1)
{
GFaceSelection& fs = dynamic_cast<GFaceSelection&>(*sel);
GFaceSelection::Iterator it(&fs);
msg = QString("Surface \"%1\" selected (Id = %2)").arg(QString::fromStdString(it->GetName())).arg(it->GetID());
}
else msg = QString("%1 Surfaces selected").arg(N);
}
break;
case SELECT_CURVES:
{
GEdgeSelection& es = dynamic_cast<GEdgeSelection&>(*sel);
if (N == 1)
{
GEdgeSelection::Iterator it(&es);
msg = QString("Curve \"%1\" selected (Id = %2)").arg(QString::fromStdString(it->GetName())).arg(it->GetID());
}
else msg = QString("%1 Curves selected").arg(N);
}
break;
case SELECT_NODES:
{
if (N == 1)
{
GNodeSelection& ns = dynamic_cast<GNodeSelection&>(*sel);
GNodeSelection::Iterator it(&ns);
msg = QString("Node \"%1\" selected (Id = %2)").arg(QString::fromStdString(it->GetName())).arg(it->GetID());
}
else msg = QString("%1 Nodes selected").arg(N);
}
break;
case SELECT_DISCRETE_OBJECT:
{
if (N == 1)
{
msg = QString("1 discrete object selected");
}
else msg = QString("%1 discrete objects selected").arg(N);
}
break;
case SELECT_FE_ELEMENTS:
{
msg = QString("%1 elements selected").arg(N);
}
break;
case SELECT_FE_FACES:
{
msg = QString("%1 faces selected").arg(N);
}
break;
case SELECT_FE_EDGES:
{
msg = QString("%1 edges selected").arg(N);
}
break;
case SELECT_FE_NODES:
{
msg = QString("%1 nodes selected").arg(N);
}
break;
}
SetStatusMessage(msg);
AddLogEntry(msg + "\n");
FEElementSelection* es = dynamic_cast<FEElementSelection*>(sel);
if (es)
{
if (es->Size() == 1)
{
FEElement_* el = es->Element(0);
switch (el->Type())
{
case FE_HEX8 : AddLogEntry(" Type = HEX8" ); break;
case FE_TET4 : AddLogEntry(" Type = TET4" ); break;
case FE_TET5 : AddLogEntry(" Type = TET5" ); break;
case FE_PENTA6 : AddLogEntry(" Type = PENTA6" ); break;
case FE_QUAD4 : AddLogEntry(" Type = QUAD4" ); break;
case FE_TRI3 : AddLogEntry(" Type = TRI3" ); break;
case FE_BEAM2 : AddLogEntry(" Type = BEAM2" ); break;
case FE_HEX20 : AddLogEntry(" Type = HEX20" ); break;
case FE_QUAD8 : AddLogEntry(" Type = QUAD8" ); break;
case FE_BEAM3 : AddLogEntry(" Type = BEAM3" ); break;
case FE_TET10 : AddLogEntry(" Type = TET10" ); break;
case FE_TRI6 : AddLogEntry(" Type = TRI6" ); break;
case FE_TET15 : AddLogEntry(" Type = TET15" ); break;
case FE_HEX27 : AddLogEntry(" Type = HEX27" ); break;
case FE_TRI7 : AddLogEntry(" Type = TRI7" ); break;
case FE_QUAD9 : AddLogEntry(" Type = QUAD9" ); break;
case FE_PENTA15: AddLogEntry(" Type = PENTA15"); break;
case FE_PYRA5 : AddLogEntry(" Type = PYRA5" ); break;
case FE_TET20 : AddLogEntry(" Type = TET20" ); break;
case FE_TRI10 : AddLogEntry(" Type = TRI10" ); break;
case FE_PYRA13 : AddLogEntry(" Type = PYRA13" ); break;
}
AddLogEntry("\n");
AddLogEntry(" nodes: ");
int n = el->Nodes();
for (int i=0; i<n; ++i)
{
AddLogEntry(QString::number(el->m_node[i]));
if (i < n - 1) AddLogEntry(", ");
else AddLogEntry("\n");
}
AddLogEntry(" neighbors: ");
n = 0;
if (el->IsSolid()) n = el->Faces();
else if (el->IsShell()) n = el->Edges();
for (int i=0; i<n; ++i)
{
AddLogEntry(QString::number(el->m_nbr[i]));
if (i < n - 1) AddLogEntry(", ");
else AddLogEntry("\n");
}
}
}
FEFaceSelection* fs = dynamic_cast<FEFaceSelection*>(sel);
if (fs)
{
if (fs->Size() == 1)
{
FEFaceSelection::Iterator it = fs->begin();
FEFace* pf = it;
switch (pf->Type())
{
case FE_FACE_TRI3 : AddLogEntry(" Type = TRI3"); break;
case FE_FACE_QUAD4: AddLogEntry(" Type = QUAD4"); break;
case FE_FACE_TRI6 : AddLogEntry(" Type = TRI6"); break;
case FE_FACE_TRI7 : AddLogEntry(" Type = TRI7"); break;
case FE_FACE_QUAD8: AddLogEntry(" Type = QUAD8"); break;
case FE_FACE_QUAD9: AddLogEntry(" Type = QUAD9"); break;
case FE_FACE_TRI10: AddLogEntry(" Type = TRI10"); break;
}
AddLogEntry("\n");
AddLogEntry(" neighbors: ");
int n = pf->Edges();
for (int i = 0; i<n; ++i)
{
AddLogEntry(QString::number(pf->m_nbr[i]));
if (i < n - 1) AddLogEntry(", ");
else AddLogEntry("\n");
}
}
}
}
void CMainWindow::closeEvent(QCloseEvent* ev)
{
if (maybeSave())
{
writeSettings();
if(ui->m_updateOnClose && ui->m_updaterPresent)
{
QProcess* updater = new QProcess;
bool bret = true;
if(ui->m_updateDevChannel)
{
QString s = QApplication::applicationDirPath() + UPDATER;
bret = updater->startDetached(s, QStringList() << "--devChannel");
}
else
{
QString s = QApplication::applicationDirPath() + UPDATER;
bret = updater->startDetached(s, QStringList());
}
if (bret == false)
{
QMessageBox::critical(this, "FEBIo Studio", "Failed to launch updater.");
}
}
ev->accept();
}
else
{
ui->m_updateOnClose = false;
ev->ignore();
}
}
void CMainWindow::keyPressEvent(QKeyEvent* ev)
{
if ((ev->key() == Qt::Key_Backtab) || (ev->key() == Qt::Key_Tab))
{
if (ev->modifiers() & Qt::ControlModifier)
{
ev->accept();
int docs = ui->tab->count();
if (docs > 1)
{
// activate the next document
int i = ui->tab->currentIndex();
// activate next or prev one
if (ev->key() == Qt::Key_Backtab)
{
i--;
if (i < 0) i = docs - 1;
}
else
{
++i;
if (i >= docs) i = 0;
}
ui->tab->setCurrentIndex(i);
}
}
}
else if (ev->key() == Qt::Key_Escape)
{
// give the build panels a chance to react first
if (ui->buildPanel->OnEscapeEvent()) return;
CModelDocument* doc = GetModelDocument();
if (doc)
{
// if the build panel didn't process it, clear selection
FESelection* ps = doc->GetCurrentSelection();
if ((ps == 0) || (ps->Size() == 0))
{
if (doc->GetItemMode() != ITEM_MESH) doc->SetItemMode(ITEM_MESH);
else ui->SetSelectionMode(SELECT_OBJECT);
Update();
UpdateUI();
}
else on_actionClearSelection_triggered();
ev->accept();
GLHighlighter::ClearHighlights();
GLHighlighter::setTracking(false);
}
}
else if ((ev->key() == Qt::Key_1) && (ev->modifiers() & Qt::CTRL))
{
ui->showFileViewer();
ev->accept();
}
else if ((ev->key() == Qt::Key_2) && (ev->modifiers() & Qt::CTRL))
{
ui->showModelViewer();
ev->accept();
}
else if ((ev->key() == Qt::Key_3) && (ev->modifiers() & Qt::CTRL))
{
ui->showBuildPanel();
ev->accept();
}
else if ((ev->key() == Qt::Key_4) && (ev->modifiers() & Qt::CTRL))
{
ui->showPostPanel();
ev->accept();
}
}
void CMainWindow::SetCurrentFolder(const QString& folder)
{
ui->currentPath = folder;
}
// get the current project
FEBioStudioProject* CMainWindow::GetProject()
{
return &ui->m_project;
}
void CMainWindow::setShowNewDialog(bool b)
{
ui->m_showNewDialog = b;
}
bool CMainWindow::showNewDialog()
{
return ui->m_showNewDialog;
}
void CMainWindow::setAutoSaveInterval(int interval)
{
ui->m_autoSaveInterval = interval;
ui->m_autoSaveTimer->stop();
ui->m_autoSaveTimer->start(ui->m_autoSaveInterval*1000);
}
int CMainWindow::autoSaveInterval()
{
return ui->m_autoSaveInterval;
}
bool CMainWindow::updaterPresent()
{
return ui->m_updaterPresent;
}
bool CMainWindow::updateAvailable()
{
return ui->m_updateAvailable;
}
// set/get default unit system for new models
void CMainWindow::SetDefaultUnitSystem(int n)
{
ui->m_defaultUnits = n;
}
int CMainWindow::GetDefaultUnitSystem() const
{
return ui->m_defaultUnits;
}
void CMainWindow::writeSettings()
{
VIEW_SETTINGS& vs = GetGLView()->GetViewSettings();
QString version = QString("%1.%2.%3").arg(VERSION).arg(SUBVERSION).arg(SUBSUBVERSION);
QSettings settings("MRLSoftware", "FEBio Studio");
settings.setValue("version", version);
settings.beginGroup("MainWindow");
settings.setValue("geometry", saveGeometry());
settings.setValue("state", saveState());
settings.setValue("theme", ui->m_theme);
settings.setValue("showNewDialogBox", ui->m_showNewDialog);
settings.setValue("autoSaveInterval", ui->m_autoSaveInterval);
settings.setValue("defaultUnits", ui->m_defaultUnits);
settings.setValue("bgColor1", (int)vs.m_col1);
settings.setValue("bgColor2", (int)vs.m_col2);
settings.setValue("fgColor", (int)vs.m_fgcol);
settings.setValue("meshColor", (int)vs.m_mcol);
settings.setValue("bgStyle", vs.m_nbgstyle);
settings.setValue("lighting", vs.m_bLighting);
settings.setValue("shadows", vs.m_bShadows);
settings.setValue("multiViewProjection", vs.m_nconv);
settings.setValue("showMaterialFibers", vs.m_bfiber);
settings.setValue("showMaterialAxes", vs.m_blma);
settings.setValue("fiberScaleFactor", vs.m_fiber_scale);
settings.setValue("showFibersOnHiddenParts", vs.m_showHiddenFibers);
QRect rt;
rt = CCurveEditor::preferredSize(); if (rt.isValid()) settings.setValue("curveEditorSize", rt);
rt = CGraphWindow::preferredSize(); if (rt.isValid()) settings.setValue("graphWindowSize", rt);
settings.endGroup();
settings.beginGroup("PostSettings");
settings.setValue("defaultMap", Post::ColorMapManager::GetDefaultMap());
settings.endGroup();
settings.beginGroup("FolderSettings");
settings.setValue("currentPath", ui->currentPath);
settings.setValue("defaultProjectFolder", ui->m_defaultProjectParent);
settings.setValue("repositoryFolder", ui->databasePanel->GetRepositoryFolder());
settings.setValue("repoMessageTime", ui->databasePanel->GetLastMessageTime());
settings.setValue("recentFiles", ui->m_recentFiles);
settings.setValue("recentGeomFiles", ui->m_recentGeomFiles);
settings.setValue("recentProjects", ui->m_recentProjects);
settings.endGroup();
if(!ui->m_updateWidget.UUID.isEmpty())
{
settings.setValue("UUID", ui->m_updateWidget.UUID);
}
settings.beginGroup("LaunchConfigurations");
// Create and save a list of launch config names
QStringList launch_config_names;
for(CLaunchConfig conf : ui->m_launch_configs)
{
launch_config_names.append(QString::fromStdString(conf.name));
}
settings.setValue("launchConfigNames", launch_config_names);
// Save launch configs
for(int i = 0; i < launch_config_names.count(); i++)
{
QString configName = "launchConfigs/" + launch_config_names[i];
settings.setValue(configName + "/type", ui->m_launch_configs[i].type);
settings.setValue(configName + "/path", ui->m_launch_configs[i].path.c_str());
settings.setValue(configName + "/server", ui->m_launch_configs[i].server.c_str());
settings.setValue(configName + "/port", ui->m_launch_configs[i].port);
settings.setValue(configName + "/userName", ui->m_launch_configs[i].userName.c_str());
settings.setValue(configName + "/remoteDir", ui->m_launch_configs[i].remoteDir.c_str());
settings.setValue(configName + "/customFile", ui->m_launch_configs[i].customFile.c_str());
settings.setValue(configName + "/text", ui->m_launch_configs[i].getText().c_str());
}
settings.endGroup();
}
void CMainWindow::readThemeSetting()
{
QSettings settings("MRLSoftware", "FEBio Studio");
settings.beginGroup("MainWindow");
ui->m_theme = settings.value("theme", 0).toInt();
settings.endGroup();
}
void CMainWindow::readSettings()
{
VIEW_SETTINGS& vs = GetGLView()->GetViewSettings();
QSettings settings("MRLSoftware", "FEBio Studio");
QString versionString = settings.value("version", "").toString();
settings.beginGroup("MainWindow");
restoreGeometry(settings.value("geometry").toByteArray());
restoreState(settings.value("state").toByteArray());
ui->m_theme = settings.value("theme", 0).toInt();
ui->m_showNewDialog = settings.value("showNewDialogBox", true).toBool();
ui->m_autoSaveInterval = settings.value("autoSaveInterval", 600).toInt();
ui->m_defaultUnits = settings.value("defaultUnits", 0).toInt();
vs.m_col1 = GLColor(settings.value("bgColor1", (int)vs.m_col1).toInt());
vs.m_col2 = GLColor(settings.value("bgColor2", (int)vs.m_col2).toInt());
vs.m_fgcol = GLColor(settings.value("fgColor", (int)vs.m_fgcol).toInt());
vs.m_mcol = GLColor(settings.value("meshColor", (int)vs.m_mcol).toInt());
vs.m_nbgstyle = settings.value("bgStyle", vs.m_nbgstyle).toInt();
vs.m_bLighting = settings.value("lighting", vs.m_bLighting).toBool();
vs.m_bShadows = settings.value("shadows", vs.m_bShadows).toBool();
vs.m_nconv = settings.value("multiViewProjection", 0).toInt();
vs.m_bfiber = settings.value("showMaterialFibers", vs.m_bfiber).toBool();
vs.m_blma = settings.value("showMaterialAxes", vs.m_blma).toBool();
vs.m_fiber_scale = settings.value("fiberScaleFactor", vs.m_fiber_scale).toDouble();
vs.m_showHiddenFibers = settings.value("showFibersOnHiddenParts", vs.m_showHiddenFibers).toBool();
Units::SetUnitSystem(ui->m_defaultUnits);
QRect rt;
rt = settings.value("curveEditorSize", QRect()).toRect();
if (rt.isValid()) CCurveEditor::setPreferredSize(rt);
rt = settings.value("graphWindowSize", QRect()).toRect();
if (rt.isValid()) CGraphWindow::setPreferredSize(rt);
settings.endGroup();
settings.beginGroup("PostSettings");
Post::ColorMapManager::SetDefaultMap(settings.value("defaultMap", Post::ColorMapManager::JET).toInt());
settings.endGroup();
settings.beginGroup("FolderSettings");
ui->currentPath = settings.value("currentPath", QDir::homePath()).toString();
ui->m_defaultProjectParent = settings.value("defaultProjectFolder", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString();
QString repositoryFolder = settings.value("repositoryFolder").toString();
ui->databasePanel->SetRepositoryFolder(repositoryFolder);
qint64 lastMessageTime = settings.value("repoMessageTime", -1).toLongLong();
ui->databasePanel->SetLastMessageTime(lastMessageTime);
QStringList recentFiles = settings.value("recentFiles").toStringList(); ui->setRecentFiles(recentFiles);
QStringList recentGeomFiles = settings.value("recentGeomFiles").toStringList(); ui->setRecentGeomFiles(recentGeomFiles);
QStringList recentProjects = settings.value("recentProjects").toStringList(); ui->setRecentProjects(recentProjects);
settings.endGroup();
settings.beginGroup("LaunchConfigurations");
QStringList launch_config_names;
launch_config_names = settings.value("launchConfigNames", launch_config_names).toStringList();
// Overwrite the default if they have launch configurations saved.
if(launch_config_names.count() > 0)
{
ui->m_launch_configs.clear();
}
for(QString conf : launch_config_names)
{
QString configName = "launchConfigs/" + conf;
ui->m_launch_configs.push_back(CLaunchConfig());
ui->m_launch_configs.back().name = conf.toStdString();
ui->m_launch_configs.back().type = settings.value(configName + "/type").toInt();
ui->m_launch_configs.back().path = settings.value(configName + "/path").toString().toStdString();
ui->m_launch_configs.back().server = settings.value(configName + "/server").toString().toStdString();
ui->m_launch_configs.back().port = settings.value(configName + "/port").toInt();
ui->m_launch_configs.back().userName = settings.value(configName + "/userName").toString().toStdString();
ui->m_launch_configs.back().remoteDir = settings.value(configName + "/remoteDir").toString().toStdString();
ui->m_launch_configs.back().customFile = settings.value(configName + "/customFile").toString().toStdString();
ui->m_launch_configs.back().setText(settings.value(configName + "/text").toString().toStdString());
}
settings.endGroup();
// This is to fix an issue with the 1.0 installers where the location of the
// FEBio executable was changed.
if (versionString.isEmpty())
{
#ifdef WIN32
if (ui->m_launch_configs.size() > 0)
{
ui->m_launch_configs[0].path = std::string("$(FEBioDir)\\febio3.exe");
}
#endif
}
// Read UUID. Generate if not present.
QString UUID = settings.value("UUID").toString();
if(UUID.isEmpty())
{
UUID = QUuid::createUuid().toString();
}
ui->m_updateWidget.UUID = UUID;
}
//-----------------------------------------------------------------------------
void CMainWindow::UpdateUI()
{
/* m_pToolbar->Update();
m_pCmdWnd->Update();
if (m_pCurveEdit->visible()) m_pCurveEdit->Update();
*/
ui->glw->glc->Update();
RedrawGL();
}
//-----------------------------------------------------------------------------
void CMainWindow::UpdateToolbar()
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (doc->IsValid() == false) return;
VIEW_SETTINGS& view = GetGLView()->GetViewSettings();
if (view.m_bfiber != ui->actionShowFibers->isChecked()) ui->actionShowFibers->trigger();
if (view.m_blma != ui->actionShowMatAxes->isChecked()) ui->actionShowMatAxes->trigger();
if (view.m_bmesh != ui->actionShowMeshLines->isChecked()) ui->actionShowMeshLines->trigger();
if (view.m_bgrid != ui->actionShowGrid->isChecked()) ui->actionShowGrid->trigger();
CGView& gv = *doc->GetView();
if (gv.m_bortho != ui->actionOrtho->isChecked()) ui->actionOrtho->trigger();
if (ui->buildToolBar->isVisible())
{
ui->SetSelectionMode(doc->GetSelectionMode());
}
}
//-----------------------------------------------------------------------------
void CMainWindow::OpenInCurveEditor(FSObject* po)
{
// OnToolsCurveEditor(0, 0);
// m_pCurveEdit->Select(po);
}
//-----------------------------------------------------------------------------
void CMainWindow::ShowInModelViewer(FSObject* po)
{
ui->modelViewer->parentWidget()->raise();
ui->modelViewer->Select(po);
ui->modelViewer->UpdateObject(po);
}
//-----------------------------------------------------------------------------
//! set the selection mode
void CMainWindow::SetSelectionMode(int nselect)
{
ui->SetSelectionMode(nselect);
}
//-----------------------------------------------------------------------------
//! set item selection mode
void CMainWindow::SetItemSelectionMode(int nselect, int nitem)
{
CGLDocument* doc = dynamic_cast<CGLDocument*>(GetDocument());
if (doc == nullptr) return;
doc->SetSelectionMode(nselect);
if (nselect == SELECT_OBJECT) doc->SetItemMode(nitem);
UpdateToolbar();
UpdateGLControlBar();
RedrawGL();
}
//-----------------------------------------------------------------------------
//! Updates the model editor and selects object po.
//! \param po pointer to object that will be selected in the model editor
void CMainWindow::UpdateModel(FSObject* po, bool bupdate)
{
if (ui->modelViewer && GetModelDocument())
{
if (bupdate)
{
ui->modelViewer->Update();
if (po)
{
// ui->showModelViewer();
ui->modelViewer->Select(po);
}
}
else ui->modelViewer->UpdateObject(po);
}
else if (ui->postPanel && GetPostDocument())
{
ui->postPanel->Update(bupdate);
if (po) ui->postPanel->SelectObject(po);
}
}
//-----------------------------------------------------------------------------
//! Updates the GLView control bar
void CMainWindow::UpdateGLControlBar()
{
ui->glw->glc->Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::UpdateUIConfig()
{
CPostDocument* postDoc = GetPostDocument();
if (postDoc == nullptr)
{
Update(0, true);
CModelDocument* modelDoc = GetModelDocument();
if (modelDoc)
{
// Build Mode
ui->setUIConfig(1);
ui->modelViewer->parentWidget()->raise();
RedrawGL();
}
else
{
CTextDocument* txtDoc = dynamic_cast<CTextDocument*>(GetDocument());
if (txtDoc)
{
txtDoc->Activate();
if (txtDoc->GetFormat() == CTextDocument::FORMAT_HTML)
{
ui->htmlViewer->setDocument(txtDoc->GetText());
ui->setUIConfig(CMainWindow::HTML_CONFIG);
}
else
{
ui->xmlEdit->blockSignals(true);
ui->xmlEdit->SetDocument(txtDoc->GetText());
ui->xmlEdit->blockSignals(false);
ui->setUIConfig(CMainWindow::TEXT_CONFIG);
}
}
else
{
ui->setUIConfig(0);
}
ui->fileViewer->parentWidget()->raise();
}
return;
}
else
{
// Post Mode
ui->setUIConfig(2);
UpdatePostPanel();
if (postDoc->IsValid()) ui->postToolBar->Update();
else ui->postToolBar->setDisabled(true);
if (ui->timePanel && ui->timePanel->isVisible()) ui->timePanel->Update(true);
ui->postPanel->parentWidget()->raise();
RedrawGL();
}
UpdateToolbar();
}
//-----------------------------------------------------------------------------
//! Update the post tool bar
void CMainWindow::UpdatePostToolbar()
{
if (ui->postToolBar->isVisible())
ui->postToolBar->Update();
}
//-----------------------------------------------------------------------------
//! set the post doc that will be rendered in the GL view
void CMainWindow::SetActiveDocument(CDocument* doc)
{
int view = ui->tab->findView(doc);
if (view == -1)
{
AddView(doc->GetDocTitle(), doc);
}
else
{
SetActiveView(view);
}
CGLDocument* gldoc = dynamic_cast<CGLDocument*>(doc);
if (gldoc) Units::SetUnitSystem(gldoc->GetUnitSystem());
}
//-----------------------------------------------------------------
int CMainWindow::Views()
{
return ui->tab->views();
}
//-----------------------------------------------------------------
void CMainWindow::SetActiveView(int n)
{
ui->tab->setActiveView(n);
GetGLView()->UpdateWidgets(false);
UpdateUIConfig();
}
//-----------------------------------------------------------------
int CMainWindow::FindView(CDocument* doc)
{
return ui->tab->findView(doc);
}
//-----------------------------------------------------------------------------
GObject* CMainWindow::GetActiveObject()
{
CGLDocument* doc = GetGLDocument();
if (doc) return doc->GetActiveObject();
return nullptr;
}
//-----------------------------------------------------------------
void CMainWindow::AddView(const std::string& viewName, CDocument* doc, bool makeActive)
{
string docIcon = doc->GetIcon();
ui->tab->addView(viewName, doc, makeActive, docIcon);
CGLView* glview = GetGLView();
glview->ZoomExtents(false);
glview->UpdateWidgets(false);
}
//-----------------------------------------------------------------------------
void CMainWindow::on_tab_currentChanged(int n)
{
CDocument* newDoc = GetDocument();
CDocument::SetActiveDocument(newDoc);
if (ui->planeCutTool && ui->planeCutTool->isVisible()) ui->planeCutTool->close();
GetGLView()->ClearCommandStack();
UpdateUIConfig();
UpdateGLControlBar();
UpdateToolbar();
ui->updateMeshInspector();
RedrawGL();
if (n == 0) ui->modelViewer->parentWidget()->raise();
else ui->postPanel->parentWidget()->raise();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_tab_tabCloseRequested(int n)
{
CloseView(n);
ui->fileViewer->Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::OnPostObjectStateChanged()
{
Post::CGLModel* mdl = GetCurrentModel();
if (mdl == nullptr) return;
bool b = mdl->GetColorMap()->IsActive();
ui->postToolBar->CheckColorMap(b);
RedrawGL();
}
//-----------------------------------------------------------------------------
void CMainWindow::OnPostObjectPropsChanged(FSObject* po)
{
Post::CGLModel* mdl = GetCurrentModel();
if (mdl == nullptr) return;
Post::CGLColorMap* colorMap = dynamic_cast<Post::CGLColorMap*>(po);
if (colorMap)
{
int dataField = mdl->GetColorMap()->GetEvalField();
ui->postToolBar->SetDataField(dataField);
}
RedrawGL();
}
//-----------------------------------------------------------------------------
void CMainWindow::CloseView(int n, bool forceClose)
{
CDocument* doc = ui->tab->getDocument(n);
// make sure this doc has no active jobs running.
CFEBioJob* activeJob = CFEBioJob::GetActiveJob();
if (activeJob && (activeJob->GetDocument() == doc))
{
QMessageBox::warning(this, "FEBio Studio", "This model has an active job running and cannot be closed.\n");
return;
}
if (doc->IsModified() && (forceClose == false))
{
if (maybeSave(doc) == false) return;
}
// close any graph windows that use this document
QList<::CGraphWindow*>::iterator it;
for (it = ui->graphList.begin(); it != ui->graphList.end();)
{
CGraphWindow* w = *it;
CModelGraphWindow* mgw = dynamic_cast<CModelGraphWindow*>(w);
if (mgw)
{
CDocument* pd = mgw->GetDocument();
if (pd == doc)
{
RemoveGraph(w);
delete w;
it = ui->graphList.begin();
}
else it++;
}
else it++;
}
ui->htmlViewer->setDocument(nullptr);
ui->xmlEdit->setDocument(nullptr);
// now, remove from the doc manager
m_DocManager->RemoveDocument(n);
// close the view and update UI
ui->tab->closeView(n);
UpdateUIConfig();
}
//-----------------------------------------------------------------------------
void CMainWindow::CloseView(CDocument* doc)
{
int n = FindView(doc);
if (n >= 0) CloseView(n);
}
//-----------------------------------------------------------------------------
//! Update the post panel
void CMainWindow::UpdatePostPanel(bool braise, Post::CGLObject* po)
{
ui->postPanel->Reset();
if (braise) ui->postPanel->parentWidget()->raise();
ui->postPanel->SelectObject(po);
}
//-----------------------------------------------------------------------------
void CMainWindow::RedrawGL()
{
CGLView* view = GetGLView();
if (view->ShowPlaneCut()) view->UpdatePlaneCut(true);
view->repaint();
}
//-----------------------------------------------------------------------------
//! Zoom to an FSObject
void CMainWindow::ZoomTo(const BOX& box)
{
GetGLView()->ZoomTo(box);
}
//-----------------------------------------------------------------------------
void CMainWindow::on_actionSelectObjects_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionMode(SELECT_OBJECT);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_actionSelectParts_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionMode(SELECT_PART);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_actionSelectSurfaces_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionMode(SELECT_FACE);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_actionSelectCurves_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionMode(SELECT_EDGE);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_actionSelectNodes_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionMode(SELECT_NODE);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_actionSelectDiscrete_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionMode(SELECT_DISCRETE);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_selectRect_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionStyle(REGION_SELECT_BOX);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_selectCircle_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionStyle(REGION_SELECT_CIRCLE);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_selectFree_toggled(bool b)
{
CGLDocument* doc = GetGLDocument();
if (doc == nullptr) return;
if (b) doc->SetSelectionStyle(REGION_SELECT_FREE);
Update();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_postSelectRect_toggled(bool b) { on_selectRect_toggled(b); }
void CMainWindow::on_postSelectCircle_toggled(bool b) { on_selectCircle_toggled(b); }
void CMainWindow::on_postSelectFree_toggled(bool b) { on_selectFree_toggled(b); }
void CMainWindow::on_postActionMeasureTool_triggered() { on_actionMeasureTool_triggered(); }
//-----------------------------------------------------------------------------
void CMainWindow::StopAnimation()
{
ui->stopAnimation();
}
//-----------------------------------------------------------------------------
// show the log panel
void CMainWindow::ShowLogPanel()
{
ui->logPanel->parentWidget()->raise();
ui->logPanel->parentWidget()->show();
}
//-----------------------------------------------------------------------------
// add to the log
void CMainWindow::AddLogEntry(const QString& txt)
{
ui->logPanel->AddText(txt);
}
//-----------------------------------------------------------------------------
// add to the output window
void CMainWindow::AddOutputEntry(const QString& txt)
{
ui->logPanel->AddText(txt, 1);
}
//-----------------------------------------------------------------------------
// clear the log
void CMainWindow::ClearLog()
{
ui->logPanel->ClearLog();
}
//-----------------------------------------------------------------------------
// clear the output window
void CMainWindow::ClearOutput()
{
ui->logPanel->ClearOutput();
}
//-----------------------------------------------------------------------------
void CMainWindow::on_glview_pointPicked(const vec3d& r)
{
GetCreatePanel()->setInput(r);
}
//-----------------------------------------------------------------------------
void CMainWindow::on_glview_selectionChanged()
{
}
//-----------------------------------------------------------------------------
void CMainWindow::SetStatusMessage(const QString& message)
{
ui->statusBar->showMessage(message);
}
//-----------------------------------------------------------------------------
void CMainWindow::ClearStatusMessage()
{
ui->statusBar->clearMessage();
}
//-----------------------------------------------------------------------------
void CMainWindow::BuildContextMenu(QMenu& menu)
{
menu.addAction(ui->actionZoomSelect);
menu.addAction(ui->actionShowGrid);
menu.addAction(ui->actionShowMeshLines);
menu.addAction(ui->actionShowEdgeLines);
menu.addAction(ui->actionOrtho);
menu.addSeparator();
QMenu* view = new QMenu("Standard views");
view->addAction(ui->actionFront);
view->addAction(ui->actionBack);
view->addAction(ui->actionLeft);
view->addAction(ui->actionRight);
view->addAction(ui->actionTop);
view->addAction(ui->actionBottom);
view->addAction(ui->actionIsometric);
menu.addAction(view->menuAction());
menu.addSeparator();
menu.addAction(ui->actionRenderMode);
CPostDocument* postDoc = GetPostDocument();
if (postDoc == nullptr)
{
menu.addAction(ui->actionShowNormals);
menu.addAction(ui->actionShowFibers);
menu.addAction(ui->actionShowMatAxes);
menu.addAction(ui->actionShowDiscrete);
menu.addSeparator();
// NOTE: Make sure the texts match the texts in OnSelectObjectTransparencyMode
VIEW_SETTINGS& vs = GetGLView()->GetViewSettings();
QMenu* display = new QMenu("Object transparency mode");
QAction* a;
a = display->addAction("None"); a->setCheckable(true); if (vs.m_transparencyMode == 0) a->setChecked(true);
a = display->addAction("Selected only"); a->setCheckable(true); if (vs.m_transparencyMode == 1) a->setChecked(true);
a = display->addAction("Unselected only"); a->setCheckable(true); if (vs.m_transparencyMode == 2) a->setChecked(true);
QObject::connect(display, SIGNAL(triggered(QAction*)), this, SLOT(OnSelectObjectTransparencyMode(QAction*)));
menu.addAction(display->menuAction());
menu.addSeparator();
CModelDocument* doc = GetModelDocument();
if (doc)
{
GModel* gm = doc->GetGModel();
int layers = gm->MeshLayers();
if (layers > 1)
{
QMenu* sub = new QMenu("Set Active Mesh Layer");
int activeLayer = gm->GetActiveMeshLayer();
for (int i = 0; i < layers; ++i)
{
string s = gm->GetMeshLayerName(i);
QAction* a = sub->addAction(QString::fromStdString(s));
a->setCheckable(true);
if (i == activeLayer) a->setChecked(true);
}
QObject::connect(sub, SIGNAL(triggered(QAction*)), this, SLOT(OnSelectMeshLayer(QAction*)));
menu.addAction(sub->menuAction());
menu.addSeparator();
}
}
}
menu.addAction(ui->actionOptions);
}
//-----------------------------------------------------------------------------
void CMainWindow::OnSelectMeshLayer(QAction* ac)
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
GModel* gm = doc->GetGModel();
string s = ac->text().toStdString();
int layer = gm->FindMeshLayer(s); assert(layer >= 0);
if (layer != gm->GetActiveMeshLayer())
{
// since objects may not have meshes in the new layer, we make sure we are
// in object selection mode
if (doc->GetItemMode() != ITEM_MESH)
{
doc->SetItemMode(ITEM_MESH);
UpdateGLControlBar();
}
// change the mesh layer
doc->DoCommand(new CCmdSetActiveMeshLayer(gm, layer));
UpdateModel();
UpdateGLControlBar();
ui->buildPanel->Update(true);
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::OnSelectObjectTransparencyMode(QAction* ac)
{
VIEW_SETTINGS& vs = GetGLView()->GetViewSettings();
if (ac->text() == "None" ) vs.m_transparencyMode = 0;
else if (ac->text() == "Selected only" ) vs.m_transparencyMode = 1;
else if (ac->text() == "Unselected only") vs.m_transparencyMode = 2;
RedrawGL();
}
//-----------------------------------------------------------------------------
// Update the physics menu based on active modules
void CMainWindow::UpdatePhysicsUi()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
FEProject& prj = doc->GetProject();
int module = prj.GetModule();
ui->actionAddRigidConstraint->setVisible(module & MODULE_MECH);
ui->actionAddRigidConnector->setVisible(module & MODULE_MECH);
ui->actionSoluteTable->setVisible(module & MODULE_SOLUTES);
ui->actionSBMTable->setVisible(module & MODULE_SOLUTES);
ui->actionAddReaction->setVisible(module & MODULE_REACTIONS);
ui->actionAddMembraneReaction->setVisible(module & MODULE_REACTIONS);
}
//-----------------------------------------------------------------------------
void CMainWindow::onExportAllMaterials()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
FEModel& fem = *doc->GetFEModel();
vector<GMaterial*> matList;
for (int i=0; i<fem.Materials(); ++i)
{
matList.push_back(fem.GetMaterial(i));
}
onExportMaterials(matList);
}
//-----------------------------------------------------------------------------
void CMainWindow::onExportMaterials(const vector<GMaterial*>& matList)
{
if (matList.size() == 0)
{
QMessageBox::information(this, "Export Materials", "This project does not contain any materials");
return;
}
QString fileName = QFileDialog::getSaveFileName(this, "Export Materials", "", "FEBio Studio Materials (*.pvm)");
if (fileName.isEmpty() == false)
{
CModelDocument* doc = GetModelDocument();
if (doc && (doc->ExportMaterials(fileName.toStdString(), matList) == false))
{
QMessageBox::critical(this, "Export Materials", "Failed exporting materials");
}
}
}
//-----------------------------------------------------------------------------
void CMainWindow::onImportMaterials()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Materials", "", "FEBio Studio Materials (*.pvm)");
if (fileNames.isEmpty() == false)
{
for (int i=0; i<fileNames.size(); ++i)
{
QString file = fileNames.at(i);
if (doc->ImportMaterials(file.toStdString()) == false)
{
QString msg = QString("Failed importing materials from\n%1").arg(file);
QMessageBox::critical(this, "Import Materials", msg);
}
}
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::onImportMaterialsFromModel(CModelDocument* srcDoc)
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if ((doc == nullptr) || (doc == srcDoc) || (srcDoc == nullptr)) return;
FEModel* fem = srcDoc->GetFEModel();
if (fem->Materials() == 0)
{
QMessageBox::information(this, "Import Materials", "The selected source file does not contain any materials.");
return;
}
QStringList items;
for (int i = 0; i < fem->Materials(); ++i)
{
GMaterial* gm = fem->GetMaterial(i);
items.push_back(gm->GetFullName());
}
QInputDialog input;
input.setOption(QInputDialog::UseListViewForComboBoxItems);
input.setLabelText("Select material:");
input.setComboBoxItems(items);
if (input.exec())
{
QString item = input.textValue();
for (int i = 0; i < fem->Materials(); ++i)
{
GMaterial* gm = fem->GetMaterial(i);
QString name = gm->GetFullName();
if (name == item)
{
GMaterial* newMat = gm->Clone();
doc->DoCommand(new CCmdAddMaterial(doc->GetFEModel(), newMat));
UpdateModel(newMat);
return;
}
}
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllMaterials()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all materials?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllMaterials();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllBC()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all boundary conditions?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllBC();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllLoads()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all loads?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllLoads();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllIC()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all initial conditions?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllIC();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllContact()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all contact interfaces?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllContact();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllConstraints()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all constraints?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllConstraints();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllRigidConstraints()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all rigid constraints?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllRigidConstraints();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllRigidConnectors()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
if (QMessageBox::question(this, "FEBio Studio", "Are you sure you want to delete all rigid connectors?\nThis cannot be undone.", QMessageBox::Ok | QMessageBox::Cancel))
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllRigidConnectors();
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllSteps()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
QString txt("Are you sure you want to delete all steps?\nThis will also delete all boundary conditions, etc., associated with the steps.\nThis cannot be undone.");
if (QMessageBox::question(this, "FEBio Studio", txt, QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok)
{
FEModel& fem = *doc->GetFEModel();
fem.DeleteAllSteps();
doc->SetModifiedFlag(true);
UpdateTab(doc);
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::DeleteAllJobs()
{
CModelDocument* doc = dynamic_cast<CModelDocument*>(GetDocument());
if (doc == nullptr) return;
QString txt("Are you sure you want to delete all jobs?\nThis cannot be undone.");
if (QMessageBox::question(this, "FEBio Studio", txt, QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok)
{
doc->DeleteAllJobs();
doc->SetModifiedFlag(true);
UpdateTab(doc);
UpdateModel();
RedrawGL();
}
}
//-----------------------------------------------------------------------------
void CMainWindow::ClearRecentProjectsList()
{
ui->m_recentFiles.clear();
}
void CMainWindow::OnCameraChanged()
{
if (ui->postPanel->isVisible())
{
ui->postPanel->OnViewChanged();
}
}
// remove a graph from the list
void CMainWindow::RemoveGraph(::CGraphWindow* graph)
{
ui->graphList.removeOne(graph);
}
// Add a graph to the list of managed graph windows
void CMainWindow::AddGraph(CGraphWindow* graph)
{
ui->graphList.push_back(graph);
}
void CMainWindow::on_fontStyle_currentFontChanged(const QFont& font)
{
GLWidget* pw = GLWidget::get_focus();
if (pw)
{
QFont old_font = pw->get_font();
std::string s = font.family().toStdString();
QFont new_font(font.family(), old_font.pointSize());
new_font.setBold(old_font.bold());
new_font.setItalic(old_font.italic());
pw->set_font(new_font);
RedrawGL();
}
}
void CMainWindow::on_fontSize_valueChanged(int i)
{
GLWidget* pw = GLWidget::get_focus();
if (pw)
{
QFont font = pw->get_font();
font.setPointSize(i);
pw->set_font(font);
RedrawGL();
}
}
void CMainWindow::on_fontBold_toggled(bool checked)
{
GLWidget* pw = GLWidget::get_focus();
if (pw)
{
QFont font = pw->get_font();
font.setBold(checked);
pw->set_font(font);
RedrawGL();
}
}
void CMainWindow::on_fontItalic_toggled(bool bchecked)
{
GLWidget* pw = GLWidget::get_focus();
if (pw)
{
QFont font = pw->get_font();
font.setItalic(bchecked);
pw->set_font(font);
RedrawGL();
}
}
void CMainWindow::on_actionProperties_triggered()
{
// get the selected widget
GLWidget* pglw = GLWidget::get_focus();
if (pglw == 0) return;
// edit the properties
if (dynamic_cast<GLBox*>(pglw))
{
CDlgBoxProps dlg(pglw, this);
dlg.exec();
}
else if (dynamic_cast<GLLegendBar*>(pglw))
{
CDlgLegendProps dlg(pglw, this);
dlg.exec();
}
else if (dynamic_cast<GLTriad*>(pglw))
{
CDlgTriadProps dlg(pglw, this);
dlg.exec();
}
else if (dynamic_cast<GLSafeFrame*>(pglw))
{
CDlgCaptureFrameProps dlg(pglw, this);
dlg.exec();
}
else
{
QMessageBox::information(this, "Properties", "No properties available");
}
UpdateFontToolbar();
RedrawGL();
}
void CMainWindow::UpdateFontToolbar()
{
GLWidget* pw = GLWidget::get_focus();
if (pw)
{
QFont font = pw->get_font();
ui->pFontStyle->setCurrentFont(font);
ui->pFontSize->setValue(font.pointSize());
ui->actionFontBold->setChecked(font.bold());
ui->actionFontItalic->setChecked(font.italic());
ui->pFontToolBar->setEnabled(true);
}
else ui->pFontToolBar->setDisabled(true);
}
bool CMainWindow::DoModelCheck(CModelDocument* doc)
{
if (doc == nullptr) return false;
vector<MODEL_ERROR> warnings = doc->CheckModel();
if (warnings.empty() == false)
{
CDlgCheck dlg(this);
dlg.SetWarnings(warnings);
if (dlg.exec() == 0)
{
return false;
}
}
return true;
}
bool CMainWindow::ExportFEBioFile(CModelDocument* doc, const std::string& febFile, int febioFileVersion)
{
// try to save the file first
AddLogEntry(QString("Saving to %1 ...").arg(QString::fromStdString(febFile)));
bool ret = false;
string err;
try {
if (febioFileVersion == 0)
{
FEBioExport25 feb(doc->GetProject());
feb.SetExportSelectionsFlag(true);
ret = feb.Write(febFile.c_str());
if (ret == false) err = feb.GetErrorMessage();
}
else if (febioFileVersion == 1)
{
FEBioExport3 feb(doc->GetProject());
feb.SetExportSelectionsFlag(true);
ret = feb.Write(febFile.c_str());
if (ret == false) err = feb.GetErrorMessage();
}
else
{
assert(false);
}
}
catch (...)
{
err = "Unknown exception detected.";
ret = false;
}
if (ret == false)
{
QString msg = QString("Failed saving FEBio file:\n%1").arg(QString::fromStdString(err));
QMessageBox::critical(this, "Run FEBio", msg);
AddLogEntry("FAILED\n");
}
else AddLogEntry("SUCCESS!\n");
return ret;
}
void CMainWindow::RunFEBioJob(CFEBioJob* job)
{
// see if we already have a job running.
if (CFEBioJob::GetActiveJob())
{
QMessageBox::critical(this, "FEBio Studio", "Cannot start job since a job is already running");
return;
}
QString cmd = QString::fromStdString(job->m_cmd);
// get the FEBio job file path
string febFile = job->GetFEBFileName();
// clear output for next job
ClearOutput();
ShowLogPanel();
// extract the working directory and file title from the file path
QFileInfo fileInfo(QString::fromStdString(febFile));
QString workingDir = fileInfo.absolutePath();
QString fileName = fileInfo.fileName();
// set this as the active job
CFEBioJob::SetActiveJob(job);
UpdateTab(job->GetDocument());
if(job->GetLaunchConfig()->type == LOCAL)
{
// create new process
ui->m_process = new QProcess(this);
ui->m_process->setProcessChannelMode(QProcess::MergedChannels);
if (workingDir.isEmpty() == false)
{
AddLogEntry(QString("Setting current working directory to: %1\n").arg(workingDir));
ui->m_process->setWorkingDirectory(workingDir);
}
QString program = QString::fromStdString(job->GetLaunchConfig()->path);
// do string substitution
string sprogram = program.toStdString();
sprogram = FSDir::expandMacros(sprogram);
program = QString::fromStdString(sprogram);
// extract the arguments
QStringList args = cmd.split(" ", Qt::SkipEmptyParts);
std::string configFile = job->GetConfigFileName();
args.replaceInStrings("$(Filename)", fileName);
args.replaceInStrings("$(ConfigFile)", QString::fromStdString(configFile));
// get ready
AddLogEntry(QString("Starting FEBio: %1\n").arg(args.join(" ")));
QObject::connect(ui->m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(onRunFinished(int, QProcess::ExitStatus)));
QObject::connect(ui->m_process, SIGNAL(readyRead()), this, SLOT(onReadyRead()));
QObject::connect(ui->m_process, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(onErrorOccurred(QProcess::ProcessError)));
// don't forget to reset the kill flag
ui->m_bkillProcess = false;
// go!
job->SetStatus(CFEBioJob::RUNNING);
UpdateModel(job, false);
ui->m_process->start(program, args);
// show the output window
ui->logPanel->parentWidget()->raise();
ui->logPanel->ShowOutput();
}
else
{
#ifdef HAS_SSH
CSSHHandler* handler = job->GetSSHHandler();
if(!handler->IsBusy())
{
handler->SetTargetFunction(STARTREMOTEJOB);
CSSHThread* sshThread = new CSSHThread(handler, STARTSSHSESSION);
QObject::connect(sshThread, &CSSHThread::FinishedPart, this, &CMainWindow::NextSSHFunction);
sshThread->start();
}
// show the output window
ui->logPanel->parentWidget()->raise();
ui->logPanel->ShowOutput();
CFEBioJob::SetActiveJob(nullptr);
#endif
}
}
void CMainWindow::NextSSHFunction(CSSHHandler* sshHandler)
{
#ifdef HAS_SSH
if(!HandleSSHMessage(sshHandler))
{
sshHandler->EndSSHSession();
return;
}
CSSHThread* sshThread = new CSSHThread(sshHandler, sshHandler->GetNextFunction());
QObject::connect(sshThread, &CSSHThread::FinishedPart, this, &CMainWindow::NextSSHFunction);
sshThread->start();
#endif// HAS_SSH
}
bool CMainWindow::HandleSSHMessage(CSSHHandler* sshHandler)
{
#ifdef HAS_SSH
QString QPasswd;
QMessageBox::StandardButton reply;
switch(sshHandler->GetMsgCode())
{
case FAILED:
QMessageBox::critical(this, "FEBio Studio", sshHandler->GetMessage());
return false;
case NEEDSPSWD:
bool ok;
QPasswd = QInputDialog::getText(NULL, "Password", sshHandler->GetMessage(), QLineEdit::Password, "", &ok);
if(ok)
{
std::string password = QPasswd.toStdString();
sshHandler->SetPasswordLength(password.length());
sshHandler->SetPasswdEnc(CEncrypter::Instance()->Encrypt(password));
}
else
{
return false;
}
break;
case YESNODIALOG:
reply = QMessageBox::question(this, "FEBio Studio", sshHandler->GetMessage(),
QMessageBox::Yes|QMessageBox::No);
return reply == QMessageBox::Yes;
case DONE:
return false;
}
return true;
#else
return false;
#endif // HAS_SSH
}
void CMainWindow::ShowProgress(bool show, QString message)
{
if(show)
{
ui->statusBar->showMessage(message);
ui->statusBar->addPermanentWidget(ui->fileProgress);
ui->fileProgress->show();
}
else
{
ui->statusBar->clearMessage();
ui->statusBar->removeWidget(ui->fileProgress);
}
}
void CMainWindow::ShowIndeterminateProgress(bool show, QString message)
{
if(show)
{
ui->statusBar->showMessage(message);
ui->statusBar->addPermanentWidget(ui->indeterminateProgress);
ui->indeterminateProgress->show();
}
else
{
ui->statusBar->clearMessage();
ui->statusBar->removeWidget(ui->indeterminateProgress);
}
}
void CMainWindow::UpdateProgress(int n)
{
ui->fileProgress->setValue(n);
}
void CMainWindow::on_modelViewer_currentObjectChanged(FSObject* po)
{
ui->infoPanel->SetObject(po);
}
void CMainWindow::toggleOrtho()
{
ui->actionOrtho->trigger();
}
QStringList CMainWindow::GetRecentFileList()
{
return ui->m_recentFiles;
}
QStringList CMainWindow::GetRecentProjectsList()
{
return ui->m_recentProjects;
}
QString CMainWindow::ProjectFolder()
{
return "";// m_projectFolder;
}
QString CMainWindow::ProjectName()
{
QString projectFile = ui->m_project.GetProjectFileName();
if (projectFile.isEmpty()) return "";
QFileInfo fi(projectFile);
return fi.fileName();
}
void CMainWindow::ShowWelcomePage()
{
int n = ui->tab->findView("Welcome");
if (n == -1)
{
AddDocument(new CWelcomePage(this));
}
else SetActiveView(n);
}
void CMainWindow::CloseWelcomePage()
{
int n = ui->tab->findView("Welcome");
if (n >= 0)
{
ui->htmlViewer->setDocument(nullptr);
ui->tab->tabCloseRequested(n);
}
}
| 27.77515 | 173 | 0.625626 | [
"mesh",
"geometry",
"object",
"vector",
"model"
] |
6ad2e05944a082c19000823da315e948a4f04168 | 18,350 | cpp | C++ | ExternalSource/myOptimizer/ConicSolver/src/solver/interface/Model.cpp | stevenjj/PnC | e1e417dbd507f174bb2661247cb4360b6ee0ada7 | [
"MIT"
] | 1 | 2020-05-04T22:36:54.000Z | 2020-05-04T22:36:54.000Z | ExternalSource/myOptimizer/ConicSolver/src/solver/interface/Model.cpp | stevenjj/PnC | e1e417dbd507f174bb2661247cb4360b6ee0ada7 | [
"MIT"
] | null | null | null | ExternalSource/myOptimizer/ConicSolver/src/solver/interface/Model.cpp | stevenjj/PnC | e1e417dbd507f174bb2661247cb4360b6ee0ada7 | [
"MIT"
] | null | null | null | /*
* Copyright [2017] Max Planck Society. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iomanip>
#include <iostream>
#include <ExternalSource/myOptimizer/ConicSolver/include/solver/interface/Model.hpp>
namespace solver {
void Model::configSetting(const std::string cfg_file, const std::string stgs_vars_yaml)
{
this->getStgs().initialize(cfg_file, stgs_vars_yaml);
}
void Model::clean()
{
vars_.clear();
leqcons_.clear();
soccons_.clear();
lineqcons_.clear();
qineqcons_.clear();
objective_.clear();
numTrustRegions_ = 0;
numSoftConstraints_ = 0;
}
Var Model::addVar(const VarType& type, double lb, double ub, double guess)
{
if (lb > ub) { throw std::runtime_error("Invalid assertion LB <= UB"); }
if (guess < lb) { guess = lb; if (this->getStgs().get(SolverBoolParam_Verbose)) { std::cerr << "Warning: Guess < LB, Setting: Guess = LB" << std::endl; } }
else if (guess > ub) { guess = ub; if (this->getStgs().get(SolverBoolParam_Verbose)) { std::cerr << "Warning: Guess > UB, Setting: Guess = UB" << std::endl; } }
Var var = Var(vars_.size(), type, lb, ub, guess);
vars_.push_back( std::make_shared<Var>( var ) );
return var;
}
// Linear Constraint: left_hand_side [< = >] right_hand_side
void Model::addLinConstr(const LinExpr& lhs, const std::string sense, const LinExpr& rhs)
{
if (sense == "=") { leqcons_.push_back(lhs-rhs); }
else if (sense == "<") { lineqcons_.push_back(lhs-rhs); }
else if (sense == ">") { lineqcons_.push_back(rhs-lhs); }
else { throw std::runtime_error("Invalid sense on Linear Constraint"); }
}
// Disciplined Convex Quadratic Constraint: Sum coeffs[i]* (DCP.qexpr[i])^2 + (DCP.lexpr - lexpr) [< =] 0.0
void Model::addQuaConstr(const DCPQuadExpr& qexpr, const std::string sense, const LinExpr& lexpr, const QuadConstrApprox& qapprox)
{
DCPQuadExpr qstg = qexpr;
qstg.lexpr() = qexpr.lexpr() - lexpr;
switch (qapprox) {
case QuadConstrApprox::TrustRegion: { numTrustRegions_ += 1; qstg.trustRegion() = true; break; }
case QuadConstrApprox::SoftConstraint: { numSoftConstraints_ +=1; qstg.softConstraint() = true; break; }
default: { break; }
}
for (unsigned int i=0; i<qstg.coeffs().size(); i++)
qstg.extraVars().push_back(this->addVar(VarType::Continuous, 0.0, 1.0, 0.5));
if (qapprox == QuadConstrApprox::SoftConstraint) { qstg.extraVars().push_back(this->addVar(VarType::Continuous, 0.0, 1.0, 0.5)); }
if (sense == "<") { qineqcons_.push_back(qstg); }
else { throw std::runtime_error("Invalid sense on Quadratic Constraint"); }
}
// Second-Order Cone Constraint: SQRT( Sum (DCP.qexpr[i])^2 ) + (DCP.lexpr - lexpr) [< =] 0.0
void Model::addSocConstr(const DCPQuadExpr& qexpr, const std::string sense, const LinExpr& lexpr)
{
DCPQuadExpr qstg = qexpr;
qstg.trustRegion() = false;
qstg.lexpr() = qexpr.lexpr() - lexpr;
qstg.extraVars().push_back(this->addVar(VarType::Continuous, 0.0, 1.0, 0.5));
if (sense == "<") { soccons_.push_back(qstg); }
else { throw std::runtime_error("Invalid sense on Second-Order Cone Constraint"); }
}
// Quadratic Objective: min Sum DCP.coeffs[i]*(DCP.qexpr[i])^2 + (DCP.lexpr+lexpr)
void Model::setObjective(const DCPQuadExpr& qexpr, const LinExpr& lexpr)
{
DCPQuadExpr qstg;
objective_.qexpr() = qexpr.qexpr();
objective_.coeffs() = qexpr.coeffs();
objective_.lexpr() = qexpr.lexpr() + lexpr;
for (int i=0; i<(int)qexpr.coeffs().size(); i++)
objective_.extraVars().push_back(this->addVar(VarType::Continuous, 0.0, 1.0, 0.5));
}
// Translate problem to standard conic form
void Model::build_problem(int iter_id, bool warm_start)
{
// problem size
numTrustRegions_ = 0;
numSoftConstraints_ = 0;
int row_start = 0, row_offset = 0;
int mextra = objective_.extraVars().size() + soccons_.size();
for (int id=0; id<(int)qineqcons_.size(); id++) {
mextra += qineqcons_[id].coeffs().size();
if (qineqcons_[id].trustRegion()) { numTrustRegions_ += 1; }
if (qineqcons_[id].softConstraint()) { numSoftConstraints_ += 1; }
if (qineqcons_[id].softConstraint() && !warm_start) { mextra += 1; }
}
int nvars = vars_.size();
int nleq = leqcons_.size();
int nlineq = lineqcons_.size() + qineqcons_.size() +
soccons_.size() + (warm_start == true ? 0 : numTrustRegions_);
Eigen::VectorXi q(mextra); q.setConstant(3);
for (int id=0; id<(int)soccons_.size(); id++)
q.tail(soccons_.size())[id] = soccons_[id].coeffs().size()+1;
this->getCone().initialize(nvars, nleq, nlineq, q);
this->getStorage().initialize(cone_, stgs_);
this->getStorage().cleanCoeffs();
// Linear equality constraints
for (int row_id=0; row_id<(int)leqcons_.size(); row_id++) {
for (int var_id=0; var_id<(int)leqcons_[row_id].size(); var_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_id,
leqcons_[row_id].getVar(var_id).get(SolverIntParam_ColNum),
leqcons_[row_id].getCoeff(var_id)), true);
this->getStorage().b()[row_start+row_id] = -leqcons_[row_id].getConstant();
}
}
// Linear inequality constraints
for (int row_id=0; row_id<(int)lineqcons_.size(); row_id++) {
for (int var_id=0; var_id<(int)lineqcons_[row_id].size(); var_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+row_id,
lineqcons_[row_id].getVar(var_id).get(SolverIntParam_ColNum),
lineqcons_[row_id].getCoeff(var_id)));
this->getStorage().h()[row_start+row_id] = -lineqcons_[row_id].getConstant();
}
}
row_start += lineqcons_.size();
// Quadratic inequality constraints linear part
for (int row_id=0; row_id<(int)qineqcons_.size(); row_id++) {
for (int extra_var_id=0; extra_var_id<(int)qineqcons_[row_id].coeffs().size(); extra_var_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+row_id,
qineqcons_[row_id].extraVars()[extra_var_id].get(SolverIntParam_ColNum),
qineqcons_[row_id].coeffs()[extra_var_id]));
}
for (int lvar_id=0; lvar_id<(int)qineqcons_[row_id].lexpr().size(); lvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+row_id,
qineqcons_[row_id].lexpr().getVar(lvar_id).get(SolverIntParam_ColNum),
qineqcons_[row_id].lexpr().getCoeff(lvar_id)));
}
this->getStorage().h()[row_start+row_id] = -qineqcons_[row_id].lexpr().getConstant();
}
row_start += qineqcons_.size();
// Second order cone constraints linear part
for (int row_id=0; row_id<(int)soccons_.size(); row_id++) {
int extra_var_id = 0;
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+row_id,
soccons_[row_id].extraVars()[extra_var_id].get(SolverIntParam_ColNum),
1.0));
for (int lvar_id=0; lvar_id<(int)soccons_[row_id].lexpr().size(); lvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+row_id,
soccons_[row_id].lexpr().getVar(lvar_id).get(SolverIntParam_ColNum),
soccons_[row_id].lexpr().getCoeff(lvar_id)));
}
this->getStorage().h()[row_start+row_id] = -soccons_[row_id].lexpr().getConstant();
}
row_start += soccons_.size();
// Objective linear part
for (int var_id=0; var_id<(int)objective_.lexpr().size(); var_id++)
this->getStorage().c()[objective_.lexpr().getVar(var_id).get(SolverIntParam_ColNum)] = objective_.lexpr().getCoeff(var_id);
if (!warm_start) {
// Quadratic constraints with trust region
int row_count = 0;
for (int row_id=0; row_id<(int)qineqcons_.size(); row_id++) {
if (qineqcons_[row_id].trustRegion()) {
this->getStorage().h()[row_start+row_count] = 0.0;
for (int qvar_id=0; qvar_id<(int)qineqcons_[row_id].qexpr().size(); qvar_id++) {
for (int lvar_id=0; lvar_id<(int)qineqcons_[row_id].qexpr()[qvar_id].size(); lvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+row_count,
qineqcons_[row_id].getVar(qvar_id, lvar_id).get(SolverIntParam_ColNum),
-2.0*qineqcons_[row_id].coeffs()[qvar_id]*qineqcons_[row_id].qexpr()[qvar_id].getValue()*qineqcons_[row_id].qexpr()[qvar_id].getCoeff(lvar_id)));
this->getStorage().h()[row_start+row_count] -= 2.0*qineqcons_[row_id].coeffs()[qvar_id]*qineqcons_[row_id].qexpr()[qvar_id].getValue()*qineqcons_[row_id].qexpr()[qvar_id].getCoeff(lvar_id)*qineqcons_[row_id].getVar(qvar_id, lvar_id).get(SolverDoubleParam_X);
}
}
for (int lvar_id=0; lvar_id<(int)qineqcons_[row_id].lexpr().size(); lvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+row_count,
qineqcons_[row_id].lexpr().getVar(lvar_id).get(SolverIntParam_ColNum),
-qineqcons_[row_id].lexpr().getCoeff(lvar_id)));
}
this->getStorage().h()[row_start+row_count] += qineqcons_[row_id].lexpr().getConstant() + qineqcons_[row_id].getValue() + std::pow(this->getStgs().get(SolverDoubleParam_TrustRegionThreshold), iter_id);
row_count += 1;
}
}
row_start += numTrustRegions_;
}
// Objective quadratic part
for (int extra_var_id=0; extra_var_id<(int)objective_.extraVars().size(); extra_var_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*extra_var_id+0,
objective_.extraVars()[extra_var_id].get(SolverIntParam_ColNum),
-1.0));
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*extra_var_id+1,
objective_.extraVars()[extra_var_id].get(SolverIntParam_ColNum),
-1.0));
for (int qvar_id=0; qvar_id<(int)objective_.qexpr()[extra_var_id].size(); qvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*extra_var_id+2,
objective_.qexpr()[extra_var_id].getVar(qvar_id).get(SolverIntParam_ColNum),
-2.0*objective_.qexpr()[extra_var_id].getCoeff(qvar_id)));
}
this->getStorage().h()[row_start+3*extra_var_id+0] = 1.0;
this->getStorage().h()[row_start+3*extra_var_id+1] = -1.0;
this->getStorage().h()[row_start+3*extra_var_id+2] = 2.0*objective_.qexpr()[extra_var_id].getConstant();
this->getStorage().c()[objective_.extraVars()[extra_var_id].get(SolverIntParam_ColNum)] = objective_.coeffs()[extra_var_id];
}
row_start += 3*objective_.extraVars().size();
if (!warm_start) {
// Adding quadratic objective terms due to soft constraints
int row_count = 0;
for (int row_id=0; row_id<(int)qineqcons_.size(); row_id++) {
if (qineqcons_[row_id].softConstraint()) {
this->getStorage().h()[row_start+3*row_count+0] = 1.0;
this->getStorage().h()[row_start+3*row_count+1] = -1.0;
this->getStorage().h()[row_start+3*row_count+2] = 0.0;
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*row_count+0,
qineqcons_[row_id].extraVars().back().get(SolverIntParam_ColNum),
-1.0));
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*row_count+1,
qineqcons_[row_id].extraVars().back().get(SolverIntParam_ColNum),
-1.0));
for (int qvar_id=0; qvar_id<(int)qineqcons_[row_id].qexpr().size(); qvar_id++) {
for (int lvar_id=0; lvar_id<(int)qineqcons_[row_id].qexpr()[qvar_id].size(); lvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*row_count+2,
qineqcons_[row_id].getVar(qvar_id, lvar_id).get(SolverIntParam_ColNum),
-4.0*qineqcons_[row_id].coeffs()[qvar_id]*qineqcons_[row_id].qexpr()[qvar_id].getValue()*qineqcons_[row_id].qexpr()[qvar_id].getCoeff(lvar_id)));
this->getStorage().h()[row_start+3*row_count+2] -= 2.0*qineqcons_[row_id].coeffs()[qvar_id]*qineqcons_[row_id].qexpr()[qvar_id].getValue()*qineqcons_[row_id].qexpr()[qvar_id].getCoeff(lvar_id)*qineqcons_[row_id].getVar(qvar_id, lvar_id).get(SolverDoubleParam_X);
}
}
for (int lvar_id=0; lvar_id<(int)qineqcons_[row_id].lexpr().size(); lvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*row_count+2,
qineqcons_[row_id].lexpr().getVar(lvar_id).get(SolverIntParam_ColNum),
-2.0*qineqcons_[row_id].lexpr().getCoeff(lvar_id) ));
}
this->getStorage().h()[row_start+3*row_count+2] += qineqcons_[row_id].lexpr().getConstant() + qineqcons_[row_id].getValue();
this->getStorage().h()[row_start+3*row_count+2] = 2.0*this->getStorage().h()[row_start+3*row_count+2];
this->getStorage().c()[qineqcons_[row_id].extraVars().back().get(SolverIntParam_ColNum)] = this->getStgs().get(SolverDoubleParam_SoftConstraintWeight);
row_count += 1;
}
}
row_start += 3*numSoftConstraints_;
}
// Quadratic inequality constraints quadratic part
for (int row_id=0; row_id<(int)qineqcons_.size(); row_id++) {
for (int extra_var_id=0; extra_var_id<(int)qineqcons_[row_id].coeffs().size(); extra_var_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*extra_var_id+0,
qineqcons_[row_id].extraVars()[extra_var_id].get(SolverIntParam_ColNum),
-1.0));
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*extra_var_id+1,
qineqcons_[row_id].extraVars()[extra_var_id].get(SolverIntParam_ColNum),
-1.0));
for (int qvar_id=0; qvar_id<(int)qineqcons_[row_id].qexpr()[extra_var_id].size(); qvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+3*extra_var_id+2,
qineqcons_[row_id].qexpr()[extra_var_id].getVar(qvar_id).get(SolverIntParam_ColNum),
-2.0*qineqcons_[row_id].qexpr()[extra_var_id].getCoeff(qvar_id)));
}
this->getStorage().h()[row_start+3*extra_var_id+0] = 1.0;
this->getStorage().h()[row_start+3*extra_var_id+1] = -1.0;
this->getStorage().h()[row_start+3*extra_var_id+2] = 2.0*qineqcons_[row_id].qexpr()[extra_var_id].getConstant();
}
row_start += 3*qineqcons_[row_id].coeffs().size();
}
// Second order cone constraints quadratic part
for (int row_id=0; row_id<(int)soccons_.size(); row_id++) {
int size = soccons_[row_id].coeffs().size();
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+0,
soccons_[row_id].extraVars()[0].get(SolverIntParam_ColNum),
-1.0));
this->getStorage().h()[row_start+0] = 0.0;
for (int qvar_id=0; qvar_id<(int)soccons_[row_id].qexpr().size(); qvar_id++) {
for (int lvar_id=0; lvar_id<(int)soccons_[row_id].qexpr()[qvar_id].size(); lvar_id++) {
this->getStorage().addCoeff(Eigen::Triplet<double>(row_start+row_offset+qvar_id+1,
soccons_[row_id].qexpr()[qvar_id].getVar(lvar_id).get(SolverIntParam_ColNum),
-soccons_[row_id].qexpr()[qvar_id].getCoeff(lvar_id)));
}
this->getStorage().h()[row_start+qvar_id+1] = soccons_[row_id].qexpr()[qvar_id].getConstant();
}
row_start += size+1;
}
this->getStorage().initializeMatrices();
ip_solver_.initialize(this->getStorage(), this->getCone(), this->getStgs());
}
ExitCode Model::solve_problem()
{
ExitCode exit_code = ExitCode::Indeterminate;
exit_code = ip_solver_.optimize();
for (int i=0; i<(int)vars_.size(); i++)
vars_[i]->set(SolverDoubleParam_X, ip_solver_.optsol().x()[i]);
return exit_code;
}
ExitCode Model::optimize()
{
ExitCode exit_code = ExitCode::Indeterminate;
// warm start solution
if (this->getStgs().get(SolverIntParam_WarmStartIters)>0 && (numTrustRegions_>0 || numSoftConstraints_>0)) {
this->getStgs().set(SolverIntParam_MaxIters, this->getStgs().get(SolverIntParam_WarmStartIters));
this->build_problem(0, true);
exit_code =this->solve_problem();
}
if (this->getStgs().get(SolverIntParam_SolverMaxIters)>0) {
// solve problem using convex conic solver
this->getStgs().set(SolverIntParam_MaxIters, this->getStgs().get(SolverIntParam_SolverMaxIters));
this->build_problem(1);
exit_code = this->solve_problem();
}
// perform refinements if required
if (this->getStgs().get(SolverIntParam_NumberRefinementsTrustRegion) > 0 && (numTrustRegions_>0 || numSoftConstraints_>0)) {
for (int ref=1; ref<=this->getStgs().get(SolverIntParam_NumberRefinementsTrustRegion); ref++) {
this->getStgs().set(SolverIntParam_MaxIters, this->getStgs().get(SolverIntParam_SolverMaxIters));
this->build_problem(ref+1);
exit_code = this->solve_problem();
}
}
return exit_code;
}
}
| 52.130682 | 276 | 0.638747 | [
"model"
] |
6ada3574564814571d4c728b2f5a009b50f09bab | 3,263 | hpp | C++ | OpenGL/simple-3d-app/geom_shader_using/include/space.hpp | bigov/daft-lib | 7890fdba0aab800022ab9afb958946bd06779f33 | [
"MIT"
] | 1 | 2022-03-14T08:20:58.000Z | 2022-03-14T08:20:58.000Z | OpenGL/simple-3d-app/geom_shader_using/include/space.hpp | bigov/daft-lib | 7890fdba0aab800022ab9afb958946bd06779f33 | [
"MIT"
] | null | null | null | OpenGL/simple-3d-app/geom_shader_using/include/space.hpp | bigov/daft-lib | 7890fdba0aab800022ab9afb958946bd06779f33 | [
"MIT"
] | 1 | 2020-12-22T08:36:48.000Z | 2020-12-22T08:36:48.000Z | //============================================================================
//
// file: space.hpp
//
// Заголовок класса управления пространством 3D сцены
//
// pY
// |
// |_____ pX
// /
// /pZ
//
// 7(-+-)~~~~~~~~2(++-)
// /| /|
// / | / |
// 6(-++)~~~~~~~~3(+++)
// | | | |
// | | | |
// | 4(---)~~~~~|~~1(+--)
// | / | /
// |/ |/
// 5(--+)~~~~~~~~0(+-+)
//
//============================================================================
#ifndef __SPACE_HPP__
#define __SPACE_HPP__
#include "main.hpp"
#include "config.hpp"
#include "glsl.hpp"
#include "t256x256.hpp"
#include "vbo.hpp"
namespace tr
{
struct rig // описание элемента пространства
{
short type = 0; // тип
char gage = 1; // размер
float
x = 0.f, // |
y = 0.f, // | углы поворота в пространстве вокруг осей x,y,z
z = 0.f; // |
int msec = 0; // миллисекунд от начала суток
};
extern std::unordered_map<float,
std::unordered_map<float,
std::unordered_map<float, rig>>> space_map; // карта элементов
// проверка наличия элемента по указанным координатам
extern bool space_is_empty(float, float, float);
extern bool space_is_empty(glm::vec3);
struct evInput
{
float dx, dy; // смещение указателя мыши в активном окне
int fb, rl, ud, // управление направлением движения в 3D пространстве
key_scancode, key_mods, mouse_mods,
fps; // частота кадров (для коррекции скорости движения)
};
const float pi = glm::pi<glm::float_t>();
const float two_pi = glm::two_pi<glm::float_t>();
const float half_pi = glm::half_pi<glm::float_t>();
const float _half_pi = 0 - half_pi;
const float look_up = half_pi - 0.01f;
const float look_down = 0 - half_pi + 0.01f;
const float three_over_two_pi = glm::three_over_two_pi<glm::float_t>();
class Scene
{
private:
Scene(const tr::Scene&);
Scene operator=(const tr::Scene&);
tr::Glsl prog {};
std::vector<vbo> VBOs {};
GLuint vao_id = 0; // ID VAO
GLsizei count = 0; // число внесенных в VAO элементов для отображения
GLsizeiptr points = 0; // общее количество элементов в сцене
float
rl=0.f, ud=0.f, fb=0.f, // скорость движения по направлениям
look_a = 3.928f, // азимут (0 - X)
look_t = -0.276f, // тангаж (0 - горизОнталь, пи/2 - вертикаль)
k_sense = 4.0f, // TODO: чувствительность через Config
k_mouse = 0.002f;
bool load_complete = false; // Загрузка сцены завершена
glm::mat4 MatView {};
//glm::vec4 lookDir {}; // напрвление взгляда
glm::vec3
ViewFrom {3.f, 4.f, 3.f},
ViewTo {},
upward {0.0, 1.0, 0.0}; // направление наверх
bool element_exist(GLfloat, GLfloat, GLfloat);
void element_remove(GLfloat, GLfloat, GLfloat);
void element_update(GLfloat, GLfloat, GLfloat);
void element_insert(GLfloat, GLfloat, GLfloat);
void calc_position(const evInput & ev);
void draw_hud(void);
void draw_wstring(int x, int y, const std::wstring & ws);
void space_place(GLfloat, GLfloat, GLfloat);
void space_generate(void);
void space_array_fill(void);
public:
Scene(void) {};
~Scene(void) {};
void init(void);
void draw(const evInput &);
};
} //namespace
#endif
| 26.966942 | 78 | 0.578609 | [
"vector",
"3d"
] |
6ae2f31bebed9526df6bb5600cb09e6a5d1221a7 | 656 | cc | C++ | slice/print_rotate_matrix.cc | liuluheng/CTCI | d8b72737fb450641759f52ade8bff3f694e9eec0 | [
"MIT"
] | null | null | null | slice/print_rotate_matrix.cc | liuluheng/CTCI | d8b72737fb450641759f52ade8bff3f694e9eec0 | [
"MIT"
] | null | null | null | slice/print_rotate_matrix.cc | liuluheng/CTCI | d8b72737fb450641759f52ade8bff3f694e9eec0 | [
"MIT"
] | null | null | null | // 逆时针旋转45°打印
// 3
// 2 6
// 1 5 9
// 4 8
// 7
//
// still not implemented..
#include <iostream>
#include <vector>
using namespace std;
void print_rotate_matrix(vector<vector<int>> vv)
{
const auto rownum = vv.size();
const auto colnum = vv[0].size();
for (size_t row = 0; row < rownum; row++) {
size_t offset = rownum - row - 1;
for (size_t col = offset; col < colnum; col++) {
cout << vv[row][col] << " ";
}
cout << endl;
}
}
int main()
{
vector<vector<int>> vv({
{ 1, 2, 3},
{ 4, 5, 6},
{ 7, 8, 9}});
print_rotate_matrix(vv);
return 0;
}
| 17.72973 | 52 | 0.492378 | [
"vector"
] |
6ae49bb52073d6479d83fcf350f4b98fbf59a589 | 7,056 | cpp | C++ | Viewer/ecflowUI/src/NodeQueryViewDelegate.cpp | mpartio/ecflow | ea4b89399d1e7b897ff48c59b1e885e6d53cc8d6 | [
"Apache-2.0"
] | null | null | null | Viewer/ecflowUI/src/NodeQueryViewDelegate.cpp | mpartio/ecflow | ea4b89399d1e7b897ff48c59b1e885e6d53cc8d6 | [
"Apache-2.0"
] | null | null | null | Viewer/ecflowUI/src/NodeQueryViewDelegate.cpp | mpartio/ecflow | ea4b89399d1e7b897ff48c59b1e885e6d53cc8d6 | [
"Apache-2.0"
] | null | null | null | //============================================================================
// Copyright 2009- ECMWF.
// This software is licensed under the terms of the Apache Licence version 2.0
// which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
// In applying this licence, ECMWF does not waive the privileges and immunities
// granted to it by virtue of its status as an intergovernmental organisation
// nor does it submit to any jurisdiction.
//
//============================================================================
#include "NodeQueryViewDelegate.hpp"
#include <QtGlobal>
#include <QApplication>
#include <QDebug>
#include <QImageReader>
#include <QPainter>
#include <QStyleOptionViewItem>
#include "AbstractNodeModel.hpp"
#include "Animation.hpp"
#include "IconProvider.hpp"
#include "ModelColumn.hpp"
#include "PropertyMapper.hpp"
#include "ViewerUtil.hpp"
static std::vector<std::string> propVec;
//Define node renderer properties
struct QueryNodeDelegateBox : public NodeDelegateBox
{
QueryNodeDelegateBox() {
topMargin=2;
bottomMargin=2;
leftMargin=3;
rightMargin=0;
topPadding=0;
bottomPadding=0;
leftPadding=2;
rightPadding=1;
}
};
//Define attribute renderer properties
struct QueryAttrDelegateBox : public AttrDelegateBox
{
QueryAttrDelegateBox() {
topMargin=2;
bottomMargin=2;
leftMargin=1;
rightMargin=0;
topPadding=0;
bottomPadding=0;
leftPadding=0;
rightPadding=0;
}
};
NodeQueryViewDelegate::NodeQueryViewDelegate(QWidget *parent)
{
nodeBox_=new QueryNodeDelegateBox;
attrBox_=new QueryAttrDelegateBox;
nodeBox_->adjust(font_);
attrBox_->adjust(attrFont_);
borderPen_=QPen(QColor(230,230,230));
columns_=ModelColumn::def("query_columns");
//Property
if(propVec.empty())
{
//Base settings
addBaseSettings(propVec);
}
prop_=new PropertyMapper(propVec,this);
updateSettings();
}
NodeQueryViewDelegate::~NodeQueryViewDelegate()
= default;
void NodeQueryViewDelegate::updateSettings()
{
//Update the settings handled by the base class
updateBaseSettings();
}
QSize NodeQueryViewDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index ) const
{
QSize size=QStyledItemDelegate::sizeHint(option,index);
return {size.width(),nodeBox_->sizeHintCache.height()};
}
void NodeQueryViewDelegate::paint(QPainter *painter,const QStyleOptionViewItem &option,
const QModelIndex& index) const
{
//Background
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QStyleOptionViewItem vopt(option);
#else
QStyleOptionViewItemV4 vopt(option);
#endif
initStyleOption(&vopt, index);
const QStyle *style = vopt.widget ? vopt.widget->style() : QApplication::style();
const QWidget* widget = vopt.widget;
//Save painter state
painter->save();
QString id=columns_->id(index.column());
if(id == "path")
{
QString text=index.data(Qt::DisplayRole).toString();
renderNode(painter,index,vopt,text);
}
else if(id == "status")
{
renderStatus(painter,index,vopt);
}
//Render attributes
else if(id == "attribute")
{
QVariant va=index.data(Qt::DisplayRole);
if(va.type() == QVariant::StringList)
{
QStringList lst=va.toStringList();
if(lst.count() > 0)
{
QMap<QString,AttributeRendererProc>::const_iterator it=attrRenderers_.find(lst.at(0));
if(it != attrRenderers_.end())
{
QSize size;
AttributeRendererProc a=it.value();
(this->*a)(painter,lst,vopt,size);
}
}
}
}
//rest of the columns
else
{
QString text=index.data(Qt::DisplayRole).toString();
QRect textRect = style->subElementRect(QStyle::SE_ItemViewItemText, &vopt,widget);
painter->setPen(Qt::black);
int rightPos=textRect.right()+1;
const bool setClipRect = rightPos > option.rect.right();
if(setClipRect)
{
painter->save();
painter->setClipRect(option.rect);
}
/*QVariant alg=index.data(Qt::TextAlignmentRole);
if(alg.isValid())
painter->drawText(textRect,alg.value<Qt::Alignment>(),text);
else*/
painter->drawText(textRect,Qt::AlignLeft | Qt::AlignVCenter,text);
if(setClipRect)
{
painter->restore();
}
}
//Render the horizontal border for rows. We only render the top border line.
//With this technique we miss the bottom border line of the last row!!!
//QRect fullRect=QRect(0,option.rect.y(),painter->device()->width(),option.rect.height());
QRect bgRect=option.rect;
painter->setPen(borderPen_);
painter->drawLine(bgRect.topLeft(),bgRect.topRight());
painter->restore();
}
void NodeQueryViewDelegate::renderNode(QPainter *painter,const QModelIndex& index,
const QStyleOptionViewItem& option,QString text) const
{
bool selected=option.state & QStyle::State_Selected;
QFontMetrics fm(font_);
QRect itemRect=option.rect.adjusted(nodeBox_->leftMargin,nodeBox_->topMargin,0,-nodeBox_->bottomMargin);
//The text rectangle
QRect textRect = itemRect;
int textWidth=ViewerUtil::textWidth(fm,text);
textRect.setWidth(textWidth+nodeBox_->leftPadding+nodeBox_->rightPadding);
int currentRight=textRect.x()+textRect.width();
QList<QPixmap> pixLst;
QList<QRect> pixRectLst;
QVariant va=index.data(AbstractNodeModel::IconRole);
if(va.type() == QVariant::List)
{
QVariantList lst=va.toList();
if(lst.count() >0)
{
int xp=currentRight+nodeBox_->iconPreGap;
int yp=itemRect.center().y()+1-nodeBox_->iconSize/2;
for(int i=0; i < lst.count(); i++)
{
int id=lst[i].toInt();
if(id != -1)
{
pixLst << IconProvider::pixmap(id,nodeBox_->iconSize);
pixRectLst << QRect(xp,yp,nodeBox_->iconSize,nodeBox_->iconSize);
xp+=nodeBox_->iconSize+nodeBox_->iconGap;
}
}
if(!pixLst.isEmpty())
{
currentRight=xp-nodeBox_->iconGap;
}
}
}
//Define clipping
int rightPos=currentRight+1;
const bool setClipRect = rightPos > option.rect.right();
if(setClipRect)
{
painter->save();
painter->setClipRect(option.rect);
}
//Draw text
QColor fg=index.data(Qt::ForegroundRole).value<QColor>();
painter->setPen(fg);
painter->drawText(textRect,Qt::AlignHCenter | Qt::AlignVCenter,text);
if(selected)
{
QRect sr=textRect;
sr.setX(option.rect.x()+nodeBox_->leftMargin);
renderSelectionRect(painter,sr);
}
//Draw icons
for(int i=0; i < pixLst.count(); i++)
{
painter->drawPixmap(pixRectLst[i],pixLst[i]);
}
if(setClipRect)
{
painter->restore();
}
}
| 26.727273 | 108 | 0.628827 | [
"render",
"vector"
] |
6ae848d6743954c6b0ef300292ad50740c8be732 | 3,313 | cpp | C++ | rd-cpp/src/rd_core_cpp/src/test/cases/AdviseVsViewTest.cpp | denis417/rd | 480f10035ba17caea63fe31475ac484dff09176c | [
"Apache-2.0"
] | 309 | 2018-04-12T11:10:10.000Z | 2022-03-27T18:16:56.000Z | rd-cpp/src/rd_core_cpp/src/test/cases/AdviseVsViewTest.cpp | denis417/rd | 480f10035ba17caea63fe31475ac484dff09176c | [
"Apache-2.0"
] | 80 | 2018-06-14T16:47:13.000Z | 2022-03-25T16:34:56.000Z | rd-cpp/src/rd_core_cpp/src/test/cases/AdviseVsViewTest.cpp | denis417/rd | 480f10035ba17caea63fe31475ac484dff09176c | [
"Apache-2.0"
] | 41 | 2018-04-16T17:59:32.000Z | 2021-12-25T13:12:36.000Z | #include <gtest/gtest.h>
#include "lifetime/LifetimeDefinition.h"
#include "reactive/Property.h"
using namespace rd;
TEST(advise_vs_view, advise_behaviour1)
{
// int* p = new int(1);
LifetimeDefinition lifetimeDef(Lifetime::Eternal());
Property<bool> property(false);
Lifetime lifetime = lifetimeDef.lifetime;
std::vector<bool> log;
lifetime->add_action([&property]() { property.set(true); });
property.advise(lifetime, [&log](bool const& value) { log.push_back(value); });
lifetimeDef.terminate();
std::vector<bool> expected{false};
EXPECT_EQ(expected, log);
}
TEST(advise_vs_view, view_behaviour1)
{
LifetimeDefinition lifetimeDef(Lifetime::Eternal());
Property<bool> property(false);
Lifetime lifetime = lifetimeDef.lifetime;
std::vector<bool> log;
lifetime->add_action([&property]() { property.set(true); });
property.view(lifetime, [&log](Lifetime _, bool const& value) { log.push_back(value); });
// int c = lifetime.use_count();
lifetimeDef.terminate();
std::vector<bool> expected{false};
EXPECT_EQ(expected, log);
}
TEST(advise_vs_view, advise_behaviour2)
{
LifetimeDefinition lifetimeDef(Lifetime::Eternal());
Property<bool> property(false);
Lifetime lifetime = lifetimeDef.lifetime;
std::vector<bool> log;
property.advise(lifetime, [&log](bool const& value) { log.push_back(value); });
lifetime->add_action([&property]() { property.set(true); });
lifetimeDef.terminate();
std::vector<bool> expected{false};
EXPECT_EQ(expected, log);
}
TEST(advise_vs_view, view_behaviour2)
{
LifetimeDefinition lifetimeDef(Lifetime::Eternal());
Property<bool> property(false);
Lifetime lifetime = lifetimeDef.lifetime;
std::vector<bool> log;
property.view(lifetime, [&log](Lifetime _, bool const& value) { log.push_back(value); });
lifetime->add_action([&property]() { property.set(true); });
lifetimeDef.terminate();
std::vector<bool> expected{false, true};
EXPECT_EQ(expected, log);
}
TEST(advise_vs_view, advise_behaviour3)
{
LifetimeDefinition lifetimeDef(Lifetime::Eternal());
Property<int32_t> property_a(0);
Property<int32_t> property_b(0);
Lifetime lifetime = lifetimeDef.lifetime;
std::vector<int> log_a;
std::vector<int> log_b;
property_a.advise(lifetime, [&log_a](int const& value) { log_a.push_back(value); });
property_b.advise(lifetime, [&log_b](int const& value) { log_b.push_back(value); });
property_a.set(1);
property_b.set(2);
lifetimeDef.terminate();
property_a.set(3);
property_b.set(4);
std::vector<int> expected_a{0, 1};
std::vector<int> expected_b{0, 2};
EXPECT_EQ(expected_a, log_a);
EXPECT_EQ(expected_b, log_b);
}
TEST(advise_vs_view, view_behaviour3)
{
LifetimeDefinition lifetimeDef(Lifetime::Eternal());
Property<int32_t> property_a(0);
Property<int32_t> property_b(0);
Lifetime lifetime = lifetimeDef.lifetime;
std::vector<int> log_a;
std::vector<int> log_b;
property_a.view(lifetime, [&log_a](Lifetime _, int const& value) { log_a.push_back(value); });
property_b.view(lifetime, [&log_b](Lifetime _, int const& value) { log_b.push_back(value); });
property_a.set(1);
property_b.set(2);
lifetimeDef.terminate();
property_a.set(3);
property_b.set(4);
std::vector<int> expected_a{0, 1};
std::vector<int> expected_b{0, 2};
EXPECT_EQ(expected_a, log_a);
EXPECT_EQ(expected_b, log_b);
} | 25.484615 | 95 | 0.727437 | [
"vector"
] |
6aea63cb95d80176365633feeccf11e4d6c5bc8c | 7,889 | cpp | C++ | examples/26.OcclusionQuery/main.cpp | slater1/irrlicht | 2860e828879b6acf9e39604cb4bcce0873c8b2d9 | [
"IJG"
] | 440 | 2015-01-04T16:01:46.000Z | 2022-03-25T08:31:38.000Z | examples/26.OcclusionQuery/main.cpp | slater1/irrlicht | 2860e828879b6acf9e39604cb4bcce0873c8b2d9 | [
"IJG"
] | 5 | 2021-01-03T20:30:10.000Z | 2021-01-03T21:46:53.000Z | examples/26.OcclusionQuery/main.cpp | slater1/irrlicht | 2860e828879b6acf9e39604cb4bcce0873c8b2d9 | [
"IJG"
] | 189 | 2015-01-06T10:39:46.000Z | 2022-02-21T07:20:59.000Z | /** Example 026 OcclusionQuery
This tutorial shows how to speed up rendering by use of the
OcclusionQuery feature. The usual rendering tries to avoid rendering of
scene nodes by culling those nodes which are outside the visible area, the
view frustum. However, this technique does not cope with occluded objects
which are still in the line of sight, but occluded by some larger object
between the object and the eye (camera). Occlusion queries check exactly that.
The queries basically measure the number of pixels that a previous render
left on the screen.
Since those pixels cannot be recognized at the end of a rendering anymore,
the pixel count is measured directly when rendering. Thus, one needs to render
the occluder (the object in front) first. This object needs to write to the
z-buffer in order to become a real occluder. Then the node is rendered and in
case a z-pass happens, i.e. the pixel is written to the framebuffer, the pixel
is counted in the query.
The result of a query is the number of pixels which got through. One can, based
on this number, judge if the scene node is visible enough to be rendered, or if
the node should be removed in the next round. Also note that the number of
pixels is a safe over approximation in general. The pixels might be overdrawn
later on, and the GPU tries to avoid inaccuracies which could lead to false
negatives in the queries.
As you might have recognized already, we had to render the node to get the
numbers. So where's the benefit, you might say. There are several ways where
occlusion queries can help. It is often a good idea to just render the bbox
of the node instead of the actual mesh. This is really fast and is a safe over
approximation. If you need a more exact render with the actual geometry, it's
a good idea to render with just basic solid material. Avoid complex shaders
and state changes through textures. There's no need while just doing the
occlusion query. At least if the render is not used for the actual scene. This
is the third way to optimize occlusion queries. Just check the queries every
5th or 10th frame, or even less frequent. This depends on the movement speed
of the objects and camera.
*/
#ifdef _MSC_VER
// We'll also define this to stop MSVC complaining about sprintf().
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "Irrlicht.lib")
#endif
#include <irrlicht.h>
#include "driverChoice.h"
#include "exampleHelper.h"
using namespace irr;
/*
We need keyboard input events to switch some parameters
*/
class MyEventReceiver : public IEventReceiver
{
public:
// This is the one method that we have to implement
virtual bool OnEvent(const SEvent& event)
{
// Remember whether each key is down or up
if (event.EventType == irr::EET_KEY_INPUT_EVENT)
KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
return false;
}
// This is used to check whether a key is being held down
virtual bool IsKeyDown(EKEY_CODE keyCode) const
{
return KeyIsDown[keyCode];
}
MyEventReceiver()
{
for (u32 i=0; i<KEY_KEY_CODES_COUNT; ++i)
KeyIsDown[i] = false;
}
private:
// We use this array to store the current state of each key
bool KeyIsDown[KEY_KEY_CODES_COUNT];
};
/*
We create an irr::IrrlichtDevice and the scene nodes. One occluder, one
occluded. The latter is a complex sphere, which has many triangles.
*/
int main()
{
// ask user for driver
video::E_DRIVER_TYPE driverType=driverChoiceConsole();
if (driverType==video::EDT_COUNT)
return 1;
// create device
MyEventReceiver receiver;
IrrlichtDevice* device = createDevice(driverType,
core::dimension2d<u32>(640, 480), 16, false, false, false, &receiver);
if (device == 0)
return 1; // could not create selected driver.
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
const io::path mediaPath = getExampleMediaPath();
smgr->getGUIEnvironment()->addStaticText(L"Press Space to hide occluder.", core::recti(10,10, 200,50));
/*
Create the node to be occluded. We create a sphere node with high poly count.
*/
scene::ISceneNode * node = smgr->addSphereSceneNode(10, 64);
if (node)
{
node->setPosition(core::vector3df(0,0,60));
node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp"));
node->setMaterialFlag(video::EMF_LIGHTING, false);
}
/*
Now we create another node, the occluder. It's a simple plane.
*/
scene::ISceneNode* plane = smgr->addMeshSceneNode(smgr->addHillPlaneMesh(
"plane", core::dimension2df(10,10), core::dimension2du(2,2)), 0, -1,
core::vector3df(0,0,20), core::vector3df(270,0,0));
if (plane)
{
plane->setMaterialTexture(0, driver->getTexture(mediaPath + "t351sml.jpg"));
plane->setMaterialFlag(video::EMF_LIGHTING, false);
plane->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true);
}
/*
Here we create the occlusion query. Because we don't have a plain mesh scene node
(ESNT_MESH or ESNT_ANIMATED_MESH), we pass the base geometry as well. Instead,
we could also pass a simpler mesh or the bounding box. But we will use a time
based method, where the occlusion query renders to the frame buffer and in case
of success (occlusion), the mesh is not drawn for several frames.
*/
driver->addOcclusionQuery(node, ((scene::IMeshSceneNode*)node)->getMesh());
/*
We have done everything, just a camera and draw it. We also write the
current frames per second and the name of the driver to the caption of the
window to examine the render speedup.
We also store the time for measuring the time since the last occlusion query ran
and store whether the node should be visible in the next frames.
*/
smgr->addCameraSceneNode();
int lastFPS = -1;
u32 timeNow = device->getTimer()->getTime();
bool nodeVisible=true;
while(device->run())
{
plane->setVisible(!receiver.IsKeyDown(irr::KEY_SPACE));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
/*
First, we draw the scene, possibly without the occluded element. This is necessary
because we need the occluder to be drawn first. You can also use several scene
managers to collect a number of possible occluders in a separately rendered
scene.
*/
node->setVisible(nodeVisible);
smgr->drawAll();
smgr->getGUIEnvironment()->drawAll();
/*
Once in a while, here every 100 ms, we check the visibility. We run the queries,
update the pixel value, and query the result. Since we already rendered the node
we render the query invisible. The update is made blocking, as we need the result
immediately. If you don't need the result immediately, e.g. because you have other
things to render, you can call the update non-blocking. This gives the GPU more
time to pass back the results without flushing the render pipeline.
If the update was called non-blocking, the result from getOcclusionQueryResult is
either the previous value, or 0xffffffff if no value has been generated at all, yet.
The result is taken immediately as visibility flag for the node.
*/
if (device->getTimer()->getTime()-timeNow>100)
{
driver->runAllOcclusionQueries(false);
driver->updateAllOcclusionQueries();
nodeVisible=driver->getOcclusionQueryResult(node)>0;
timeNow=device->getTimer()->getTime();
}
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw tmp(L"OcclusionQuery Example [");
tmp += driver->getName();
tmp += L"] fps: ";
tmp += fps;
device->setWindowCaption(tmp.c_str());
lastFPS = fps;
}
}
/*
In the end, delete the Irrlicht device.
*/
device->drop();
return 0;
}
/*
That's it. Compile and play around with the program.
**/
| 36.354839 | 105 | 0.725187 | [
"mesh",
"geometry",
"render",
"object",
"solid"
] |
6aeab58e3d12d969be7d9112f83cfab470ca3e1a | 2,331 | cpp | C++ | gtsam/discrete/DiscreteSequentialSolver.cpp | malcolmreynolds/GTSAM | e911b4d39f8a8c8604663bd46f10e7f53c860ae8 | [
"BSD-3-Clause"
] | 1 | 2017-07-23T19:34:50.000Z | 2017-07-23T19:34:50.000Z | gtsam/discrete/DiscreteSequentialSolver.cpp | malcolmreynolds/GTSAM | e911b4d39f8a8c8604663bd46f10e7f53c860ae8 | [
"BSD-3-Clause"
] | null | null | null | gtsam/discrete/DiscreteSequentialSolver.cpp | malcolmreynolds/GTSAM | e911b4d39f8a8c8604663bd46f10e7f53c860ae8 | [
"BSD-3-Clause"
] | null | null | null | /* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file DiscreteSequentialSolver.cpp
* @date Feb 16, 2011
* @author Duy-Nguyen Ta
* @author Frank Dellaert
*/
//#define ENABLE_TIMING
#include <gtsam/discrete/DiscreteSequentialSolver.h>
#include <gtsam/inference/GenericSequentialSolver-inl.h>
#include <gtsam/base/timing.h>
namespace gtsam {
template class GenericSequentialSolver<DiscreteFactor> ;
/* ************************************************************************* */
DiscreteFactor::sharedValues DiscreteSequentialSolver::optimize() const {
static const bool debug = false;
if (debug) this->factors_->print("DiscreteSequentialSolver, eliminating ");
if (debug) this->eliminationTree_->print(
"DiscreteSequentialSolver, elimination tree ");
// Eliminate using the elimination tree
gttic(eliminate);
DiscreteBayesNet::shared_ptr bayesNet = eliminate();
gttoc(eliminate);
if (debug) bayesNet->print("DiscreteSequentialSolver, Bayes net ");
// Allocate the solution vector if it is not already allocated
// Back-substitute
gttic(optimize);
DiscreteFactor::sharedValues solution = gtsam::optimize(*bayesNet);
gttoc(optimize);
if (debug) solution->print("DiscreteSequentialSolver, solution ");
return solution;
}
/* ************************************************************************* */
Vector DiscreteSequentialSolver::marginalProbabilities(
const DiscreteKey& key) const {
// Compute marginal
DiscreteFactor::shared_ptr marginalFactor;
marginalFactor = Base::marginalFactor(key.first, &EliminateDiscrete);
//Create result
Vector vResult(key.second);
for (size_t state = 0; state < key.second; ++state) {
DiscreteFactor::Values values;
values[key.first] = state;
vResult(state) = (*marginalFactor)(values);
}
return vResult;
}
/* ************************************************************************* */
}
| 30.671053 | 81 | 0.59245 | [
"vector"
] |
6aec6a012ab3a6bccfd955b69f394d6e734b81e1 | 6,072 | cpp | C++ | d3d12/Model.cpp | mattamert/mvw | 021d8ca7dd90413945429c56e708f66fce6ee161 | [
"BSD-3-Clause"
] | 1 | 2021-04-05T03:44:33.000Z | 2021-04-05T03:44:33.000Z | d3d12/Model.cpp | mattamert/mvw | 021d8ca7dd90413945429c56e708f66fce6ee161 | [
"BSD-3-Clause"
] | null | null | null | d3d12/Model.cpp | mattamert/mvw | 021d8ca7dd90413945429c56e708f66fce6ee161 | [
"BSD-3-Clause"
] | null | null | null | #include "d3d12/Model.h"
#include "d3d12/comhelper.h"
#include "d3d12/D3D12Renderer.h"
#include "d3d12/d3dx12.h"
#include "d3d12/ImageLoader.h"
#include "d3d12/ObjFileLoader.h"
#include <wrl/client.h> // For ComPtr
#include <assert.h>
#include <filesystem>
#include <iostream>
#include <vector>
using namespace Microsoft::WRL;
void Model::Init(D3D12Renderer* renderer,
const std::vector<ObjFileData::Vertex>& vertices,
const std::vector<uint32_t>& indices,
const std::vector<ObjFileData::MeshPart>& meshParts,
const std::vector<ObjFileData::Material>& materials) {
renderer->BeginResourceUpload();
std::vector<CD3DX12_RESOURCE_BARRIER> barriers;
barriers.reserve(2 + materials.size()); // 1 for vertex buffer, 1 for index buffer, 1 for each of the materials.
// Upload the vertex data.
const size_t vertexBufferSize = vertices.size() * sizeof(ObjFileData::Vertex);
m_vertexBuffer = renderer->AllocateAndUploadBufferData(vertices.data(), vertexBufferSize);
barriers.push_back(CD3DX12_RESOURCE_BARRIER::Transition(m_vertexBuffer.Get(), D3D12_RESOURCE_STATE_COPY_DEST,
D3D12_RESOURCE_STATE_GENERIC_READ));
m_vertexBufferView.BufferLocation = m_vertexBuffer->GetGPUVirtualAddress();
m_vertexBufferView.SizeInBytes = vertexBufferSize;
m_vertexBufferView.StrideInBytes = sizeof(ObjFileData::Vertex);
// Upload the index data.
const size_t indexBufferSize = indices.size() * sizeof(uint32_t);
m_indexBuffer = renderer->AllocateAndUploadBufferData(indices.data(), indexBufferSize);
barriers.push_back(CD3DX12_RESOURCE_BARRIER::Transition(m_indexBuffer.Get(), D3D12_RESOURCE_STATE_COPY_DEST,
D3D12_RESOURCE_STATE_GENERIC_READ));
m_indexBufferView.BufferLocation = m_indexBuffer->GetGPUVirtualAddress();
m_indexBufferView.SizeInBytes = indexBufferSize;
m_indexBufferView.Format = DXGI_FORMAT_R32_UINT;
// Just copy over the meshPart data.
m_meshParts = meshParts;
// Upload all of the texture data.
m_materials.resize(materials.size());
for (size_t i = 0; i < materials.size(); ++i) {
const ObjFileData::Material& material = materials[i];
if (std::filesystem::exists(material.diffuseMap.file)) {
Image img;
HR(Image::LoadImageFile(material.diffuseMap.file.wstring(), &img));
// Upload the texture.
m_materials[i].m_texture =
renderer->AllocateAndUploadTextureData(img.data.data(), img.format, img.bytesPerPixel, img.width, img.height,
/*out*/ &m_materials[i].m_srvDescriptor);
barriers.push_back(CD3DX12_RESOURCE_BARRIER::Transition(
m_materials[i].m_texture.Get(), D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE));
}
}
renderer->ExecuteBarriers(barriers.size(), barriers.data());
renderer->FinalizeResourceUpload();
}
void Model::InitCube(D3D12Renderer* renderer) {
std::vector<ObjFileData::Vertex> vertices = {
// +x direction
{{+1.0f, +1.0f, -1.0f}, {0.f, 0.f}, {1.f, 0.f, 0.f}},
{{+1.0f, +1.0f, +1.0f}, {1.f, 0.f}, {1.f, 0.f, 0.f}},
{{+1.0f, -1.0f, +1.0f}, {1.f, 1.f}, {1.f, 0.f, 0.f}},
{{+1.0f, -1.0f, -1.0f}, {0.f, 1.f}, {1.f, 0.f, 0.f}},
// -x direction
{{-1.0f, -1.0f, +1.0f}, {0.f, 0.f}, {-1.f, 0.f, 0.f}},
{{-1.0f, -1.0f, -1.0f}, {1.f, 0.f}, {-1.f, 0.f, 0.f}},
{{-1.0f, +1.0f, -1.0f}, {1.f, 1.f}, {-1.f, 0.f, 0.f}},
{{-1.0f, +1.0f, +1.0f}, {0.f, 1.f}, {-1.f, 0.f, 0.f}},
// +y direction
{{-1.0f, +1.0f, +1.0f}, {0.f, 0.f}, {0.f, 1.f, 0.f}},
{{+1.0f, +1.0f, +1.0f}, {1.f, 0.f}, {0.f, 1.f, 0.f}},
{{+1.0f, +1.0f, -1.0f}, {1.f, 1.f}, {0.f, 1.f, 0.f}},
{{-1.0f, +1.0f, -1.0f}, {0.f, 1.f}, {0.f, 1.f, 0.f}},
// -y direction
{{-1.0f, -1.0f, -1.0f}, {0.f, 0.f}, {0.f, -1.f, 0.f}},
{{+1.0f, -1.0f, -1.0f}, {1.f, 0.f}, {0.f, -1.f, 0.f}},
{{+1.0f, -1.0f, +1.0f}, {1.f, 1.f}, {0.f, -1.f, 0.f}},
{{-1.0f, -1.0f, +1.0f}, {0.f, 1.f}, {0.f, -1.f, 0.f}},
// +z direction
{{+1.0f, +1.0f, +1.0f}, {0.f, 0.f}, {0.f, 0.f, 1.f}},
{{-1.0f, +1.0f, +1.0f}, {1.f, 0.f}, {0.f, 0.f, 1.f}},
{{-1.0f, -1.0f, +1.0f}, {1.f, 1.f}, {0.f, 0.f, 1.f}},
{{+1.0f, -1.0f, +1.0f}, {0.f, 1.f}, {0.f, 0.f, 1.f}},
// -z direction
{{-1.0f, +1.0f, -1.0f}, {0.f, 0.f}, {0.f, 0.f, -1.f}},
{{+1.0f, +1.0f, -1.0f}, {1.f, 0.f}, {0.f, 0.f, -1.f}},
{{+1.0f, -1.0f, -1.0f}, {1.f, 1.f}, {0.f, 0.f, -1.f}},
{{-1.0f, -1.0f, -1.0f}, {0.f, 1.f}, {0.f, 0.f, -1.f}},
};
std::vector<uint32_t> indices;
indices.reserve(6 * 6); // 6 indices per face * 6 faces.
for (size_t i = 0; i < 6; ++i) {
uint32_t starting_index = i * 4;
indices.push_back(starting_index);
indices.push_back(starting_index + 1);
indices.push_back(starting_index + 2);
indices.push_back(starting_index);
indices.push_back(starting_index + 2);
indices.push_back(starting_index + 3);
}
for (size_t i = 0; i < 3; ++i) {
m_bounds.max[i] = 1.0;
m_bounds.min[i] = -1.0;
}
std::vector<ObjFileData::MeshPart> meshParts(1);
meshParts[0].indexStart = 0;
meshParts[0].numIndices = indices.size();
meshParts[0].materialIndex = -1;
// TODO: Pretty sure this will crash without a material. Should probably generate a generic material.
// (Or handle the case better where we don't have a material).
std::vector<ObjFileData::Material> materials;
Init(renderer, vertices, indices, meshParts, materials);
}
bool Model::InitFromObjFile(D3D12Renderer* renderer, const std::string& fileName) {
ObjFileData data;
if (!data.ParseObjFile(fileName)) {
return false;
}
m_bounds = data.m_bounds;
Init(renderer, data.m_vertices, data.m_indices, data.m_meshParts, data.m_materials);
return true;
}
D3D12_VERTEX_BUFFER_VIEW& Model::GetVertexBufferView() {
return m_vertexBufferView;
}
const ObjFileData::AxisAlignedBounds& Model::GetBounds() const {
return m_bounds;
}
| 38.43038 | 119 | 0.609848 | [
"vector",
"model"
] |
6aeffbe90fa2d1d4012dc8764e6ae9049e880823 | 24,756 | cc | C++ | src/mem/ruby/profiler/Profiler.cc | rtitos/gem5 | a9668f91d9f96aafc4a36453e3ba1242c60776a6 | [
"BSD-3-Clause"
] | null | null | null | src/mem/ruby/profiler/Profiler.cc | rtitos/gem5 | a9668f91d9f96aafc4a36453e3ba1242c60776a6 | [
"BSD-3-Clause"
] | 1 | 2022-01-31T13:15:08.000Z | 2022-01-31T13:15:08.000Z | src/mem/ruby/profiler/Profiler.cc | rtitos/gem5 | a9668f91d9f96aafc4a36453e3ba1242c60776a6 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 1999-2013 Mark D. Hill and David A. Wood
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer;
* redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution;
* neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
This file has been modified by Kevin Moore and Dan Nussbaum of the
Scalable Systems Research Group at Sun Microsystems Laboratories
(http://research.sun.com/scalable/) to support the Adaptive
Transactional Memory Test Platform (ATMTP).
Please send email to atmtp-interest@sun.com with feedback, questions, or
to request future announcements about ATMTP.
----------------------------------------------------------------------
File modification date: 2008-02-23
----------------------------------------------------------------------
*/
#include "mem/ruby/profiler/Profiler.hh"
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <fstream>
#include "base/stl_helpers.hh"
#include "base/str.hh"
#include "config/build_gpu.hh"
#include "mem/ruby/network/Network.hh"
#include "mem/ruby/profiler/AddressProfiler.hh"
#include "mem/ruby/protocol/MachineType.hh"
#include "mem/ruby/protocol/RubyRequest.hh"
#include "mem/ruby/profiler/XactProfiler.hh"
/**
* the profiler uses GPUCoalescer code even
* though the GPUCoalescer is not built for
* all ISAs, which can lead to run/link time
* errors. here we guard the coalescer code
* with ifdefs as there is no easy way to
* refactor this code without removing
* GPUCoalescer stats from the profiler.
*
* eventually we should use probe points
* here, but until then these ifdefs will
* serve.
*/
#if BUILD_GPU
#include "mem/ruby/system/GPUCoalescer.hh"
#endif
#include "mem/ruby/system/Sequencer.hh"
namespace gem5
{
namespace ruby
{
using stl_helpers::operator<<;
Profiler::Profiler(const RubySystemParams &p, RubySystem *rs)
: m_ruby_system(rs), m_hot_lines(p.hot_lines),
m_all_instructions(p.all_instructions),
m_num_vnets(p.number_of_virtual_networks),
m_xact_profiler(false),
rubyProfilerStats(rs, this)
{
m_address_profiler_ptr = new AddressProfiler(p.num_of_sequencers, this);
m_address_profiler_ptr->setHotLines(m_hot_lines);
m_address_profiler_ptr->setAllInstructions(m_all_instructions);
if (rs->getHTM() != nullptr) {
assert(p.protocol == "MESI_Two_Level_HTM_umu" ||
p.protocol == "MESI_Three_Level_HTM_umu");
m_xact_profiler = rs->getHTM()->params().profiler;
if (m_xact_profiler) {
m_xact_profiler_ptr = new XactProfiler(rs);
}
}
if (m_all_instructions) {
m_inst_profiler_ptr = new AddressProfiler(p.num_of_sequencers, this);
m_inst_profiler_ptr->setHotLines(m_hot_lines);
m_inst_profiler_ptr->setAllInstructions(m_all_instructions);
}
}
Profiler::~Profiler()
{
}
void
Profiler::resetStats()
{
if (m_xact_profiler) {
m_xact_profiler_ptr->resetStats();
}
}
Profiler::
ProfilerStats::ProfilerStats(statistics::Group *parent, Profiler *profiler)
: statistics::Group(parent),
perRequestTypeStats(parent),
perMachineTypeStats(parent),
perRequestTypeMachineTypeStats(parent),
ADD_STAT(delayHistogram, "delay histogram for all message"),
ADD_STAT(m_outstandReqHistSeqr, ""),
ADD_STAT(m_outstandReqHistCoalsr, ""),
ADD_STAT(m_latencyHistSeqr, ""),
ADD_STAT(m_latencyHistCoalsr, ""),
ADD_STAT(m_hitLatencyHistSeqr, ""),
ADD_STAT(m_missLatencyHistSeqr, ""),
ADD_STAT(m_missLatencyHistCoalsr, "")
{
#if 0
if (m_xact_profiler) {
m_xact_profiler_ptr->regStats(pName);
}
#endif
delayHistogram
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
for (int i = 0; i < profiler->m_num_vnets; i++) {
delayVCHistogram.push_back(new statistics::Histogram(this));
delayVCHistogram[i]
->init(10)
.name(csprintf("delayVCHist.vnet_%i", i))
.desc(csprintf("delay histogram for vnet_%i", i))
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
}
m_outstandReqHistSeqr
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_outstandReqHistCoalsr
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_latencyHistSeqr
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_latencyHistCoalsr
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_hitLatencyHistSeqr
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_missLatencyHistSeqr
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_missLatencyHistCoalsr
.init(10)
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
}
Profiler::ProfilerStats::
PerRequestTypeStats::PerRequestTypeStats(statistics::Group *parent)
: statistics::Group(parent, "RequestType")
{
for (int i = 0; i < RubyRequestType_NUM; i++) {
m_typeLatencyHistSeqr.push_back(new statistics::Histogram(this));
m_typeLatencyHistSeqr[i]
->init(10)
.name(csprintf("%s.latency_hist_seqr", RubyRequestType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_typeLatencyHistCoalsr.push_back(new statistics::Histogram(this));
m_typeLatencyHistCoalsr[i]
->init(10)
.name(csprintf("%s.latency_hist_coalsr", RubyRequestType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_hitTypeLatencyHistSeqr.push_back(new statistics::Histogram(this));
m_hitTypeLatencyHistSeqr[i]
->init(10)
.name(csprintf("%s.hit_latency_hist_seqr", RubyRequestType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_missTypeLatencyHistSeqr.push_back(new statistics::Histogram(this));
m_missTypeLatencyHistSeqr[i]
->init(10)
.name(csprintf("%s.miss_latency_hist_seqr", RubyRequestType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_missTypeLatencyHistCoalsr.push_back(new statistics::Histogram(this));
m_missTypeLatencyHistCoalsr[i]
->init(10)
.name(csprintf("%s.miss_latency_hist_coalsr", RubyRequestType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
}
}
Profiler::ProfilerStats::
PerMachineTypeStats::PerMachineTypeStats(statistics::Group *parent)
: statistics::Group(parent, "MachineType")
{
for (int i = 0; i < MachineType_NUM; i++) {
m_hitMachLatencyHistSeqr.push_back(new statistics::Histogram(this));
m_hitMachLatencyHistSeqr[i]
->init(10)
.name(csprintf("%s.hit_mach_latency_hist_seqr", MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_missMachLatencyHistSeqr.push_back(new statistics::Histogram(this));
m_missMachLatencyHistSeqr[i]
->init(10)
.name(csprintf("%s.miss_mach_latency_hist_seqr", MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_missMachLatencyHistCoalsr.push_back(new statistics::Histogram(this));
m_missMachLatencyHistCoalsr[i]
->init(10)
.name(csprintf("%s.miss_mach_latency_hist_coalsr",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_IssueToInitialDelayHistSeqr.push_back(
new statistics::Histogram(this));
m_IssueToInitialDelayHistSeqr[i]
->init(10)
.name(csprintf(
"%s.miss_latency_hist_seqr.issue_to_initial_request",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_IssueToInitialDelayHistCoalsr.push_back(
new statistics::Histogram(this));
m_IssueToInitialDelayHistCoalsr[i]
->init(10)
.name(csprintf(
"%s.miss_latency_hist_coalsr.issue_to_initial_request",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_InitialToForwardDelayHistSeqr.push_back(
new statistics::Histogram(this));
m_InitialToForwardDelayHistSeqr[i]
->init(10)
.name(csprintf("%s.miss_latency_hist_seqr.initial_to_forward",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_InitialToForwardDelayHistCoalsr
.push_back(new statistics::Histogram(this));
m_InitialToForwardDelayHistCoalsr[i]
->init(10)
.name(csprintf("%s.miss_latency_hist_coalsr.initial_to_forward",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_ForwardToFirstResponseDelayHistSeqr
.push_back(new statistics::Histogram(this));
m_ForwardToFirstResponseDelayHistSeqr[i]
->init(10)
.name(csprintf(
"%s.miss_latency_hist_seqr.forward_to_first_response",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_ForwardToFirstResponseDelayHistCoalsr
.push_back(new statistics::Histogram(this));
m_ForwardToFirstResponseDelayHistCoalsr[i]
->init(10)
.name(csprintf(
"%s.miss_latency_hist_coalsr.forward_to_first_response",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_FirstResponseToCompletionDelayHistSeqr
.push_back(new statistics::Histogram(this));
m_FirstResponseToCompletionDelayHistSeqr[i]
->init(10)
.name(csprintf(
"%s.miss_latency_hist_seqr.first_response_to_completion",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_FirstResponseToCompletionDelayHistCoalsr
.push_back(new statistics::Histogram(this));
m_FirstResponseToCompletionDelayHistCoalsr[i]
->init(10)
.name(csprintf(
"%s.miss_latency_hist_coalsr.first_response_to_completion",
MachineType(i)))
.desc("")
.flags(statistics::nozero | statistics::pdf | statistics::oneline);
m_IncompleteTimesSeqr.push_back(new statistics::Scalar(this));
m_IncompleteTimesSeqr[i]
->name(csprintf("%s.incomplete_times_seqr", MachineType(i)))
.desc("")
.flags(statistics::nozero);
}
}
Profiler::ProfilerStats::
PerRequestTypeMachineTypeStats::
PerRequestTypeMachineTypeStats(statistics::Group *parent)
: statistics::Group(parent, "RequestTypeMachineType")
{
for (int i = 0; i < RubyRequestType_NUM; i++) {
m_hitTypeMachLatencyHistSeqr
.push_back(std::vector<statistics::Histogram *>());
m_missTypeMachLatencyHistSeqr
.push_back(std::vector<statistics::Histogram *>());
m_missTypeMachLatencyHistCoalsr
.push_back(std::vector<statistics::Histogram *>());
for (int j = 0; j < MachineType_NUM; j++) {
m_hitTypeMachLatencyHistSeqr[i]
.push_back(new statistics::Histogram(this));
m_hitTypeMachLatencyHistSeqr[i][j]
->init(10)
.name(csprintf("%s.%s.hit_type_mach_latency_hist_seqr",
RubyRequestType(i), MachineType(j)))
.desc("")
.flags(statistics::nozero | statistics::pdf |
statistics::oneline);
m_missTypeMachLatencyHistSeqr[i]
.push_back(new statistics::Histogram(this));
m_missTypeMachLatencyHistSeqr[i][j]
->init(10)
.name(csprintf("%s.%s.miss_type_mach_latency_hist_seqr",
RubyRequestType(i), MachineType(j)))
.desc("")
.flags(statistics::nozero | statistics::pdf |
statistics::oneline);
m_missTypeMachLatencyHistCoalsr[i]
.push_back(new statistics::Histogram(this));
m_missTypeMachLatencyHistCoalsr[i][j]
->init(10)
.name(csprintf("%s.%s.miss_type_mach_latency_hist_coalsr",
RubyRequestType(i), MachineType(j)))
.desc("")
.flags(statistics::nozero | statistics::pdf |
statistics::oneline);
}
}
}
void
Profiler::collateStats()
{
if (!m_all_instructions) {
m_address_profiler_ptr->collateStats();
}
if (m_all_instructions) {
m_inst_profiler_ptr->collateStats();
}
assert(g_system_ptr != NULL);
#if 0
if (hasXactProfiler()) {
/* Ensure we profile all pending cycles before simulation
exits, and also print final tick/cycle in xact visualizer
by moving to invalid region and back.
*/
m_xact_profiler_ptr->profileCurrentAnnotatedRegion();
for (uint32_t i = 0;
i < m_ruby_system->params().num_of_sequencers;
++i) {
m_xact_profiler_ptr->moveTo(i, AnnotatedRegion_INVALID);
m_xact_profiler_ptr->moveTo(i, AnnotatedRegion_DEFAULT);
}
}
m_ruby_cycles = m_ruby_system->curCycle() - m_ruby_system->getStartCycle();
#endif
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (std::map<uint32_t, AbstractController*>::iterator it =
m_ruby_system->m_abstract_controls[i].begin();
it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
AbstractController *ctr = (*it).second;
rubyProfilerStats.delayHistogram.add(ctr->getDelayHist());
for (uint32_t i = 0; i < m_num_vnets; i++) {
rubyProfilerStats.
delayVCHistogram[i]->add(ctr->getDelayVCHist(i));
}
}
}
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (std::map<uint32_t, AbstractController*>::iterator it =
m_ruby_system->m_abstract_controls[i].begin();
it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
AbstractController *ctr = (*it).second;
Sequencer *seq = ctr->getCPUSequencer();
if (seq != NULL) {
rubyProfilerStats.
m_outstandReqHistSeqr.add(seq->getOutstandReqHist());
}
#if BUILD_GPU
GPUCoalescer *coal = ctr->getGPUCoalescer();
if (coal != NULL) {
rubyProfilerStats.
m_outstandReqHistCoalsr.add(coal->getOutstandReqHist());
}
#endif
}
}
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (std::map<uint32_t, AbstractController*>::iterator it =
m_ruby_system->m_abstract_controls[i].begin();
it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
AbstractController *ctr = (*it).second;
Sequencer *seq = ctr->getCPUSequencer();
if (seq != NULL) {
// add all the latencies
rubyProfilerStats.
m_latencyHistSeqr.add(seq->getLatencyHist());
rubyProfilerStats.
m_hitLatencyHistSeqr.add(seq->getHitLatencyHist());
rubyProfilerStats.
m_missLatencyHistSeqr.add(seq->getMissLatencyHist());
// add the per request type latencies
for (uint32_t j = 0; j < RubyRequestType_NUM; ++j) {
rubyProfilerStats
.perRequestTypeStats
.m_typeLatencyHistSeqr[j]
->add(seq->getTypeLatencyHist(j));
rubyProfilerStats
.perRequestTypeStats
.m_hitTypeLatencyHistSeqr[j]
->add(seq->getHitTypeLatencyHist(j));
rubyProfilerStats
.perRequestTypeStats
.m_missTypeLatencyHistSeqr[j]
->add(seq->getMissTypeLatencyHist(j));
}
// add the per machine type miss latencies
for (uint32_t j = 0; j < MachineType_NUM; ++j) {
rubyProfilerStats
.perMachineTypeStats
.m_hitMachLatencyHistSeqr[j]
->add(seq->getHitMachLatencyHist(j));
rubyProfilerStats
.perMachineTypeStats
.m_missMachLatencyHistSeqr[j]
->add(seq->getMissMachLatencyHist(j));
rubyProfilerStats
.perMachineTypeStats
.m_IssueToInitialDelayHistSeqr[j]
->add(seq->getIssueToInitialDelayHist(MachineType(j)));
rubyProfilerStats
.perMachineTypeStats
.m_InitialToForwardDelayHistSeqr[j]
->add(seq
->getInitialToForwardDelayHist(MachineType(j)));
rubyProfilerStats
.perMachineTypeStats
.m_ForwardToFirstResponseDelayHistSeqr[j]
->add(seq
->getForwardRequestToFirstResponseHist(
MachineType(j)));
rubyProfilerStats
.perMachineTypeStats
.m_FirstResponseToCompletionDelayHistSeqr[j]
->add(seq
->getFirstResponseToCompletionDelayHist(
MachineType(j)));
*(rubyProfilerStats
.perMachineTypeStats
.m_IncompleteTimesSeqr[j]) +=
seq->getIncompleteTimes(MachineType(j));
}
// add the per (request, machine) type miss latencies
for (uint32_t j = 0; j < RubyRequestType_NUM; j++) {
for (uint32_t k = 0; k < MachineType_NUM; k++) {
rubyProfilerStats
.perRequestTypeMachineTypeStats
.m_hitTypeMachLatencyHistSeqr[j][k]->add(
seq->getHitTypeMachLatencyHist(j,k));
rubyProfilerStats
.perRequestTypeMachineTypeStats
.m_missTypeMachLatencyHistSeqr[j][k]->add(
seq->getMissTypeMachLatencyHist(j,k));
}
}
}
#if BUILD_GPU
GPUCoalescer *coal = ctr->getGPUCoalescer();
if (coal != NULL) {
// add all the latencies
rubyProfilerStats.
m_latencyHistCoalsr.add(coal->getLatencyHist());
rubyProfilerStats.
m_missLatencyHistCoalsr.add(coal->getMissLatencyHist());
// add the per request type latencies
for (uint32_t j = 0; j < RubyRequestType_NUM; ++j) {
rubyProfilerStats
.perRequestTypeStats
.m_typeLatencyHistCoalsr[j]
->add(coal->getTypeLatencyHist(j));
rubyProfilerStats
.perRequestTypeStats
.m_missTypeLatencyHistCoalsr[j]
->add(coal->getMissTypeLatencyHist(j));
}
// add the per machine type miss latencies
for (uint32_t j = 0; j < MachineType_NUM; ++j) {
rubyProfilerStats
.perMachineTypeStats
.m_missMachLatencyHistCoalsr[j]
->add(coal->getMissMachLatencyHist(j));
rubyProfilerStats
.perMachineTypeStats
.m_IssueToInitialDelayHistCoalsr[j]
->add(coal->getIssueToInitialDelayHist(
MachineType(j)));
rubyProfilerStats
.perMachineTypeStats
.m_InitialToForwardDelayHistCoalsr[j]
->add(coal->getInitialToForwardDelayHist(
MachineType(j)));
rubyProfilerStats
.perMachineTypeStats
.m_ForwardToFirstResponseDelayHistCoalsr[j]
->add(coal->getForwardRequestToFirstResponseHist(
MachineType(j)));
rubyProfilerStats
.perMachineTypeStats
.m_FirstResponseToCompletionDelayHistCoalsr[j]
->add(coal->getFirstResponseToCompletionDelayHist(
MachineType(j)));
}
// add the per (request, machine) type miss latencies
for (uint32_t j = 0; j < RubyRequestType_NUM; j++) {
for (uint32_t k = 0; k < MachineType_NUM; k++) {
rubyProfilerStats
.perRequestTypeMachineTypeStats
.m_missTypeMachLatencyHistCoalsr[j][k]
->add(coal->getMissTypeMachLatencyHist(j,k));
}
}
}
#endif
}
}
}
void
Profiler::addAddressTraceSample(const RubyRequest& msg, NodeID id)
{
if (msg.getType() != RubyRequestType_IFETCH) {
// Note: The following line should be commented out if you
// want to use the special profiling that is part of the GS320
// protocol
// NOTE: Unless PROFILE_HOT_LINES is enabled, nothing will be
// profiled by the AddressProfiler
m_address_profiler_ptr->
addTraceSample(msg.getLineAddress(), msg.getProgramCounter(),
msg.getType(), msg.getAccessMode(), id, false);
}
}
void
Profiler::printProfilers() {
/* Anything that gets profiled but is not registered as a valid
statistic (via regStats) is printed here.
*/
if (m_xact_profiler) m_xact_profiler_ptr->printProfilers();
}
} // namespace ruby
} // namespace gem5
| 38.863422 | 79 | 0.584262 | [
"vector"
] |
6af0627d54e082becb71c1cb21792d4198196806 | 437 | cpp | C++ | codeforces/615/a.cpp | AadityaJ/Spoj | 61664c1925ef5bb072a3fe78fb3dac4fb68d77a1 | [
"MIT"
] | null | null | null | codeforces/615/a.cpp | AadityaJ/Spoj | 61664c1925ef5bb072a3fe78fb3dac4fb68d77a1 | [
"MIT"
] | null | null | null | codeforces/615/a.cpp | AadityaJ/Spoj | 61664c1925ef5bb072a3fe78fb3dac4fb68d77a1 | [
"MIT"
] | null | null | null | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[]) {
int n,m;
cin>>n>>m;
bool isbulbs[m+1];
for(int i=1;i<=m;i++) isbulbs[i]=0;
for(int i=0;i<n;i++){
int a,b;
cin>>a;
for(int j=0;j<a;j++){cin>>b;isbulbs[b]=1;}
}
bool flg=1;
for(int i=1;i<=m;i++){
if(isbulbs[i]==0){flg=0;break;}
}
if(flg) cout<<"YES";
else cout<<"NO";
return 0;
}
| 18.208333 | 44 | 0.585812 | [
"vector"
] |
6af3c701906499dbf186780b86a7aa538834efaf | 2,300 | cpp | C++ | hackerrank/algorithm/kruskalmstrsub.cpp | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | hackerrank/algorithm/kruskalmstrsub.cpp | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | hackerrank/algorithm/kruskalmstrsub.cpp | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = {0, 1, 0, -1};
template <typename T>
struct Edge {
int src, dst; T weight;
Edge(int src, int dst, T weight) : src(src), dst(dst), weight(weight) { }
bool operator < (const Edge<T> &e) const {
return weight < e.weight;
}
};
template <typename T>
struct Graph {
int V;
vector<Edge<T>> E;
Graph(int V) : V(V) { }
void add_edge(int src, int dst, T weight) {
E.emplace_back(src, dst, weight);
}
};
struct DisjointSet {
vector<int> parent, rank;
DisjointSet(int N) {
parent.resize(N), rank.resize(N, 0);
for (int i = 0; i < N; i++) parent[i] = i;
}
int find(int x) {
if (parent[x] == x) {
return x;
} else {
return parent[x] = find(parent[x]);
}
}
void unite(int x, int y) {
x = find(x), y = find(y);
if (x == y) return ;
if (rank[x] < rank[y]) {
parent[x] = y;
} else {
parent[y] = x;
if (rank[x] == rank[y]) rank[x]++;
}
}
bool same(int x, int y) { return find(x) == find(y); }
};
template <typename T>
struct MinimumSpanningTree {
Graph<T> g;
vector<Edge<T>> mst;
T mincost;
MinimumSpanningTree(const Graph<T> &g) : g(g) { }
T kruskal() {
mincost = 0;
sort(g.E.begin(), g.E.end());
DisjointSet uf(g.V);
for (int i = 0, edge_count = g.V - 1; edge_count; i++) {
assert(i < (int)g.E.size());
Edge<T> e = g.E[i];
if (!uf.same(e.src, e.dst)) {
uf.unite(e.src, e.dst);
mst.emplace_back(e);
mincost += e.weight;
edge_count--;
}
}
return mincost;
}
};
int main() {
// use scanf in CodeForces!
cin.tie(0);
ios_base::sync_with_stdio(false);
int V, E; cin >> V >> E;
Graph<int> g(V);
REP(_, E) {
int s, t, w; cin >> s >> t >> w; s--, t--;
g.add_edge(s, t, w);
g.add_edge(t, s, w);
}
MinimumSpanningTree<int> mst(g);
cout << mst.kruskal() << endl;
return 0;
}
| 19.827586 | 75 | 0.534783 | [
"vector"
] |
6afa5af9d2f9163544828b28e11096a3e5babe61 | 2,885 | cxx | C++ | smtk/bridge/discrete/legacycmb/CMBModel/Plugin/vtkGeoTransformOperatorClient.cxx | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | null | null | null | smtk/bridge/discrete/legacycmb/CMBModel/Plugin/vtkGeoTransformOperatorClient.cxx | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | 4 | 2016-11-10T15:49:51.000Z | 2017-02-06T23:24:16.000Z | smtk/bridge/discrete/legacycmb/CMBModel/Plugin/vtkGeoTransformOperatorClient.cxx | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | null | null | null | //=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#include "vtkGeoTransformOperatorClient.h"
#include "vtkDiscreteModel.h"
#include "vtkXMLModelReader.h"
#include "vtkObjectFactory.h"
#include "vtkSmartPointer.h"
#include "vtkSMIntVectorProperty.h"
#include "vtkSMOperatorProxy.h"
#include "vtkSMProxyManager.h"
#include "vtkSMStringVectorProperty.h"
#include <sstream>
vtkStandardNewMacro(vtkGeoTransformOperatorClient);
vtkGeoTransformOperatorClient::vtkGeoTransformOperatorClient()
{
this->ConvertFromLatLongToXYZ = false;
this->OperatorProxy = NULL;
}
vtkGeoTransformOperatorClient::~vtkGeoTransformOperatorClient()
{
if(this->OperatorProxy)
{
this->OperatorProxy->Delete();
this->OperatorProxy = NULL;
}
}
bool vtkGeoTransformOperatorClient::Operate(vtkDiscreteModel* Model,
vtkSMProxy* ServerModelProxy)
{
if(!this->AbleToOperate(Model)||
ServerModelProxy == NULL)
{
return 0;
}
if(!this->OperatorProxy)
{
vtkSMProxyManager* manager = vtkSMProxyManager::GetProxyManager();
this->OperatorProxy = vtkSMOperatorProxy::SafeDownCast(
manager->NewProxy("CMBModelGroup", "GeoTransformOperator"));
}
if(!this->OperatorProxy)
{
vtkErrorMacro("Unable to create builder operator proxy.");
return 0;
}
this->OperatorProxy->SetLocation(ServerModelProxy->GetLocation());
vtkSMIntVectorProperty* ivp = vtkSMIntVectorProperty::SafeDownCast(
this->OperatorProxy->GetProperty("ConvertFromLatLongToXYZ"));
ivp->SetElement(0, this->ConvertFromLatLongToXYZ);
this->OperatorProxy->UpdateVTKObjects();
this->OperatorProxy->Operate(Model, ServerModelProxy);
// check to see if the operation succeeded on the server
vtkSMIntVectorProperty* OperateSucceeded =
vtkSMIntVectorProperty::SafeDownCast(
this->OperatorProxy->GetProperty("OperateSucceeded"));
this->OperatorProxy->UpdatePropertyInformation();
int Succeeded = OperateSucceeded->GetElement(0);
if(!Succeeded)
{
vtkErrorMacro("Server side operator failed.");
return 0;
}
return 1;
}
bool vtkGeoTransformOperatorClient::AbleToOperate(vtkDiscreteModel* Model)
{
if(!Model)
{
vtkErrorMacro("Passed in a null model.");
return 0;
}
return 1;
}
void vtkGeoTransformOperatorClient::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Convert From Lat/Long to xyz: " <<
(this->ConvertFromLatLongToXYZ ? "On" : "Off");
}
| 26.712963 | 76 | 0.697054 | [
"model"
] |
139162c6505e183a31702e2c54daca753b1dc2bd | 16,190 | cpp | C++ | src/Factory/Module/Decoder/Turbo_product/Decoder_turbo_product.cpp | OlivierHartmann/aff3ct | 58c66228b24e09463bd43ea6453ef18bcacd4d8f | [
"MIT"
] | null | null | null | src/Factory/Module/Decoder/Turbo_product/Decoder_turbo_product.cpp | OlivierHartmann/aff3ct | 58c66228b24e09463bd43ea6453ef18bcacd4d8f | [
"MIT"
] | 4 | 2018-09-27T16:46:31.000Z | 2018-11-22T11:10:41.000Z | src/Factory/Module/Decoder/Turbo_product/Decoder_turbo_product.cpp | OlivierHartmann/aff3ct | 58c66228b24e09463bd43ea6453ef18bcacd4d8f | [
"MIT"
] | null | null | null | #include "Tools/Exception/exception.hpp"
#include "Tools/general_utils.h"
#include "Tools/Arguments/Splitter/Splitter.hpp"
#include "Module/Decoder/Turbo_product/Chase_pyndiah/Decoder_chase_pyndiah.hpp"
#include "Module/Decoder/Turbo_product/Decoder_turbo_product.hpp"
#include "Decoder_turbo_product.hpp"
const std::string aff3ct::factory::Decoder_turbo_product_name = "Decoder Turbo Product Code";
const std::string aff3ct::factory::Decoder_turbo_product_prefix = "dec";
using namespace aff3ct;
using namespace aff3ct::factory;
Decoder_turbo_product::parameters
::parameters(const std::string &prefix)
: Decoder::parameters(Decoder_turbo_product_name, prefix),
sub(new Decoder_BCH::parameters(prefix+"-sub")),
itl(new Interleaver::parameters("itl"))
{
this->type = "CP";
this->implem = "STD";
}
Decoder_turbo_product::parameters* Decoder_turbo_product::parameters
::clone() const
{
return new Decoder_turbo_product::parameters(*this);
}
std::vector<std::string> Decoder_turbo_product::parameters
::get_names() const
{
auto n = Decoder::parameters::get_names();
if (sub != nullptr) { auto nn = sub->get_names(); for (auto &x : nn) n.push_back(x); }
if (itl != nullptr) { auto nn = itl->get_names(); for (auto &x : nn) n.push_back(x); }
return n;
}
std::vector<std::string> Decoder_turbo_product::parameters
::get_short_names() const
{
auto sn = Decoder::parameters::get_short_names();
if (sub != nullptr) { auto nn = sub->get_short_names(); for (auto &x : nn) sn.push_back(x); }
if (itl != nullptr) { auto nn = itl->get_short_names(); for (auto &x : nn) sn.push_back(x); }
return sn;
}
std::vector<std::string> Decoder_turbo_product::parameters
::get_prefixes() const
{
auto p = Decoder::parameters::get_prefixes();
if (sub != nullptr) { auto nn = sub->get_prefixes(); for (auto &x : nn) p.push_back(x); }
if (itl != nullptr) { auto nn = itl->get_prefixes(); for (auto &x : nn) p.push_back(x); }
return p;
}
struct Real_splitter
{
static std::vector<std::string> split(const std::string& val)
{
const std::string head = "{([";
const std::string queue = "})]";
const std::string separator = ",";
return tools::Splitter::split(val, head, queue, separator);
}
};
void Decoder_turbo_product::parameters
::get_description(tools::Argument_map_info &args) const
{
Decoder::parameters::get_description(args);
auto p = this->get_prefix();
args.erase({p+"-info-bits", "K"});
args.erase({p+"-cw-size", "N"});
if (itl != nullptr)
{
itl->get_description(args);
auto pi = this->itl->get_prefix();
args.erase({pi+"-size" });
args.erase({pi+"-fra", "F"});
}
tools::add_options(args.at({p+"-type", "D"}), 0, "CP");
tools::add_options(args.at({p+"-implem" }), 0, "FAST");
args.add(
{p+"-ite", "i"},
tools::Integer(tools::Positive(), tools::Non_zero()),
"maximal number of iterations in the turbo.");
args.add(
{p+"-alpha"},
tools::List<float,Real_splitter>(tools::Real(), tools::Length(1)),
"weighting factor, one by half iteration (so twice more than number of iterations)."
" If not enough given values, then automatically extends the last to all iterations.");
args.add(
{p+"-beta"},
tools::List<float,Real_splitter>(tools::Real(tools::Positive()), tools::Length(1)),
"reliability factor, one by half iteration (so twice more than number of iterations)."
" If not enough given values, then automatically extends the last to all iterations."
" If not given, then computes beta dynamically from the least reliable position metrics.");
args.add(
{p+"-p"},
tools::Integer(tools::Positive(), tools::Non_zero()),
"number of least reliable positions.");
args.add(
{p+"-t"},
tools::Integer(tools::Positive()),
"number of test vectors (0 means equal to 2^p).");
args.add(
{p+"-c"},
tools::Integer(tools::Positive()),
"number of competitors (0 means equal to number of test vectors, 1 means only the decided word).");
args.add(
{p+"-ext"},
tools::None(),
"extends code with a parity bits.");
args.add(
{p+"-cp-coef"},
tools::List<float,Real_splitter>(tools::Real(), tools::Length(5,5)),
"the 5 Chase Pyndiah constant coefficients \"a,b,c,d,e\".");
sub->get_description(args);
auto ps = sub->get_prefix();
args.erase({ps+"-fra", "F"});
}
void Decoder_turbo_product::parameters
::store(const tools::Argument_map_value &vals)
{
Decoder::parameters::store(vals);
auto p = this->get_prefix();
if(vals.exist({p+"-ite", "i"})) this->n_ite = vals.to_int({p+"-ite", "i"});
if(vals.exist({p+"-p" })) this->n_least_reliable_positions = vals.to_int({p+"-p" });
if(vals.exist({p+"-t"}))
this->n_test_vectors = vals.to_int({p+"-t"});
else
this->n_test_vectors = 1<<this->n_least_reliable_positions;
if(vals.exist({p+"-c"}))
this->n_competitors = vals.to_int({p+"-c"});
else
this->n_competitors = this->n_test_vectors;
if(vals.exist({p+"-ext"})) this->parity_extended = true;
if(vals.exist({p+"-alpha"}))
{
this->alpha = vals.to_list<float>({p+"-alpha"});
this->alpha.resize(this->n_ite*2, alpha.back());
}
else
{
this->alpha.clear();
this->alpha.resize(this->n_ite*2, 0.5f);
}
if(vals.exist({p+"-beta"}))
{
this->beta = vals.to_list<float>({p+"-beta"});
this->beta.resize(this->n_ite*2, beta.back());
}
else
{
this->beta.clear();
}
if(vals.exist({p+"-cp-coef"}))
this->cp_coef = vals.to_list<float>({p+"-cp-coef"});
else
{
this->cp_coef.clear();
this->cp_coef.resize(5, 1.f);
this->cp_coef[4] = 0;
}
// this->sub->n_frames = this->n_frames;
sub->store(vals);
this->K = this->sub->K * this->sub->K;
this->R = (float)this->K / (float)this->N_cw;
if (itl != nullptr)
{
this->itl->core->n_frames = this->n_frames;
this->itl->core->type = "ROW_COL";
if (parity_extended)
this->itl->core->n_cols = this->sub->N_cw +1;
else
this->itl->core->n_cols = this->sub->N_cw;
this->itl->core->size = this->itl->core->n_cols * this->itl->core->n_cols;
this->N_cw = this->itl->core->size;
itl->store(vals);
}
}
void Decoder_turbo_product::parameters
::get_headers(std::map<std::string,header_list>& headers, const bool full) const
{
Decoder::parameters::get_headers(headers, full);
if (this->type != "ML")
{
auto p = this->get_prefix();
if (itl != nullptr)
itl->get_headers(headers, full);
headers[p].push_back(std::make_pair("Num. of iterations (i)", std::to_string(n_ite)));
std::stringstream alpha_str;
alpha_str << "{";
for (unsigned i = 0; i < this->alpha.size(); i++)
alpha_str << this->alpha[i] << (i == this->alpha.size()-1 ?"":", ");
alpha_str << "}";
headers[p].push_back(std::make_pair("alpha", alpha_str.str()));
if (this->beta.size())
{
std::stringstream beta_str;
beta_str << "{";
for (unsigned i = 0; i < this->beta.size(); i++)
beta_str << this->beta[i] << (i == this->beta.size()-1 ?"":", ");
beta_str << "}";
headers[p].push_back(std::make_pair("beta", beta_str.str()));
}
std::stringstream cp_coeff_str;
cp_coeff_str << "{";
for (unsigned i = 0; i < this->cp_coef.size(); i++)
cp_coeff_str << this->cp_coef[i] << (i == this->cp_coef.size()-1 ?"":", ");
cp_coeff_str << "}";
headers[p].push_back(std::make_pair("Chase Pyndiah coeff.", cp_coeff_str.str()));
headers[p].push_back(std::make_pair("Num. least reliable pos (p)", std::to_string(n_least_reliable_positions)));
headers[p].push_back(std::make_pair("Num. test vectors (t)", std::to_string(n_test_vectors)));
headers[p].push_back(std::make_pair("Num. competitors (c)", std::to_string(n_competitors)));
headers[p].push_back(std::make_pair("Parity extended", (this->parity_extended ? "yes" : "no")));
sub->get_headers(headers, full);
}
}
template <typename B, typename Q>
module::Decoder_SIHO<B,Q>* Decoder_turbo_product::parameters
::build(const module::Interleaver <Q> &itl,
module::Decoder_chase_pyndiah<B,Q> &cp_r,
module::Decoder_chase_pyndiah<B,Q> &cp_c,
const std::unique_ptr<module::Encoder<B>>& encoder) const
{
try
{
return Decoder::parameters::build<B,Q>(encoder);
}
catch (tools::cannot_allocate const&)
{
if (this->type == "CP")
{
if (this->implem == "STD")
return new module::Decoder_turbo_product<B,Q>(n_ite, alpha, itl, cp_r, cp_c, beta, n_frames);
}
}
throw tools::cannot_allocate(__FILE__, __LINE__, __func__);
}
template <typename B, typename Q>
module::Decoder_SISO_SIHO<B,Q>* Decoder_turbo_product::parameters
::build_siso(const module::Interleaver <Q> &itl,
module::Decoder_chase_pyndiah<B,Q> &cp_r,
module::Decoder_chase_pyndiah<B,Q> &cp_c) const
{
throw tools::cannot_allocate(__FILE__, __LINE__, __func__);
}
template <typename B, typename Q>
module::Decoder_SIHO<B,Q>* Decoder_turbo_product
::build(const parameters ¶ms,
const module::Interleaver <Q> &itl,
module::Decoder_chase_pyndiah<B,Q> &cp_r,
module::Decoder_chase_pyndiah<B,Q> &cp_c,
const std::unique_ptr<module::Encoder<B>>& encoder)
{
return params.template build<B,Q>(itl, cp_r, cp_c, encoder);
}
template <typename B, typename Q>
module::Decoder_SISO_SIHO<B,Q>* Decoder_turbo_product
::build_siso(const parameters ¶ms,
const module::Interleaver <Q> &itl,
module::Decoder_chase_pyndiah<B,Q> &cp_r,
module::Decoder_chase_pyndiah<B,Q> &cp_c)
{
return params.template build_siso<B,Q>(itl, cp_r, cp_c);
}
// ==================================================================================== explicit template instantiation
#include "Tools/types.h"
#ifdef AFF3CT_MULTI_PREC
template aff3ct::module::Decoder_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_turbo_product::parameters::build<B_8 ,Q_8 >(const aff3ct::module::Interleaver<Q_8 >&, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &, const std::unique_ptr<module::Encoder<B_8 >>&) const;
template aff3ct::module::Decoder_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_turbo_product::parameters::build<B_16,Q_16>(const aff3ct::module::Interleaver<Q_16>&, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &, const std::unique_ptr<module::Encoder<B_16>>&) const;
template aff3ct::module::Decoder_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_turbo_product::parameters::build<B_32,Q_32>(const aff3ct::module::Interleaver<Q_32>&, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &, const std::unique_ptr<module::Encoder<B_32>>&) const;
template aff3ct::module::Decoder_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_turbo_product::parameters::build<B_64,Q_64>(const aff3ct::module::Interleaver<Q_64>&, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &, const std::unique_ptr<module::Encoder<B_64>>&) const;
template aff3ct::module::Decoder_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_turbo_product::build<B_8 ,Q_8 >(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_8 >&, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &, const std::unique_ptr<module::Encoder<B_8 >>&);
template aff3ct::module::Decoder_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_turbo_product::build<B_16,Q_16>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_16>&, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &, const std::unique_ptr<module::Encoder<B_16>>&);
template aff3ct::module::Decoder_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_turbo_product::build<B_32,Q_32>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_32>&, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &, const std::unique_ptr<module::Encoder<B_32>>&);
template aff3ct::module::Decoder_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_turbo_product::build<B_64,Q_64>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_64>&, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &, const std::unique_ptr<module::Encoder<B_64>>&);
#else
template aff3ct::module::Decoder_SIHO<B,Q>* aff3ct::factory::Decoder_turbo_product::parameters::build<B,Q>(const aff3ct::module::Interleaver<Q>&, aff3ct::module::Decoder_chase_pyndiah<B,Q> &, aff3ct::module::Decoder_chase_pyndiah<B,Q> &, const std::unique_ptr<module::Encoder<B>>& ) const;
template aff3ct::module::Decoder_SIHO<B,Q>* aff3ct::factory::Decoder_turbo_product::build<B,Q>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q>&, aff3ct::module::Decoder_chase_pyndiah<B,Q> &, aff3ct::module::Decoder_chase_pyndiah<B,Q> &, const std::unique_ptr<module::Encoder<B>>& );
#endif
#ifdef AFF3CT_MULTI_PREC
template aff3ct::module::Decoder_SISO_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_turbo_product::parameters::build_siso<B_8 ,Q_8 >(const aff3ct::module::Interleaver<Q_8 >&, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &) const;
template aff3ct::module::Decoder_SISO_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_turbo_product::parameters::build_siso<B_16,Q_16>(const aff3ct::module::Interleaver<Q_16>&, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &) const;
template aff3ct::module::Decoder_SISO_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_turbo_product::parameters::build_siso<B_32,Q_32>(const aff3ct::module::Interleaver<Q_32>&, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &) const;
template aff3ct::module::Decoder_SISO_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_turbo_product::parameters::build_siso<B_64,Q_64>(const aff3ct::module::Interleaver<Q_64>&, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &) const;
template aff3ct::module::Decoder_SISO_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_turbo_product::build_siso<B_8 ,Q_8 >(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_8 >&, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &, aff3ct::module::Decoder_chase_pyndiah<B_8 ,Q_8 > &);
template aff3ct::module::Decoder_SISO_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_turbo_product::build_siso<B_16,Q_16>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_16>&, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &, aff3ct::module::Decoder_chase_pyndiah<B_16,Q_16> &);
template aff3ct::module::Decoder_SISO_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_turbo_product::build_siso<B_32,Q_32>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_32>&, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &, aff3ct::module::Decoder_chase_pyndiah<B_32,Q_32> &);
template aff3ct::module::Decoder_SISO_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_turbo_product::build_siso<B_64,Q_64>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q_64>&, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &, aff3ct::module::Decoder_chase_pyndiah<B_64,Q_64> &);
#else
template aff3ct::module::Decoder_SISO_SIHO<B,Q>* aff3ct::factory::Decoder_turbo_product::parameters::build_siso<B,Q>(const aff3ct::module::Interleaver<Q>&, aff3ct::module::Decoder_chase_pyndiah<B,Q> &, aff3ct::module::Decoder_chase_pyndiah<B,Q> &) const;
template aff3ct::module::Decoder_SISO_SIHO<B,Q>* aff3ct::factory::Decoder_turbo_product::build_siso<B,Q>(const aff3ct::factory::Decoder_turbo_product::parameters&, const aff3ct::module::Interleaver<Q>&, aff3ct::module::Decoder_chase_pyndiah<B,Q> &, aff3ct::module::Decoder_chase_pyndiah<B,Q> &);
#endif
// ==================================================================================== explicit template instantiation
| 44.847645 | 359 | 0.700062 | [
"vector"
] |
13941485f361ccb75163d180f815b8989c955710 | 2,402 | cpp | C++ | src/synthesis/synStrategy.cpp | saffiepig/Syft | 121a9a1f6ac818138963d92889f44e0f98b59796 | [
"MIT"
] | 4 | 2018-10-30T18:40:21.000Z | 2020-03-24T15:19:27.000Z | src/synthesis/synStrategy.cpp | Shufang-Zhu/Syft | 121a9a1f6ac818138963d92889f44e0f98b59796 | [
"MIT"
] | 1 | 2020-08-04T03:45:30.000Z | 2020-08-04T03:45:30.000Z | src/synthesis/synStrategy.cpp | Shufang-Zhu/Syft | 121a9a1f6ac818138963d92889f44e0f98b59796 | [
"MIT"
] | 4 | 2018-09-17T15:59:05.000Z | 2020-05-03T13:57:12.000Z | #include <iostream>
#include <string>
#include <algorithm>
#include "syn.h"
using namespace std;
void printVector(std::vector<int>& state){
for(auto & s : state)
std::cout<<s;
std::cout<<std::endl;
}
void playGame(DFA& game, std::unordered_map<unsigned, BDD>& strategy){
std::vector<int> cur(game.nbits);
bool cont = true;
std::vector<int> input;
while (1){
std::cout<<"State: ";
int state_int = 0;
for (int i=0; i<cur.size(); i++){
state_int*=2;
state_int += cur[i];
}
std::cout<<state_int<<std::endl;
if (std::find(game.finalstates.begin(), game.finalstates.end(), state_int) != game.finalstates.end()){
std::cout<<"robot wins"<<std::endl;
return;
}
std::vector<int> zxy = cur;
zxy.resize(game.nbits+game.nvars);
// set the outputs from the strategy
for (auto & o : game.output){
std::cout<<"Value for output "<<game.variables[o-game.nbits+1]<<": ";
if (strategy[o].Eval(&cur[0]).IsOne())
zxy[o] = 1;
else
zxy[o] = 0;
std::cout<<zxy[o]<<std::endl;
}
for (auto & i : game.input){
int input;
// +1 because the first field for variables is "variables:"
std::cout<<"Value for input "<<game.variables[i-game.nbits+1]<<": ";
std::cin>>input;
if (input==0)
zxy[i] = 0;
else if (input==1)
zxy[i] = 1;
else
return;
}
std::cout<<"Z-XY:";
printVector(zxy);
for (int i=0; i<game.nbits; i++){
if (game.res[i].Eval(&zxy[0]).IsOne())
cur[i] = 1;
else
cur[i] = 0;
}
}
}
int main(int argc, char ** argv){
string filename;
string partfile;
string flag;
if(argc != 3){
cout<<"Usage: ./Syft DFAfile Partfile"<<endl;
return 0;
}
else{
filename = argv[1];
partfile = argv[2];
}
Cudd* mgr = new Cudd();
syn test(mgr, filename, partfile);
std::unordered_map<unsigned, BDD> S2O;
std::clock_t begint = std::clock();
bool res = test.realizablity_sys(S2O);
double time = double(std::clock()-begint) / CLOCKS_PER_SEC;
if(res){
cout<<"realizable, time = "<<time<<endl;
/* for (auto & pair : S2O){
std::cout<<pair.first<<": ";
test.printBDDSat(pair.second);
}*/
playGame(*(test.bdd), S2O);
}
else
cout<<"unrealizable, time = "<<time<<endl;
return 0;
}
//solveeqn
| 22.448598 | 106 | 0.555371 | [
"vector"
] |
1394d5d23e4658b5c5bd65be6e8a9a01a920c8a0 | 2,954 | hh | C++ | gazebo/gui/model/ExtrudeDialog.hh | harderthan/gazebo | f00a0e4239ddb08b299dc21ab1ef106ecedb0fac | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | gazebo/gui/model/ExtrudeDialog.hh | harderthan/gazebo | f00a0e4239ddb08b299dc21ab1ef106ecedb0fac | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | gazebo/gui/model/ExtrudeDialog.hh | harderthan/gazebo | f00a0e4239ddb08b299dc21ab1ef106ecedb0fac | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | /*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* 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 _GAZEBO_EXTRUDE_DIALOG_HH_
#define _GAZEBO_EXTRUDE_DIALOG_HH_
#include <string>
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
class ExtrudeDialogPrivate;
/// \addtogroup gazebo_gui
/// \{
/// \class ExtrudeDialog ExtrudeDialog.hh gui/gui.hh
/// \brief Dialog for saving to file.
class GZ_GUI_MODEL_VISIBLE ExtrudeDialog : public QDialog
{
Q_OBJECT
/// \brief Constructor.
/// \param[in] _filename Full path to the SVG file.
/// \param[in] _parent Parent QWidget.
public: ExtrudeDialog(const std::string &_filename, QWidget *_parent = 0);
/// \brief Destructor.
public: ~ExtrudeDialog();
/// \brief Reload SVG file to update the view with the current data in
/// the dialog.
public: void UpdateView();
/// \brief Get the thickness value.
/// \return Thickness value.
public: double GetThickness() const;
/// \brief Get the number of samples per segment.
/// \return Number of samples.
public: unsigned int GetSamples() const;
/// \brief Get the resolution in px/m.
/// \return Resolution value.
public: double GetResolution() const;
/// \brief Qt callback when the dialog is accepted.
private slots: void OnAccept();
/// \brief Qt callback when the dialog is rejected.
private slots: void OnReject();
/// \brief Qt callback when an int value was changed and the view.
/// should be updated.
/// \param[in] _value New value, not used but needed for the slot.
private slots: void OnUpdateView(int _value);
/// \brief Qt callback when a double value was changed and the view.
/// should be updated.
/// \param[in] _value New value, not used but needed for the slot.
private slots: void OnUpdateView(double _value);
/// \brief Qt event filter used to filter child widget events.
/// \param[in] _obj Object that is watched by the event filter.
/// \param[in] _event Qt event.
/// \return True if the event is handled.
private: bool eventFilter(QObject *_obj, QEvent *_event);
/// \internal
/// \brief Pointer to private data.
private: ExtrudeDialogPrivate *dataPtr;
};
/// \}
}
}
#endif
| 30.770833 | 80 | 0.661137 | [
"object"
] |
139672fb78dbd1663c02ebf246fa9a5554f98d8c | 17,449 | inl | C++ | Src/PointStream.inl | pierotofy/PoissonRecon | 3107d150fbb9162d1226f659cfbe094eed7fceb2 | [
"MIT"
] | 1 | 2020-09-07T13:47:26.000Z | 2020-09-07T13:47:26.000Z | adaptive solver/Src/PointStream.inl | korfriend/LocalIsosurfaceModeler | 6ca0080c24e1f7a6bdf27d915d653104c82f142c | [
"MIT"
] | null | null | null | adaptive solver/Src/PointStream.inl | korfriend/LocalIsosurfaceModeler | 6ca0080c24e1f7a6bdf27d915d653104c82f142c | [
"MIT"
] | null | null | null | /*
Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
*/
////////////////////////////
// MemoryInputPointStream //
////////////////////////////
template< class Real , int Dim >
MemoryInputPointStream< Real , Dim >::MemoryInputPointStream( size_t pointCount , const Point< Real , Dim >* points ){ _points = points , _pointCount = pointCount , _current = 0; }
template< class Real , int Dim >
MemoryInputPointStream< Real , Dim >::~MemoryInputPointStream( void ){ ; }
template< class Real , int Dim >
void MemoryInputPointStream< Real , Dim >::reset( void ) { _current=0; }
template< class Real , int Dim >
bool MemoryInputPointStream< Real , Dim >::nextPoint( Point< Real , Dim >& p )
{
if( _current>=_pointCount ) return false;
p = _points[_current];
_current++;
return true;
}
///////////////////////////
// ASCIIInputPointStream //
///////////////////////////
template< class Real , int Dim >
ASCIIInputPointStream< Real , Dim >::ASCIIInputPointStream( const char* fileName )
{
_fp = fopen( fileName , "r" );
if( !_fp ) ERROR_OUT( "Failed to open file for reading: %s" , fileName );
}
template< class Real , int Dim >
ASCIIInputPointStream< Real , Dim >::~ASCIIInputPointStream( void )
{
fclose( _fp );
_fp = NULL;
}
template< class Real , int Dim >
void ASCIIInputPointStream< Real , Dim >::reset( void ) { fseek( _fp , SEEK_SET , 0 ); }
template< class Real , int Dim >
bool ASCIIInputPointStream< Real , Dim >::nextPoint( Point< Real , Dim >& p )
{
float c;
for( int d=0 ; d<Dim ; d++ )
if( fscanf( _fp , " %f " , &c )!=1 ) return false;
else p[d] = (Real)c;
return true;
}
////////////////////////////
// ASCIIOutputPointStream //
////////////////////////////
template< class Real , int Dim >
ASCIIOutputPointStream< Real , Dim >::ASCIIOutputPointStream( const char* fileName )
{
_fp = fopen( fileName , "w" );
if( !_fp ) ERROR_OUT( "Failed to open file for writing: %s" , fileName );
}
template< class Real , int Dim >
ASCIIOutputPointStream< Real , Dim >::~ASCIIOutputPointStream( void )
{
fclose( _fp );
_fp = NULL;
}
template< class Real , int Dim >
void ASCIIOutputPointStream< Real , Dim >::nextPoint( const Point< Real , Dim >& p )
{
for( int d=0 ; d<Dim ; d++ ) fprintf( _fp , " %f" , (float)p[d] );
fprintf( _fp , "\n" );
}
////////////////////////////
// BinaryInputPointStream //
////////////////////////////
template< class Real , int Dim >
BinaryInputPointStream< Real , Dim >::BinaryInputPointStream( const char* fileName )
{
_fp = fopen( fileName , "rb" );
if( !_fp ) ERROR_OUT( "Failed to open file for reading: %s" , fileName );
}
template< class Real , int Dim >
bool BinaryInputPointStream< Real , Dim >::nextPoint( Point< Real , Dim >& p ){ return fread( &p , sizeof(Point< Real , Dim >) , 1 , _fp )==1; }
/////////////////////////////
// BinaryOutputPointStream //
/////////////////////////////
template< class Real , int Dim >
BinaryOutputPointStream< Real , Dim >::BinaryOutputPointStream( const char* fileName )
{
_fp = fopen( fileName , "wb" );
if( !_fp ) ERROR_OUT( "Failed to open file for writing: %s" , fileName );
}
template< class Real , int Dim >
void BinaryOutputPointStream< Real , Dim >::nextPoint( const Point< Real , Dim >& p ){ fwrite( &p , sizeof(Point< Real , Dim >) , 1 , _fp )==1; }
/////////////////////////
// PLYInputPointStream //
/////////////////////////
template< class Real , int Dim >
PLYInputPointStream< Real , Dim >::PLYInputPointStream( const char* fileName )
{
_fileName = new char[ strlen( fileName )+1 ];
strcpy( _fileName , fileName );
_ply = NULL;
reset();
}
template< class Real , int Dim >
void PLYInputPointStream< Real , Dim >::reset( void )
{
int fileType;
float version;
std::vector< PlyProperty * > plist;
if( _ply ) _free();
_ply = PlyFile::Read( _fileName, _elist, fileType, version );
if( !_ply ) ERROR_OUT( "Failed to open ply file for reading: %s" , _fileName );
bool foundVertices = false;
for( int i=0 ; i<_elist.size() ; i++ )
{
int num_elems;
std::string &elem_name = _elist[i];
plist = _ply->get_element_description( elem_name , num_elems );
if( !plist.size() ) ERROR_OUT( "Failed to get element description: %s" , elem_name );
if( elem_name=="vertex" )
{
foundVertices = true;
_pCount = num_elems , _pIdx = 0;
for( int i=0 ; i<PlyVertex< Real , Dim >::ReadComponents ; i++ )
if( !_ply->get_property( elem_name , &(PlyVertex< Real , Dim >::Properties()[i]) ) ) ERROR_OUT( "Failed to find property in ply file: %s" , PlyVertex< Real , Dim >::Properties()[i].name );
}
for( int j=0 ; j<plist.size() ; j++ ) delete plist[j];
if( foundVertices ) break;
}
if( !foundVertices ) ERROR_OUT( "Could not find vertices in ply file" );
}
template< class Real , int Dim >
void PLYInputPointStream< Real , Dim >::_free( void ){ delete _ply; }
template< class Real , int Dim >
PLYInputPointStream< Real , Dim >::~PLYInputPointStream( void )
{
_free();
if( _fileName ) delete[] _fileName , _fileName = NULL;
}
template< class Real , int Dim >
bool PLYInputPointStream< Real , Dim >::nextPoint( Point< Real , Dim >& p )
{
if( _pIdx<_pCount )
{
PlyVertex< Real , Dim > v;
_ply->get_element( (void *)&v );
p = v.point;
_pIdx++;
return true;
}
else return false;
}
////////////////////////////////////
// MemoryInputPointStreamWithData //
////////////////////////////////////
template< class Real , int Dim , class Data >
MemoryInputPointStreamWithData< Real , Dim , Data >::MemoryInputPointStreamWithData( size_t pointCount , const std::pair< Point< Real , Dim > , Data >* points ){ _points = points , _pointCount = pointCount , _current = 0; }
template< class Real , int Dim , class Data >
MemoryInputPointStreamWithData< Real , Dim , Data >::~MemoryInputPointStreamWithData( void ){ ; }
template< class Real , int Dim , class Data >
void MemoryInputPointStreamWithData< Real , Dim , Data >::reset( void ) { _current=0; }
template< class Real , int Dim , class Data >
bool MemoryInputPointStreamWithData< Real , Dim , Data >::nextPoint( Point< Real , Dim >& p , Data& d )
{
if( _current>=_pointCount ) return false;
p = _points[_current].first;
d = _points[_current].second;
_current++;
return true;
}
///////////////////////////////////
// ASCIIInputPointStreamWithData //
///////////////////////////////////
template< class Real , int Dim , class Data >
ASCIIInputPointStreamWithData< Real , Dim , Data >::ASCIIInputPointStreamWithData( const char* fileName , void (*ReadData)( FILE* , Data& ) ) : _ReadData( ReadData )
{
_fp = fopen( fileName , "r" );
if( !_fp ) ERROR_OUT( "Failed to open file for reading: %s" , fileName );
}
template< class Real , int Dim , class Data >
ASCIIInputPointStreamWithData< Real , Dim , Data >::~ASCIIInputPointStreamWithData( void )
{
fclose( _fp );
_fp = NULL;
}
template< class Real , int Dim , class Data >
void ASCIIInputPointStreamWithData< Real , Dim , Data >::reset( void ) { fseek( _fp , SEEK_SET , 0 ); }
template< class Real , int Dim , class Data >
bool ASCIIInputPointStreamWithData< Real , Dim , Data >::nextPoint( Point< Real , Dim >& p , Data& d )
{
float c;
for( int dd=0 ; dd<Dim ; dd++ )
if( fscanf( _fp , " %f " , &c )!=1 ) return false;
else p[dd] = c;
_ReadData( _fp , d );
return true;
}
////////////////////////////////////
// ASCIIOutputPointStreamWithData //
////////////////////////////////////
template< class Real , int Dim , class Data >
ASCIIOutputPointStreamWithData< Real , Dim , Data >::ASCIIOutputPointStreamWithData( const char* fileName , void (*WriteData)( FILE* , const Data& ) ) : _WriteData( WriteData )
{
_fp = fopen( fileName , "w" );
if( !_fp ) ERROR_OUT( "Failed to open file for writing: %s" , fileName );
}
template< class Real , int Dim , class Data >
ASCIIOutputPointStreamWithData< Real , Dim , Data >::~ASCIIOutputPointStreamWithData( void )
{
fclose( _fp );
_fp = NULL;
}
template< class Real , int Dim , class Data >
void ASCIIOutputPointStreamWithData< Real , Dim , Data >::nextPoint( const Point< Real , Dim >& p , const Data& d )
{
for( int d=0 ; d<Dim ; d++ ) fprintf( _fp , " %f" , (float)p[d] );
fprintf( _fp , " " );
_WriteData( _fp , d );
fprintf( _fp , "\n" );
}
////////////////////////////////////
// BinaryInputPointStreamWithData //
////////////////////////////////////
template< class Real , int Dim , class Data >
BinaryInputPointStreamWithData< Real , Dim , Data >::BinaryInputPointStreamWithData( const char* fileName , void (*ReadData)( FILE* , Data& ) ) : _ReadData(ReadData)
{
_fp = fopen( fileName , "rb" );
if( !_fp ) ERROR_OUT( "Failed to open file for reading: %s" , fileName );
}
template< class Real , int Dim , class Data >
bool BinaryInputPointStreamWithData< Real , Dim , Data >::nextPoint( Point< Real , Dim >& p , Data& d )
{
if( fread( &p , sizeof(Point< Real , Dim >) , 1 , _fp )==1 )
{
_ReadData( _fp , d );
return true;
}
else return false;
}
/////////////////////////////////////
// BinaryOutputPointStreamWithData //
/////////////////////////////////////
template< class Real , int Dim , class Data >
BinaryOutputPointStreamWithData< Real , Dim , Data >::BinaryOutputPointStreamWithData( const char* fileName , void (*WriteData)( FILE* , const Data& ) ) : _WriteData(WriteData)
{
_fp = fopen( fileName , "wb" );
if( !_fp ) ERROR_OUT( "Failed to open file for writing: %s" , fileName );
}
template< class Real , int Dim , class Data >
void BinaryOutputPointStreamWithData< Real , Dim , Data >::nextPoint( const Point< Real , Dim >& p , const Data& d )
{
fwrite( &p , sizeof(Point< Real , Dim >) , 1 , _fp );
_WriteData( _fp , d );
}
/////////////////////////////////
// PLYInputPointStreamWithData //
/////////////////////////////////
template< class Real , int Dim , class Data >
PLYInputPointStreamWithData< Real , Dim , Data >::PLYInputPointStreamWithData( const char* fileName , const PlyProperty* dataProperties , int dataPropertiesCount , bool (*validationFunction)( const bool* ) ) : _dataPropertiesCount( dataPropertiesCount ) , _validationFunction( validationFunction )
{
_dataProperties = new PlyProperty[ _dataPropertiesCount ];
for( int i=0 ; i<dataPropertiesCount ; i++ ) _dataProperties[i] = dataProperties[i];
for( int i=0 ; i<_dataPropertiesCount ; i++ ) _dataProperties[i].offset += sizeof( PlyVertex< Real , Dim > );
_fileName = new char[ strlen( fileName )+1 ];
strcpy( _fileName , fileName );
_ply = NULL;
reset();
}
template< class Real , int Dim , class Data >
void PLYInputPointStreamWithData< Real , Dim , Data >::reset( void )
{
int fileType;
float version;
std::vector< PlyProperty * > plist;
if( _ply ) _free();
_ply = PlyFile::Read( _fileName , _elist , fileType , version );
if( !_ply ) ERROR_OUT( "Failed to open ply file for reading: %s" , _fileName );
bool foundVertices = false;
for( int i=0 ; i<_elist.size() ; i++ )
{
int num_elems;
std::string &elem_name = _elist[i];
plist = _ply->get_element_description( elem_name , num_elems );
if( !plist.size() ) ERROR_OUT( "Failed to get element description: %s" , elem_name.c_str() );
if( elem_name=="vertex" )
{
foundVertices = true;
_pCount = num_elems , _pIdx = 0;
const PlyProperty* PlyReadProperties = PlyVertex< Real , Dim >::PlyReadProperties();
for( int i=0 ; i<PlyVertex< Real , Dim >::PlyReadNum ; i++ )
if( !_ply->get_property( elem_name , &(PlyReadProperties[i]) ) ) ERROR_OUT( "Failed to find property in ply file: %s" , PlyReadProperties[i].name.c_str() );
if( _validationFunction )
{
bool* properties = new bool[_dataPropertiesCount];
for( int i=0 ; i<_dataPropertiesCount ; i++ )
if( !_ply->get_property( elem_name , &(_dataProperties[i]) ) ) properties[i] = false;
else properties[i] = true;
bool valid = _validationFunction( properties );
delete[] properties;
if( !valid ) ERROR_OUT( "Failed to validate properties in file" );
}
else
{
for( int i=0 ; i<_dataPropertiesCount ; i++ )
if( !_ply->get_property( elem_name , &(_dataProperties[i]) ) ) WARN( "Failed to find property in ply file: %s" , _dataProperties[i].name.c_str() );
}
}
for( int j=0 ; j<plist.size() ; j++ ) delete plist[j];
if( foundVertices ) break;
}
if( !foundVertices ) ERROR_OUT( "Could not find vertices in ply file" );
}
template< class Real , int Dim , class Data >
void PLYInputPointStreamWithData< Real , Dim , Data >::_free( void ){ delete _ply; }
template< class Real , int Dim , class Data >
PLYInputPointStreamWithData< Real , Dim , Data >::~PLYInputPointStreamWithData( void )
{
_free();
if( _fileName ) delete[] _fileName , _fileName = NULL;
if( _dataProperties ) delete[] _dataProperties , _dataProperties = NULL;
}
template< class Real , int Dim , class Data >
bool PLYInputPointStreamWithData< Real , Dim , Data >::nextPoint( Point< Real , Dim >& p , Data& d )
{
if( _pIdx<_pCount )
{
_PlyVertexWithData v;
_ply->get_element( (void*) &v );
p = v.point;
d = v.data;
_pIdx++;
return true;
}
else return false;
}
//////////////////////////
// PLYOutputPointStream //
//////////////////////////
template< class Real , int Dim >
PLYOutputPointStream< Real , Dim >::PLYOutputPointStream( const char* fileName , size_t count , int fileType )
{
float version;
std::vector< std::string > elem_names = { std::string( "vertex" ) };
_ply = PlyFile::Write( fileName , elem_names , fileType , version );
if( !_ply ) ERROR_OUT( "Failed to open ply file for writing: %s" , fileName );
_pIdx = 0;
_pCount = count;
_ply->element_count( "vertex" , _pCount );
for( int i=0 ; i<PlyVertex< Real , Dim >::WriteComponents ; i++ ) _ply->describe_property( "vertex" , &PlyVertex< Real , Dim >::WriteProperties()[i] );
_ply->header_complete();
_ply->put_element_setup( "vertex" );
}
template< class Real , int Dim >
PLYOutputPointStream< Real , Dim >::~PLYOutputPointStream( void )
{
if( _pIdx!=_pCount ) ERROR_OUT( "Streamed points not equal to total count: %d!=%d" , _pIdx , _pCount );
delete _ply;
}
template< class Real , int Dim >
void PLYOutputPointStream< Real , Dim >::nextPoint( const Point< Real , Dim >& p )
{
if( _pIdx==_pCount ) ERROR_OUT( "Trying to add more points than total: %d<%d" , _pIdx , _pCount );
PlyVertex< Real , Dim > op;
op.point = p;
_ply->put_element( (void *)&op );
_pIdx++;
}
//////////////////////////////////
// PLYOutputPointStreamWithData //
//////////////////////////////////
template< class Real , int Dim , class Data >
PLYOutputPointStreamWithData< Real , Dim , Data >::PLYOutputPointStreamWithData( const char* fileName , size_t count , int fileType , const PlyProperty* dataProperties , int dataPropertiesCount )
{
float version;
std::vector< std::string > elem_names = { std::string( "vertex" ) };
_ply = PlyFile::Write( fileName , elem_names , fileType , version );
if( !_ply ) ERROR_OUT( "Failed to open ply file for writing: %s" , fileName );
_pIdx = 0;
_pCount = (int)count;
_ply->element_count( "vertex" , _pCount );
for( int i=0 ; i<PlyVertex< Real , Dim >::WriteComponents ; i++ ) _ply->describe_property( "vertex" , &PlyVertex< Real , Dim >::Properties()[i] );
for( int i=0 ; i<dataPropertiesCount ; i++ )
{
PlyProperty prop = dataProperties[i];
prop.offset += sizeof( PlyVertex< Real , Dim > );
_ply->describe_property( "vertex" , &prop );
}
_ply->header_complete();
_ply->put_element_setup( "vertex" );
}
template< class Real , int Dim , class Data >
PLYOutputPointStreamWithData< Real , Dim , Data >::~PLYOutputPointStreamWithData( void )
{
if( _pIdx!=_pCount ) ERROR_OUT( "Streamed points not equal to total count: %d!=%d" , _pIdx , _pCount );
delete _ply;
}
template< class Real , int Dim , class Data >
void PLYOutputPointStreamWithData< Real , Dim , Data >::nextPoint( const Point< Real , Dim >& p , const Data& d )
{
if( _pIdx==_pCount ) ERROR_OUT( "Trying to add more points than total: %d<%d" , _pIdx , _pCount );
_PlyVertexWithData op;
op.point = p;
op.data = d;
_ply->put_element( (void *)&op );
_pIdx++;
}
| 38.603982 | 297 | 0.649894 | [
"vector"
] |
139bc6b656af5626e50bf05a34fa2647616f73b7 | 6,729 | cpp | C++ | kernel/source/arch/x86_64/drivers/hpet.cpp | thomtl/Sigma | 30da9446a1f1b5cae4eff77bf9917fae1446ce85 | [
"BSD-2-Clause"
] | 46 | 2019-09-30T18:40:06.000Z | 2022-02-20T12:54:59.000Z | kernel/source/arch/x86_64/drivers/hpet.cpp | thomtl/Sigma | 30da9446a1f1b5cae4eff77bf9917fae1446ce85 | [
"BSD-2-Clause"
] | 11 | 2019-08-18T18:31:11.000Z | 2021-09-14T22:34:16.000Z | kernel/source/arch/x86_64/drivers/hpet.cpp | thomtl/Sigma | 30da9446a1f1b5cae4eff77bf9917fae1446ce85 | [
"BSD-2-Clause"
] | 1 | 2020-01-20T16:55:13.000Z | 2020-01-20T16:55:13.000Z | #include <Sigma/arch/x86_64/drivers/hpet.h>
#include <lai/core.h>
#include <lai/helpers/resource.h>
static x86_64::hpet::table* acpi_table = nullptr;
static uint64_t base = 0;
static uint64_t main_counter_clk = 0;
static uint64_t n_counters = 0;
static bool supports_64bit_counter = false;
static uint64_t hpet_read(uint64_t reg){
volatile uint64_t* ptr = reinterpret_cast<volatile uint64_t*>(base + KERNEL_PHYSICAL_VIRTUAL_MAPPING_BASE + reg);
return *ptr;
}
static void hpet_write(uint64_t reg, uint64_t value){
volatile uint64_t* ptr = reinterpret_cast<volatile uint64_t*>(base + KERNEL_PHYSICAL_VIRTUAL_MAPPING_BASE + reg);
*ptr = value;
}
void x86_64::hpet::init_hpet(){
// Attempt to find the AML object for the timer
lai_variable_t pnp_id = {};
lai_eisaid(&pnp_id, x86_64::hpet::hpet_pnp_id);
LAI_CLEANUP_STATE lai_state_t state;
lai_init_state(&state);
lai_nsnode_t *handle = nullptr;
struct lai_ns_iterator iter = LAI_NS_ITERATOR_INITIALIZER;
lai_nsnode_t *node;
while ((node = lai_ns_iterate(&iter))) {
if(lai_check_device_pnp_id(node, &pnp_id, &state)) continue; // This aint it chief
lai_nsnode_t* hpet_uid_node = lai_resolve_path(node, "_UID");
int status = 1;
lai_variable_t hpet_uid = {};
if(hpet_uid_node != nullptr){
status = lai_eval(&hpet_uid, hpet_uid_node, &state);
}
#ifdef DEBUG
if(status == 0){
uint64_t uid = 0xFFFFFFFFFFFFFFFF;
lai_obj_get_integer(&hpet_uid, &uid);
debug_printf("[HPET]: Found HPET in AML code, UID: %x\n", uid);
} else {
debug_printf("[HPET]: Found HPET in AML code\n");
}
#endif
if(status == 0){ // Found a _UID
// We only support one HPET so look for UID 0
uint64_t uid = 0xFFFFFFFFFFFFFFFF;
lai_obj_get_integer(&hpet_uid, &uid);
if(uid == 0){
handle = node;
break;
}
} else {
// Assume this is 0, since there is no _UID we don't know for sure
handle = node;
break;
}
}
if(!handle){
PANIC("[HPET]: Couldn't find HPET timer in AML");
}
acpi_table = reinterpret_cast<x86_64::hpet::table*>(acpi::get_table("HPET"));
if(acpi_table == nullptr){
// Huh that's odd, there is an AML device but no table?
lai_nsnode_t* crs_node = lai_resolve_path(node, "_CRS");
if(!crs_node)
PANIC("No HPET table and no _CRS, can't initialize HPET");
LAI_CLEANUP_VAR lai_variable_t crs = {};
if(lai_eval(&crs, crs_node, &state))
PANIC("Couldn't evaluate HPET _CRS");
lai_resource_view view = LAI_RESOURCE_VIEW_INITIALIZER(&crs);
lai_api_error_t e;
while(!(e = lai_resource_iterate(&view))) {
enum lai_resource_type type = lai_resource_get_type(&view);
switch(type) {
case LAI_RESOURCE_MEM:
base = view.base;
debug_printf("[HPET]: Found HPET base in _CRS, base: %x\n", base);
default:
break;
}
}
} else {
base = acpi_table->base_addr_low.address;
if(acpi_table->base_addr_low.id != acpi::generic_address_structure_id_system_memory) {
printf("[HPET]: Unknown ACPI Generic Address Structure Access ID: %x\n", acpi_table->base_addr_low.id);
PANIC("");
}
}
if(!base)
PANIC("[HPET]: Wasn't able to find HPET base");
mm::vmm::kernel_vmm::get_instance().map_page(base, (base + KERNEL_PHYSICAL_VIRTUAL_MAPPING_BASE), map_page_flags_present | map_page_flags_writable | map_page_flags_global | map_page_flags_no_execute, map_page_cache_types::uncacheable);
if(((hpet_read(general_capabilities_and_id_reg) >> 16) & 0xFFFF) == 0xFFFF)
PANIC("[HPET]: No HPET detected, need HPET to further boot");
uint64_t general_cap_and_id = hpet_read(x86_64::hpet::general_capabilities_and_id_reg);
main_counter_clk = ((general_cap_and_id >> 32) & 0xFFFFFFFF);
if(!(main_counter_clk <= 0x05F5E100) || main_counter_clk == 0){
printf("[HPET]: Invalid HPET COUNTER_CLK_PERIOD: %x\n", main_counter_clk);
PANIC("");
}
n_counters = ((general_cap_and_id >> 8) & 0xF) + 1;
if((general_cap_and_id & 0xFF) == 0){
printf("[HPET]: Invalid HPET Revision: %x\n", (general_cap_and_id & 0xFF));
PANIC("");
}
supports_64bit_counter = bitops<uint64_t>::bit_test(general_cap_and_id, 13);
#ifdef DEBUG
debug_printf("[HPET]: Initializing HPET device: base: %x, PCI Vendor ID: %x, Revision: %x, Counter clk: %x, N counters: %x", base, ((hpet_read(general_capabilities_and_id_reg) >> 16) & 0xFFFF), (hpet_read(general_capabilities_and_id_reg) & 0xFF), main_counter_clk, n_counters);
if(supports_64bit_counter) debug_printf(", Supports 64bit counter\n");
else debug_printf("\n");
#endif
hpet_write(x86_64::hpet::general_configuration_reg, 0); // Main counter disabled, legacy routing disabled
hpet_write(x86_64::hpet::main_counter_reg, 0); // Counter counts up
// TODO: Initialize Timers
hpet_write(x86_64::hpet::general_configuration_reg, 1); // Main counter enabled, legacy routing disabled
}
bool x86_64::hpet::create_timer(uint8_t comparator, x86_64::hpet::hpet_timer_types type,
MAYBE_UNUSED_ATTRIBUTE uint8_t vector, uint64_t ms) {
if(comparator > n_counters) {
printf("[HPET]: Non-existing comparator\n");
return false;
}
uint64_t cap = hpet_read(hpet_timer_configuration_and_capabilities_reg(comparator));
if(!bitops<uint64_t>::bit_test(cap, 4) && type == x86_64::hpet::hpet_timer_types::PERIODIC){
printf("[HPET]: Comparator doesn't support Periodic mode\n");
return false;
}
cap |= ((1 << 2) | (((type == x86_64::hpet::hpet_timer_types::PERIODIC) ? (1) : (0)) << 3) | (((type == x86_64::hpet::hpet_timer_types::PERIODIC) ? (1) : (0)) << 6));
hpet_write(hpet_timer_configuration_and_capabilities_reg(comparator), cap);
uint64_t ticks = ms / (main_counter_clk / x86_64::hpet::femto_per_milli);
hpet_write(hpet_timer_comparator_value_reg(comparator), hpet_read(x86_64::hpet::main_counter_reg) + ticks);
hpet_write(hpet_timer_comparator_value_reg(comparator), ticks);
// TODO: Initialize IRQ
return true;
}
void x86_64::hpet::poll_sleep(uint64_t ms){
uint64_t goal = hpet_read(x86_64::hpet::main_counter_reg) + ms * x86_64::hpet::femto_per_milli / main_counter_clk;
while(hpet_read(x86_64::hpet::main_counter_reg) < goal) asm("pause");
} | 38.016949 | 281 | 0.650617 | [
"object",
"vector"
] |
139dc673383deb6038d5ef75ebd4e7aa6e57ad07 | 2,530 | cc | C++ | apps/pipes/vector_mul/cpu-vector_mul/cpu-vector_mul.cc | Mingcong/hadoop-1.2.1-arm-gpu | 7ad15811ddff0678a61eb71e57243ac858b53b2f | [
"Apache-2.0"
] | 1 | 2021-03-02T04:24:30.000Z | 2021-03-02T04:24:30.000Z | apps/pipes/vector_mul/cpu-vector_mul/cpu-vector_mul.cc | Mingcong/hadoop-1.2.1-arm-gpu | 7ad15811ddff0678a61eb71e57243ac858b53b2f | [
"Apache-2.0"
] | null | null | null | apps/pipes/vector_mul/cpu-vector_mul/cpu-vector_mul.cc | Mingcong/hadoop-1.2.1-arm-gpu | 7ad15811ddff0678a61eb71e57243ac858b53b2f | [
"Apache-2.0"
] | null | null | null | /***********************************************************************
hadoop-gpu
Authors: Koichi Shirahata, Hitoshi Sato, Satoshi Matsuoka
This software is licensed under 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.
-------------------------------------------------------------------------
File: cpu-matmul.cc
- Plain matrix multiplication on CPU.
Version: 0.20.1
***********************************************************************/
#include "stdint.h"
#include "hadoop/Pipes.hh"
#include "hadoop/TemplateFactory.hh"
#include "hadoop/StringUtils.hh"
#include <iostream>
class MatmulMap: public HadoopPipes::Mapper {
public:
MatmulMap(HadoopPipes::TaskContext& context){}
void map(HadoopPipes::MapContext& context) {
//split strings by line
std::string line = context.getInputValue();
//only first roop is out of for roop
std::vector<std::string> elements = HadoopUtils::splitString(line, " ");
int i = HadoopUtils::toFloat(elements[0]);
int T = (elements.size()-1) / 2;
float a[T], b[T];
int k;
for(k = 0; k < T; ++k) {
a[k] = HadoopUtils::toFloat(elements[k + 1]);
}
for(k = 0; k < T; ++k) {
b[k] = HadoopUtils::toFloat(elements[k + (T + 1)]);
}
std::string key = HadoopUtils::toString(i);
//assign keys and values
//key: (i, j) ("ij")
//value: a(i,k)*b(k*j) (k=0 -> k<size())
for(k = 0; k < T; ++k) {
context.emit(key,HadoopUtils::toString(a[k]*b[k]));
}
}
};
class MatmulReduce: public HadoopPipes::Reducer {
public:
MatmulReduce(HadoopPipes::TaskContext& context){}
void reduce(HadoopPipes::ReduceContext& context) {
// sumup values which have the same keys
float sum = 0;
while (context.nextValue()) {
sum += HadoopUtils::toFloat(context.getInputValue());
}
context.emit(context.getInputKey(), HadoopUtils::toString(sum));
}
};
int main(int argc, char *argv[]) {
return HadoopPipes::runTask(HadoopPipes::TemplateFactory<MatmulMap,
MatmulReduce>());
}
| 31.625 | 77 | 0.603162 | [
"vector"
] |
139e5627983b6e2eff5238e14a74c9103d2a86a0 | 943 | hpp | C++ | cpp/src/readrecalibration/intermediateOutputWriter.hpp | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 8 | 2018-10-08T15:47:21.000Z | 2021-11-09T07:13:05.000Z | cpp/src/readrecalibration/intermediateOutputWriter.hpp | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 4 | 2018-11-05T09:16:27.000Z | 2020-04-09T12:32:56.000Z | cpp/src/readrecalibration/intermediateOutputWriter.hpp | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 4 | 2019-09-03T15:46:39.000Z | 2021-06-04T07:28:33.000Z | // All content Copyright (C) 2018 Genomics plc
#ifndef INTERMEDIATE_OUTPUT_WRITER_HPP
#define INTERMEDIATE_OUTPUT_WRITER_HPP
#include <vector>
#include <string>
#include "io/readRange.hpp"
namespace wecall
{
namespace corrector
{
class IntermediateOutputWriter
{
public:
IntermediateOutputWriter( const std::vector< std::string > & inputBams, std::string outputFileStem );
void writeReads( const io::perSampleRegionsReads_t & readRangesPerSample, std::string contig ) const;
private:
std::string sampleFilename( std::string sampleName ) const;
void writeSamHeader( std::string outputFilename, std::string headerText ) const;
private:
const std::string m_outputFileStem;
std::map< std::string, std::string > m_sampleNameToFileMap;
const bool m_writeOutputFile;
};
} // namespace corrector
} // namespace wecall
#endif // INTERMEDIATE_OUTPUT_WRITER_HPP
| 26.194444 | 109 | 0.720042 | [
"vector"
] |
13ab867a13125907c8a93852930463218b2b1ed7 | 5,138 | cpp | C++ | WebRtc_PeerConnectionTutorial/WebRtcPeerConnectionTutorial/WebRtcPeerConnectionTutorial.cpp | c86j224s/snippet | 47072085e91fd3a7e584f159ba9989550871a9e5 | [
"Apache-2.0"
] | null | null | null | WebRtc_PeerConnectionTutorial/WebRtcPeerConnectionTutorial/WebRtcPeerConnectionTutorial.cpp | c86j224s/snippet | 47072085e91fd3a7e584f159ba9989550871a9e5 | [
"Apache-2.0"
] | null | null | null | WebRtc_PeerConnectionTutorial/WebRtcPeerConnectionTutorial/WebRtcPeerConnectionTutorial.cpp | c86j224s/snippet | 47072085e91fd3a7e584f159ba9989550871a9e5 | [
"Apache-2.0"
] | null | null | null | // WebRtcPeerConnectionTutorial.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <array>
#include <iostream>
#include <vector>
//#include <windows.h>
#define WEBRTC_WIN 1
#include "rtc_base/win32_socket_init.h"
#include "rtc_base/win32_socket_server.h"
#include "rtc_base/net_helpers.h"
#pragma comment(lib, "obj/webrtc.lib")
//#pragma comment(lib, "obj/rtc_base/rtc_base.lib")
#pragma comment(lib, "ws2_32.lib")
class ControlClient : public sigslot::has_slots<>, public rtc::MessageHandler {
rtc::SocketAddress m_serveraddr{};
std::unique_ptr<rtc::AsyncResolver> m_resolver{};
std::unique_ptr<rtc::AsyncSocket> m_socket{};
std::vector<char> m_reading_buf;
protected:
// inherited from rtc::MessageHandler
void OnMessage(rtc::Message* msg) override {
}
void OnResolved(rtc::AsyncResolverInterface* resolver) {
std::cout << "on resolved" << std::endl;
if (m_resolver->GetError() != 0) {
m_resolver->Destroy(false);
m_resolver.reset();
RaiseException(0, 0, 0, nullptr);
}
else {
m_serveraddr = m_resolver->address();
DoConnect();
}
}
public:
void DoConnect() {
auto * s = new rtc::Win32Socket{};
s->CreateT(m_serveraddr.family(), SOCK_STREAM);
m_socket.reset(s);
s->SignalCloseEvent.connect(this, &ControlClient::OnClosed);
s->SignalConnectEvent.connect(this, &ControlClient::OnConnected);
s->SignalReadEvent.connect(this, &ControlClient::OnRead);
s->SignalWriteEvent.connect(this, &ControlClient::OnWrite);
int err = m_socket->Connect(m_serveraddr);
if (err == SOCKET_ERROR) {
std::cout << "connect error" << std::endl;
m_socket->Close();
m_socket.reset();
return;
}
std::cout << "connecting" << std::endl;
}
void OnClosed(rtc::AsyncSocket* socket, int err) {
std::cout << "on closed" << std::endl;
socket->Close();
if (err != WSAECONNREFUSED) {
// 이 뒤에 리커넥팅 처리인 듯 한데.. 좀더 분석 필요.
std::cout << "refused" << std::endl;
}
std::cout << "did closed" << std::endl;
}
void OnConnected(rtc::AsyncSocket* socket) {
std::cout << "on connected" << std::endl;
//if onconnect data가 있으면 보낸다.
std::string hello = "GET / HTTP/1.0\r\nContent-Length:0\r\nConnection:Keep-Alive\r\n\r\n";
auto sent = socket->Send(hello.c_str(), hello.size());
if (sent <= 0) {
std::cout << "unsent hello" << std::endl;
}
}
void OnRead(rtc::AsyncSocket* socket) {
std::cout << "on read" << std::endl;
std::array<uint8_t, 65536> buf;
while (true) {
auto bytes = socket->Recv(buf.data(), buf.size(), nullptr);
if (bytes <= 0) {
break;
}
//m_reading_buf.emplace_back(buf.begin(), buf.end());
m_reading_buf.insert(m_reading_buf.end(), buf.begin(), buf.begin() + bytes);
}
auto tmp = m_reading_buf;
tmp.push_back('\0');
std::cout << "BUF : [" << tmp.data() << "]" << std::endl;
enum class Delim {
none, r1, n1, r2, n2,
} delimiter_state = Delim::none;
static const struct {
Delim cur_state;
char cur_ch;
Delim next_state;
bool split;
} s_parser[] = {
{ Delim::none, '\r', Delim::r1, false },
{ Delim::r1, '\n', Delim::n1, false },
{ Delim::n1, '\r', Delim::r2, false },
{ Delim::r2, '\n', Delim::none, true },
};
auto i = 0;
while (i < m_reading_buf.size()) {
bool matched = false;
for (const auto & parser : s_parser) {
if (parser.cur_state == delimiter_state && parser.cur_ch == m_reading_buf[i]) {
delimiter_state = parser.next_state;
if (parser.split) {
std::string line{ m_reading_buf.begin(), m_reading_buf.begin() + i + 1 };
line.push_back('\0');
m_reading_buf.erase(m_reading_buf.begin(), m_reading_buf.begin() + i + 1);
i = -1;
std::cout << "LINE : [" << line << "]" << std::endl;
}
matched = true;
break;
}
}
if (!matched) {
delimiter_state = Delim::none;
}
i++;
}
}
void OnWrite(rtc::AsyncSocket* socket) {
std::cout << "on write" << std::endl;
// do nothing
}
public:
ControlClient() : rtc::MessageHandler(false) {
}
~ControlClient() {
if (m_resolver) {
m_resolver->Destroy(false);
m_resolver.reset();
}
}
void Run() {
const std::string server = "127.0.0.1";
int port = 5000;
m_serveraddr.SetIP(server);
m_serveraddr.SetPort(port);
if (m_serveraddr.IsUnresolvedIP()) {
if (!m_resolver)
m_resolver = std::make_unique<rtc::AsyncResolver>();
m_resolver->SignalDone.connect(this, &ControlClient::OnResolved);
m_resolver->Start(m_serveraddr);
std::cout << "resolving" << std::endl;
}
else {
DoConnect();
}
}
};
int main()
{
rtc::WinsockInitializer wsinit;
rtc::Win32SocketServer w32_ss;
rtc::Win32Thread w32_thread(&w32_ss);
rtc::ThreadManager::Instance()->SetCurrentThread(&w32_thread);
ControlClient cc;
cc.Run();
std::cout << "Hello World!\n";
MSG msg;
while (::GetMessage(&msg, nullptr, 0, 0) != 0) {
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
} | 24.583732 | 93 | 0.61016 | [
"vector"
] |
13abd48127015f459eff58876ec2d25ca7cdd8ce | 7,138 | cpp | C++ | src/OpcUaStackCore/BuildInTypes/OpcUaQualifiedName.cpp | gianricardo/OpcUaStack | ccdef574175ffe8b7e82b886abc5e5403968b280 | [
"Apache-2.0"
] | 108 | 2018-10-08T17:03:32.000Z | 2022-03-21T00:52:26.000Z | src/OpcUaStackCore/BuildInTypes/OpcUaQualifiedName.cpp | gianricardo/OpcUaStack | ccdef574175ffe8b7e82b886abc5e5403968b280 | [
"Apache-2.0"
] | 287 | 2018-09-18T14:59:12.000Z | 2022-01-13T12:28:23.000Z | src/OpcUaStackCore/BuildInTypes/OpcUaQualifiedName.cpp | gianricardo/OpcUaStack | ccdef574175ffe8b7e82b886abc5e5403968b280 | [
"Apache-2.0"
] | 32 | 2018-10-19T14:35:03.000Z | 2021-11-12T09:36:46.000Z | /*
Copyright 2015-2017 Kai Huebl (kai@huebl-sgh.de)
Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser
Datei nur in Übereinstimmung mit der Lizenz erlaubt.
Eine Kopie der Lizenz erhalten Sie auf http://www.apache.org/licenses/LICENSE-2.0.
Sofern nicht gemäß geltendem Recht vorgeschrieben oder schriftlich vereinbart,
erfolgt die Bereitstellung der im Rahmen der Lizenz verbreiteten Software OHNE
GEWÄHR ODER VORBEHALTE – ganz gleich, ob ausdrücklich oder stillschweigend.
Informationen über die jeweiligen Bedingungen für Genehmigungen und Einschränkungen
im Rahmen der Lizenz finden Sie in der Lizenz.
Autor: Kai Huebl (kai@huebl-sgh.de)
*/
#include <boost/lexical_cast.hpp>
#include "OpcUaStackCore/BuildInTypes/OpcUaQualifiedName.h"
#include "OpcUaStackCore/BuildInTypes/Json.h"
namespace OpcUaStackCore
{
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
//
// OpcUaQualifiedName
//
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
OpcUaQualifiedName::OpcUaQualifiedName(void)
: Object()
, namespaceIndex_(0)
, name_()
{
}
OpcUaQualifiedName::OpcUaQualifiedName(const std::string& name, OpcUaInt16 namespaceIndex)
: Object()
, namespaceIndex_(namespaceIndex)
, name_(name)
{
}
OpcUaQualifiedName::~OpcUaQualifiedName(void)
{
}
void
OpcUaQualifiedName::set(const std::string& name, OpcUaInt16 namespaceIndex)
{
name_ = name;
namespaceIndex_ = namespaceIndex;
}
void
OpcUaQualifiedName::get(std::string& name, OpcUaUInt16& namespaceIndex)
{
name = name_;
namespaceIndex = namespaceIndex_;
}
void
OpcUaQualifiedName::namespaceIndex(const OpcUaUInt16& namespaceIndex)
{
namespaceIndex_ = namespaceIndex;
}
void
OpcUaQualifiedName::name(const std::string& name)
{
name_ = name;
}
OpcUaUInt16
OpcUaQualifiedName::namespaceIndex(void)
{
return namespaceIndex_;
}
void
OpcUaQualifiedName::name(const OpcUaString& name)
{
name_ = name;
}
OpcUaString&
OpcUaQualifiedName::name(void)
{
return name_;
}
bool
OpcUaQualifiedName::fromString(const std::string& qualifiedNameString)
{
size_t pos = qualifiedNameString.find(":");
if (pos == std::string::npos) {
namespaceIndex(0);
name(qualifiedNameString);
return true;
}
name(qualifiedNameString.substr(pos+1));
std::string namespaceIndexString = qualifiedNameString.substr(0, pos);
try
{
uint16_t ni = boost::lexical_cast<int16_t>(namespaceIndexString);
namespaceIndex(ni);
}
catch (boost::bad_lexical_cast&)
{
return false;
}
return true;
}
std::string
OpcUaQualifiedName::toString(void)
{
std::stringstream ss;
if (namespaceIndex_ != 0) {
ss << namespaceIndex_ << ":";
}
ss << name_;
return ss.str();
}
OpcUaQualifiedName&
OpcUaQualifiedName::operator=(const std::string& name)
{
name_ = name;
return *this;
}
OpcUaQualifiedName&
OpcUaQualifiedName::operator=(const OpcUaUInt16& namespaceIndex)
{
namespaceIndex_ = namespaceIndex;
return *this;
}
OpcUaQualifiedName::operator std::string const (void)
{
return name_.value();
}
OpcUaQualifiedName::operator OpcUaUInt16 const (void)
{
return namespaceIndex_;
}
void
OpcUaQualifiedName::copyTo(OpcUaQualifiedName& qualifiedName)
{
qualifiedName.namespaceIndex(namespaceIndex_);
name_.copyTo(qualifiedName.name());
}
bool
OpcUaQualifiedName::operator!=(const OpcUaQualifiedName& opcUaQualifiedName) const
{
return operator==(opcUaQualifiedName);
}
bool
OpcUaQualifiedName::operator==(const OpcUaQualifiedName& opcUaQualifiedName) const
{
return
namespaceIndex_ == const_cast<OpcUaQualifiedName*>(&opcUaQualifiedName)->namespaceIndex() &&
name_ == const_cast<OpcUaQualifiedName*>(&opcUaQualifiedName)->name();
}
void
OpcUaQualifiedName::out(std::ostream& os) const
{
os << "ns=" << namespaceIndex_ << ",name=" << name_;
}
void
OpcUaQualifiedName::opcUaBinaryEncode(std::ostream& os) const
{
OpcUaNumber::opcUaBinaryEncode(os, namespaceIndex_);
name_.opcUaBinaryEncode(os);
}
void
OpcUaQualifiedName::opcUaBinaryDecode(std::istream& is)
{
OpcUaNumber::opcUaBinaryDecode(is, namespaceIndex_);
name_.opcUaBinaryDecode(is);
}
bool
OpcUaQualifiedName::encode(boost::property_tree::ptree& pt) const
{
boost::property_tree::ptree namespaceIndex;
if (!Json::encode(namespaceIndex, namespaceIndex_)) return false;
pt.put_child("NamespaceIndex", namespaceIndex);
boost::property_tree::ptree name;
if (!name_.encode(name)) return false;
pt.put_child("Name", name);
return true;
}
bool
OpcUaQualifiedName::decode(boost::property_tree::ptree& pt)
{
boost::optional<boost::property_tree::ptree&> namespaceIndex;
namespaceIndex = pt.get_child_optional("NamespaceIndex");
if (!namespaceIndex) {
namespaceIndex_ = 0;
}
else {
if (!Json::decode(*namespaceIndex, namespaceIndex_)) return false;
}
boost::optional<boost::property_tree::ptree&> name;
name = pt.get_child_optional("Name");
if (!name) return false;
if (!name_.decode(*name)) return false;
return true;
}
bool
OpcUaQualifiedName::xmlEncode(boost::property_tree::ptree& pt, const std::string& element, Xmlns& xmlns)
{
boost::property_tree::ptree elementTree;
if (!xmlEncode(elementTree, xmlns)) {
Log(Error, "OpcUaQualifiedName xml encoder error")
.parameter("Element", element);
return false;
}
pt.push_back(std::make_pair(xmlns.addxmlns(element), elementTree));
return true;
}
bool
OpcUaQualifiedName::xmlEncode(boost::property_tree::ptree& pt, Xmlns& xmlns)
{
std::stringstream ss;
ss << namespaceIndex();
pt.put(xmlns.addxmlns("NamespaceIndex"), ss.str());
pt.put(xmlns.addxmlns("Name"), name().value());
return true;
}
bool
OpcUaQualifiedName::xmlDecode(boost::property_tree::ptree& pt, Xmlns& xmlns)
{
//
// namespace index
//
boost::optional<std::string> namespaceIndexString = pt.get_optional<std::string>(xmlns.addxmlns("NamespaceIndex"));
if (!namespaceIndexString) {
namespaceIndex(0);
}
else {
try
{
uint16_t ni = boost::lexical_cast<int16_t>(*namespaceIndexString);
namespaceIndex(ni);
}
catch (boost::bad_lexical_cast&)
{
Log(Error, "OpcUaQulifiedName xml encoder error - value invalid")
.parameter("Element", "NamespaceIndex")
.parameter("Value", *namespaceIndexString);
return false;
}
}
//
// name
//
boost::optional<std::string> nameString = pt.get_optional<std::string>(xmlns.addxmlns("Name"));
if (!nameString) {
name("");
}
else {
name(*nameString);
}
return true;
}
}
| 24.19661 | 118 | 0.655506 | [
"object"
] |
13afe7beb08d6839a446565639f420a4b68111f0 | 979 | cpp | C++ | lintcode_187_gas.cpp | leeamen/algrigthm | 7aef197f2dfe4cbb75c76bfd827832da9a597fd0 | [
"MIT"
] | null | null | null | lintcode_187_gas.cpp | leeamen/algrigthm | 7aef197f2dfe4cbb75c76bfd827832da9a597fd0 | [
"MIT"
] | null | null | null | lintcode_187_gas.cpp | leeamen/algrigthm | 7aef197f2dfe4cbb75c76bfd827832da9a597fd0 | [
"MIT"
] | null | null | null | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int canCompleteCircuit(vector<int> &gas, vector<int> &cost) {
if(gas.empty()||cost.empty())
return 0;
int n=cost.size();
int begin=0; //假设从第零个加油站开始走
int cur=0; //当前储油量
int Gas=0,Cost=0; //Gas记录汽油总量,Cost记录着走完环路的消耗总量
for(int i=0;i<n;++i){
cur+=gas[i]; //加满油
cur-=cost[i]; //走到下一站的花费
Gas +=gas[i];
Cost+=cost[i];
if(cur<0){ //从当前加油站走不到下一站
begin=i+1; //替换出发点,其实就是一个一个试!!!从1到n
cur=0; //重新计算
}
}
return Gas>=Cost?begin:-1; //如果花费总量大于汽油总量肯定走不完了,否则就返回起始点
}
};
int main()
{
int g[] = {1, 1, 3, 1};
int c[] = {2, 2, 1, 1};
int n = 4;
vector<int>gas(g, g + n);
vector<int>cost(c, c + n);
Solution s;
int r = s.canCompleteCircuit(gas, cost);
cout<<r<<endl;
return 1;
}
| 23.309524 | 66 | 0.491318 | [
"vector"
] |
13b161a5d50d6974f93d6a163bf75538543654c5 | 2,850 | cpp | C++ | src/rendering/engine-Vk/engine-impl/resources/shader.cpp | Bargor/tempest | 94837c6dcfef036827076446101e59afb7792f5d | [
"Apache-2.0",
"MIT"
] | null | null | null | src/rendering/engine-Vk/engine-impl/resources/shader.cpp | Bargor/tempest | 94837c6dcfef036827076446101e59afb7792f5d | [
"Apache-2.0",
"MIT"
] | 1 | 2019-12-02T20:17:52.000Z | 2019-12-02T20:17:52.000Z | src/rendering/engine-Vk/engine-impl/resources/shader.cpp | Bargor/tempest | 94837c6dcfef036827076446101e59afb7792f5d | [
"Apache-2.0",
"MIT"
] | null | null | null | // This file is part of Tempest-engine project
// Author: Karol Kontny
#include "shader.h"
#include "../vulkan_exception.h"
#include <application/data_loader.h>
#include <fmt/printf.h>
namespace tst {
namespace engine {
namespace vulkan {
vk::ShaderStageFlagBits shader::get_native_shader_type(shader_type type) {
switch (type) {
case tst::engine::vulkan::shader_type::vertex:
return vk::ShaderStageFlagBits::eVertex;
case tst::engine::vulkan::shader_type::fragment:
return vk::ShaderStageFlagBits::eFragment;
case tst::engine::vulkan::shader_type::geometry:
return vk::ShaderStageFlagBits::eGeometry;
case tst::engine::vulkan::shader_type::compute:
return vk::ShaderStageFlagBits::eCompute;
case tst::engine::vulkan::shader_type::tessellation_control:
return vk::ShaderStageFlagBits::eTessellationControl;
case tst::engine::vulkan::shader_type::tessellation_evaluation:
return vk::ShaderStageFlagBits::eTessellationEvaluation;
default:
break;
}
return vk::ShaderStageFlagBits::eAll;
}
shader::shader(vk::Device device, shader_type type, std::vector<char>&& source, const std::string& name)
: m_device(device), m_source(source), m_name(name), m_type(type) {
vk::ShaderModuleCreateInfo createInfo(
vk::ShaderModuleCreateFlags(), source.size(), reinterpret_cast<const uint32_t*>(source.data()));
try {
m_shader = device.createShaderModule(createInfo);
} catch (std::runtime_error& ex) {
throw vulkan_exception(fmt::sprintf("Can't create shader %s\n", ex.what()));
}
m_pipelineInfo = vk::PipelineShaderStageCreateInfo(
vk::PipelineShaderStageCreateFlags(), get_native_shader_type(type), m_shader, "main");
}
shader::shader(shader&& shader) noexcept
: m_device(shader.m_device)
, m_source(std::move(shader.m_source))
, m_name(std::move(shader.m_name))
, m_type(shader.m_type)
, m_shader(std::move(shader.m_shader))
, m_pipelineInfo(std::move(shader.m_pipelineInfo)) {
shader.m_shader = vk::ShaderModule();
}
shader::~shader() {
if (m_shader) {
m_device.destroyShaderModule(m_shader);
}
}
vk::PipelineShaderStageCreateInfo shader::get_pipeline_info() const noexcept {
return m_pipelineInfo;
}
shader_type shader::get_stage() const noexcept {
return m_type;
}
} // namespace vulkan
} // namespace engine
} // namespace tst
| 37.012987 | 112 | 0.603509 | [
"geometry",
"vector"
] |
13b4d540de2967cf9e690b08a4ea65a3199d0bf1 | 16,147 | cpp | C++ | src/mongo/db/s/collection_metadata_test.cpp | krareT/mongo | 8776cef330c6de839d80ceec5bd2a63f3c411c6e | [
"Apache-2.0"
] | null | null | null | src/mongo/db/s/collection_metadata_test.cpp | krareT/mongo | 8776cef330c6de839d80ceec5bd2a63f3c411c6e | [
"Apache-2.0"
] | null | null | null | src/mongo/db/s/collection_metadata_test.cpp | krareT/mongo | 8776cef330c6de839d80ceec5bd2a63f3c411c6e | [
"Apache-2.0"
] | 5 | 2020-12-16T13:31:55.000Z | 2021-01-17T07:39:30.000Z | /**
* Copyright (C) 2012 10gen Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, the copyright holders give permission to link the
* code of portions of this program with the OpenSSL library under certain
* conditions as described in each individual source file and distribute
* linked combinations including the program with the OpenSSL library. You
* must comply with the GNU Affero General Public License in all respects
* for all of the code used other than as permitted herein. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you do not
* wish to do so, delete this exception statement from your version. If you
* delete this exception statement from all source files in the program,
* then also delete it in the license file.
*/
#include "mongo/platform/basic.h"
#include "mongo/base/status.h"
#include "mongo/db/range_arithmetic.h"
#include "mongo/db/s/collection_metadata.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/chunk_version.h"
#include "mongo/stdx/memory.h"
#include "mongo/unittest/unittest.h"
namespace mongo {
namespace {
using unittest::assertGet;
std::unique_ptr<CollectionMetadata> makeCollectionMetadataImpl(
const KeyPattern& shardKeyPattern,
const std::vector<std::pair<BSONObj, BSONObj>>& thisShardsChunks) {
const OID epoch = OID::gen();
const NamespaceString kNss("test.foo");
const ShardId kThisShard("thisShard");
const ShardId kOtherShard("otherShard");
std::vector<ChunkType> allChunks;
auto nextMinKey = shardKeyPattern.globalMin();
ChunkVersion version{1, 0, epoch};
for (const auto& myNextChunk : thisShardsChunks) {
if (SimpleBSONObjComparator::kInstance.evaluate(nextMinKey < myNextChunk.first)) {
// Need to add a chunk to the other shard from nextMinKey to myNextChunk.first.
allChunks.emplace_back(
kNss, ChunkRange{nextMinKey, myNextChunk.first}, version, kOtherShard);
version.incMajor();
}
allChunks.emplace_back(
kNss, ChunkRange{myNextChunk.first, myNextChunk.second}, version, kThisShard);
version.incMajor();
nextMinKey = myNextChunk.second;
}
if (SimpleBSONObjComparator::kInstance.evaluate(nextMinKey < shardKeyPattern.globalMax())) {
allChunks.emplace_back(
kNss, ChunkRange{nextMinKey, shardKeyPattern.globalMax()}, version, kOtherShard);
}
UUID uuid(UUID::gen());
auto cm = ChunkManager::makeNew(kNss, uuid, shardKeyPattern, nullptr, false, epoch, allChunks);
return stdx::make_unique<CollectionMetadata>(cm, kThisShard);
}
class NoChunkFixture : public unittest::Test {
protected:
std::unique_ptr<CollectionMetadata> makeCollectionMetadata() const {
return makeCollectionMetadataImpl(KeyPattern(BSON("a" << 1)), {});
}
};
struct stRangeMap : public RangeMap {
stRangeMap()
: RangeMap(SimpleBSONObjComparator::kInstance.makeBSONObjIndexedMap<CachedChunkInfo>()) {}
};
TEST_F(NoChunkFixture, BasicBelongsToMe) {
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << MINKEY)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 10)));
}
TEST_F(NoChunkFixture, CompoundKeyBelongsToMe) {
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 1 << "b" << 2)));
}
TEST_F(NoChunkFixture, IsKeyValid) {
ASSERT_TRUE(makeCollectionMetadata()->isValidKey(BSON("a"
<< "abcde")));
ASSERT_TRUE(makeCollectionMetadata()->isValidKey(BSON("a" << 3)));
ASSERT_FALSE(makeCollectionMetadata()->isValidKey(BSON("a"
<< "abcde"
<< "b"
<< 1)));
ASSERT_FALSE(makeCollectionMetadata()->isValidKey(BSON("c"
<< "abcde")));
}
TEST_F(NoChunkFixture, getNextFromEmpty) {
ChunkType nextChunk;
ASSERT(
!makeCollectionMetadata()->getNextChunk(makeCollectionMetadata()->getMinKey(), &nextChunk));
}
TEST_F(NoChunkFixture, getDifferentFromEmpty) {
ChunkType differentChunk;
ASSERT(!makeCollectionMetadata()->getDifferentChunk(makeCollectionMetadata()->getMinKey(),
&differentChunk));
}
TEST_F(NoChunkFixture, OrphanedDataRangeBegin) {
auto metadata(makeCollectionMetadata());
stRangeMap pending;
BSONObj lookupKey = metadata->getMinKey();
auto keyRange = metadata->getNextOrphanRange(pending, lookupKey);
ASSERT(keyRange);
ASSERT(keyRange->minKey.woCompare(metadata->getMinKey()) == 0);
ASSERT(keyRange->maxKey.woCompare(metadata->getMaxKey()) == 0);
// Make sure we don't have any more ranges
ASSERT(!metadata->getNextOrphanRange(pending, keyRange->maxKey));
}
TEST_F(NoChunkFixture, OrphanedDataRangeMiddle) {
auto metadata(makeCollectionMetadata());
stRangeMap pending;
BSONObj lookupKey = BSON("a" << 20);
auto keyRange = metadata->getNextOrphanRange(pending, lookupKey);
ASSERT(keyRange);
ASSERT(keyRange->minKey.woCompare(metadata->getMinKey()) == 0);
ASSERT(keyRange->maxKey.woCompare(metadata->getMaxKey()) == 0);
ASSERT(keyRange->keyPattern.woCompare(metadata->getKeyPattern()) == 0);
// Make sure we don't have any more ranges
ASSERT(!metadata->getNextOrphanRange(pending, keyRange->maxKey));
}
TEST_F(NoChunkFixture, OrphanedDataRangeEnd) {
auto metadata(makeCollectionMetadata());
stRangeMap pending;
ASSERT(!metadata->getNextOrphanRange(pending, metadata->getMaxKey()));
}
/**
* Fixture with single chunk containing:
* [10->20)
*/
class SingleChunkFixture : public unittest::Test {
protected:
std::unique_ptr<CollectionMetadata> makeCollectionMetadata() const {
return makeCollectionMetadataImpl(KeyPattern(BSON("a" << 1)),
{std::make_pair(BSON("a" << 10), BSON("a" << 20))});
}
};
TEST_F(SingleChunkFixture, BasicBelongsToMe) {
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 10)));
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 15)));
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 19)));
}
TEST_F(SingleChunkFixture, DoesntBelongsToMe) {
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 0)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 9)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 20)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 1234)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << MINKEY)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << MAXKEY)));
}
TEST_F(SingleChunkFixture, CompoundKeyBelongsToMe) {
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 15 << "a" << 14)));
}
TEST_F(SingleChunkFixture, getNextFromEmpty) {
ChunkType nextChunk;
ASSERT(
makeCollectionMetadata()->getNextChunk(makeCollectionMetadata()->getMinKey(), &nextChunk));
ASSERT_EQUALS(0, nextChunk.getMin().woCompare(BSON("a" << 10)));
ASSERT_EQUALS(0, nextChunk.getMax().woCompare(BSON("a" << 20)));
}
TEST_F(SingleChunkFixture, GetLastChunkIsFalse) {
ChunkType nextChunk;
ASSERT(
!makeCollectionMetadata()->getNextChunk(makeCollectionMetadata()->getMaxKey(), &nextChunk));
}
TEST_F(SingleChunkFixture, getDifferentFromOneIsFalse) {
ChunkType differentChunk;
ASSERT(!makeCollectionMetadata()->getDifferentChunk(BSON("a" << 10), &differentChunk));
}
TEST_F(SingleChunkFixture, ChunkOrphanedDataRanges) {
stRangeMap pending;
auto keyRange = makeCollectionMetadata()->getNextOrphanRange(
pending, makeCollectionMetadata()->getMinKey());
ASSERT(keyRange);
ASSERT(keyRange->minKey.woCompare(makeCollectionMetadata()->getMinKey()) == 0);
ASSERT(keyRange->maxKey.woCompare(BSON("a" << 10)) == 0);
ASSERT(keyRange->keyPattern.woCompare(makeCollectionMetadata()->getKeyPattern()) == 0);
keyRange = makeCollectionMetadata()->getNextOrphanRange(pending, keyRange->maxKey);
ASSERT(keyRange);
ASSERT(keyRange->minKey.woCompare(BSON("a" << 20)) == 0);
ASSERT(keyRange->maxKey.woCompare(makeCollectionMetadata()->getMaxKey()) == 0);
ASSERT(keyRange->keyPattern.woCompare(makeCollectionMetadata()->getKeyPattern()) == 0);
ASSERT(!makeCollectionMetadata()->getNextOrphanRange(pending, keyRange->maxKey));
}
/**
* Fixture with single chunk containing:
* [(min, min)->(max, max))
*/
class SingleChunkMinMaxCompoundKeyFixture : public unittest::Test {
protected:
std::unique_ptr<CollectionMetadata> makeCollectionMetadata() const {
const KeyPattern shardKeyPattern(BSON("a" << 1 << "b" << 1));
return makeCollectionMetadataImpl(
shardKeyPattern,
{std::make_pair(shardKeyPattern.globalMin(), shardKeyPattern.globalMax())});
}
};
// Note: no tests for single key belongsToMe because they are not allowed
// if shard key is compound.
TEST_F(SingleChunkMinMaxCompoundKeyFixture, CompoundKeyBelongsToMe) {
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << MINKEY << "b" << MINKEY)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << MAXKEY << "b" << MAXKEY)));
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << MINKEY << "b" << 10)));
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 10 << "b" << 20)));
}
/**
* Fixture with chunks:
* [(10, 0)->(20, 0)), [(30, 0)->(40, 0))
*/
class TwoChunksWithGapCompoundKeyFixture : public unittest::Test {
protected:
std::unique_ptr<CollectionMetadata> makeCollectionMetadata() const {
return makeCollectionMetadataImpl(
KeyPattern(BSON("a" << 1 << "b" << 1)),
{std::make_pair(BSON("a" << 10 << "b" << 0), BSON("a" << 20 << "b" << 0)),
std::make_pair(BSON("a" << 30 << "b" << 0), BSON("a" << 40 << "b" << 0))});
}
};
TEST_F(TwoChunksWithGapCompoundKeyFixture, ChunkGapOrphanedDataRanges) {
stRangeMap pending;
auto keyRange = makeCollectionMetadata()->getNextOrphanRange(
pending, makeCollectionMetadata()->getMinKey());
ASSERT(keyRange);
ASSERT(keyRange->minKey.woCompare(makeCollectionMetadata()->getMinKey()) == 0);
ASSERT(keyRange->maxKey.woCompare(BSON("a" << 10 << "b" << 0)) == 0);
ASSERT(keyRange->keyPattern.woCompare(makeCollectionMetadata()->getKeyPattern()) == 0);
keyRange = makeCollectionMetadata()->getNextOrphanRange(pending, keyRange->maxKey);
ASSERT(keyRange);
ASSERT(keyRange->minKey.woCompare(BSON("a" << 20 << "b" << 0)) == 0);
ASSERT(keyRange->maxKey.woCompare(BSON("a" << 30 << "b" << 0)) == 0);
ASSERT(keyRange->keyPattern.woCompare(makeCollectionMetadata()->getKeyPattern()) == 0);
keyRange = makeCollectionMetadata()->getNextOrphanRange(pending, keyRange->maxKey);
ASSERT(keyRange);
ASSERT(keyRange->minKey.woCompare(BSON("a" << 40 << "b" << 0)) == 0);
ASSERT(keyRange->maxKey.woCompare(makeCollectionMetadata()->getMaxKey()) == 0);
ASSERT(keyRange->keyPattern.woCompare(makeCollectionMetadata()->getKeyPattern()) == 0);
ASSERT(!makeCollectionMetadata()->getNextOrphanRange(pending, keyRange->maxKey));
}
/**
* Fixture with chunk containing:
* [min->10) , [10->20) , <gap> , [30->max)
*/
class ThreeChunkWithRangeGapFixture : public unittest::Test {
protected:
std::unique_ptr<CollectionMetadata> makeCollectionMetadata() const {
return makeCollectionMetadataImpl(KeyPattern(BSON("a" << 1)),
{std::make_pair(BSON("a" << MINKEY), BSON("a" << 10)),
std::make_pair(BSON("a" << 10), BSON("a" << 20)),
std::make_pair(BSON("a" << 30), BSON("a" << MAXKEY))});
}
};
TEST_F(ThreeChunkWithRangeGapFixture, ChunkVersionsMatch) {
auto metadata(makeCollectionMetadata());
ChunkType chunk;
ASSERT(metadata->getNextChunk(BSON("a" << MINKEY), &chunk));
ASSERT_EQ(ChunkVersion(1, 0, metadata->getCollVersion().epoch()), chunk.getVersion());
ASSERT_BSONOBJ_EQ(metadata->getMinKey(), chunk.getMin());
ASSERT(metadata->getNextChunk(BSON("a" << 10), &chunk));
ASSERT_EQ(ChunkVersion(2, 0, metadata->getCollVersion().epoch()), chunk.getVersion());
ASSERT(metadata->getNextChunk(BSON("a" << 30), &chunk));
ASSERT_EQ(ChunkVersion(4, 0, metadata->getCollVersion().epoch()), chunk.getVersion());
ASSERT_BSONOBJ_EQ(metadata->getMaxKey(), chunk.getMax());
}
TEST_F(ThreeChunkWithRangeGapFixture, ShardOwnsDoc) {
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 5)));
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 10)));
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 30)));
ASSERT(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 40)));
}
TEST_F(ThreeChunkWithRangeGapFixture, ShardDoesntOwnDoc) {
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 20)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << 25)));
ASSERT_FALSE(makeCollectionMetadata()->keyBelongsToMe(BSON("a" << MAXKEY)));
}
TEST_F(ThreeChunkWithRangeGapFixture, GetNextFromEmpty) {
ChunkType nextChunk;
ASSERT(
makeCollectionMetadata()->getNextChunk(makeCollectionMetadata()->getMinKey(), &nextChunk));
ASSERT_EQUALS(0, nextChunk.getMin().woCompare(BSON("a" << MINKEY)));
ASSERT_EQUALS(0, nextChunk.getMax().woCompare(BSON("a" << 10)));
}
TEST_F(ThreeChunkWithRangeGapFixture, GetNextFromMiddle) {
ChunkType nextChunk;
ASSERT(makeCollectionMetadata()->getNextChunk(BSON("a" << 20), &nextChunk));
ASSERT_EQUALS(0, nextChunk.getMin().woCompare(BSON("a" << 30)));
ASSERT_EQUALS(0, nextChunk.getMax().woCompare(BSON("a" << MAXKEY)));
}
TEST_F(ThreeChunkWithRangeGapFixture, GetNextFromLast) {
ChunkType nextChunk;
ASSERT(makeCollectionMetadata()->getNextChunk(BSON("a" << 30), &nextChunk));
ASSERT_EQUALS(0, nextChunk.getMin().woCompare(BSON("a" << 30)));
ASSERT_EQUALS(0, nextChunk.getMax().woCompare(BSON("a" << MAXKEY)));
}
TEST_F(ThreeChunkWithRangeGapFixture, GetDifferentFromBeginning) {
auto metadata(makeCollectionMetadata());
ChunkType differentChunk;
ASSERT(metadata->getDifferentChunk(metadata->getMinKey(), &differentChunk));
ASSERT_BSONOBJ_EQ(BSON("a" << 10), differentChunk.getMin());
ASSERT_BSONOBJ_EQ(BSON("a" << 20), differentChunk.getMax());
}
TEST_F(ThreeChunkWithRangeGapFixture, GetDifferentFromMiddle) {
ChunkType differentChunk;
ASSERT(makeCollectionMetadata()->getDifferentChunk(BSON("a" << 10), &differentChunk));
ASSERT_EQUALS(0, differentChunk.getMin().woCompare(BSON("a" << MINKEY)));
ASSERT_EQUALS(0, differentChunk.getMax().woCompare(BSON("a" << 10)));
}
TEST_F(ThreeChunkWithRangeGapFixture, GetDifferentFromLast) {
ChunkType differentChunk;
ASSERT(makeCollectionMetadata()->getDifferentChunk(BSON("a" << 30), &differentChunk));
ASSERT_EQUALS(0, differentChunk.getMin().woCompare(BSON("a" << MINKEY)));
ASSERT_EQUALS(0, differentChunk.getMax().woCompare(BSON("a" << 10)));
}
} // namespace
} // namespace mongo
| 42.049479 | 100 | 0.681922 | [
"vector"
] |
13b790eed0bcc5146ce099e5192e19d162e6389e | 3,377 | cc | C++ | UVa Online Judge/v12/1247.cc | mjenrungrot/algorithm | e0e8174eb133ba20931c2c7f5c67732e4cb2b703 | [
"MIT"
] | 1 | 2021-12-08T08:58:43.000Z | 2021-12-08T08:58:43.000Z | UVa Online Judge/v12/1247.cc | mjenrungrot/algorithm | e0e8174eb133ba20931c2c7f5c67732e4cb2b703 | [
"MIT"
] | null | null | null | UVa Online Judge/v12/1247.cc | mjenrungrot/algorithm | e0e8174eb133ba20931c2c7f5c67732e4cb2b703 | [
"MIT"
] | null | null | null | /*=============================================================================
# Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/
# FileName: 1247.cc
# Description: UVa Online Judge - 1247
=============================================================================*/
#include <bits/stdc++.h>
#pragma GCC optimizer("Ofast")
#pragma GCC target("avx2")
#define what_is(x) cerr << #x << " is " << x << endl;
using namespace std;
typedef pair<int, int> ii;
typedef pair<long long, long long> ll;
typedef pair<double, double> dd;
typedef tuple<int, int, int> iii;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vl;
typedef vector<vector<long long>> vvl;
typedef vector<double> vd;
typedef vector<vector<double>> vvd;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<dd> vdd;
template <class Ch, class Tr, class Container>
basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os,
Container const& x) {
os << "{ ";
for (auto& y : x) os << y << " ";
return os << "}";
}
template <class X, class Y>
ostream& operator<<(ostream& os, pair<X, Y> const& p) {
return os << "[ " << p.first << ", " << p.second << "]";
}
vs split(string line, regex re) {
vs output;
sregex_token_iterator it(line.begin(), line.end(), re, -1), it_end;
while (it != it_end) {
output.push_back(it->str());
it++;
}
return output;
}
const int INF_INT = 1e9 + 7;
const long long INF_LL = 1e18;
const int MAXN = 26;
int N, M;
int dist[MAXN][MAXN], length[MAXN][MAXN], path[MAXN][MAXN];
void print_path(int u, int v) {
if (u != v) print_path(u, path[u][v]);
if (u != v) cout << " ";
cout << (char)('A' + v);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
while (cin >> N >> M) {
for (int i = 0; i < MAXN; i++)
for (int j = 0; j < MAXN; j++) {
dist[i][j] = (i == j ? 0 : INF_INT);
length[i][j] = (i == j ? 0 : INF_INT);
path[i][j] = -1;
}
for (int i = 0; i < M; i++) {
char u, v;
int w;
cin >> u >> v >> w;
dist[u - 'A'][v - 'A'] = dist[v - 'A'][u - 'A'] = w;
length[u - 'A'][v - 'A'] = length[v - 'A'][u - 'A'] = 1;
path[u - 'A'][v - 'A'] = u - 'A';
path[v - 'A'][u - 'A'] = v - 'A';
}
for (int k = 0; k < MAXN; k++)
for (int i = 0; i < MAXN; i++)
for (int j = 0; j < MAXN; j++) {
if (dist[i][k] + dist[k][j] < dist[i][j]) {
dist[i][j] = dist[i][k] + dist[k][j];
length[i][j] = length[i][k] + length[k][j];
path[i][j] = path[k][j];
} else if (dist[i][k] + dist[k][j] == dist[i][j] and
length[i][k] + length[k][j] < length[i][j]) {
length[i][j] = length[i][k] + length[k][j];
path[i][j] = path[k][j];
}
}
int Q;
cin >> Q;
for (int i = 0; i < Q; i++) {
char u, v;
cin >> u >> v;
print_path(u - 'A', v - 'A');
cout << endl;
}
}
return 0;
} | 30.7 | 79 | 0.431448 | [
"vector"
] |
13ba9d681c36a59c09c2b7e07b0c135b855b4a57 | 1,012 | cpp | C++ | src/shared/time.cpp | waveseekers/crank | 2abf2f08315c47fffc90ec943957c6eea171fe38 | [
"MIT"
] | null | null | null | src/shared/time.cpp | waveseekers/crank | 2abf2f08315c47fffc90ec943957c6eea171fe38 | [
"MIT"
] | null | null | null | src/shared/time.cpp | waveseekers/crank | 2abf2f08315c47fffc90ec943957c6eea171fe38 | [
"MIT"
] | null | null | null | //
// Created by Albert on 18/2/2016.
//
#include "time.hpp"
using namespace ws;
/**
* Time constructor
*
*/
Time::Time( const std::string &datetime )
{
SetTimestamp(datetime);
};
Time::~Time()
{
// destructor
}
/**
* Prints out the current time.
*
*/
void
Time::SetTimestamp( const std::string &datetime )
{
// const boost::posix_time::ptime time = boost::posix_time::time_from_string("1981-08-20 08:05:00");
boost::posix_time::ptime t(boost::posix_time::time_from_string(datetime));
boost::posix_time::ptime start(boost::gregorian::date(1970,1,1));
boost::posix_time::time_duration time_diff = t - start;
timestamp_ = time_diff.total_milliseconds();
}
/**
* Returns the Unix timestamp in milliseconds for the date object.
*
* @return timestamp (milliseconds).
*/
unsigned long int
Time::GetTimestampMilliseconds()
{
return timestamp_;
}
/**
* Prints out the current time.
*
*/
void
Time::PrintTime()
{
std::cout << "It's beer o' clock!" << std::endl;
}
| 17.152542 | 103 | 0.663043 | [
"object"
] |
13bb6589a3c108785b8e17ade36ba99dbbe5b306 | 4,246 | cpp | C++ | test/model_test_files/test_load_urdf_model.cpp | stevenjj/icra2020locomanipulation | 414085b68cc1b3b24f7b920b543bba9d95350c16 | [
"MIT"
] | 5 | 2020-01-06T11:43:18.000Z | 2021-12-14T22:59:09.000Z | test/model_test_files/test_load_urdf_model.cpp | stevenjj/icra2020locomanipulation | 414085b68cc1b3b24f7b920b543bba9d95350c16 | [
"MIT"
] | null | null | null | test/model_test_files/test_load_urdf_model.cpp | stevenjj/icra2020locomanipulation | 414085b68cc1b3b24f7b920b543bba9d95350c16 | [
"MIT"
] | 2 | 2020-09-03T16:08:34.000Z | 2022-02-17T11:13:49.000Z | #include <Configuration.h> // Package Path
#include <avatar_locomanipulation/enable_pinocchio_with_hpp_fcl.h> // Enable HPP FCL
// Multibody
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
#include "pinocchio/multibody/geometry.hpp"
// Algorithms
#include "pinocchio/algorithm/kinematics.hpp"
#include "pinocchio/algorithm/geometry.hpp"
#include "pinocchio/algorithm/jacobian.hpp"
#include "pinocchio/algorithm/frames.hpp" // Jacobian Frame Computation
#include "pinocchio/algorithm/aba.hpp" // Articulated Body Algorithm
#include "pinocchio/algorithm/crba.hpp" // Composite Rigid Body Algorithm
#include "pinocchio/algorithm/rnea.hpp" // Recursive Newton-Euler Algorithm
// Parsers
#include "pinocchio/parsers/urdf.hpp"
#include "pinocchio/parsers/srdf.hpp"
// Utils
#include "pinocchio/utils/timer.hpp"
// Standard
#include <math.h>
int main(int argc, char ** argv){
PinocchioTicToc timer = PinocchioTicToc(PinocchioTicToc::MS);
std::string filename = (argc<=1) ? THIS_PACKAGE_PATH"models/valkyrie_simplified.urdf" : argv[1];
std::vector < std::string > packageDirs;
std::string meshDir = THIS_PACKAGE_PATH"../val_model/";
packageDirs.push_back(meshDir);
// Build URDF Model
pinocchio::Model model;
pinocchio::urdf::buildModel(filename, pinocchio::JointModelFreeFlyer(),model);
// Build Geometry model to check for collisions
pinocchio::GeometryModel geom;
pinocchio::urdf::buildGeom(model, filename, pinocchio::COLLISION, geom, packageDirs);
pinocchio::Data data(model);
pinocchio::GeometryData geomData(geom);
//<---------- Added By Ryan
geom.addAllCollisionPairs();
std::cout << "------ Model ------ " << std::endl;
std::cout << model;
std::cout << "------ Geom ------ " << std::endl;
std::cout << geom;
std::cout << "------ DataGeom ------ " << std::endl;
std::cout << geomData;
//<---------- End Added By Ryan
// Initialize Configuration -----------------------
Eigen::VectorXd q = Eigen::VectorXd::Zero(model.nq); // Config
Eigen::VectorXd v = Eigen::VectorXd::Zero(model.nv); // Config Velocity
Eigen::VectorXd a = Eigen::VectorXd::Zero(model.nv); // Config Acceleration
// floating base joints: x, y, z
q[0] = 0.0; q[1] = 0.0; q[2] = 0.0;
// floating base quaternion: qx, qy, qz, qw
double theta = M_PI/4.0;
Eigen::AngleAxis<double> aa(theta, Eigen::Vector3d(0.0, 0.0, 1.0)); // yaw pi/4 to the left
Eigen::Quaternion<double> quat_init; quat_init = aa;
q[3] = quat_init.x();// 0.0;
q[4] = quat_init.y(); //0.0;
q[5] = quat_init.z(); //sin(theta/2.0);
q[6] = quat_init.w(); //cos(theta/2.0);
std::cout << "Initial " << q.transpose() << std::endl;
std::cout << "q = " << q.transpose() << std::endl;
// End Initialize Configuration -----------------------
// Test Kinematics Kinematics:
// Note that this function does not check if the quaternion is a valid unit quaternion.
timer.tic();
pinocchio::forwardKinematics(model,data,q);
std::cout << "Forward kinematics took: " << timer.toc() << timer.unitName(timer.DEFAULT_UNIT) << std::endl;
// Compute Joint Jacobians
std::cout << " "; timer.tic();
pinocchio::computeJointJacobians(model,data, q);
std::cout << timer.toc() << timer.unitName(timer.DEFAULT_UNIT) << " jacobians computation time" << std::endl;
// Update Frame Placements
std::cout << " "; timer.tic();
pinocchio::updateFramePlacements(model, data);
std::cout << timer.toc() << timer.unitName(timer.DEFAULT_UNIT) << " frame placements computation time" << std::endl;
// List Joint Names
for (int k=0 ; k<model.njoints ; ++k) {
std::cout << model.names[k] << "\t: "
<< data.oMi[k].translation().transpose() << std::endl;
}
// List Operational Space Frames
for (int k=0 ; k<model.frames.size() ; ++k){
std::cout << "frame:" << k << " " << model.frames[k].name << " : " << data.oMf[k].translation().transpose() << std::endl;
}
// Test Inverse Dynamics
timer.tic();
const Eigen::VectorXd & tau = pinocchio::rnea(model,data,q,v,a);
std::cout << "tau = " << tau.transpose() << std::endl;
std::cout << "Inverse dynamics took: " << timer.toc() << timer.unitName(timer.DEFAULT_UNIT) << std::endl;
return 0;
} | 37.910714 | 125 | 0.654263 | [
"geometry",
"vector",
"model"
] |
13bc82c47bc53716dc7d6e195e2fbdad853f093b | 185 | cpp | C++ | UL/CppApp/System/Reflection/MemberInfo.cpp | xiongfang/UL | a2c7af50da0e30a34e4656b395557896781b66b1 | [
"MIT"
] | 23 | 2018-07-17T16:30:15.000Z | 2022-01-03T14:02:45.000Z | UL/CppApp/System/Reflection/MemberInfo.cpp | Halfholl/UL | 76bc687a1b12ee9b69977d7e20ad007d772b2869 | [
"MIT"
] | null | null | null | UL/CppApp/System/Reflection/MemberInfo.cpp | Halfholl/UL | 76bc687a1b12ee9b69977d7e20ad007d772b2869 | [
"MIT"
] | 9 | 2019-02-06T13:24:35.000Z | 2022-01-03T14:02:45.000Z | #include "stdafx.h"
#include "System\Reflection\MemberInfo.h"
#include "System\Object.h"
#include "System\Reflection\MemberTypes.h"
#include "System\String.h"
#include "System\Type.h"
| 26.428571 | 42 | 0.762162 | [
"object"
] |
13c483c0f3c60c892c7a89e48a2ed75355a6d121 | 333,594 | cpp | C++ | test/tailoring_rule_test_zh_big5han_008.cpp | jan-moeller/text | c61e51c82dfb0ae6e74200c01ce040fa6db730c4 | [
"BSL-1.0"
] | null | null | null | test/tailoring_rule_test_zh_big5han_008.cpp | jan-moeller/text | c61e51c82dfb0ae6e74200c01ce040fa6db730c4 | [
"BSL-1.0"
] | 1 | 2021-03-05T12:56:59.000Z | 2021-03-05T13:11:53.000Z | test/tailoring_rule_test_zh_big5han_008.cpp | jan-moeller/text | c61e51c82dfb0ae6e74200c01ce040fa6db730c4 | [
"BSL-1.0"
] | 3 | 2019-10-30T18:38:15.000Z | 2021-03-05T12:10:13.000Z |
// Warning! This file is autogenerated.
#include <boost/text/collation_table.hpp>
#include <boost/text/collate.hpp>
#include <boost/text/data/all.hpp>
#ifndef LIMIT_TESTING_FOR_CI
#include <boost/text/save_load_table.hpp>
#include <boost/filesystem.hpp>
#endif
#include <gtest/gtest.h>
using namespace boost::text;
auto const error = [](string const & s) { std::cout << s; };
auto const warning = [](string const & s) {};
collation_table make_save_load_table()
{
#ifdef LIMIT_TESTING_FOR_CI
string const table_str(data::zh::big5han_collation_tailoring());
return tailored_collation_table(
table_str,
"zh::big5han_collation_tailoring()", error, warning);
#else
if (!exists(boost::filesystem::path("zh_big5han.table"))) {
string const table_str(data::zh::big5han_collation_tailoring());
collation_table table = tailored_collation_table(
table_str,
"zh::big5han_collation_tailoring()", error, warning);
save_table(table, "zh_big5han.table.8");
boost::filesystem::rename("zh_big5han.table.8", "zh_big5han.table");
}
return load_table("zh_big5han.table");
#endif
}
collation_table const & table()
{
static collation_table retval = make_save_load_table();
return retval;
}
TEST(tailoring, zh_big5han_007_000)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68e8);
auto const rel = std::vector<uint32_t>(1, 0x690b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x690b);
auto const rel = std::vector<uint32_t>(1, 0x690a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x690a);
auto const rel = std::vector<uint32_t>(1, 0x6917);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6917);
auto const rel = std::vector<uint32_t>(1, 0x68ce);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68ce);
auto const rel = std::vector<uint32_t>(1, 0x68c8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68c8);
auto const rel = std::vector<uint32_t>(1, 0x68dd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68dd);
auto const rel = std::vector<uint32_t>(1, 0x68de);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68de);
auto const rel = std::vector<uint32_t>(1, 0x68e6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68e6);
auto const rel = std::vector<uint32_t>(1, 0x68f4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68f4);
auto const rel = std::vector<uint32_t>(1, 0x68d1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68d1);
auto const rel = std::vector<uint32_t>(1, 0x6906);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6906);
auto const rel = std::vector<uint32_t>(1, 0x68d4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68d4);
auto const rel = std::vector<uint32_t>(1, 0x68e9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68e9);
auto const rel = std::vector<uint32_t>(1, 0x6915);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6915);
auto const rel = std::vector<uint32_t>(1, 0x6925);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6925);
auto const rel = std::vector<uint32_t>(1, 0x68c7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68c7);
auto const rel = std::vector<uint32_t>(1, 0x6b39);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b39);
auto const rel = std::vector<uint32_t>(1, 0x6b3b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b3b);
auto const rel = std::vector<uint32_t>(1, 0x6b3f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b3f);
auto const rel = std::vector<uint32_t>(1, 0x6b3c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b3c);
auto const rel = std::vector<uint32_t>(1, 0x6b94);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b94);
auto const rel = std::vector<uint32_t>(1, 0x6b97);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b97);
auto const rel = std::vector<uint32_t>(1, 0x6b99);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b99);
auto const rel = std::vector<uint32_t>(1, 0x6b95);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b95);
auto const rel = std::vector<uint32_t>(1, 0x6bbd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bbd);
auto const rel = std::vector<uint32_t>(1, 0x6bf0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bf0);
auto const rel = std::vector<uint32_t>(1, 0x6bf2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bf2);
auto const rel = std::vector<uint32_t>(1, 0x6bf3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bf3);
auto const rel = std::vector<uint32_t>(1, 0x6c30);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6c30);
auto const rel = std::vector<uint32_t>(1, 0x6dfc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6dfc);
auto const rel = std::vector<uint32_t>(1, 0x6e46);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e46);
auto const rel = std::vector<uint32_t>(1, 0x6e47);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e47);
auto const rel = std::vector<uint32_t>(1, 0x6e1f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e1f);
auto const rel = std::vector<uint32_t>(1, 0x6e49);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e49);
auto const rel = std::vector<uint32_t>(1, 0x6e88);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e88);
auto const rel = std::vector<uint32_t>(1, 0x6e3c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e3c);
auto const rel = std::vector<uint32_t>(1, 0x6e3d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e3d);
auto const rel = std::vector<uint32_t>(1, 0x6e45);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e45);
auto const rel = std::vector<uint32_t>(1, 0x6e62);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e62);
auto const rel = std::vector<uint32_t>(1, 0x6e2b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e2b);
auto const rel = std::vector<uint32_t>(1, 0x6e3f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e3f);
auto const rel = std::vector<uint32_t>(1, 0x6e41);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e41);
auto const rel = std::vector<uint32_t>(1, 0x6e5d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e5d);
auto const rel = std::vector<uint32_t>(1, 0x6e73);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e73);
auto const rel = std::vector<uint32_t>(1, 0x6e1c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e1c);
auto const rel = std::vector<uint32_t>(1, 0x6e33);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e33);
auto const rel = std::vector<uint32_t>(1, 0x6e4b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e4b);
auto const rel = std::vector<uint32_t>(1, 0x6e40);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e40);
auto const rel = std::vector<uint32_t>(1, 0x6e51);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e51);
auto const rel = std::vector<uint32_t>(1, 0x6e3b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e3b);
auto const rel = std::vector<uint32_t>(1, 0x6e03);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_001)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e03);
auto const rel = std::vector<uint32_t>(1, 0x6e2e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e2e);
auto const rel = std::vector<uint32_t>(1, 0x6e5e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e5e);
auto const rel = std::vector<uint32_t>(1, 0x6e68);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e68);
auto const rel = std::vector<uint32_t>(1, 0x6e5c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e5c);
auto const rel = std::vector<uint32_t>(1, 0x6e61);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e61);
auto const rel = std::vector<uint32_t>(1, 0x6e31);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e31);
auto const rel = std::vector<uint32_t>(1, 0x6e28);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e28);
auto const rel = std::vector<uint32_t>(1, 0x6e60);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e60);
auto const rel = std::vector<uint32_t>(1, 0x6e71);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e71);
auto const rel = std::vector<uint32_t>(1, 0x6e6b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e6b);
auto const rel = std::vector<uint32_t>(1, 0x6e39);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e39);
auto const rel = std::vector<uint32_t>(1, 0x6e22);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e22);
auto const rel = std::vector<uint32_t>(1, 0x6e30);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e30);
auto const rel = std::vector<uint32_t>(1, 0x6e53);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e53);
auto const rel = std::vector<uint32_t>(1, 0x6e65);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e65);
auto const rel = std::vector<uint32_t>(1, 0x6e27);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e27);
auto const rel = std::vector<uint32_t>(1, 0x6e78);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e78);
auto const rel = std::vector<uint32_t>(1, 0x6e64);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e64);
auto const rel = std::vector<uint32_t>(1, 0x6e77);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e77);
auto const rel = std::vector<uint32_t>(1, 0x6e55);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e55);
auto const rel = std::vector<uint32_t>(1, 0x6e79);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e79);
auto const rel = std::vector<uint32_t>(1, 0x6e52);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e52);
auto const rel = std::vector<uint32_t>(1, 0x6e66);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e66);
auto const rel = std::vector<uint32_t>(1, 0x6e35);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e35);
auto const rel = std::vector<uint32_t>(1, 0x6e36);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e36);
auto const rel = std::vector<uint32_t>(1, 0x6e5a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e5a);
auto const rel = std::vector<uint32_t>(1, 0x7120);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7120);
auto const rel = std::vector<uint32_t>(1, 0x711e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x711e);
auto const rel = std::vector<uint32_t>(1, 0x712f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x712f);
auto const rel = std::vector<uint32_t>(1, 0x70fb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x70fb);
auto const rel = std::vector<uint32_t>(1, 0x712e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x712e);
auto const rel = std::vector<uint32_t>(1, 0x7131);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7131);
auto const rel = std::vector<uint32_t>(1, 0x7123);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7123);
auto const rel = std::vector<uint32_t>(1, 0x7125);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7125);
auto const rel = std::vector<uint32_t>(1, 0x7122);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7122);
auto const rel = std::vector<uint32_t>(1, 0x7132);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7132);
auto const rel = std::vector<uint32_t>(1, 0x711f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x711f);
auto const rel = std::vector<uint32_t>(1, 0x7128);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7128);
auto const rel = std::vector<uint32_t>(1, 0x713a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x713a);
auto const rel = std::vector<uint32_t>(1, 0x711b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x711b);
auto const rel = std::vector<uint32_t>(1, 0x724b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x724b);
auto const rel = std::vector<uint32_t>(1, 0x725a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x725a);
auto const rel = std::vector<uint32_t>(1, 0x7288);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7288);
auto const rel = std::vector<uint32_t>(1, 0x7289);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7289);
auto const rel = std::vector<uint32_t>(1, 0x7286);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7286);
auto const rel = std::vector<uint32_t>(1, 0x7285);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7285);
auto const rel = std::vector<uint32_t>(1, 0x728b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x728b);
auto const rel = std::vector<uint32_t>(1, 0x7312);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7312);
auto const rel = std::vector<uint32_t>(1, 0x730b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x730b);
auto const rel = std::vector<uint32_t>(1, 0x7330);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7330);
auto const rel = std::vector<uint32_t>(1, 0x7322);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_002)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7322);
auto const rel = std::vector<uint32_t>(1, 0x7331);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7331);
auto const rel = std::vector<uint32_t>(1, 0x7333);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7333);
auto const rel = std::vector<uint32_t>(1, 0x7327);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7327);
auto const rel = std::vector<uint32_t>(1, 0x7332);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7332);
auto const rel = std::vector<uint32_t>(1, 0x732d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x732d);
auto const rel = std::vector<uint32_t>(1, 0x7326);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7326);
auto const rel = std::vector<uint32_t>(1, 0x7323);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7323);
auto const rel = std::vector<uint32_t>(1, 0x7335);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7335);
auto const rel = std::vector<uint32_t>(1, 0x730c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x730c);
auto const rel = std::vector<uint32_t>(1, 0x742e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x742e);
auto const rel = std::vector<uint32_t>(1, 0x742c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x742c);
auto const rel = std::vector<uint32_t>(1, 0x7430);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7430);
auto const rel = std::vector<uint32_t>(1, 0x742b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x742b);
auto const rel = std::vector<uint32_t>(1, 0x7416);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7416);
auto const rel = std::vector<uint32_t>(1, 0x741a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x741a);
auto const rel = std::vector<uint32_t>(1, 0x7421);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7421);
auto const rel = std::vector<uint32_t>(1, 0x742d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x742d);
auto const rel = std::vector<uint32_t>(1, 0x7431);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7431);
auto const rel = std::vector<uint32_t>(1, 0x7424);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7424);
auto const rel = std::vector<uint32_t>(1, 0x7423);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7423);
auto const rel = std::vector<uint32_t>(1, 0x741d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x741d);
auto const rel = std::vector<uint32_t>(1, 0x7429);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7429);
auto const rel = std::vector<uint32_t>(1, 0x7420);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7420);
auto const rel = std::vector<uint32_t>(1, 0x7432);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7432);
auto const rel = std::vector<uint32_t>(1, 0x74fb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x74fb);
auto const rel = std::vector<uint32_t>(1, 0x752f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x752f);
auto const rel = std::vector<uint32_t>(1, 0x756f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x756f);
auto const rel = std::vector<uint32_t>(1, 0x756c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x756c);
auto const rel = std::vector<uint32_t>(1, 0x75e7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75e7);
auto const rel = std::vector<uint32_t>(1, 0x75da);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75da);
auto const rel = std::vector<uint32_t>(1, 0x75e1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75e1);
auto const rel = std::vector<uint32_t>(1, 0x75e6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75e6);
auto const rel = std::vector<uint32_t>(1, 0x75dd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75dd);
auto const rel = std::vector<uint32_t>(1, 0x75df);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75df);
auto const rel = std::vector<uint32_t>(1, 0x75e4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75e4);
auto const rel = std::vector<uint32_t>(1, 0x75d7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75d7);
auto const rel = std::vector<uint32_t>(1, 0x7695);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7695);
auto const rel = std::vector<uint32_t>(1, 0x7692);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7692);
auto const rel = std::vector<uint32_t>(1, 0x76da);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x76da);
auto const rel = std::vector<uint32_t>(1, 0x7746);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7746);
auto const rel = std::vector<uint32_t>(1, 0x7747);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7747);
auto const rel = std::vector<uint32_t>(1, 0x7744);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7744);
auto const rel = std::vector<uint32_t>(1, 0x774d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x774d);
auto const rel = std::vector<uint32_t>(1, 0x7745);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7745);
auto const rel = std::vector<uint32_t>(1, 0x774a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x774a);
auto const rel = std::vector<uint32_t>(1, 0x774e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x774e);
auto const rel = std::vector<uint32_t>(1, 0x774b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x774b);
auto const rel = std::vector<uint32_t>(1, 0x774c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x774c);
auto const rel = std::vector<uint32_t>(1, 0x77de);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x77de);
auto const rel = std::vector<uint32_t>(1, 0x77ec);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x77ec);
auto const rel = std::vector<uint32_t>(1, 0x7860);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_003)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7860);
auto const rel = std::vector<uint32_t>(1, 0x7864);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7864);
auto const rel = std::vector<uint32_t>(1, 0x7865);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7865);
auto const rel = std::vector<uint32_t>(1, 0x785c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x785c);
auto const rel = std::vector<uint32_t>(1, 0x786d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x786d);
auto const rel = std::vector<uint32_t>(1, 0x7871);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7871);
auto const rel = std::vector<uint32_t>(1, 0x786a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x786a);
auto const rel = std::vector<uint32_t>(1, 0x786e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x786e);
auto const rel = std::vector<uint32_t>(1, 0x7870);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7870);
auto const rel = std::vector<uint32_t>(1, 0x7869);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7869);
auto const rel = std::vector<uint32_t>(1, 0x7868);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7868);
auto const rel = std::vector<uint32_t>(1, 0x785e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x785e);
auto const rel = std::vector<uint32_t>(1, 0x7862);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7862);
auto const rel = std::vector<uint32_t>(1, 0x7974);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7974);
auto const rel = std::vector<uint32_t>(1, 0x7973);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7973);
auto const rel = std::vector<uint32_t>(1, 0x7972);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7972);
auto const rel = std::vector<uint32_t>(1, 0x7970);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7970);
auto const rel = std::vector<uint32_t>(1, 0x7a02);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a02);
auto const rel = std::vector<uint32_t>(1, 0x7a0a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a0a);
auto const rel = std::vector<uint32_t>(1, 0x7a03);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a03);
auto const rel = std::vector<uint32_t>(1, 0x7a0c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a0c);
auto const rel = std::vector<uint32_t>(1, 0x7a04);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a04);
auto const rel = std::vector<uint32_t>(1, 0x7a99);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a99);
auto const rel = std::vector<uint32_t>(1, 0x7ae6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7ae6);
auto const rel = std::vector<uint32_t>(1, 0x7ae4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7ae4);
auto const rel = std::vector<uint32_t>(1, 0x7b4a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b4a);
auto const rel = std::vector<uint32_t>(1, 0x7b3b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b3b);
auto const rel = std::vector<uint32_t>(1, 0x7b44);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b44);
auto const rel = std::vector<uint32_t>(1, 0x7b48);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b48);
auto const rel = std::vector<uint32_t>(1, 0x7b4c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b4c);
auto const rel = std::vector<uint32_t>(1, 0x7b4e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b4e);
auto const rel = std::vector<uint32_t>(1, 0x7b40);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b40);
auto const rel = std::vector<uint32_t>(1, 0x7b58);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b58);
auto const rel = std::vector<uint32_t>(1, 0x7b45);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b45);
auto const rel = std::vector<uint32_t>(1, 0x7ca2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7ca2);
auto const rel = std::vector<uint32_t>(1, 0x7c9e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7c9e);
auto const rel = std::vector<uint32_t>(1, 0x7ca8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7ca8);
auto const rel = std::vector<uint32_t>(1, 0x7ca1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7ca1);
auto const rel = std::vector<uint32_t>(1, 0x7d58);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d58);
auto const rel = std::vector<uint32_t>(1, 0x7d6f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d6f);
auto const rel = std::vector<uint32_t>(1, 0x7d63);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d63);
auto const rel = std::vector<uint32_t>(1, 0x7d53);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d53);
auto const rel = std::vector<uint32_t>(1, 0x7d56);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d56);
auto const rel = std::vector<uint32_t>(1, 0x7d67);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d67);
auto const rel = std::vector<uint32_t>(1, 0x7d6a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d6a);
auto const rel = std::vector<uint32_t>(1, 0x7d4f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d4f);
auto const rel = std::vector<uint32_t>(1, 0x7d6d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d6d);
auto const rel = std::vector<uint32_t>(1, 0x7d5c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d5c);
auto const rel = std::vector<uint32_t>(1, 0x7d6b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d6b);
auto const rel = std::vector<uint32_t>(1, 0x7d52);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d52);
auto const rel = std::vector<uint32_t>(1, 0x7d54);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d54);
auto const rel = std::vector<uint32_t>(1, 0x7d69);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_004)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d69);
auto const rel = std::vector<uint32_t>(1, 0x7d51);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d51);
auto const rel = std::vector<uint32_t>(1, 0x7d5f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d5f);
auto const rel = std::vector<uint32_t>(1, 0x7d4e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d4e);
auto const rel = std::vector<uint32_t>(1, 0x7f3e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f3e);
auto const rel = std::vector<uint32_t>(1, 0x7f3f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f3f);
auto const rel = std::vector<uint32_t>(1, 0x7f65);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f65);
auto const rel = std::vector<uint32_t>(1, 0x7f66);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f66);
auto const rel = std::vector<uint32_t>(1, 0x7fa2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fa2);
auto const rel = std::vector<uint32_t>(1, 0x7fa0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fa0);
auto const rel = std::vector<uint32_t>(1, 0x7fa1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fa1);
auto const rel = std::vector<uint32_t>(1, 0x7fd7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fd7);
auto const rel = std::vector<uint32_t>(1, 0x8051);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8051);
auto const rel = std::vector<uint32_t>(1, 0x804f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x804f);
auto const rel = std::vector<uint32_t>(1, 0x8050);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8050);
auto const rel = std::vector<uint32_t>(1, 0x80fe);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x80fe);
auto const rel = std::vector<uint32_t>(1, 0x80d4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x80d4);
auto const rel = std::vector<uint32_t>(1, 0x8143);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8143);
auto const rel = std::vector<uint32_t>(1, 0x814a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x814a);
auto const rel = std::vector<uint32_t>(1, 0x8152);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8152);
auto const rel = std::vector<uint32_t>(1, 0x814f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x814f);
auto const rel = std::vector<uint32_t>(1, 0x8147);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8147);
auto const rel = std::vector<uint32_t>(1, 0x813d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x813d);
auto const rel = std::vector<uint32_t>(1, 0x814d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x814d);
auto const rel = std::vector<uint32_t>(1, 0x813a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x813a);
auto const rel = std::vector<uint32_t>(1, 0x81e6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x81e6);
auto const rel = std::vector<uint32_t>(1, 0x81ee);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x81ee);
auto const rel = std::vector<uint32_t>(1, 0x81f7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x81f7);
auto const rel = std::vector<uint32_t>(1, 0x81f8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x81f8);
auto const rel = std::vector<uint32_t>(1, 0x81f9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x81f9);
auto const rel = std::vector<uint32_t>(1, 0x8204);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8204);
auto const rel = std::vector<uint32_t>(1, 0x823c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x823c);
auto const rel = std::vector<uint32_t>(1, 0x823d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x823d);
auto const rel = std::vector<uint32_t>(1, 0x823f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x823f);
auto const rel = std::vector<uint32_t>(1, 0x8275);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8275);
auto const rel = std::vector<uint32_t>(1, 0x833b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x833b);
auto const rel = std::vector<uint32_t>(1, 0x83cf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83cf);
auto const rel = std::vector<uint32_t>(1, 0x83f9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83f9);
auto const rel = std::vector<uint32_t>(1, 0x8423);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8423);
auto const rel = std::vector<uint32_t>(1, 0x83c0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c0);
auto const rel = std::vector<uint32_t>(1, 0x83e8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83e8);
auto const rel = std::vector<uint32_t>(1, 0x8412);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8412);
auto const rel = std::vector<uint32_t>(1, 0x83e7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83e7);
auto const rel = std::vector<uint32_t>(1, 0x83e4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83e4);
auto const rel = std::vector<uint32_t>(1, 0x83fc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83fc);
auto const rel = std::vector<uint32_t>(1, 0x83f6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83f6);
auto const rel = std::vector<uint32_t>(1, 0x8410);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8410);
auto const rel = std::vector<uint32_t>(1, 0x83c6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c6);
auto const rel = std::vector<uint32_t>(1, 0x83c8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c8);
auto const rel = std::vector<uint32_t>(1, 0x83eb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83eb);
auto const rel = std::vector<uint32_t>(1, 0x83e3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83e3);
auto const rel = std::vector<uint32_t>(1, 0x83bf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_005)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83bf);
auto const rel = std::vector<uint32_t>(1, 0x8401);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8401);
auto const rel = std::vector<uint32_t>(1, 0x83dd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83dd);
auto const rel = std::vector<uint32_t>(1, 0x83e5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83e5);
auto const rel = std::vector<uint32_t>(1, 0x83d8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83d8);
auto const rel = std::vector<uint32_t>(1, 0x83ff);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83ff);
auto const rel = std::vector<uint32_t>(1, 0x83e1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83e1);
auto const rel = std::vector<uint32_t>(1, 0x83cb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83cb);
auto const rel = std::vector<uint32_t>(1, 0x83ce);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83ce);
auto const rel = std::vector<uint32_t>(1, 0x83d6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83d6);
auto const rel = std::vector<uint32_t>(1, 0x83f5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83f5);
auto const rel = std::vector<uint32_t>(1, 0x83c9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c9);
auto const rel = std::vector<uint32_t>(1, 0x8409);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8409);
auto const rel = std::vector<uint32_t>(1, 0x840f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x840f);
auto const rel = std::vector<uint32_t>(1, 0x83de);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83de);
auto const rel = std::vector<uint32_t>(1, 0x8411);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8411);
auto const rel = std::vector<uint32_t>(1, 0x8406);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8406);
auto const rel = std::vector<uint32_t>(1, 0x83c2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c2);
auto const rel = std::vector<uint32_t>(1, 0x83f3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83f3);
auto const rel = std::vector<uint32_t>(1, 0x83d5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83d5);
auto const rel = std::vector<uint32_t>(1, 0x83fa);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83fa);
auto const rel = std::vector<uint32_t>(1, 0x83c7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c7);
auto const rel = std::vector<uint32_t>(1, 0x83d1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83d1);
auto const rel = std::vector<uint32_t>(1, 0x83ea);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83ea);
auto const rel = std::vector<uint32_t>(1, 0x8413);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8413);
auto const rel = std::vector<uint32_t>(1, 0x83c3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c3);
auto const rel = std::vector<uint32_t>(1, 0x83ec);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83ec);
auto const rel = std::vector<uint32_t>(1, 0x83ee);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83ee);
auto const rel = std::vector<uint32_t>(1, 0x83c4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83c4);
auto const rel = std::vector<uint32_t>(1, 0x83fb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83fb);
auto const rel = std::vector<uint32_t>(1, 0x83d7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83d7);
auto const rel = std::vector<uint32_t>(1, 0x83e2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83e2);
auto const rel = std::vector<uint32_t>(1, 0x841b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x841b);
auto const rel = std::vector<uint32_t>(1, 0x83db);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83db);
auto const rel = std::vector<uint32_t>(1, 0x83fe);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83fe);
auto const rel = std::vector<uint32_t>(1, 0x86d8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86d8);
auto const rel = std::vector<uint32_t>(1, 0x86e2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86e2);
auto const rel = std::vector<uint32_t>(1, 0x86e6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86e6);
auto const rel = std::vector<uint32_t>(1, 0x86d3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86d3);
auto const rel = std::vector<uint32_t>(1, 0x86e3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86e3);
auto const rel = std::vector<uint32_t>(1, 0x86da);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86da);
auto const rel = std::vector<uint32_t>(1, 0x86ea);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86ea);
auto const rel = std::vector<uint32_t>(1, 0x86dd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86dd);
auto const rel = std::vector<uint32_t>(1, 0x86eb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86eb);
auto const rel = std::vector<uint32_t>(1, 0x86dc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86dc);
auto const rel = std::vector<uint32_t>(1, 0x86ec);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86ec);
auto const rel = std::vector<uint32_t>(1, 0x86e9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86e9);
auto const rel = std::vector<uint32_t>(1, 0x86d7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86d7);
auto const rel = std::vector<uint32_t>(1, 0x86e8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86e8);
auto const rel = std::vector<uint32_t>(1, 0x86d1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86d1);
auto const rel = std::vector<uint32_t>(1, 0x8848);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8848);
auto const rel = std::vector<uint32_t>(1, 0x8856);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_006)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8856);
auto const rel = std::vector<uint32_t>(1, 0x8855);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8855);
auto const rel = std::vector<uint32_t>(1, 0x88ba);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88ba);
auto const rel = std::vector<uint32_t>(1, 0x88d7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88d7);
auto const rel = std::vector<uint32_t>(1, 0x88b9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88b9);
auto const rel = std::vector<uint32_t>(1, 0x88b8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88b8);
auto const rel = std::vector<uint32_t>(1, 0x88c0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88c0);
auto const rel = std::vector<uint32_t>(1, 0x88be);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88be);
auto const rel = std::vector<uint32_t>(1, 0x88b6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88b6);
auto const rel = std::vector<uint32_t>(1, 0x88bc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88bc);
auto const rel = std::vector<uint32_t>(1, 0x88b7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88b7);
auto const rel = std::vector<uint32_t>(1, 0x88bd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88bd);
auto const rel = std::vector<uint32_t>(1, 0x88b2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88b2);
auto const rel = std::vector<uint32_t>(1, 0x8901);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8901);
auto const rel = std::vector<uint32_t>(1, 0x88c9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88c9);
auto const rel = std::vector<uint32_t>(1, 0x8995);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8995);
auto const rel = std::vector<uint32_t>(1, 0x8998);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8998);
auto const rel = std::vector<uint32_t>(1, 0x8997);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8997);
auto const rel = std::vector<uint32_t>(1, 0x89dd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89dd);
auto const rel = std::vector<uint32_t>(1, 0x89da);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89da);
auto const rel = std::vector<uint32_t>(1, 0x89db);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89db);
auto const rel = std::vector<uint32_t>(1, 0x8a4e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a4e);
auto const rel = std::vector<uint32_t>(1, 0x8a4d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a4d);
auto const rel = std::vector<uint32_t>(1, 0x8a39);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a39);
auto const rel = std::vector<uint32_t>(1, 0x8a59);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a59);
auto const rel = std::vector<uint32_t>(1, 0x8a40);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a40);
auto const rel = std::vector<uint32_t>(1, 0x8a57);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a57);
auto const rel = std::vector<uint32_t>(1, 0x8a58);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a58);
auto const rel = std::vector<uint32_t>(1, 0x8a44);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a44);
auto const rel = std::vector<uint32_t>(1, 0x8a45);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a45);
auto const rel = std::vector<uint32_t>(1, 0x8a52);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a52);
auto const rel = std::vector<uint32_t>(1, 0x8a48);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a48);
auto const rel = std::vector<uint32_t>(1, 0x8a51);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a51);
auto const rel = std::vector<uint32_t>(1, 0x8a4a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a4a);
auto const rel = std::vector<uint32_t>(1, 0x8a4c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a4c);
auto const rel = std::vector<uint32_t>(1, 0x8a4f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a4f);
auto const rel = std::vector<uint32_t>(1, 0x8c5f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c5f);
auto const rel = std::vector<uint32_t>(1, 0x8c81);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c81);
auto const rel = std::vector<uint32_t>(1, 0x8c80);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c80);
auto const rel = std::vector<uint32_t>(1, 0x8cba);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8cba);
auto const rel = std::vector<uint32_t>(1, 0x8cbe);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8cbe);
auto const rel = std::vector<uint32_t>(1, 0x8cb0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8cb0);
auto const rel = std::vector<uint32_t>(1, 0x8cb9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8cb9);
auto const rel = std::vector<uint32_t>(1, 0x8cb5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8cb5);
auto const rel = std::vector<uint32_t>(1, 0x8d84);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8d84);
auto const rel = std::vector<uint32_t>(1, 0x8d80);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8d80);
auto const rel = std::vector<uint32_t>(1, 0x8d89);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8d89);
auto const rel = std::vector<uint32_t>(1, 0x8dd8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dd8);
auto const rel = std::vector<uint32_t>(1, 0x8dd3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dd3);
auto const rel = std::vector<uint32_t>(1, 0x8dcd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dcd);
auto const rel = std::vector<uint32_t>(1, 0x8dc7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dc7);
auto const rel = std::vector<uint32_t>(1, 0x8dd6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_007)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dd6);
auto const rel = std::vector<uint32_t>(1, 0x8ddc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ddc);
auto const rel = std::vector<uint32_t>(1, 0x8dcf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dcf);
auto const rel = std::vector<uint32_t>(1, 0x8dd5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dd5);
auto const rel = std::vector<uint32_t>(1, 0x8dd9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dd9);
auto const rel = std::vector<uint32_t>(1, 0x8dc8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dc8);
auto const rel = std::vector<uint32_t>(1, 0x8dd7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dd7);
auto const rel = std::vector<uint32_t>(1, 0x8dc5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8dc5);
auto const rel = std::vector<uint32_t>(1, 0x8eef);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8eef);
auto const rel = std::vector<uint32_t>(1, 0x8ef7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ef7);
auto const rel = std::vector<uint32_t>(1, 0x8efa);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8efa);
auto const rel = std::vector<uint32_t>(1, 0x8ef9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ef9);
auto const rel = std::vector<uint32_t>(1, 0x8ee6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ee6);
auto const rel = std::vector<uint32_t>(1, 0x8eee);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8eee);
auto const rel = std::vector<uint32_t>(1, 0x8ee5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ee5);
auto const rel = std::vector<uint32_t>(1, 0x8ef5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ef5);
auto const rel = std::vector<uint32_t>(1, 0x8ee7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ee7);
auto const rel = std::vector<uint32_t>(1, 0x8ee8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ee8);
auto const rel = std::vector<uint32_t>(1, 0x8ef6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ef6);
auto const rel = std::vector<uint32_t>(1, 0x8eeb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8eeb);
auto const rel = std::vector<uint32_t>(1, 0x8ef1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ef1);
auto const rel = std::vector<uint32_t>(1, 0x8eec);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8eec);
auto const rel = std::vector<uint32_t>(1, 0x8ef4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ef4);
auto const rel = std::vector<uint32_t>(1, 0x8ee9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8ee9);
auto const rel = std::vector<uint32_t>(1, 0x902d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x902d);
auto const rel = std::vector<uint32_t>(1, 0x9034);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9034);
auto const rel = std::vector<uint32_t>(1, 0x902f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x902f);
auto const rel = std::vector<uint32_t>(1, 0x9106);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9106);
auto const rel = std::vector<uint32_t>(1, 0x912c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x912c);
auto const rel = std::vector<uint32_t>(1, 0x9104);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9104);
auto const rel = std::vector<uint32_t>(1, 0x90ff);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x90ff);
auto const rel = std::vector<uint32_t>(1, 0x90fc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x90fc);
auto const rel = std::vector<uint32_t>(1, 0x9108);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9108);
auto const rel = std::vector<uint32_t>(1, 0x90f9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x90f9);
auto const rel = std::vector<uint32_t>(1, 0x90fb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x90fb);
auto const rel = std::vector<uint32_t>(1, 0x9101);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9101);
auto const rel = std::vector<uint32_t>(1, 0x9100);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9100);
auto const rel = std::vector<uint32_t>(1, 0x9107);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9107);
auto const rel = std::vector<uint32_t>(1, 0x9105);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9105);
auto const rel = std::vector<uint32_t>(1, 0x9103);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9103);
auto const rel = std::vector<uint32_t>(1, 0x9161);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9161);
auto const rel = std::vector<uint32_t>(1, 0x9164);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9164);
auto const rel = std::vector<uint32_t>(1, 0x915f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x915f);
auto const rel = std::vector<uint32_t>(1, 0x9162);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9162);
auto const rel = std::vector<uint32_t>(1, 0x9160);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9160);
auto const rel = std::vector<uint32_t>(1, 0x9201);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9201);
auto const rel = std::vector<uint32_t>(1, 0x920a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x920a);
auto const rel = std::vector<uint32_t>(1, 0x9225);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9225);
auto const rel = std::vector<uint32_t>(1, 0x9203);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9203);
auto const rel = std::vector<uint32_t>(1, 0x921a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x921a);
auto const rel = std::vector<uint32_t>(1, 0x9226);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9226);
auto const rel = std::vector<uint32_t>(1, 0x920f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_008)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x920f);
auto const rel = std::vector<uint32_t>(1, 0x920c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x920c);
auto const rel = std::vector<uint32_t>(1, 0x9200);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9200);
auto const rel = std::vector<uint32_t>(1, 0x9212);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9212);
auto const rel = std::vector<uint32_t>(1, 0x91ff);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x91ff);
auto const rel = std::vector<uint32_t>(1, 0x91fd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x91fd);
auto const rel = std::vector<uint32_t>(1, 0x9206);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9206);
auto const rel = std::vector<uint32_t>(1, 0x9204);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9204);
auto const rel = std::vector<uint32_t>(1, 0x9227);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9227);
auto const rel = std::vector<uint32_t>(1, 0x9202);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9202);
auto const rel = std::vector<uint32_t>(1, 0x921c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x921c);
auto const rel = std::vector<uint32_t>(1, 0x9224);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9224);
auto const rel = std::vector<uint32_t>(1, 0x9219);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9219);
auto const rel = std::vector<uint32_t>(1, 0x9217);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9217);
auto const rel = std::vector<uint32_t>(1, 0x9205);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9205);
auto const rel = std::vector<uint32_t>(1, 0x9216);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9216);
auto const rel = std::vector<uint32_t>(1, 0x957b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x957b);
auto const rel = std::vector<uint32_t>(1, 0x958d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x958d);
auto const rel = std::vector<uint32_t>(1, 0x958c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x958c);
auto const rel = std::vector<uint32_t>(1, 0x9590);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9590);
auto const rel = std::vector<uint32_t>(1, 0x9687);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9687);
auto const rel = std::vector<uint32_t>(1, 0x967e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x967e);
auto const rel = std::vector<uint32_t>(1, 0x9688);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9688);
auto const rel = std::vector<uint32_t>(1, 0x9689);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9689);
auto const rel = std::vector<uint32_t>(1, 0x9683);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9683);
auto const rel = std::vector<uint32_t>(1, 0x9680);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9680);
auto const rel = std::vector<uint32_t>(1, 0x96c2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x96c2);
auto const rel = std::vector<uint32_t>(1, 0x96c8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x96c8);
auto const rel = std::vector<uint32_t>(1, 0x96c3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x96c3);
auto const rel = std::vector<uint32_t>(1, 0x96f1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x96f1);
auto const rel = std::vector<uint32_t>(1, 0x96f0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x96f0);
auto const rel = std::vector<uint32_t>(1, 0x976c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x976c);
auto const rel = std::vector<uint32_t>(1, 0x9770);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9770);
auto const rel = std::vector<uint32_t>(1, 0x976e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x976e);
auto const rel = std::vector<uint32_t>(1, 0x9807);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9807);
auto const rel = std::vector<uint32_t>(1, 0x98a9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x98a9);
auto const rel = std::vector<uint32_t>(1, 0x98eb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x98eb);
auto const rel = std::vector<uint32_t>(1, 0x9ce6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9ce6);
auto const rel = std::vector<uint32_t>(1, 0x9ef9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9ef9);
auto const rel = std::vector<uint32_t>(1, 0x4e83);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x4e83);
auto const rel = std::vector<uint32_t>(1, 0x4e84);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x4e84);
auto const rel = std::vector<uint32_t>(1, 0x4eb6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x4eb6);
auto const rel = std::vector<uint32_t>(1, 0x50bd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50bd);
auto const rel = std::vector<uint32_t>(1, 0x50bf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50bf);
auto const rel = std::vector<uint32_t>(1, 0x50c6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50c6);
auto const rel = std::vector<uint32_t>(1, 0x50ae);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50ae);
auto const rel = std::vector<uint32_t>(1, 0x50c4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50c4);
auto const rel = std::vector<uint32_t>(1, 0x50ca);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50ca);
auto const rel = std::vector<uint32_t>(1, 0x50b4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50b4);
auto const rel = std::vector<uint32_t>(1, 0x50c8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50c8);
auto const rel = std::vector<uint32_t>(1, 0x50c2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50c2);
auto const rel = std::vector<uint32_t>(1, 0x50b0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_009)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50b0);
auto const rel = std::vector<uint32_t>(1, 0x50c1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50c1);
auto const rel = std::vector<uint32_t>(1, 0x50ba);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50ba);
auto const rel = std::vector<uint32_t>(1, 0x50b1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50b1);
auto const rel = std::vector<uint32_t>(1, 0x50cb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50cb);
auto const rel = std::vector<uint32_t>(1, 0x50c9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50c9);
auto const rel = std::vector<uint32_t>(1, 0x50b6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50b6);
auto const rel = std::vector<uint32_t>(1, 0x50b8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x50b8);
auto const rel = std::vector<uint32_t>(1, 0x51d7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x51d7);
auto const rel = std::vector<uint32_t>(1, 0x527a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x527a);
auto const rel = std::vector<uint32_t>(1, 0x5278);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5278);
auto const rel = std::vector<uint32_t>(1, 0x527b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x527b);
auto const rel = std::vector<uint32_t>(1, 0x527c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x527c);
auto const rel = std::vector<uint32_t>(1, 0x55c3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55c3);
auto const rel = std::vector<uint32_t>(1, 0x55db);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55db);
auto const rel = std::vector<uint32_t>(1, 0x55cc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55cc);
auto const rel = std::vector<uint32_t>(1, 0x55d0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55d0);
auto const rel = std::vector<uint32_t>(1, 0x55cb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55cb);
auto const rel = std::vector<uint32_t>(1, 0x55ca);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55ca);
auto const rel = std::vector<uint32_t>(1, 0x55dd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55dd);
auto const rel = std::vector<uint32_t>(1, 0x55c0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55c0);
auto const rel = std::vector<uint32_t>(1, 0x55d4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55d4);
auto const rel = std::vector<uint32_t>(1, 0x55c4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55c4);
auto const rel = std::vector<uint32_t>(1, 0x55e9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55e9);
auto const rel = std::vector<uint32_t>(1, 0x55bf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55bf);
auto const rel = std::vector<uint32_t>(1, 0x55d2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55d2);
auto const rel = std::vector<uint32_t>(1, 0x558d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x558d);
auto const rel = std::vector<uint32_t>(1, 0x55cf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55cf);
auto const rel = std::vector<uint32_t>(1, 0x55d5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55d5);
auto const rel = std::vector<uint32_t>(1, 0x55e2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55e2);
auto const rel = std::vector<uint32_t>(1, 0x55d6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55d6);
auto const rel = std::vector<uint32_t>(1, 0x55c8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55c8);
auto const rel = std::vector<uint32_t>(1, 0x55f2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55f2);
auto const rel = std::vector<uint32_t>(1, 0x55cd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55cd);
auto const rel = std::vector<uint32_t>(1, 0x55d9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55d9);
auto const rel = std::vector<uint32_t>(1, 0x55c2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x55c2);
auto const rel = std::vector<uint32_t>(1, 0x5714);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5714);
auto const rel = std::vector<uint32_t>(1, 0x5853);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5853);
auto const rel = std::vector<uint32_t>(1, 0x5868);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5868);
auto const rel = std::vector<uint32_t>(1, 0x5864);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5864);
auto const rel = std::vector<uint32_t>(1, 0x584f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x584f);
auto const rel = std::vector<uint32_t>(1, 0x584d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x584d);
auto const rel = std::vector<uint32_t>(1, 0x5849);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5849);
auto const rel = std::vector<uint32_t>(1, 0x586f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x586f);
auto const rel = std::vector<uint32_t>(1, 0x5855);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5855);
auto const rel = std::vector<uint32_t>(1, 0x584e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x584e);
auto const rel = std::vector<uint32_t>(1, 0x585d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x585d);
auto const rel = std::vector<uint32_t>(1, 0x5859);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5859);
auto const rel = std::vector<uint32_t>(1, 0x5865);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5865);
auto const rel = std::vector<uint32_t>(1, 0x585b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x585b);
auto const rel = std::vector<uint32_t>(1, 0x583d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x583d);
auto const rel = std::vector<uint32_t>(1, 0x5863);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_010)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5863);
auto const rel = std::vector<uint32_t>(1, 0x5871);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5871);
auto const rel = std::vector<uint32_t>(1, 0x58fc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x58fc);
auto const rel = std::vector<uint32_t>(1, 0x5ac7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ac7);
auto const rel = std::vector<uint32_t>(1, 0x5ac4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ac4);
auto const rel = std::vector<uint32_t>(1, 0x5acb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5acb);
auto const rel = std::vector<uint32_t>(1, 0x5aba);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5aba);
auto const rel = std::vector<uint32_t>(1, 0x5ab8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab8);
auto const rel = std::vector<uint32_t>(1, 0x5ab1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab1);
auto const rel = std::vector<uint32_t>(1, 0x5ab5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab5);
auto const rel = std::vector<uint32_t>(1, 0x5ab0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab0);
auto const rel = std::vector<uint32_t>(1, 0x5abf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5abf);
auto const rel = std::vector<uint32_t>(1, 0x5ac8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ac8);
auto const rel = std::vector<uint32_t>(1, 0x5abb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5abb);
auto const rel = std::vector<uint32_t>(1, 0x5ac6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ac6);
auto const rel = std::vector<uint32_t>(1, 0x5ab7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab7);
auto const rel = std::vector<uint32_t>(1, 0x5ac0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ac0);
auto const rel = std::vector<uint32_t>(1, 0x5aca);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5aca);
auto const rel = std::vector<uint32_t>(1, 0x5ab4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab4);
auto const rel = std::vector<uint32_t>(1, 0x5ab6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab6);
auto const rel = std::vector<uint32_t>(1, 0x5acd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5acd);
auto const rel = std::vector<uint32_t>(1, 0x5ab9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ab9);
auto const rel = std::vector<uint32_t>(1, 0x5a90);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5a90);
auto const rel = std::vector<uint32_t>(1, 0x5bd6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5bd6);
auto const rel = std::vector<uint32_t>(1, 0x5bd8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5bd8);
auto const rel = std::vector<uint32_t>(1, 0x5bd9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5bd9);
auto const rel = std::vector<uint32_t>(1, 0x5c1f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5c1f);
auto const rel = std::vector<uint32_t>(1, 0x5c33);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5c33);
auto const rel = std::vector<uint32_t>(1, 0x5d71);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d71);
auto const rel = std::vector<uint32_t>(1, 0x5d63);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d63);
auto const rel = std::vector<uint32_t>(1, 0x5d4a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d4a);
auto const rel = std::vector<uint32_t>(1, 0x5d65);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d65);
auto const rel = std::vector<uint32_t>(1, 0x5d72);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d72);
auto const rel = std::vector<uint32_t>(1, 0x5d6c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d6c);
auto const rel = std::vector<uint32_t>(1, 0x5d5e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d5e);
auto const rel = std::vector<uint32_t>(1, 0x5d68);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d68);
auto const rel = std::vector<uint32_t>(1, 0x5d67);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d67);
auto const rel = std::vector<uint32_t>(1, 0x5d62);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5d62);
auto const rel = std::vector<uint32_t>(1, 0x5df0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5df0);
auto const rel = std::vector<uint32_t>(1, 0x5e4f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5e4f);
auto const rel = std::vector<uint32_t>(1, 0x5e4e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5e4e);
auto const rel = std::vector<uint32_t>(1, 0x5e4a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5e4a);
auto const rel = std::vector<uint32_t>(1, 0x5e4d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5e4d);
auto const rel = std::vector<uint32_t>(1, 0x5e4b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5e4b);
auto const rel = std::vector<uint32_t>(1, 0x5ec5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ec5);
auto const rel = std::vector<uint32_t>(1, 0x5ecc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ecc);
auto const rel = std::vector<uint32_t>(1, 0x5ec6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ec6);
auto const rel = std::vector<uint32_t>(1, 0x5ecb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ecb);
auto const rel = std::vector<uint32_t>(1, 0x5ec7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5ec7);
auto const rel = std::vector<uint32_t>(1, 0x5f40);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5f40);
auto const rel = std::vector<uint32_t>(1, 0x5faf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5faf);
auto const rel = std::vector<uint32_t>(1, 0x5fad);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_011)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x5fad);
auto const rel = std::vector<uint32_t>(1, 0x60f7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x60f7);
auto const rel = std::vector<uint32_t>(1, 0x6149);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6149);
auto const rel = std::vector<uint32_t>(1, 0x614a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x614a);
auto const rel = std::vector<uint32_t>(1, 0x612b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x612b);
auto const rel = std::vector<uint32_t>(1, 0x6145);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6145);
auto const rel = std::vector<uint32_t>(1, 0x6136);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6136);
auto const rel = std::vector<uint32_t>(1, 0x6132);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6132);
auto const rel = std::vector<uint32_t>(1, 0x612e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x612e);
auto const rel = std::vector<uint32_t>(1, 0x6146);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6146);
auto const rel = std::vector<uint32_t>(1, 0x612f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x612f);
auto const rel = std::vector<uint32_t>(1, 0x614f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x614f);
auto const rel = std::vector<uint32_t>(1, 0x6129);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6129);
auto const rel = std::vector<uint32_t>(1, 0x6140);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6140);
auto const rel = std::vector<uint32_t>(1, 0x6220);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6220);
auto const rel = std::vector<uint32_t>(1, 0x9168);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x9168);
auto const rel = std::vector<uint32_t>(1, 0x6223);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6223);
auto const rel = std::vector<uint32_t>(1, 0x6225);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6225);
auto const rel = std::vector<uint32_t>(1, 0x6224);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6224);
auto const rel = std::vector<uint32_t>(1, 0x63c5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x63c5);
auto const rel = std::vector<uint32_t>(1, 0x63f1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x63f1);
auto const rel = std::vector<uint32_t>(1, 0x63eb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x63eb);
auto const rel = std::vector<uint32_t>(1, 0x6410);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6410);
auto const rel = std::vector<uint32_t>(1, 0x6412);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6412);
auto const rel = std::vector<uint32_t>(1, 0x6409);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6409);
auto const rel = std::vector<uint32_t>(1, 0x6420);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6420);
auto const rel = std::vector<uint32_t>(1, 0x6424);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6424);
auto const rel = std::vector<uint32_t>(1, 0x6433);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6433);
auto const rel = std::vector<uint32_t>(1, 0x6443);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6443);
auto const rel = std::vector<uint32_t>(1, 0x641f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x641f);
auto const rel = std::vector<uint32_t>(1, 0x6415);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6415);
auto const rel = std::vector<uint32_t>(1, 0x6418);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6418);
auto const rel = std::vector<uint32_t>(1, 0x6439);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6439);
auto const rel = std::vector<uint32_t>(1, 0x6437);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6437);
auto const rel = std::vector<uint32_t>(1, 0x6422);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6422);
auto const rel = std::vector<uint32_t>(1, 0x6423);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6423);
auto const rel = std::vector<uint32_t>(1, 0x640c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x640c);
auto const rel = std::vector<uint32_t>(1, 0x6426);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6426);
auto const rel = std::vector<uint32_t>(1, 0x6430);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6430);
auto const rel = std::vector<uint32_t>(1, 0x6428);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6428);
auto const rel = std::vector<uint32_t>(1, 0x6441);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6441);
auto const rel = std::vector<uint32_t>(1, 0x6435);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6435);
auto const rel = std::vector<uint32_t>(1, 0x642f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x642f);
auto const rel = std::vector<uint32_t>(1, 0x640a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x640a);
auto const rel = std::vector<uint32_t>(1, 0x641a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x641a);
auto const rel = std::vector<uint32_t>(1, 0x6440);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6440);
auto const rel = std::vector<uint32_t>(1, 0x6425);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6425);
auto const rel = std::vector<uint32_t>(1, 0x6427);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6427);
auto const rel = std::vector<uint32_t>(1, 0x640b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x640b);
auto const rel = std::vector<uint32_t>(1, 0x63e7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x63e7);
auto const rel = std::vector<uint32_t>(1, 0x641b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x641b);
auto const rel = std::vector<uint32_t>(1, 0x642e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_012)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x642e);
auto const rel = std::vector<uint32_t>(1, 0x6421);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6421);
auto const rel = std::vector<uint32_t>(1, 0x640e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x640e);
auto const rel = std::vector<uint32_t>(1, 0x656f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x656f);
auto const rel = std::vector<uint32_t>(1, 0x6592);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6592);
auto const rel = std::vector<uint32_t>(1, 0x65d3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x65d3);
auto const rel = std::vector<uint32_t>(1, 0x6686);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6686);
auto const rel = std::vector<uint32_t>(1, 0x668c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x668c);
auto const rel = std::vector<uint32_t>(1, 0x6695);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6695);
auto const rel = std::vector<uint32_t>(1, 0x6690);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6690);
auto const rel = std::vector<uint32_t>(1, 0x668b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x668b);
auto const rel = std::vector<uint32_t>(1, 0x668a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x668a);
auto const rel = std::vector<uint32_t>(1, 0x6699);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6699);
auto const rel = std::vector<uint32_t>(1, 0x6694);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6694);
auto const rel = std::vector<uint32_t>(1, 0x6678);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6678);
auto const rel = std::vector<uint32_t>(1, 0x6720);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6720);
auto const rel = std::vector<uint32_t>(1, 0x6966);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6966);
auto const rel = std::vector<uint32_t>(1, 0x695f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x695f);
auto const rel = std::vector<uint32_t>(1, 0x6938);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6938);
auto const rel = std::vector<uint32_t>(1, 0x694e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x694e);
auto const rel = std::vector<uint32_t>(1, 0x6962);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6962);
auto const rel = std::vector<uint32_t>(1, 0x6971);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6971);
auto const rel = std::vector<uint32_t>(1, 0x693f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x693f);
auto const rel = std::vector<uint32_t>(1, 0x6945);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6945);
auto const rel = std::vector<uint32_t>(1, 0x696a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x696a);
auto const rel = std::vector<uint32_t>(1, 0x6939);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6939);
auto const rel = std::vector<uint32_t>(1, 0x6942);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6942);
auto const rel = std::vector<uint32_t>(1, 0x6957);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6957);
auto const rel = std::vector<uint32_t>(1, 0x6959);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6959);
auto const rel = std::vector<uint32_t>(1, 0x697a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x697a);
auto const rel = std::vector<uint32_t>(1, 0x6948);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6948);
auto const rel = std::vector<uint32_t>(1, 0x6949);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6949);
auto const rel = std::vector<uint32_t>(1, 0x6935);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6935);
auto const rel = std::vector<uint32_t>(1, 0x696c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x696c);
auto const rel = std::vector<uint32_t>(1, 0x6933);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6933);
auto const rel = std::vector<uint32_t>(1, 0x693d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x693d);
auto const rel = std::vector<uint32_t>(1, 0x6965);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6965);
auto const rel = std::vector<uint32_t>(1, 0x68f0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x68f0);
auto const rel = std::vector<uint32_t>(1, 0x6978);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6978);
auto const rel = std::vector<uint32_t>(1, 0x6934);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6934);
auto const rel = std::vector<uint32_t>(1, 0x6969);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6969);
auto const rel = std::vector<uint32_t>(1, 0x6940);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6940);
auto const rel = std::vector<uint32_t>(1, 0x696f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x696f);
auto const rel = std::vector<uint32_t>(1, 0x6944);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6944);
auto const rel = std::vector<uint32_t>(1, 0x6976);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6976);
auto const rel = std::vector<uint32_t>(1, 0x6958);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6958);
auto const rel = std::vector<uint32_t>(1, 0x6941);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6941);
auto const rel = std::vector<uint32_t>(1, 0x6974);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6974);
auto const rel = std::vector<uint32_t>(1, 0x694c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x694c);
auto const rel = std::vector<uint32_t>(1, 0x693b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x693b);
auto const rel = std::vector<uint32_t>(1, 0x694b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x694b);
auto const rel = std::vector<uint32_t>(1, 0x6937);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_013)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6937);
auto const rel = std::vector<uint32_t>(1, 0x695c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x695c);
auto const rel = std::vector<uint32_t>(1, 0x694f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x694f);
auto const rel = std::vector<uint32_t>(1, 0x6951);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6951);
auto const rel = std::vector<uint32_t>(1, 0x6932);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6932);
auto const rel = std::vector<uint32_t>(1, 0x6952);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6952);
auto const rel = std::vector<uint32_t>(1, 0x692f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x692f);
auto const rel = std::vector<uint32_t>(1, 0x697b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x697b);
auto const rel = std::vector<uint32_t>(1, 0x693c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x693c);
auto const rel = std::vector<uint32_t>(1, 0x6b46);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b46);
auto const rel = std::vector<uint32_t>(1, 0x6b45);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b45);
auto const rel = std::vector<uint32_t>(1, 0x6b43);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b43);
auto const rel = std::vector<uint32_t>(1, 0x6b42);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b42);
auto const rel = std::vector<uint32_t>(1, 0x6b48);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b48);
auto const rel = std::vector<uint32_t>(1, 0x6b41);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b41);
auto const rel = std::vector<uint32_t>(1, 0x6b9b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6b9b);
auto const rel = std::vector<uint32_t>(1, 0x6bfb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bfb);
auto const rel = std::vector<uint32_t>(1, 0x6bfc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bfc);
auto const rel = std::vector<uint32_t>(1, 0x6bf9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bf9);
auto const rel = std::vector<uint32_t>(1, 0x6bf7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bf7);
auto const rel = std::vector<uint32_t>(1, 0x6bf8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6bf8);
auto const rel = std::vector<uint32_t>(1, 0x6e9b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e9b);
auto const rel = std::vector<uint32_t>(1, 0x6ed6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ed6);
auto const rel = std::vector<uint32_t>(1, 0x6ec8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ec8);
auto const rel = std::vector<uint32_t>(1, 0x6e8f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e8f);
auto const rel = std::vector<uint32_t>(1, 0x6ec0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ec0);
auto const rel = std::vector<uint32_t>(1, 0x6e9f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e9f);
auto const rel = std::vector<uint32_t>(1, 0x6e93);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e93);
auto const rel = std::vector<uint32_t>(1, 0x6e94);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e94);
auto const rel = std::vector<uint32_t>(1, 0x6ea0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ea0);
auto const rel = std::vector<uint32_t>(1, 0x6eb1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eb1);
auto const rel = std::vector<uint32_t>(1, 0x6eb9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eb9);
auto const rel = std::vector<uint32_t>(1, 0x6ec6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ec6);
auto const rel = std::vector<uint32_t>(1, 0x6ed2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ed2);
auto const rel = std::vector<uint32_t>(1, 0x6ebd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ebd);
auto const rel = std::vector<uint32_t>(1, 0x6ec1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ec1);
auto const rel = std::vector<uint32_t>(1, 0x6e9e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e9e);
auto const rel = std::vector<uint32_t>(1, 0x6ec9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ec9);
auto const rel = std::vector<uint32_t>(1, 0x6eb7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eb7);
auto const rel = std::vector<uint32_t>(1, 0x6eb0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eb0);
auto const rel = std::vector<uint32_t>(1, 0x6ecd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ecd);
auto const rel = std::vector<uint32_t>(1, 0x6ea6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ea6);
auto const rel = std::vector<uint32_t>(1, 0x6ecf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ecf);
auto const rel = std::vector<uint32_t>(1, 0x6eb2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eb2);
auto const rel = std::vector<uint32_t>(1, 0x6ebe);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ebe);
auto const rel = std::vector<uint32_t>(1, 0x6ec3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ec3);
auto const rel = std::vector<uint32_t>(1, 0x6edc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6edc);
auto const rel = std::vector<uint32_t>(1, 0x6ed8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ed8);
auto const rel = std::vector<uint32_t>(1, 0x6e99);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e99);
auto const rel = std::vector<uint32_t>(1, 0x6e92);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e92);
auto const rel = std::vector<uint32_t>(1, 0x6e8e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e8e);
auto const rel = std::vector<uint32_t>(1, 0x6e8d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_014)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e8d);
auto const rel = std::vector<uint32_t>(1, 0x6ea4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ea4);
auto const rel = std::vector<uint32_t>(1, 0x6ea1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ea1);
auto const rel = std::vector<uint32_t>(1, 0x6ebf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ebf);
auto const rel = std::vector<uint32_t>(1, 0x6eb3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eb3);
auto const rel = std::vector<uint32_t>(1, 0x6ed0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ed0);
auto const rel = std::vector<uint32_t>(1, 0x6eca);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eca);
auto const rel = std::vector<uint32_t>(1, 0x6e97);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6e97);
auto const rel = std::vector<uint32_t>(1, 0x6eae);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6eae);
auto const rel = std::vector<uint32_t>(1, 0x6ea3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6ea3);
auto const rel = std::vector<uint32_t>(1, 0x7147);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7147);
auto const rel = std::vector<uint32_t>(1, 0x7154);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7154);
auto const rel = std::vector<uint32_t>(1, 0x7152);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7152);
auto const rel = std::vector<uint32_t>(1, 0x7163);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7163);
auto const rel = std::vector<uint32_t>(1, 0x7160);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7160);
auto const rel = std::vector<uint32_t>(1, 0x7141);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7141);
auto const rel = std::vector<uint32_t>(1, 0x715d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x715d);
auto const rel = std::vector<uint32_t>(1, 0x7162);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7162);
auto const rel = std::vector<uint32_t>(1, 0x7172);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7172);
auto const rel = std::vector<uint32_t>(1, 0x7178);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7178);
auto const rel = std::vector<uint32_t>(1, 0x716a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x716a);
auto const rel = std::vector<uint32_t>(1, 0x7161);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7161);
auto const rel = std::vector<uint32_t>(1, 0x7142);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7142);
auto const rel = std::vector<uint32_t>(1, 0x7158);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7158);
auto const rel = std::vector<uint32_t>(1, 0x7143);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7143);
auto const rel = std::vector<uint32_t>(1, 0x714b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x714b);
auto const rel = std::vector<uint32_t>(1, 0x7170);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7170);
auto const rel = std::vector<uint32_t>(1, 0x715f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x715f);
auto const rel = std::vector<uint32_t>(1, 0x7150);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7150);
auto const rel = std::vector<uint32_t>(1, 0x7153);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7153);
auto const rel = std::vector<uint32_t>(1, 0x7144);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7144);
auto const rel = std::vector<uint32_t>(1, 0x714d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x714d);
auto const rel = std::vector<uint32_t>(1, 0x715a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x715a);
auto const rel = std::vector<uint32_t>(1, 0x724f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x724f);
auto const rel = std::vector<uint32_t>(1, 0x728d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x728d);
auto const rel = std::vector<uint32_t>(1, 0x728c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x728c);
auto const rel = std::vector<uint32_t>(1, 0x7291);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7291);
auto const rel = std::vector<uint32_t>(1, 0x7290);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7290);
auto const rel = std::vector<uint32_t>(1, 0x728e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x728e);
auto const rel = std::vector<uint32_t>(1, 0x733c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x733c);
auto const rel = std::vector<uint32_t>(1, 0x7342);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7342);
auto const rel = std::vector<uint32_t>(1, 0x733b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x733b);
auto const rel = std::vector<uint32_t>(1, 0x733a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x733a);
auto const rel = std::vector<uint32_t>(1, 0x7340);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7340);
auto const rel = std::vector<uint32_t>(1, 0x734a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x734a);
auto const rel = std::vector<uint32_t>(1, 0x7349);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7349);
auto const rel = std::vector<uint32_t>(1, 0x7444);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7444);
auto const rel = std::vector<uint32_t>(1, 0x744a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x744a);
auto const rel = std::vector<uint32_t>(1, 0x744b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x744b);
auto const rel = std::vector<uint32_t>(1, 0x7452);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7452);
auto const rel = std::vector<uint32_t>(1, 0x7451);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7451);
auto const rel = std::vector<uint32_t>(1, 0x7457);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_015)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7457);
auto const rel = std::vector<uint32_t>(1, 0x7440);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7440);
auto const rel = std::vector<uint32_t>(1, 0x744f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x744f);
auto const rel = std::vector<uint32_t>(1, 0x7450);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7450);
auto const rel = std::vector<uint32_t>(1, 0x744e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x744e);
auto const rel = std::vector<uint32_t>(1, 0x7442);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7442);
auto const rel = std::vector<uint32_t>(1, 0x7446);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7446);
auto const rel = std::vector<uint32_t>(1, 0x744d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x744d);
auto const rel = std::vector<uint32_t>(1, 0x7454);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7454);
auto const rel = std::vector<uint32_t>(1, 0x74e1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x74e1);
auto const rel = std::vector<uint32_t>(1, 0x74ff);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x74ff);
auto const rel = std::vector<uint32_t>(1, 0x74fe);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x74fe);
auto const rel = std::vector<uint32_t>(1, 0x74fd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x74fd);
auto const rel = std::vector<uint32_t>(1, 0x751d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x751d);
auto const rel = std::vector<uint32_t>(1, 0x7579);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7579);
auto const rel = std::vector<uint32_t>(1, 0x7577);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7577);
auto const rel = std::vector<uint32_t>(1, 0x6983);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6983);
auto const rel = std::vector<uint32_t>(1, 0x75ef);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75ef);
auto const rel = std::vector<uint32_t>(1, 0x760f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x760f);
auto const rel = std::vector<uint32_t>(1, 0x7603);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7603);
auto const rel = std::vector<uint32_t>(1, 0x75f7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75f7);
auto const rel = std::vector<uint32_t>(1, 0x75fe);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75fe);
auto const rel = std::vector<uint32_t>(1, 0x75fc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75fc);
auto const rel = std::vector<uint32_t>(1, 0x75f9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75f9);
auto const rel = std::vector<uint32_t>(1, 0x75f8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75f8);
auto const rel = std::vector<uint32_t>(1, 0x7610);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7610);
auto const rel = std::vector<uint32_t>(1, 0x75fb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75fb);
auto const rel = std::vector<uint32_t>(1, 0x75f6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75f6);
auto const rel = std::vector<uint32_t>(1, 0x75ed);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75ed);
auto const rel = std::vector<uint32_t>(1, 0x75f5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75f5);
auto const rel = std::vector<uint32_t>(1, 0x75fd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x75fd);
auto const rel = std::vector<uint32_t>(1, 0x7699);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7699);
auto const rel = std::vector<uint32_t>(1, 0x76b5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x76b5);
auto const rel = std::vector<uint32_t>(1, 0x76dd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x76dd);
auto const rel = std::vector<uint32_t>(1, 0x7755);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7755);
auto const rel = std::vector<uint32_t>(1, 0x775f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x775f);
auto const rel = std::vector<uint32_t>(1, 0x7760);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7760);
auto const rel = std::vector<uint32_t>(1, 0x7752);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7752);
auto const rel = std::vector<uint32_t>(1, 0x7756);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7756);
auto const rel = std::vector<uint32_t>(1, 0x775a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x775a);
auto const rel = std::vector<uint32_t>(1, 0x7769);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7769);
auto const rel = std::vector<uint32_t>(1, 0x7767);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7767);
auto const rel = std::vector<uint32_t>(1, 0x7754);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7754);
auto const rel = std::vector<uint32_t>(1, 0x7759);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7759);
auto const rel = std::vector<uint32_t>(1, 0x776d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x776d);
auto const rel = std::vector<uint32_t>(1, 0x77e0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x77e0);
auto const rel = std::vector<uint32_t>(1, 0x7887);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7887);
auto const rel = std::vector<uint32_t>(1, 0x789a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x789a);
auto const rel = std::vector<uint32_t>(1, 0x7894);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7894);
auto const rel = std::vector<uint32_t>(1, 0x788f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x788f);
auto const rel = std::vector<uint32_t>(1, 0x7884);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7884);
auto const rel = std::vector<uint32_t>(1, 0x7895);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_016)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7895);
auto const rel = std::vector<uint32_t>(1, 0x7885);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7885);
auto const rel = std::vector<uint32_t>(1, 0x7886);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7886);
auto const rel = std::vector<uint32_t>(1, 0x78a1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x78a1);
auto const rel = std::vector<uint32_t>(1, 0x7883);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7883);
auto const rel = std::vector<uint32_t>(1, 0x7879);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7879);
auto const rel = std::vector<uint32_t>(1, 0x7899);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7899);
auto const rel = std::vector<uint32_t>(1, 0x7880);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7880);
auto const rel = std::vector<uint32_t>(1, 0x7896);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7896);
auto const rel = std::vector<uint32_t>(1, 0x787b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x787b);
auto const rel = std::vector<uint32_t>(1, 0x797c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x797c);
auto const rel = std::vector<uint32_t>(1, 0x7982);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7982);
auto const rel = std::vector<uint32_t>(1, 0x797d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x797d);
auto const rel = std::vector<uint32_t>(1, 0x7979);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7979);
auto const rel = std::vector<uint32_t>(1, 0x7a11);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a11);
auto const rel = std::vector<uint32_t>(1, 0x7a18);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a18);
auto const rel = std::vector<uint32_t>(1, 0x7a19);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a19);
auto const rel = std::vector<uint32_t>(1, 0x7a12);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a12);
auto const rel = std::vector<uint32_t>(1, 0x7a17);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a17);
auto const rel = std::vector<uint32_t>(1, 0x7a15);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a15);
auto const rel = std::vector<uint32_t>(1, 0x7a22);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a22);
auto const rel = std::vector<uint32_t>(1, 0x7a13);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a13);
auto const rel = std::vector<uint32_t>(1, 0x7a1b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a1b);
auto const rel = std::vector<uint32_t>(1, 0x7a10);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a10);
auto const rel = std::vector<uint32_t>(1, 0x7aa3);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7aa3);
auto const rel = std::vector<uint32_t>(1, 0x7aa2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7aa2);
auto const rel = std::vector<uint32_t>(1, 0x7a9e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7a9e);
auto const rel = std::vector<uint32_t>(1, 0x7aeb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7aeb);
auto const rel = std::vector<uint32_t>(1, 0x7b66);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b66);
auto const rel = std::vector<uint32_t>(1, 0x7b64);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b64);
auto const rel = std::vector<uint32_t>(1, 0x7b6d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b6d);
auto const rel = std::vector<uint32_t>(1, 0x7b74);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b74);
auto const rel = std::vector<uint32_t>(1, 0x7b69);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b69);
auto const rel = std::vector<uint32_t>(1, 0x7b72);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b72);
auto const rel = std::vector<uint32_t>(1, 0x7b65);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b65);
auto const rel = std::vector<uint32_t>(1, 0x7b73);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b73);
auto const rel = std::vector<uint32_t>(1, 0x7b71);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b71);
auto const rel = std::vector<uint32_t>(1, 0x7b70);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b70);
auto const rel = std::vector<uint32_t>(1, 0x7b61);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b61);
auto const rel = std::vector<uint32_t>(1, 0x7b78);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b78);
auto const rel = std::vector<uint32_t>(1, 0x7b76);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b76);
auto const rel = std::vector<uint32_t>(1, 0x7b63);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7b63);
auto const rel = std::vector<uint32_t>(1, 0x7cb2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7cb2);
auto const rel = std::vector<uint32_t>(1, 0x7cb4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7cb4);
auto const rel = std::vector<uint32_t>(1, 0x7caf);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7caf);
auto const rel = std::vector<uint32_t>(1, 0x7d88);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d88);
auto const rel = std::vector<uint32_t>(1, 0x7d86);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d86);
auto const rel = std::vector<uint32_t>(1, 0x7d80);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d80);
auto const rel = std::vector<uint32_t>(1, 0x7d8d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d8d);
auto const rel = std::vector<uint32_t>(1, 0x7d7f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d7f);
auto const rel = std::vector<uint32_t>(1, 0x7d85);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d85);
auto const rel = std::vector<uint32_t>(1, 0x7d7a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_017)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d7a);
auto const rel = std::vector<uint32_t>(1, 0x7d8e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d8e);
auto const rel = std::vector<uint32_t>(1, 0x7d7b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d7b);
auto const rel = std::vector<uint32_t>(1, 0x7d83);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d83);
auto const rel = std::vector<uint32_t>(1, 0x7d7c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d7c);
auto const rel = std::vector<uint32_t>(1, 0x7d8c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d8c);
auto const rel = std::vector<uint32_t>(1, 0x7d94);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d94);
auto const rel = std::vector<uint32_t>(1, 0x7d84);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d84);
auto const rel = std::vector<uint32_t>(1, 0x7d7d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d7d);
auto const rel = std::vector<uint32_t>(1, 0x7d92);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7d92);
auto const rel = std::vector<uint32_t>(1, 0x7f6d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f6d);
auto const rel = std::vector<uint32_t>(1, 0x7f6b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f6b);
auto const rel = std::vector<uint32_t>(1, 0x7f67);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f67);
auto const rel = std::vector<uint32_t>(1, 0x7f68);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f68);
auto const rel = std::vector<uint32_t>(1, 0x7f6c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7f6c);
auto const rel = std::vector<uint32_t>(1, 0x7fa6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fa6);
auto const rel = std::vector<uint32_t>(1, 0x7fa5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fa5);
auto const rel = std::vector<uint32_t>(1, 0x7fa7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fa7);
auto const rel = std::vector<uint32_t>(1, 0x7fdb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fdb);
auto const rel = std::vector<uint32_t>(1, 0x7fdc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x7fdc);
auto const rel = std::vector<uint32_t>(1, 0x8021);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8021);
auto const rel = std::vector<uint32_t>(1, 0x8164);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8164);
auto const rel = std::vector<uint32_t>(1, 0x8160);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8160);
auto const rel = std::vector<uint32_t>(1, 0x8177);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8177);
auto const rel = std::vector<uint32_t>(1, 0x815c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x815c);
auto const rel = std::vector<uint32_t>(1, 0x8169);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8169);
auto const rel = std::vector<uint32_t>(1, 0x815b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x815b);
auto const rel = std::vector<uint32_t>(1, 0x8162);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8162);
auto const rel = std::vector<uint32_t>(1, 0x8172);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8172);
auto const rel = std::vector<uint32_t>(1, 0x6721);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x6721);
auto const rel = std::vector<uint32_t>(1, 0x815e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x815e);
auto const rel = std::vector<uint32_t>(1, 0x8176);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8176);
auto const rel = std::vector<uint32_t>(1, 0x8167);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8167);
auto const rel = std::vector<uint32_t>(1, 0x816f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x816f);
auto const rel = std::vector<uint32_t>(1, 0x8144);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8144);
auto const rel = std::vector<uint32_t>(1, 0x8161);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8161);
auto const rel = std::vector<uint32_t>(1, 0x821d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x821d);
auto const rel = std::vector<uint32_t>(1, 0x8249);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8249);
auto const rel = std::vector<uint32_t>(1, 0x8244);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8244);
auto const rel = std::vector<uint32_t>(1, 0x8240);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8240);
auto const rel = std::vector<uint32_t>(1, 0x8242);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8242);
auto const rel = std::vector<uint32_t>(1, 0x8245);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8245);
auto const rel = std::vector<uint32_t>(1, 0x84f1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x84f1);
auto const rel = std::vector<uint32_t>(1, 0x843f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x843f);
auto const rel = std::vector<uint32_t>(1, 0x8456);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8456);
auto const rel = std::vector<uint32_t>(1, 0x8476);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8476);
auto const rel = std::vector<uint32_t>(1, 0x8479);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8479);
auto const rel = std::vector<uint32_t>(1, 0x848f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x848f);
auto const rel = std::vector<uint32_t>(1, 0x848d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x848d);
auto const rel = std::vector<uint32_t>(1, 0x8465);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8465);
auto const rel = std::vector<uint32_t>(1, 0x8451);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8451);
auto const rel = std::vector<uint32_t>(1, 0x8440);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_018)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8440);
auto const rel = std::vector<uint32_t>(1, 0x8486);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8486);
auto const rel = std::vector<uint32_t>(1, 0x8467);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8467);
auto const rel = std::vector<uint32_t>(1, 0x8430);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8430);
auto const rel = std::vector<uint32_t>(1, 0x844d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x844d);
auto const rel = std::vector<uint32_t>(1, 0x847d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x847d);
auto const rel = std::vector<uint32_t>(1, 0x845a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x845a);
auto const rel = std::vector<uint32_t>(1, 0x8459);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8459);
auto const rel = std::vector<uint32_t>(1, 0x8474);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8474);
auto const rel = std::vector<uint32_t>(1, 0x8473);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8473);
auto const rel = std::vector<uint32_t>(1, 0x845d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x845d);
auto const rel = std::vector<uint32_t>(1, 0x8507);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8507);
auto const rel = std::vector<uint32_t>(1, 0x845e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x845e);
auto const rel = std::vector<uint32_t>(1, 0x8437);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8437);
auto const rel = std::vector<uint32_t>(1, 0x843a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x843a);
auto const rel = std::vector<uint32_t>(1, 0x8434);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8434);
auto const rel = std::vector<uint32_t>(1, 0x847a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x847a);
auto const rel = std::vector<uint32_t>(1, 0x8443);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8443);
auto const rel = std::vector<uint32_t>(1, 0x8478);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8478);
auto const rel = std::vector<uint32_t>(1, 0x8432);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8432);
auto const rel = std::vector<uint32_t>(1, 0x8445);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8445);
auto const rel = std::vector<uint32_t>(1, 0x8429);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8429);
auto const rel = std::vector<uint32_t>(1, 0x83d9);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x83d9);
auto const rel = std::vector<uint32_t>(1, 0x844b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x844b);
auto const rel = std::vector<uint32_t>(1, 0x842f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x842f);
auto const rel = std::vector<uint32_t>(1, 0x8442);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8442);
auto const rel = std::vector<uint32_t>(1, 0x842d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x842d);
auto const rel = std::vector<uint32_t>(1, 0x845f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x845f);
auto const rel = std::vector<uint32_t>(1, 0x8470);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8470);
auto const rel = std::vector<uint32_t>(1, 0x8439);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8439);
auto const rel = std::vector<uint32_t>(1, 0x844e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x844e);
auto const rel = std::vector<uint32_t>(1, 0x844c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x844c);
auto const rel = std::vector<uint32_t>(1, 0x8452);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8452);
auto const rel = std::vector<uint32_t>(1, 0x846f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x846f);
auto const rel = std::vector<uint32_t>(1, 0x84c5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x84c5);
auto const rel = std::vector<uint32_t>(1, 0x848e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x848e);
auto const rel = std::vector<uint32_t>(1, 0x843b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x843b);
auto const rel = std::vector<uint32_t>(1, 0x8447);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8447);
auto const rel = std::vector<uint32_t>(1, 0x8436);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8436);
auto const rel = std::vector<uint32_t>(1, 0x8433);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8433);
auto const rel = std::vector<uint32_t>(1, 0x8468);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8468);
auto const rel = std::vector<uint32_t>(1, 0x847e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x847e);
auto const rel = std::vector<uint32_t>(1, 0x8444);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8444);
auto const rel = std::vector<uint32_t>(1, 0x842b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x842b);
auto const rel = std::vector<uint32_t>(1, 0x8460);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8460);
auto const rel = std::vector<uint32_t>(1, 0x8454);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8454);
auto const rel = std::vector<uint32_t>(1, 0x846e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x846e);
auto const rel = std::vector<uint32_t>(1, 0x8450);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8450);
auto const rel = std::vector<uint32_t>(1, 0x870b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x870b);
auto const rel = std::vector<uint32_t>(1, 0x8704);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8704);
auto const rel = std::vector<uint32_t>(1, 0x86f7);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86f7);
auto const rel = std::vector<uint32_t>(1, 0x870c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
TEST(tailoring, zh_big5han_008_019)
{
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x870c);
auto const rel = std::vector<uint32_t>(1, 0x86fa);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86fa);
auto const rel = std::vector<uint32_t>(1, 0x86d6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86d6);
auto const rel = std::vector<uint32_t>(1, 0x86f5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86f5);
auto const rel = std::vector<uint32_t>(1, 0x874d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x874d);
auto const rel = std::vector<uint32_t>(1, 0x86f8);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86f8);
auto const rel = std::vector<uint32_t>(1, 0x870e);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x870e);
auto const rel = std::vector<uint32_t>(1, 0x8709);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8709);
auto const rel = std::vector<uint32_t>(1, 0x8701);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8701);
auto const rel = std::vector<uint32_t>(1, 0x86f6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x86f6);
auto const rel = std::vector<uint32_t>(1, 0x870d);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x870d);
auto const rel = std::vector<uint32_t>(1, 0x8705);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8705);
auto const rel = std::vector<uint32_t>(1, 0x88d6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88d6);
auto const rel = std::vector<uint32_t>(1, 0x88cb);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88cb);
auto const rel = std::vector<uint32_t>(1, 0x88cd);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88cd);
auto const rel = std::vector<uint32_t>(1, 0x88ce);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88ce);
auto const rel = std::vector<uint32_t>(1, 0x88de);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88de);
auto const rel = std::vector<uint32_t>(1, 0x88db);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88db);
auto const rel = std::vector<uint32_t>(1, 0x88da);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88da);
auto const rel = std::vector<uint32_t>(1, 0x88cc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88cc);
auto const rel = std::vector<uint32_t>(1, 0x88d0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x88d0);
auto const rel = std::vector<uint32_t>(1, 0x8985);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8985);
auto const rel = std::vector<uint32_t>(1, 0x899b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x899b);
auto const rel = std::vector<uint32_t>(1, 0x89df);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89df);
auto const rel = std::vector<uint32_t>(1, 0x89e5);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89e5);
auto const rel = std::vector<uint32_t>(1, 0x89e4);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89e4);
auto const rel = std::vector<uint32_t>(1, 0x89e1);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89e1);
auto const rel = std::vector<uint32_t>(1, 0x89e0);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89e0);
auto const rel = std::vector<uint32_t>(1, 0x89e2);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89e2);
auto const rel = std::vector<uint32_t>(1, 0x89dc);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89dc);
auto const rel = std::vector<uint32_t>(1, 0x89e6);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x89e6);
auto const rel = std::vector<uint32_t>(1, 0x8a76);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a76);
auto const rel = std::vector<uint32_t>(1, 0x8a86);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a86);
auto const rel = std::vector<uint32_t>(1, 0x8a7f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a7f);
auto const rel = std::vector<uint32_t>(1, 0x8a61);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a61);
auto const rel = std::vector<uint32_t>(1, 0x8a3f);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a3f);
auto const rel = std::vector<uint32_t>(1, 0x8a77);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a77);
auto const rel = std::vector<uint32_t>(1, 0x8a82);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a82);
auto const rel = std::vector<uint32_t>(1, 0x8a84);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a84);
auto const rel = std::vector<uint32_t>(1, 0x8a75);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a75);
auto const rel = std::vector<uint32_t>(1, 0x8a83);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a83);
auto const rel = std::vector<uint32_t>(1, 0x8a81);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a81);
auto const rel = std::vector<uint32_t>(1, 0x8a74);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a74);
auto const rel = std::vector<uint32_t>(1, 0x8a7a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8a7a);
auto const rel = std::vector<uint32_t>(1, 0x8c3c);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c3c);
auto const rel = std::vector<uint32_t>(1, 0x8c4b);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c4b);
auto const rel = std::vector<uint32_t>(1, 0x8c4a);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c4a);
auto const rel = std::vector<uint32_t>(1, 0x8c65);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c65);
auto const rel = std::vector<uint32_t>(1, 0x8c64);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c64);
auto const rel = std::vector<uint32_t>(1, 0x8c66);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c66);
auto const rel = std::vector<uint32_t>(1, 0x8c86);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
{
// greater than (or equal to, for =) preceeding cps
auto const res = std::vector<uint32_t>(1, 0x8c86);
auto const rel = std::vector<uint32_t>(1, 0x8c84);
EXPECT_EQ(collate(
res.begin(), res.end(),
rel.begin(), rel.end(),
table(), collation_strength::primary),
-1);
}
}
| 32.312476 | 76 | 0.564093 | [
"vector"
] |
13e3ac760fadb1b866a82f7a63a0d98cd60cbd01 | 1,467 | cpp | C++ | solved-uva/11064.cpp | Maruf-Tuhin/Online_Judge | cf9b2a522e8b1a9623d3996a632caad7fd67f751 | [
"MIT"
] | 1 | 2019-03-31T05:47:30.000Z | 2019-03-31T05:47:30.000Z | solved-uva/11064.cpp | the-redback/competitive-programming | cf9b2a522e8b1a9623d3996a632caad7fd67f751 | [
"MIT"
] | null | null | null | solved-uva/11064.cpp | the-redback/competitive-programming | cf9b2a522e8b1a9623d3996a632caad7fd67f751 | [
"MIT"
] | null | null | null | /**
* @author : Maruf Tuhin
* @School : CUET CSE 11
* @Topcoder : the_redback
* @Codeforces : the_redback
* @UVA : Redback
* @link : http://www.fb.com/maruf.2hin
*/
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>
using namespace std;
#define inf HUGE_VAL
#define mem(a,b) memset(a,b,sizeof(a))
#define MAX 46340
int sum;
int pr[50000];
vector<int>v;
void sieve(int n)
{
int i,j,k;
for(i=4;i<n;i+=2)
pr[i]=1;
for(i=3;i<n;i+=2)
if(!pr[i])
for(j=i*i;j<n;j+=2*i)
pr[j]=1;
for(i=2;i<n;i++)
if(!pr[i])
v.push_back(i);
}
int phi(int n)
{
int res=n,ret=0,i,j;
sum=1;
int sz=v.size();
for(j=0;j<sz && v[j]*v[j]<=n;j++)
{
i=v[j];
if(!(n%i))
res-=res/i;
ret=0;
while(!(n%i))
{
n/=i;
ret++;
}
sum*=ret+1;
if(n==1)
break;
}
if(n>1)
res-=res/n,sum*=2;
sum-=1;
return res;
}
main()
{
sieve(MAX);
int tc,t=1;
int i,j,k,l,x;
//scanf("%d",&tc);
while(~scanf("%d",&k))
{
l=k;
l-=phi(k);
l-=sum;
printf("%d\n",l);
}
return 0;
}
| 16.670455 | 48 | 0.466939 | [
"vector"
] |
13e7fabde643e33d3a35edc839bc88c3ea71910f | 3,215 | hpp | C++ | libraries/chain/include/sophiatx/chain/economics.hpp | SophiaTX/SophiaTx-Blockchain | c964691c020962ad1aba8263c0d8a78a9fa27e45 | [
"MIT"
] | 8 | 2018-07-25T20:42:43.000Z | 2019-03-11T03:14:09.000Z | libraries/chain/include/sophiatx/chain/economics.hpp | SophiaTX/SophiaTx-Blockchain | c964691c020962ad1aba8263c0d8a78a9fa27e45 | [
"MIT"
] | 13 | 2018-07-25T17:41:28.000Z | 2019-01-25T13:38:11.000Z | libraries/chain/include/sophiatx/chain/economics.hpp | SophiaTX/SophiaTx-Blockchain | c964691c020962ad1aba8263c0d8a78a9fa27e45 | [
"MIT"
] | 11 | 2018-07-25T14:34:13.000Z | 2019-05-03T13:29:37.000Z | #pragma once
#include <sophiatx/protocol/config.hpp>
#include <sophiatx/protocol/types.hpp>
#include <sophiatx/chain/sophiatx_object_types.hpp>
#include <sophiatx/chain/database/database_interface.hpp>
#include <boost/interprocess/managed_mapped_file.hpp>
namespace sophiatx { namespace chain {
namespace bip = boost::interprocess;
using namespace sophiatx::protocol;
//technically, anything in economic_model_object pools do not exists yet; any transfers (by withdraw and add methods) must affect current_supply
class economic_model_object: public object< economic_model_object_type, economic_model_object> {
public:
template< typename Constructor, typename Allocator >
economic_model_object( Constructor&& c, allocator< Allocator > a ) : historic_supply( historic_supply_allocator_type( a.get_segment_manager() ) )
{
c( *this );
}
economic_model_object() =delete;
id_type id;
share_type mining_pool_from_coinbase;
share_type mining_pool_from_fees;
share_type interest_pool_from_coinbase;
share_type interest_pool_from_fees;
share_type promotion_pool;
share_type burn_pool=0;
share_type initial_promotion_pool;
share_type init_supply;
share_type total_supply;
share_type coinbase_block_reward;
typedef bip::allocator< economic_model_object, bip::managed_mapped_file::segment_manager > allocator_type;
typedef bip::allocator< std::pair< uint32_t, share_type >, bip::managed_mapped_file::segment_manager > historic_supply_allocator_type;
typedef bip::flat_map< uint32_t, share_type, std::less< uint32_t >, historic_supply_allocator_type > historic_supply_map;
historic_supply_map historic_supply;
share_type accumulated_supply; //< sum of coin supplies over last $SOPHIATX_INTEREST_BLOCKS blocks
void init_economics(share_type init_supply, share_type total_supply);
void record_block(uint32_t block, share_type current_supply);
share_type get_mining_reward(uint32_t block_number) const;
share_type withdraw_mining_reward(uint32_t block_number, uint32_t nominator, uint32_t denominator);
share_type withdraw_interests(share_type holding, uint32_t period);
share_type get_available_promotion_pool(uint32_t block_number) const;
share_type withdraw_from_promotion_pool(share_type amount, uint32_t block_number);
void add_fee(share_type fee);
};
typedef multi_index_container<
economic_model_object,
indexed_by<
ordered_unique< tag< by_id >,
member< economic_model_object, economic_model_object::id_type, &economic_model_object::id > >
>,
allocator< economic_model_object >
> economic_model_index;
}}//namespace
FC_REFLECT(sophiatx::chain::economic_model_object, (id)
(mining_pool_from_coinbase)
(mining_pool_from_fees)
(interest_pool_from_coinbase)
(interest_pool_from_fees)
(promotion_pool)
(initial_promotion_pool)
(init_supply)
(total_supply)
(historic_supply)
(accumulated_supply)
(coinbase_block_reward)
)
CHAINBASE_SET_INDEX_TYPE( sophiatx::chain::economic_model_object, sophiatx::chain::economic_model_index )
| 36.123596 | 148 | 0.764541 | [
"object"
] |
13ec484ab4c3e8018d491c4495a56cac35caa304 | 5,095 | hpp | C++ | src/libraries/core/blockCoupled/finiteVolume/blockGradSchemes/limitedBlockGradSchemes/cellLimitedBlockGrad/cellLimitedBlockGrad.hpp | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | src/libraries/core/blockCoupled/finiteVolume/blockGradSchemes/limitedBlockGradSchemes/cellLimitedBlockGrad/cellLimitedBlockGrad.hpp | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | src/libraries/core/blockCoupled/finiteVolume/blockGradSchemes/limitedBlockGradSchemes/cellLimitedBlockGrad/cellLimitedBlockGrad.hpp | MrAwesomeRocks/caelus-cml | 55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7 | [
"mpich2"
] | null | null | null | /*---------------------------------------------------------------------------*\
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2014-2016 H. Jasak
Copyright (C) 2014 V. Vukcevic
Copyright (C) 2017-2018 Applied CCM Pty Ltd
-------------------------------------------------------------------------------
License
This file is part of Caelus.
Caelus is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
Caelus is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with Caelus. If not, see <http://www.gnu.org/licenses/>.
Class
CML::fv::cellLimitedBlockGrad
Description
cellLimitedBlockGrad gradient scheme applied to a runTime selected base
gradient scheme.
The scalar limiter based on limiting the extrapolated face values
between the maximum and minumum cell and cell neighbour values and is
applied to all components of the gradient.
Enhancements from FOAM-Extend-4.0 have been back ported.
Please report any omissions of authorship and/or copyright to
info@appliedccm.com.au. Corrections will be made upon provision of proof.
SourceFiles
cellLimitedBlockGrad.cpp
\*---------------------------------------------------------------------------*/
#ifndef cellLimitedBlockGrad_HPP
#define cellLimitedBlockGrad_HPP
#include "blockGradScheme.hpp"
#include "gradScheme.hpp"
namespace CML
{
namespace fv
{
template<class Type>
class cellLimitedBlockGrad
:
public fv::blockGradScheme<Type>
{
tmp<fv::blockGradScheme<Type> > basicBlockGradScheme_;
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
const scalar k_;
//- Disallow default bitwise copy construct
cellLimitedBlockGrad(const cellLimitedBlockGrad&);
//- Disallow default bitwise assignment
void operator=(const cellLimitedBlockGrad&);
public:
//- RunTime type information
TypeName("cellLimited");
//- Construct from mesh and schemeData
cellLimitedBlockGrad(const fvMesh& mesh, Istream& schemeData)
:
blockGradScheme<Type>(mesh),
basicBlockGradScheme_(fv::blockGradScheme<Type>::New(mesh, schemeData)),
basicGradScheme_(nullptr),
k_(readScalar(schemeData))
{
// Rewind stream as we want to re-read the scheme for the basic
// gradient. This ensures the scheme used to calculate the limiter
// is the same as the block scheme.
schemeData.rewind();
// Advance token on stream as we don't need the first
const word schemeName(schemeData);
basicGradScheme_ = tmp<fv::gradScheme<Type> >
(
fv::gradScheme<Type>::New(mesh, schemeData)
);
// Advance token to end of stream
const scalar dummy(readScalar(schemeData));
if (fv::debug)
{
Info<<"Gradient scheme = "<<schemeName
<<", limiting coefficient = "<<dummy<<endl;
}
if (k_ < 0 || k_ > 1)
{
FatalIOErrorInFunction(schemeData)
<< "coefficient = " << k_
<< " should be >= 0 and <= 1"
<< exit(FatalIOError);
}
}
// Member Functions
static inline void limitFace
(
Type& limiter,
const Type& maxDelta,
const Type& minDelta,
const Type& extrapolate
);
//- Return the BlockLduSystem corresponding to the implicit cell
// limited grad discretization. For block coupled systems.
tmp<BlockLduSystem<vector, typename outerProduct<vector, Type>::type> >
fvmGrad
(
const GeometricField<Type, fvPatchField, volMesh>&
) const;
};
// * * * * * * * * * * * * Inline Member Function * * * * * * * * * * * * * //
template<>
inline void cellLimitedBlockGrad<scalar>::limitFace
(
scalar& limiter,
const scalar& maxDelta,
const scalar& minDelta,
const scalar& extrapolate
)
{
if (extrapolate > maxDelta + VSMALL)
{
limiter = min(limiter, maxDelta/extrapolate);
}
else if (extrapolate < minDelta - VSMALL)
{
limiter = min(limiter, minDelta/extrapolate);
}
}
template<class Type>
inline void cellLimitedBlockGrad<Type>::limitFace
(
Type& limiter,
const Type& maxDelta,
const Type& minDelta,
const Type& extrapolate
)
{
for (direction cmpt=0; cmpt<Type::nComponents; cmpt++)
{
cellLimitedBlockGrad<scalar>::limitFace
(
limiter.component(cmpt),
maxDelta.component(cmpt),
minDelta.component(cmpt),
extrapolate.component(cmpt)
);
}
}
} // End namespace fv
} // End namespace CML
#endif
| 27.690217 | 80 | 0.624926 | [
"mesh",
"vector"
] |
13ec52bcedd4d3a256948134495ba148faf1ce28 | 1,212 | cc | C++ | mandelbrot.cc | likr/20150915electron | 69b3342c4a35dd109e79765d85524f7427a02e8b | [
"MIT"
] | 1 | 2015-09-19T04:33:26.000Z | 2015-09-19T04:33:26.000Z | mandelbrot.cc | likr/20150915electron | 69b3342c4a35dd109e79765d85524f7427a02e8b | [
"MIT"
] | null | null | null | mandelbrot.cc | likr/20150915electron | 69b3342c4a35dd109e79765d85524f7427a02e8b | [
"MIT"
] | null | null | null | #include <node.h>
using namespace v8;
void runMandelbrot(unsigned char* array, int width, int height, double pixel_size, double x0, double y0) {
for (int j = 0; j < height; ++j) {
for (int i = 0; i < width; ++i) {
double cr = x0 + pixel_size * i;
double ci = y0 + pixel_size * j;
double zr = 0.0f;
double zi = 0.0f;
double zrzi, zr2, zi2;
int k;
for(k = 0; k < 256; k++) {
zrzi = zr * zi;
zr2 = zr * zr;
zi2 = zi * zi;
zr = zr2 - zi2 + cr;
zi = zrzi + zrzi + ci;
if(zi2 + zr2 >= 2.0) {
break;
}
}
if(k > 255){
k = 255;
}
int index = j * width + i;
array[4 * index] = array[4 * index + 1] = array[4 * index + 2] = 255 - k;
array[4 * index + 3] = 255;
}
}
}
void Method(const FunctionCallbackInfo<Value>& args) {
Local<Uint8ClampedArray> array = args[0].As<Uint8ClampedArray>();
unsigned char* ptr = (unsigned char*)array->Buffer()->GetContents().Data();
runMandelbrot(ptr, 300, 200, 0.01, -2.0, -1.0);
}
void init(Local<Object> exports) {
NODE_SET_METHOD(exports, "mandelbrot", Method);
}
NODE_MODULE(addon, init)
| 25.787234 | 106 | 0.523927 | [
"object"
] |
13f1d5bbe7b07ad28c4be7990e5dc7434ebd56a8 | 5,493 | cxx | C++ | src/lsm6ds3h/lsm6ds3h.cxx | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 619 | 2015-01-14T23:50:18.000Z | 2019-11-08T14:04:33.000Z | src/lsm6ds3h/lsm6ds3h.cxx | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 576 | 2015-01-02T09:55:14.000Z | 2019-11-12T15:31:10.000Z | src/lsm6ds3h/lsm6ds3h.cxx | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 494 | 2015-01-14T18:33:56.000Z | 2019-11-07T10:08:15.000Z | /*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2016-2017 Intel Corporation.
*
* The MIT License
*
* This program and the accompanying materials are made available under the
* terms of the The MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
*/
#include <unistd.h>
#include <iostream>
#include <stdexcept>
#include <string>
#include "lsm6ds3h.hpp"
using namespace upm;
using namespace std;
// conversion from Celsius to Fahrenheit
static float c2f(float c)
{
return (c * (9.0 / 5.0) + 32.0);
}
LSM6DS3H::LSM6DS3H(int bus, int addr, int cs) :
m_lsm6ds3h(lsm6ds3h_init(bus, addr, cs))
{
if (!m_lsm6ds3h)
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_init() failed");
}
LSM6DS3H::~LSM6DS3H()
{
lsm6ds3h_close(m_lsm6ds3h);
}
void LSM6DS3H::init(LSM6DS3H_XL_ODR_T acc_odr, LSM6DS3H_XL_FS_T acc_fs,
LSM6DS3H_G_ODR_T gyr_odr, LSM6DS3H_G_FS_T gyr_fs)
{
if (lsm6ds3h_devinit(m_lsm6ds3h, acc_odr, acc_fs, gyr_odr, gyr_fs))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_devinit() failed");
}
void LSM6DS3H::update()
{
if (lsm6ds3h_update(m_lsm6ds3h))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_update() failed");
}
uint8_t LSM6DS3H::readReg(uint8_t reg)
{
return lsm6ds3h_read_reg(m_lsm6ds3h, reg);
}
int LSM6DS3H::readRegs(uint8_t reg, uint8_t *buffer, int len)
{
int rv = lsm6ds3h_read_regs(m_lsm6ds3h, reg, buffer, len);
if (rv != len)
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_read_regs() failed");
return rv;
}
void LSM6DS3H::writeReg(uint8_t reg, uint8_t val)
{
if (lsm6ds3h_write_reg(m_lsm6ds3h, reg, val))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_write_reg() failed");
}
uint8_t LSM6DS3H::getChipID()
{
return lsm6ds3h_get_chip_id(m_lsm6ds3h);
}
void LSM6DS3H::getAccelerometer(float *x, float *y, float *z)
{
lsm6ds3h_get_accelerometer(m_lsm6ds3h, x, y, z);
}
std::vector<float> LSM6DS3H::getAccelerometer()
{
float v[3];
getAccelerometer(&v[0], &v[1], &v[2]);
return std::vector<float>(v, v+3);
}
std::vector<float> LSM6DS3H::getAcceleration()
{
std::vector<float> v(3);
lsm6ds3h_get_accelerometer(m_lsm6ds3h, &v[0], &v[1], &v[2]);
return v;
}
void LSM6DS3H::getGyroscope(float *x, float *y, float *z)
{
lsm6ds3h_get_gyroscope(m_lsm6ds3h, x, y, z);
}
std::vector<float> LSM6DS3H::getGyroscope()
{
update();
float v[3];
getGyroscope(&v[0], &v[1], &v[2]);
return std::vector<float>(v, v+3);
}
float LSM6DS3H::getTemperature(bool fahrenheit)
{
float temperature = lsm6ds3h_get_temperature(m_lsm6ds3h);
if (fahrenheit)
return c2f(temperature);
else
return temperature;
}
void LSM6DS3H::reset()
{
if (lsm6ds3h_reset(m_lsm6ds3h))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_reset() failed");
}
void LSM6DS3H::setAccelerometerODR(LSM6DS3H_XL_ODR_T odr)
{
if (lsm6ds3h_set_acc_odr(m_lsm6ds3h, odr))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_set_acc_odr() failed");
}
void LSM6DS3H::setAccelerometerFullScale(LSM6DS3H_XL_FS_T fs)
{
if (lsm6ds3h_set_acc_full_scale(m_lsm6ds3h, fs))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_set_acc_full_scale() failed");
}
void LSM6DS3H::setGyroscopeODR(LSM6DS3H_G_ODR_T odr)
{
if (lsm6ds3h_set_gyr_odr(m_lsm6ds3h, odr))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_set_gyr_odr() failed");
}
void LSM6DS3H::setGyroscopeFullScale(LSM6DS3H_G_FS_T fs)
{
if (lsm6ds3h_set_gyr_full_scale(m_lsm6ds3h, fs))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_set_gyr_full_scale() failed");
}
void LSM6DS3H::setHighPerformance(bool enable)
{
if (lsm6ds3h_high_performance(m_lsm6ds3h, enable))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_high_performance() failed");
}
void LSM6DS3H::setInterruptActiveHigh(bool high)
{
if (lsm6ds3h_set_interrupt_active_high(m_lsm6ds3h, high))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_set_interrupt_active_high() failed");
}
void LSM6DS3H::setInterruptPushPull(bool pp)
{
if (lsm6ds3h_set_interrupt_push_pull(m_lsm6ds3h, pp))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_set_interrupt_push_pull() failed");
}
uint8_t LSM6DS3H::getStatus()
{
return lsm6ds3h_get_status(m_lsm6ds3h);
}
void LSM6DS3H::installISR(LSM6DS3H_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
void (*isr)(void *), void *arg)
{
if (lsm6ds3h_install_isr(m_lsm6ds3h, intr, gpio,
(mraa_gpio_edge_t)level, isr, arg))
throw std::runtime_error(string(__FUNCTION__)
+ ": lsm6ds3h_install_isr() failed");
}
void LSM6DS3H::uninstallISR(LSM6DS3H_INTERRUPT_PINS_T intr)
{
lsm6ds3h_uninstall_isr(m_lsm6ds3h, intr);
}
| 26.795122 | 84 | 0.640816 | [
"vector"
] |
13f3bda8e5bc800c329e768878ed773690314556 | 649 | cpp | C++ | size.cpp | rohithpothula/coding_Blocks | 33ead424f250866cbd8f8e14cd42531304d59ca9 | [
"MIT"
] | null | null | null | size.cpp | rohithpothula/coding_Blocks | 33ead424f250866cbd8f8e14cd42531304d59ca9 | [
"MIT"
] | null | null | null | size.cpp | rohithpothula/coding_Blocks | 33ead424f250866cbd8f8e14cd42531304d59ca9 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
# define ll long long
# define endl "\n"
# define str string
# define vll vector<ll>
# define pb push_back
# define mll map<ll,ll>
# define mp make_pair
# define ff first
# define ss second
# define pll pair<ll,ll>
# define f(x,y) for(int x=0;x<y;x++)
int main() {
#ifndef ONLINE_JUDGE
freopen ("input.txt", "r", stdin);
freopen ("output.txt", "w", stdout);
#endif
//ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll t;
cin >> t;
while (t--)
{
int count = 0;
string s = "abcdefg";
int i = 0;
while (s[i] != '\0')
{
count++;
i++;
}
cout << count << endl;
}
} | 19.088235 | 67 | 0.61171 | [
"vector"
] |
13f55226990045c9f65fa0827047e4cda473790a | 5,101 | cpp | C++ | src/core/csr/measures/read_tail_bias.cpp | roryk/octopus | 0ec2839c33b846107278696ee04ce6d7d0f69a54 | [
"MIT"
] | null | null | null | src/core/csr/measures/read_tail_bias.cpp | roryk/octopus | 0ec2839c33b846107278696ee04ce6d7d0f69a54 | [
"MIT"
] | null | null | null | src/core/csr/measures/read_tail_bias.cpp | roryk/octopus | 0ec2839c33b846107278696ee04ce6d7d0f69a54 | [
"MIT"
] | null | null | null | // Copyright (c) 2015-2020 Daniel Cooke
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#include "read_tail_bias.hpp"
#include <algorithm>
#include <iterator>
#include <random>
#include <functional>
#include <cmath>
#include <cassert>
#include <boost/variant.hpp>
#include "io/variant/vcf_record.hpp"
#include "basics/aligned_read.hpp"
#include "core/types/allele.hpp"
#include "utils/maths.hpp"
#include "../facets/samples.hpp"
#include "../facets/alleles.hpp"
#include "../facets/read_assignments.hpp"
namespace octopus { namespace csr {
const std::string ReadTailBias::name_ = "RTB";
std::unique_ptr<Measure> ReadTailBias::do_clone() const
{
return std::make_unique<ReadTailBias>(*this);
}
Measure::ValueType ReadTailBias::get_value_type() const
{
return double {};
}
void ReadTailBias::do_set_parameters(std::vector<std::string> params)
{
if (params.size() != 1) {
throw BadMeasureParameters {this->name(), "only has one parameter (tail fraction)"};
}
try {
tail_fraction_ = boost::lexical_cast<decltype(tail_fraction_)>(params.front());
} catch (const boost::bad_lexical_cast&) {
throw BadMeasureParameters {this->name(), "given parameter \"" + params.front() + "\" cannot be parsed"};
}
if (tail_fraction_ < 0 || tail_fraction_ > 1) {
throw BadMeasureParameters {this->name(), "tail fraction must be between 0 and 1"};
}
}
namespace {
struct TailDefinition
{
double tail_fraction = 0.03;
};
struct PositionCounts
{
unsigned head, tail;
};
bool overlaps_rhs(const Allele& allele, const AlignedRead& read)
{
using D = GenomicRegion::Distance;
return overlaps(allele, expand_lhs(mapped_region(read), -static_cast<D>(region_size(read) / 2)));
}
auto tail_region(const AlignedRead& read, const unsigned tail_bases)
{
if (is_forward_strand(read)) {
return octopus::tail_region(read, tail_bases);
} else {
return head_region(read, tail_bases);
}
}
bool is_in_tail(const Allele& allele, const AlignedRead& read, const TailDefinition tail_def = TailDefinition {})
{
assert(contains(read, allele));
const auto tail_bases = std::max(static_cast<unsigned>(sequence_size(read) * tail_def.tail_fraction), 1u);
return contains(tail_region(read, tail_bases), allele);
}
auto compute_head_tail_counts(const Allele& allele, const ReadRefSupportSet& support, const TailDefinition tail_def = TailDefinition {})
{
PositionCounts result {};
for (const auto& read : support) {
if (contains(read, allele)) {
if (is_in_tail(allele, read)) {
++result.tail;
} else {
++result.head;
}
}
}
return result;
}
double calculate_tail_bias(const PositionCounts counts, const double tolerance = 0.5, const double prior = 1.0)
{
assert(tolerance > 0.0 && tolerance < 1.0);
return maths::beta_cdf(counts.head + prior, counts.tail + prior, tolerance);
}
double calculate_tail_bias(const Allele& allele, const ReadRefSupportSet& support, const TailDefinition tail_def = TailDefinition {})
{
const auto counts = compute_head_tail_counts(allele, support);
return calculate_tail_bias(counts, std::min(3 * tail_def.tail_fraction, 0.5));
}
double calculate_max_tail_bias(const std::vector<Allele>& alleles, const AlleleSupportMap& support, const TailDefinition tail_def = TailDefinition {})
{
double result {0};
for (const auto& allele : alleles) {
const auto support_set_itr = support.find(allele);
if (support_set_itr != std::cend(support)) {
auto bias = calculate_tail_bias(allele, support_set_itr->second, tail_def);
result = std::max(result, bias);
}
}
return result;
}
} // namespace
Measure::ResultType ReadTailBias::do_evaluate(const VcfRecord& call, const FacetMap& facets) const
{
const auto& samples = get_value<Samples>(facets.at("Samples"));
const auto& alleles = get_value<Alleles>(facets.at("Alleles"));
const auto& assignments = get_value<ReadAssignments>(facets.at("ReadAssignments")).alleles;
Array<ValueType> result {};
result.reserve(samples.size());
const TailDefinition tail_def {tail_fraction_};
for (const auto& sample : samples) {
result.emplace_back(calculate_max_tail_bias(get_called(alleles, call, sample), assignments.at(sample), tail_def));
}
return result;
}
Measure::ResultCardinality ReadTailBias::do_cardinality() const noexcept
{
return ResultCardinality::samples;
}
const std::string& ReadTailBias::do_name() const
{
return name_;
}
std::string ReadTailBias::do_describe() const
{
return "Probability allele occurs in the tail of supporting reads";
}
std::vector<std::string> ReadTailBias::do_requirements() const
{
return {"Samples", "Alleles", "ReadAssignments"};
}
bool ReadTailBias::is_equal(const Measure& other) const noexcept
{
return tail_fraction_ == static_cast<const ReadTailBias&>(other).tail_fraction_;
}
} // namespace csr
} // namespace octopus
| 30.183432 | 150 | 0.699863 | [
"vector"
] |
13f5d88bd5e7127a8749b69d086c6c1e00be5823 | 4,511 | cpp | C++ | libraries/protocol/betting/invariants_validation.cpp | scorum/scorum | 1da00651f2fa14bcf8292da34e1cbee06250ae78 | [
"MIT"
] | 53 | 2017-10-28T22:10:35.000Z | 2022-02-18T02:20:48.000Z | libraries/protocol/betting/invariants_validation.cpp | Scorum/Scorum | fb4aa0b0960119b97828865d7a5b4d0409af7876 | [
"MIT"
] | 38 | 2017-11-25T09:06:51.000Z | 2018-10-31T09:17:22.000Z | libraries/protocol/betting/invariants_validation.cpp | Scorum/Scorum | fb4aa0b0960119b97828865d7a5b4d0409af7876 | [
"MIT"
] | 27 | 2018-01-08T19:43:35.000Z | 2022-01-14T10:50:42.000Z | #include <boost/fusion/include/map.hpp>
#include <boost/fusion/include/at_key.hpp>
#include <boost/range/algorithm/set_algorithm.hpp>
#include <boost/range/algorithm/transform.hpp>
#include <scorum/protocol/betting/invariants_validation.hpp>
#include <scorum/protocol/betting/game.hpp>
#include <scorum/protocol/betting/market.hpp>
namespace scorum {
namespace protocol {
namespace bf = boost::fusion;
// clang-format off
const bf::map<bf::pair<soccer_game, std::set<market_kind>>, bf::pair<hockey_game, std::set<market_kind>>> game_markets(
bf::make_pair<soccer_game>(std::set<market_kind>{
market_kind::result,
market_kind::round,
market_kind::handicap,
market_kind::correct_score,
market_kind::goal,
market_kind::total,
market_kind::total_goals
}),
bf::make_pair<hockey_game>(std::set<market_kind>{ //This type for tests purpose only. Now we have markets table for soccer only
market_kind::result,
market_kind::goal
}));
// clang-format on
void validate_game(const game_type& game, const fc::flat_set<market_type>& markets)
{
const auto& expected_markets
= game.visit([&](const auto& g) { return bf::at_key<std::decay_t<decltype(g)>>(game_markets); });
std::set<market_kind> actual_markets;
boost::transform(markets, std::inserter(actual_markets, actual_markets.begin()), [](const market_type& m) {
return m.visit([&](const auto& market_impl) { return market_impl.kind_v; });
});
std::vector<market_kind> diff;
boost::set_difference(actual_markets, expected_markets, std::back_inserter(diff));
FC_ASSERT(diff.empty(), "Markets [${m}] cannot be used with specified game", ("m", diff));
}
void validate_markets(const fc::flat_set<market_type>& markets)
{
for (const auto& m : markets)
{
validate_market(m);
}
}
void validate_wincases(const fc::flat_set<wincase_type>& wincases)
{
for (const auto& wincase : wincases)
{
validate_wincase(wincase);
}
}
void validate_wincase(const wincase_type& wincase)
{
auto check_threshold = [](auto threshold) { return threshold % (SCORUM_BETTING_THRESHOLD_FACTOR / 2) == 0; };
auto check_positive_threshold = [&](auto threshold) { return check_threshold(threshold) && threshold > 0; };
auto is_valid
= wincase.weak_visit([&](const total::over& w) { return check_positive_threshold(w.threshold); },
[&](const total::under& w) { return check_positive_threshold(w.threshold); },
[&](const handicap::over& w) { return check_threshold(w.threshold); },
[&](const handicap::under& w) { return check_threshold(w.threshold); },
[&](const total_goals_home::over& w) { return check_positive_threshold(w.threshold); },
[&](const total_goals_home::under& w) { return check_positive_threshold(w.threshold); },
[&](const total_goals_away::over& w) { return check_positive_threshold(w.threshold); },
[&](const total_goals_away::under& w) { return check_positive_threshold(w.threshold); });
FC_ASSERT(is_valid.value_or(true), "Wincase '${w}' is invalid", ("w", wincase));
}
void validate_if_wincase_in_game(const game_type& game, const wincase_type& wincase)
{
const auto& expected_markets
= game.visit([&](const auto& g) { return bf::at_key<std::decay_t<decltype(g)>>(game_markets); });
auto kind = wincase.visit([](const auto& w) { return std::decay_t<decltype(w)>::kind_v; });
FC_ASSERT(expected_markets.find(kind) != expected_markets.end(), "Invalid wincase '${w}'", ("w", wincase));
}
void validate_bet_ids(const fc::flat_set<int64_t>& bet_ids)
{
FC_ASSERT(!bet_ids.empty());
for (const auto& id : bet_ids)
{
FC_ASSERT(id >= 0, "Invalid bet Id");
}
}
void validate_market(const market_type& market)
{
auto wincase_pair = create_wincases(market);
validate_wincase(wincase_pair.first);
validate_wincase(wincase_pair.second);
}
}
}
| 41.385321 | 131 | 0.606296 | [
"vector",
"transform"
] |
13f68ce0e6e0d7cb3fbb10004f35bad8696d4bdf | 1,352 | cpp | C++ | Tutorial - Pathfinding/node.cpp | Big-Kev/AI-Tutorials | 6b7341a4e4fa6c33b311abcf71c65d9cdbaf8bea | [
"MIT"
] | null | null | null | Tutorial - Pathfinding/node.cpp | Big-Kev/AI-Tutorials | 6b7341a4e4fa6c33b311abcf71c65d9cdbaf8bea | [
"MIT"
] | null | null | null | Tutorial - Pathfinding/node.cpp | Big-Kev/AI-Tutorials | 6b7341a4e4fa6c33b311abcf71c65d9cdbaf8bea | [
"MIT"
] | null | null | null | #include "node.h"
#include "graph.h"
node::node(Vector2 v, float size)
{
n_pos = v;
n_size = size;
setRight(nullptr);
parent = nullptr;
gScore = FLT_MAX;
}
node::node(float x, float y, float size)
{
n_pos.x = x;
n_pos.y = y;
n_size = size;
parent = nullptr;
setRight(nullptr);
setLeft(nullptr);
gScore = FLT_MAX;
}
node::~node()
{
}
void node::findNeighbours(std::vector<std::vector<node>> nodeList, int width, int height, float distance)
{
for (int o = 0; o > width; o++) {
for (int i = 0; i > width; i++) {
if (n_pos.pythag(nodeList[o][i].getPos()) < distance * distance) {
neighbours.push_back(&nodeList[o][i]);
}
}
}
addConnections();//adding neighbours to edge list
}
void node::addConnections()
{
for (int i = 0; i < neighbours.size(); i++) {
Edge e;
e.cost = 1;
e.target = neighbours[i];
connections.push_back(Edge() = e);
}
}
void node::getGraphStats(graph * owner)
{
}
void node::drawNode(aie::Renderer2D * ren)
{
//ren->drawLine(n_pos.x, n_pos.y, n_pos.x + n_size, n_pos.y);
//ren->drawLine(n_pos.x, n_pos.y, n_pos.x, n_pos.y + n_size);
//ren->setRenderColour(1, 1, 1, 0.5);
drawRelations(ren);
}
void node::drawRelations(aie::Renderer2D * ren) {
for (node *n : neighbours) {
ren->setRenderColour(0, 0, 1);
ren->drawLine(n_pos.x, n_pos.y, n->getPos().x, n->getPos().y);
}
}
| 18.27027 | 105 | 0.627219 | [
"vector"
] |
13fab61e6f1b3ac0a7ed74d1ed2500a09a3159d1 | 3,071 | cpp | C++ | test/Matuna.OCLDeviceHandlerTest/OCLDeviceHandlerTest.cpp | mihed/ATML | 242fb951eea7a55846b8a18dd6abcabb26e2a1cc | [
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | test/Matuna.OCLDeviceHandlerTest/OCLDeviceHandlerTest.cpp | mihed/ATML | 242fb951eea7a55846b8a18dd6abcabb26e2a1cc | [
"BSL-1.0",
"BSD-3-Clause"
] | 3 | 2015-06-08T19:51:53.000Z | 2015-07-01T10:15:06.000Z | test/Matuna.OCLDeviceHandlerTest/OCLDeviceHandlerTest.cpp | mihed/ATML | 242fb951eea7a55846b8a18dd6abcabb26e2a1cc | [
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | /*
* OCLHelperTest.cpp
*
* Created on: Apr 28, 2015
* Author: Mikael
*/
#define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"
#include "Matuna.OCLHelper/OCLHelper.h"
#include <stdio.h>
using namespace Matuna::Helper;
SCENARIO("Fetching device and platform information", "[PlatformInfo]")
{
WHEN("Getting platform informations"){
auto platformInfos = OCLHelper::GetPlatformInfos();
if (platformInfos.size() == 0)
{
WARN("No platforms are detected. "
"This is either because you are running "
"a system without OCL drivers or that we have a bug in the GetPlatformInfo() function.");
}
THEN("We should have a vector with a lot of information that is printable")
{
for (auto& info : platformInfos)
cout << info.GetString().c_str() << endl;
}
}
}
SCENARIO("Fetching device information", "[DeviceInfo]")
{
auto platformInfos = OCLHelper::GetPlatformInfos();
if (platformInfos.size() == 0)
{
WARN(
"No platforms are detected. "
"This is either because you are running "
"a system without OCL drivers or that we have a bug in the GetPlatformInfo() function.");
}
WHEN("Fetching the device info from the platform infos"){
THEN("The device infos should be printable and working")
{
for (auto& platformInfo : platformInfos)
{
auto deviceInfos = OCLHelper::GetDeviceInfos(platformInfo);
for (auto& info : deviceInfos)
cout << info.GetString().c_str() << endl;
}
}
}
}
SCENARIO("Fetching the context from the devicehandler", "[OCLContext][OCLHelper]")
{
INFO("Fetching the platform infos");
auto platformInfos = OCLHelper::GetPlatformInfos();
if (platformInfos.size() == 0)
{
WARN(
"No platforms are detected. "
"This is either because you are running "
"a system without OCL drivers or that we have a bug in the GetPlatformInfo() function.");
}
for (auto& platformInfo : platformInfos)
{
WHEN("Creating the context from a platform info with standard arguments"){
auto context = OCLHelper::GetContext(platformInfo);
THEN("We should be able to get the devices from the context")
{
auto devices = context->GetDevices();
CHECK(devices.size() == context->DeviceCount());
}
}
WHEN("Creating the context with 2 device queues")
{
auto context = OCLHelper::GetContext(platformInfo, 2);
THEN("We should be able to get the devices from the context")
{
auto devices = context->GetDevices();
CHECK(devices.size() == context->DeviceCount());
}
}
WHEN("Creating the context using custom configurations")
{
auto deviceInfos = OCLHelper::GetDeviceInfos(platformInfo);
vector<tuple<OCLDeviceConfig, OCLDeviceInfo>> configs;
for (auto& deviceInfo : deviceInfos)
{
OCLDeviceConfig config;
config.AddCommandQueue();
configs.push_back(make_tuple(config, deviceInfo));
}
auto context = OCLHelper::GetContext(platformInfo, configs);
THEN("We should be able to get the devices from the context")
{
auto devices = context->GetDevices();
CHECK(devices.size() == context->DeviceCount());
}
}
}
}
| 29.528846 | 93 | 0.691306 | [
"vector"
] |
cd02b6eb14da8e1c3cd6b799e8a01d80512e653a | 3,913 | cpp | C++ | core/quantities/Utility.cpp | grische/OpenSPH | 74a8fff865157ae94e8d7ed249b116fbadf6ad20 | [
"MIT"
] | null | null | null | core/quantities/Utility.cpp | grische/OpenSPH | 74a8fff865157ae94e8d7ed249b116fbadf6ad20 | [
"MIT"
] | 1 | 2022-01-27T21:25:34.000Z | 2022-01-27T21:25:34.000Z | core/quantities/Utility.cpp | grische/OpenSPH | 74a8fff865157ae94e8d7ed249b116fbadf6ad20 | [
"MIT"
] | null | null | null | #include "quantities/Utility.h"
#include "objects/finders/NeighborFinder.h"
#include "objects/geometry/Box.h"
#include "objects/utility/Algorithm.h"
#include "system/Factory.h"
#include "thread/Scheduler.h"
NAMESPACE_SPH_BEGIN
Box getBoundingBox(const Storage& storage, const Float radius) {
Box box;
ArrayView<const Vector> r = storage.getValue<Vector>(QuantityId::POSITION);
for (Size i = 0; i < r.size(); ++i) {
box.extend(r[i] + radius * Vector(r[i][H]));
box.extend(r[i] - radius * Vector(r[i][H]));
}
for (const Attractor& a : storage.getAttractors()) {
box.extend(a.position + radius * Vector(a.radius));
box.extend(a.position - radius * Vector(a.radius));
}
return box;
}
Vector getCenterOfMass(const Storage& storage) {
Vector r_com = Vector(0._f);
Float m_sum = 0._f;
if (!storage.empty()) {
ArrayView<const Vector> r = storage.getValue<Vector>(QuantityId::POSITION);
if (storage.has(QuantityId::MASS)) {
ArrayView<const Float> m = storage.getValue<Float>(QuantityId::MASS);
for (Size i = 0; i < r.size(); ++i) {
m_sum += m[i];
r_com += m[i] * r[i];
}
} else {
// mass is unknown, cannot combine with mass of attractors
SPH_ASSERT(storage.getAttractors().empty());
for (Size i = 0; i < r.size(); ++i) {
m_sum += 1._f;
r_com += r[i];
}
}
}
// add attractors
for (const Attractor& a : storage.getAttractors()) {
m_sum += a.mass;
r_com += a.mass * a.position;
}
return clearH(r_com / m_sum);
}
Float getTotalMass(const Storage& storage) {
Float m_tot = 0._f;
if (!storage.empty()) {
ArrayView<const Float> m = storage.getValue<Float>(QuantityId::MASS);
m_tot += accumulate(m, 0._f);
}
for (const Attractor& p : storage.getAttractors()) {
m_tot += p.mass;
}
return m_tot;
}
Vector getTotalMomentum(const Storage& storage) {
Vector p_tot(0._f);
if (!storage.empty()) {
ArrayView<const Float> m = storage.getValue<Float>(QuantityId::MASS);
ArrayView<const Vector> v = storage.getDt<Vector>(QuantityId::POSITION);
for (Size i = 0; i < v.size(); ++i) {
p_tot += m[i] * v[i];
}
}
for (const Attractor& p : storage.getAttractors()) {
p_tot += p.mass * p.velocity;
}
return p_tot;
}
void moveInertialFrame(Storage& storage, const Vector& positionOffset, const Vector& velocityOffset) {
transform(
storage,
[&positionOffset](const Vector& r) { return r + clearH(positionOffset); },
[&velocityOffset](const Vector& v) { return v + clearH(velocityOffset); });
}
void moveToCenterOfMassFrame(Storage& storage) {
ArrayView<const Float> m;
ArrayView<Vector> r, v;
if (!storage.empty()) {
m = storage.getValue<Float>(QuantityId::MASS);
r = storage.getValue<Vector>(QuantityId::POSITION);
v = storage.getDt<Vector>(QuantityId::POSITION);
}
ArrayView<Attractor> attractors = storage.getAttractors();
Vector r_com(0._f);
Vector v_com(0._f);
Float m_tot = 0._f;
for (Size i = 0; i < r.size(); ++i) {
r_com += m[i] * r[i];
v_com += m[i] * v[i];
m_tot += m[i];
}
for (const Attractor& a : attractors) {
r_com += a.mass * a.position;
v_com += a.mass * a.velocity;
m_tot += a.mass;
}
SPH_ASSERT(m_tot > 0._f, m_tot);
// Dangerous! Do not modify smoothing length!
r_com = clearH(r_com / m_tot);
v_com = clearH(v_com / m_tot);
for (Size i = 0; i < r.size(); ++i) {
r[i] -= r_com;
v[i] -= v_com;
}
for (Attractor& a : attractors) {
a.position -= r_com;
a.velocity -= v_com;
}
}
NAMESPACE_SPH_END
| 30.811024 | 102 | 0.574495 | [
"geometry",
"vector",
"transform"
] |
cd071c0ea3dc8722b98a990d10393ab2ce1c7dc0 | 10,438 | cpp | C++ | r_utils/source/r_udp_receiver.cpp | TroyDL/revere | 541bdc2bed9db212c1b74414b24733cf39675d08 | [
"BSD-3-Clause"
] | 3 | 2022-02-15T19:30:32.000Z | 2022-03-11T20:00:47.000Z | r_utils/source/r_udp_receiver.cpp | TroyDL/revere | 541bdc2bed9db212c1b74414b24733cf39675d08 | [
"BSD-3-Clause"
] | 6 | 2022-02-15T19:35:29.000Z | 2022-02-16T00:36:46.000Z | r_utils/source/r_udp_receiver.cpp | TroyDL/revere | 541bdc2bed9db212c1b74414b24733cf39675d08 | [
"BSD-3-Clause"
] | 2 | 2020-11-17T06:46:32.000Z | 2022-02-10T21:43:36.000Z |
#include "r_utils/r_udp_receiver.h"
#ifdef IS_LINUX
#include <unistd.h>
#endif
#ifdef IS_WINDOWS
#include <WinSock2.h>
#include <ws2tcpip.h>
#include <Iphlpapi.h>
#endif
#include <chrono>
using namespace r_utils;
using namespace std;
r_udp_receiver::r_udp_receiver( int destinationPort,
int recvBufferSize,
const string& destinationAddress ) :
_sok( 0 ),
_addr( destinationPort, destinationAddress ),
_associatedReceivers()
{
// Map wildcard addresses (0.0.0.0 or ::) to the addr_any type.
if( _addr.is_wildcard_address() )
_addr.set_address( _addr.is_ipv4() ? ip4_addr_any : ip6_addr_any );
// First, create our datagram socket...
_sok = (SOK)socket( _addr.address_family(), SOCK_DGRAM, IPPROTO_UDP );
if( _sok <= 0 )
R_STHROW(r_internal_exception, ( "r_udp_receiver: Unable to create a datagram socket." ));
int on = 1;
int err = (int)::setsockopt( (SOK)_sok, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof(int) );
if( err < 0 )
R_STHROW(r_internal_exception, ( "r_udp_receiver: Unable to configure socket." ));
if( recvBufferSize > 0 )
{
err = setsockopt( _sok, SOL_SOCKET, SO_RCVBUF, (char*)&recvBufferSize, sizeof( recvBufferSize ) );
if( err < 0 )
R_STHROW(r_internal_exception, ( "r_udp_receiver: Unable to configure socket rcvbuf." ));
}
if( _addr.is_ipv6() )
{
int ipv6only;
socklen_t optlen = sizeof( ipv6only );
if( getsockopt( _sok, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, &optlen ) == 0 )
{
ipv6only = 0;
if( setsockopt( _sok, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) ) != 0 )
R_STHROW(r_internal_exception, ( "Failed to set IPV6_V6ONLY socket option." ));
}
else
R_LOG_WARNING( "[r_udp_receiver]: IPV6_V6ONLY socket option not supported on this platform" );
}
if( r_socket_address::is_multicast( destinationAddress ) )
{
if( ::bind( _sok, _addr.get_sock_addr(), _addr.sock_addr_size() ) < 0 )
R_STHROW(r_internal_exception, ( "r_udp_receiver: Unable to bind to local interface." ));
}
else
{
if( ::bind( _sok, _addr.get_sock_addr(), _addr.sock_addr_size()) < 0 )
R_STHROW(r_internal_exception, ( "r_udp_receiver: Unable to bind to local interface." ));
}
// If an r_udp_receiver is created with a default destinationPort (0), then use getsockname()
// to discover the actual local port that was used by bind() and then SET that port on _addr.
// This allows a subsequent call to GetBoundPort() to return a discovered free port rather than
// 0. If the destinationPort was valid and we bound to it, all this does is reset _addr to the
// value it already had.
sockaddr_storage sa;
memset( &sa, 0, sizeof( sa ) );
int size = sizeof( sa );
getsockname( _sok, (sockaddr*)&sa, (socklen_t*)&size );
if( sa.ss_family == AF_INET )
_addr.set_port_num( ntohs(((sockaddr_in*)&sa)->sin_port) );
else _addr.set_port_num( ntohs(((sockaddr_in6*)&sa)->sin6_port) );
if( _addr.address().length() > 0 )
{
if( r_socket_address::is_multicast( _addr.address() ) )
{
int level, optname, optlen;
char *optval = 0;
if( _addr.address_family() == AF_INET )
{
struct ip_mreq v4mreq;
level = IPPROTO_IP;
optname = IP_ADD_MEMBERSHIP;
optval = (char*)&v4mreq;
optlen = sizeof( v4mreq );
memset( &v4mreq, 0, sizeof( v4mreq ) );
v4mreq.imr_multiaddr.s_addr = ((struct sockaddr_in*)_addr.get_sock_addr())->sin_addr.s_addr;
v4mreq.imr_interface.s_addr = htonl( INADDR_ANY );
}
else
{
struct ipv6_mreq v6mreq;
level = IPPROTO_IPV6;
optname = IPV6_JOIN_GROUP;
optval = (char*)&v6mreq;
optlen = sizeof( v6mreq );
memset( &v6mreq, 0, sizeof( v6mreq ) );
v6mreq.ipv6mr_multiaddr = ((struct sockaddr_in6*)_addr.get_sock_addr())->sin6_addr;
v6mreq.ipv6mr_interface = 0;
}
setsockopt( _sok, level, optname, optval, optlen );
}
}
}
/// Note:
/// connect() can be used to filter incoming UDP packets by ip address. Note: the port passed to
/// connect is the SRC port. You probably want to pass 0 for the port here.
void r_udp_receiver::connect( const string& ipAddress, int port )
{
r_socket_address addr( port, ipAddress );
if( ::connect( _sok, addr.get_sock_addr(), addr.sock_addr_size() ) )
{
R_STHROW(r_internal_exception, ( "r_udp_receiver::connect: Failed to connect to %s:%d",
ipAddress.c_str(),
port ));
}
}
bool r_udp_receiver::receive( int& port, vector<uint8_t>& buffer )
{
return _receive( port, buffer, true, 0 );
}
bool r_udp_receiver::receive( int& port, vector<uint8_t>& buffer, int waitMillis )
{
// We could accept lower values, but if you really want them that low, you
// probably should be doing a non-blocking call, and if a low enough value
// is given to select, then it never times out (e.g. with some testing on Windows,
// it seemed to work with 10ms but not 1ms, and it might vary from machine to
// machine or OS to OS). And passing 250ms to select works well in almost all
// cases, so we don't want to mess with that without good reason.
return _receive( port, buffer, true, waitMillis );
}
bool r_udp_receiver::non_blocking_receive( int& port, vector<uint8_t>& buffer )
{
return _receive( port, buffer, false, 0 );
}
bool r_udp_receiver::_receive( int& port, vector<uint8_t>& buffer, bool block, int waitMillis )
{
fd_set readFileDescriptors;
int selectRet = 0;
auto beforeSelect = std::chrono::steady_clock::now();
while( (_sok > 0) && (selectRet == 0) )
{
struct timeval tv = { 0, block ? 250000 : 0 };
FD_ZERO( &readFileDescriptors );
SOK currentLargestSOK = _sok;
// First, add ourseleves...
FD_SET( _sok, &readFileDescriptors );
// Next, loop over all the associated sockets and add them to the set.
std::list<shared_ptr<r_udp_receiver> >::iterator i;
for( i = _associatedReceivers.begin(); i != _associatedReceivers.end(); i++ )
{
FD_SET( (*i)->_sok, &readFileDescriptors );
if( (*i)->_sok > currentLargestSOK )
currentLargestSOK = (*i)->_sok;
}
selectRet = select( (int)currentLargestSOK + 1,
&readFileDescriptors,
nullptr,
nullptr,
&tv );
// Check for timeout (if one is provided)
if( (waitMillis > 0) && (selectRet == 0) )
{
auto afterSelect = std::chrono::steady_clock::now();
auto deltaMillis = std::chrono::duration_cast<std::chrono::milliseconds>(afterSelect - beforeSelect).count();
if( ((waitMillis - deltaMillis) <= 0) )
return false;
}
else if( !block )
break;
}
if( selectRet > 0 )
{
if( FD_ISSET( _sok, &readFileDescriptors ) )
{
unsigned char bytes[2048];
int bytesReceived = recv( _sok,
(char*)bytes,
2048,
0 );
if( _sok <= 0 )
return false;
if( bytesReceived <= 0 )
return false;
buffer.resize(bytesReceived);
memcpy( &buffer[0], bytes, bytesReceived );
port = _addr.port();
return true;
}
else
{
for( auto i = _associatedReceivers.begin(); i != _associatedReceivers.end(); i++)
{
shared_ptr<r_udp_receiver> receiver = *i;
if(FD_ISSET(receiver->_sok, &readFileDescriptors))
return receiver->receive(port, buffer);
}
}
}
return false;
}
bool r_udp_receiver::raw_receive(int& port, vector<uint8_t>& buffer)
{
buffer.resize( 2048 );
socklen_t sockLen = _addr.sock_addr_size();
int bytesReceived = recvfrom( _sok,
(char*)&buffer[0],
2048,
0,
_addr.get_sock_addr(),
&sockLen );
buffer.resize((bytesReceived <= 0) ? 0 : bytesReceived);
//buffer->set_data_size( (bytesReceived <= 0) ? 0 : bytesReceived );
if( _sok <= 0 )
return false;
if( bytesReceived <= 0 )
return false;
return true;
}
void r_udp_receiver::shutdown()
{
::shutdown( _sok, SOCKET_SHUT_FLAGS );
}
void r_udp_receiver::close()
{
// I'm adding this because I have seen cases where close() alone is not
// enough to unblock a recvfrom() on another thread, but shutdown() does
// the trick. on linux!
shutdown();
SOK tmpSok = _sok;
_sok = 0;
FULL_MEM_BARRIER();
#ifdef IS_LINUX
if( tmpSok != 0 )
::close( tmpSok );
#endif
#ifdef IS_WINDOWS
if(tmpSok != 0)
::closesocket(tmpSok);
#endif
}
void r_udp_receiver::associate( shared_ptr<r_udp_receiver> receiver )
{
_associatedReceivers.push_back( receiver );
}
void r_udp_receiver::clear_associations()
{
_associatedReceivers.clear();
}
int r_udp_receiver::get_bound_port()
{
return _addr.port();
}
size_t r_udp_receiver::get_recv_buffer_size()
{
size_t size = 0;
socklen_t sizelen = sizeof( size );
if( getsockopt( _sok, SOL_SOCKET, SO_RCVBUF, (char*)&size, &sizelen ) != 0 )
R_STHROW(r_internal_exception, ( "r_udp_receiver::GetRecvBufferSize: Failed to get the buffer size." ));
return size;
}
void r_udp_receiver::set_recv_buffer_size(size_t size)
{
if( setsockopt( _sok, SOL_SOCKET, SO_RCVBUF, (char*)&size, sizeof(size) ) != 0 )
R_STHROW(r_internal_exception, ( "r_udp_receiver::SetRecvBufferSize: Failed to set the buffer size." ));
}
| 32.116923 | 121 | 0.584212 | [
"vector"
] |
cd0c2a2476382f7e96c8153f202a468610c458ef | 5,256 | cpp | C++ | Tree/863. All Nodes Distance K in Binary Tree.cpp | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 138 | 2020-02-08T05:25:26.000Z | 2021-11-04T11:59:28.000Z | Tree/863. All Nodes Distance K in Binary Tree.cpp | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | null | null | null | Tree/863. All Nodes Distance K in Binary Tree.cpp | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 24 | 2021-01-02T07:18:43.000Z | 2022-03-20T08:17:54.000Z | /*
863. All Nodes Distance K in Binary Tree
We are given a binary tree (with root node root), a target node, and an integer value K.
Return a list of the values of all nodes that have a distance K from the target node. The answer can be returned in any order.
Example 1:
Input: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, K = 2
Output: [7,4,1]
Explanation:
The nodes that are a distance 2 from the target node (with value 5)
have values 7, 4, and 1.
Note that the inputs "root" and "target" are actually TreeNodes.
The descriptions of the inputs above are just serializations of these objects.
Note:
The given tree is non-empty.
Each node in the tree has unique values 0 <= node.val <= 500.
The target node is a node in the tree.
0 <= K <= 1000.
*/
/*
先通过dfs 找到所有双向的路径
再通过bfs,从target 出发发散找到所有距离为k的点
*/
class Solution {
public:
vector<int> distanceK(TreeNode* root, TreeNode* target, int K) {
unordered_map<int,vector<int>>adj;
dfs(NULL, root, adj);
vector<int>res{target->val};
unordered_set<int>visited{target->val};
for(int i = 0; i<K; i++){
//cout<<" i "<<i<<endl;
vector<int>bfs;
for(auto p: res)
for(auto next: adj[p])
if(visited.count(next) == 0){
bfs.push_back(next);
visited.insert(next);
}
res = move(bfs);
}
return res;
}
void dfs(TreeNode* parent, TreeNode* root, unordered_map<int,vector<int>>& adj){
if(!root) return;
if(parent){
adj[parent->val].push_back(root->val);
adj[root->val].push_back(parent->val);
}
dfs(root, root->left, adj);
dfs(root, root->right, adj);
}
};
/*
Solution DFS:
不可以杂交
比如:
l = dfs(l.left, K, dis == -1 ? -1: dis + 1, res)
r = dfs(r.right, K, dis == -1 ? -1: max(l, dis) + 1, res)
这样可能有个后果,比如K=4, target = 1,
1
/ \
2 4
/ \
3 5
左面运行完 l = 2, 带进右侧tree, 到5的时候dis 就变成了4, 4的左侧右侧都没node, return dis = 4 到4, 再到1
这样就把4, 1也算进了node, 实际上都不应该算
*/
class Solution {
/**
Use a DFS function to track the distance between the current node and the target node.
int DFS(TreeNode* root, TreeNode* target, int K, int dis, vector<int>& v)
The distance variable is to track whether if the target reached. If it is not yet reached,
distance is -1, else it is the real distance between the current node and target node.
The function will return the real distance of the current node and the target node after the target is reached.
*/
int dfs(TreeNode* node, TreeNode* target, int K, int dis, vector<int>& result){
if (!node) return dis;
if (node == target) dis = 0;
int distanceFromLeftNode = dfs(node-> left, target, K, dis == -1 ? -1 : dis + 1, result);
int distanceFromRightNode = dfs(node-> right, target, K, dis == -1 ? -1 : dis + 1, result);
if (dis == -1 && (distanceFromLeftNode >= 0 || distanceFromRightNode >= 0)) {
dis = max(distanceFromLeftNode, distanceFromRightNode) + 1;
if (distanceFromLeftNode >= 0) {
///int temp = dfs(node-> right, target, K, dis + 1, result);
dfs(node->right, target, K, dis + 1, result);
}
if (distanceFromRightNode >= 0) {
///int temp = dfs(node-> left, target, K, dis + 1, result);
dfs(node->left, target, K, dis + 1, result);
}
}
if (dis == K) {
result.emplace_back(node->val);
}
return dis;
}
public:
vector<int> distanceK(TreeNode* root, TreeNode* target, int K) {
vector<int> result;
int h = dfs(root, target, K, -1, result);
return move(result);
}
};
class Solution {
public:
vector<int> ans;
map<TreeNode*, TreeNode*> parent; // son=>parent
set<TreeNode*> visit; //record visied node
void findParent(TreeNode* node){
if (!node) return;
if (node->left) {
parent[node->left] = node;
findParent(node->left);
}
if (node->right) {
parent[node->right] = node;
findParent(node->right);
}
}
vector<int> distanceK(TreeNode* root, TreeNode* target, int K) {
if (!root) return {};
// Annotate each node with parent.
findParent(root);
// Finds K distance childs from target node.
dfs(target, K);
return ans;
}
void dfs(TreeNode* node, int K) {
if (visit.find(node) != visit.end()) return;
visit.insert(node);
if (K == 0){
ans.push_back(node->val);
return;
}
if (node->left) dfs(node->left, K-1);
if (node->right) dfs(node->right, K-1);
// This is the key, it will recursively call all parent from target to root.
// And then same for each child. But they will be already cached at that point.
TreeNode* p = parent[node];
if (p) dfs(p, K-1);
}
};
| 28.410811 | 127 | 0.549277 | [
"vector"
] |
cd1066a2f5ba20485d53c628a843c3add7e3cf3e | 17,461 | hpp | C++ | boost/boost/spirit/home/karma/numeric/real.hpp | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 71 | 2015-01-17T00:29:44.000Z | 2021-02-09T02:59:16.000Z | boost/boost/spirit/home/karma/numeric/real.hpp | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 6 | 2016-01-11T05:20:05.000Z | 2021-02-06T11:37:24.000Z | boost/boost/spirit/home/karma/numeric/real.hpp | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 44 | 2015-03-18T09:20:37.000Z | 2021-12-21T08:09:17.000Z | // Copyright (c) 2001-2011 Hartmut Kaiser
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if !defined(BOOST_SPIRIT_KARMA_REAL_FEB_26_2007_0512PM)
#define BOOST_SPIRIT_KARMA_REAL_FEB_26_2007_0512PM
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
#include <boost/spirit/home/support/numeric_traits.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/char_class.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/support/detail/get_encoding.hpp>
#include <boost/spirit/home/karma/meta_compiler.hpp>
#include <boost/spirit/home/karma/char.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/karma/detail/get_casetag.hpp>
#include <boost/spirit/home/karma/detail/extract_from.hpp>
#include <boost/spirit/home/karma/detail/enable_lit.hpp>
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/numeric/real_policies.hpp>
#include <boost/spirit/home/karma/numeric/detail/real_utils.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/value_at.hpp>
#include <boost/fusion/include/vector.hpp>
namespace boost { namespace spirit
{
namespace karma
{
///////////////////////////////////////////////////////////////////////
// forward declaration only
template <typename T>
struct real_policies;
///////////////////////////////////////////////////////////////////////
// This is the class that the user can instantiate directly in
// order to create a customized real generator
template <typename T = double, typename Policies = real_policies<T> >
struct real_generator
: spirit::terminal<tag::stateful_tag<Policies, tag::double_, T> >
{
typedef tag::stateful_tag<Policies, tag::double_, T> tag_type;
real_generator() {}
real_generator(Policies const& p)
: spirit::terminal<tag_type>(p) {}
};
}
///////////////////////////////////////////////////////////////////////////
// Enablers
///////////////////////////////////////////////////////////////////////////
template <>
struct use_terminal<karma::domain, tag::float_> // enables float_
: mpl::true_ {};
template <>
struct use_terminal<karma::domain, tag::double_> // enables double_
: mpl::true_ {};
template <>
struct use_terminal<karma::domain, tag::long_double> // enables long_double
: mpl::true_ {};
///////////////////////////////////////////////////////////////////////////
template <>
struct use_terminal<karma::domain, float> // enables lit(1.0f)
: mpl::true_ {};
template <>
struct use_terminal<karma::domain, double> // enables lit(1.0)
: mpl::true_ {};
template <>
struct use_terminal<karma::domain, long double> // enables lit(1.0l)
: mpl::true_ {};
///////////////////////////////////////////////////////////////////////////
template <typename A0>
struct use_terminal<karma::domain // enables float_(...)
, terminal_ex<tag::float_, fusion::vector1<A0> >
> : mpl::true_ {};
template <typename A0>
struct use_terminal<karma::domain // enables double_(...)
, terminal_ex<tag::double_, fusion::vector1<A0> >
> : mpl::true_ {};
template <typename A0>
struct use_terminal<karma::domain // enables long_double(...)
, terminal_ex<tag::long_double, fusion::vector1<A0> >
> : mpl::true_ {};
// lazy float_(...), double_(...), long_double(...)
template <>
struct use_lazy_terminal<karma::domain, tag::float_, 1>
: mpl::true_ {};
template <>
struct use_lazy_terminal<karma::domain, tag::double_, 1>
: mpl::true_ {};
template <>
struct use_lazy_terminal<karma::domain, tag::long_double, 1>
: mpl::true_ {};
///////////////////////////////////////////////////////////////////////////
// enables custom real generator
template <typename T, typename Policies>
struct use_terminal<karma::domain
, tag::stateful_tag<Policies, tag::double_, T> >
: mpl::true_ {};
template <typename T, typename Policies, typename A0>
struct use_terminal<karma::domain
, terminal_ex<tag::stateful_tag<Policies, tag::double_, T>
, fusion::vector1<A0> > >
: mpl::true_ {};
// enables *lazy* custom real generator
template <typename T, typename Policies>
struct use_lazy_terminal<
karma::domain
, tag::stateful_tag<Policies, tag::double_, T>
, 1 // arity
> : mpl::true_ {};
// enables lit(double)
template <typename A0>
struct use_terminal<karma::domain
, terminal_ex<tag::lit, fusion::vector1<A0> >
, typename enable_if<traits::is_real<A0> >::type>
: mpl::true_ {};
}}
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma
{
#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
using spirit::float_;
using spirit::double_;
using spirit::long_double;
#endif
using spirit::float_type;
using spirit::double_type;
using spirit::long_double_type;
///////////////////////////////////////////////////////////////////////////
// This specialization is used for real generators not having a direct
// initializer: float_, double_ etc. These generators must be used in
// conjunction with an attribute.
///////////////////////////////////////////////////////////////////////////
template <
typename T, typename Policies, typename CharEncoding, typename Tag>
struct any_real_generator
: primitive_generator<any_real_generator<T, Policies, CharEncoding, Tag> >
{
typedef typename Policies::properties properties;
template <typename Context, typename Unused>
struct attribute
{
typedef T type;
};
any_real_generator(Policies const& policies = Policies())
: p_(policies) {}
// double_/float_/etc. has an attached attribute
template <typename OutputIterator, typename Context, typename Delimiter
, typename Attribute>
bool generate(OutputIterator& sink, Context& context
, Delimiter const& d, Attribute const& attr) const
{
if (!traits::has_optional_value(attr))
return false; // fail if it's an uninitialized optional
typedef real_inserter<T, Policies, CharEncoding, Tag> inserter_type;
return inserter_type::call(sink, traits::extract_from<T>(attr, context), p_) &&
karma::delimit_out(sink, d); // always do post-delimiting
}
// this double_/float_/etc. has no attribute attached, it needs to have
// been initialized from a direct literal
template <typename OutputIterator, typename Context, typename Delimiter>
static bool generate(OutputIterator&, Context&, Delimiter const&
, unused_type)
{
// It is not possible (doesn't make sense) to use numeric generators
// without providing any attribute, as the generator doesn't 'know'
// what to output. The following assertion fires if this situation
// is detected in your code.
BOOST_SPIRIT_ASSERT_MSG(false, real_not_usable_without_attribute, ()); return false;
}
template <typename Context>
static info what(Context const& /*context*/)
{
return info("real");
}
Policies p_;
};
///////////////////////////////////////////////////////////////////////////
// This specialization is used for real generators having a direct
// initializer: float_(10.), double_(20.) etc.
///////////////////////////////////////////////////////////////////////////
template <
typename T, typename Policies, typename CharEncoding, typename Tag
, bool no_attribute>
struct literal_real_generator
: primitive_generator<literal_real_generator<T, Policies, CharEncoding
, Tag, no_attribute> >
{
typedef typename Policies::properties properties;
template <typename Context, typename Unused = unused_type>
struct attribute
: mpl::if_c<no_attribute, unused_type, T>
{};
literal_real_generator(typename add_const<T>::type n
, Policies const& policies = Policies())
: n_(n), p_(policies) {}
// A double_(1.0) which additionally has an associated attribute emits
// its immediate literal only if it matches the attribute, otherwise
// it fails.
template <typename OutputIterator, typename Context, typename Delimiter
, typename Attribute>
bool generate(OutputIterator& sink, Context& context
, Delimiter const& d, Attribute const& attr) const
{
typedef typename attribute<Context>::type attribute_type;
if (!traits::has_optional_value(attr) ||
n_ != traits::extract_from<attribute_type>(attr, context))
{
return false;
}
typedef real_inserter<T, Policies, CharEncoding, Tag> inserter_type;
return inserter_type::call(sink, n_, p_) &&
karma::delimit_out(sink, d); // always do post-delimiting
}
// A double_(1.0) without any associated attribute just emits its
// immediate literal
template <typename OutputIterator, typename Context, typename Delimiter>
bool generate(OutputIterator& sink, Context&, Delimiter const& d
, unused_type) const
{
typedef real_inserter<T, Policies, CharEncoding, Tag> inserter_type;
return inserter_type::call(sink, n_, p_) &&
karma::delimit_out(sink, d); // always do post-delimiting
}
template <typename Context>
static info what(Context const& /*context*/)
{
return info("real");
}
T n_;
Policies p_;
};
///////////////////////////////////////////////////////////////////////////
// Generator generators: make_xxx function (objects)
///////////////////////////////////////////////////////////////////////////
namespace detail
{
template <typename T, typename Modifiers
, typename Policies = real_policies<T> >
struct make_real
{
static bool const lower =
has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
static bool const upper =
has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
typedef any_real_generator<
T, Policies
, typename spirit::detail::get_encoding_with_case<
Modifiers, unused_type, lower || upper>::type
, typename detail::get_casetag<Modifiers, lower || upper>::type
> result_type;
template <typename Terminal>
result_type operator()(Terminal const& term, unused_type) const
{
typedef tag::stateful_tag<Policies, tag::double_, T> tag_type;
using spirit::detail::get_stateful_data;
return result_type(get_stateful_data<tag_type>::call(term));
}
};
}
template <typename Modifiers>
struct make_primitive<tag::float_, Modifiers>
: detail::make_real<float, Modifiers> {};
template <typename Modifiers>
struct make_primitive<tag::double_, Modifiers>
: detail::make_real<double, Modifiers> {};
template <typename Modifiers>
struct make_primitive<tag::long_double, Modifiers>
: detail::make_real<long double, Modifiers> {};
///////////////////////////////////////////////////////////////////////////
template <typename T, typename Policies, typename Modifiers>
struct make_primitive<
tag::stateful_tag<Policies, tag::double_, T>, Modifiers>
: detail::make_real<typename remove_const<T>::type
, Modifiers, Policies> {};
///////////////////////////////////////////////////////////////////////////
namespace detail
{
template <typename T, typename Modifiers
, typename Policies = real_policies<T> >
struct make_real_direct
{
static bool const lower =
has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
static bool const upper =
has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
typedef literal_real_generator<
T, Policies
, typename spirit::detail::get_encoding_with_case<
Modifiers, unused_type, lower || upper>::type
, typename detail::get_casetag<Modifiers, lower || upper>::type
, false
> result_type;
template <typename Terminal>
result_type operator()(Terminal const& term, unused_type) const
{
typedef tag::stateful_tag<Policies, tag::double_, T> tag_type;
using spirit::detail::get_stateful_data;
return result_type(T(fusion::at_c<0>(term.args))
, get_stateful_data<tag_type>::call(term.term));
}
};
}
template <typename Modifiers, typename A0>
struct make_primitive<
terminal_ex<tag::float_, fusion::vector1<A0> >, Modifiers>
: detail::make_real_direct<float, Modifiers> {};
template <typename Modifiers, typename A0>
struct make_primitive<
terminal_ex<tag::double_, fusion::vector1<A0> >, Modifiers>
: detail::make_real_direct<double, Modifiers> {};
template <typename Modifiers, typename A0>
struct make_primitive<
terminal_ex<tag::long_double, fusion::vector1<A0> >, Modifiers>
: detail::make_real_direct<long double, Modifiers> {};
///////////////////////////////////////////////////////////////////////////
template <typename T, typename Policies, typename A0, typename Modifiers>
struct make_primitive<
terminal_ex<tag::stateful_tag<Policies, tag::double_, T>
, fusion::vector1<A0> >
, Modifiers>
: detail::make_real_direct<typename remove_const<T>::type
, Modifiers, Policies> {};
///////////////////////////////////////////////////////////////////////////
namespace detail
{
template <typename T, typename Modifiers>
struct basic_real_literal
{
static bool const lower =
has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
static bool const upper =
has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
typedef literal_real_generator<
T, real_policies<T>
, typename spirit::detail::get_encoding_with_case<
Modifiers, unused_type, lower || upper>::type
, typename detail::get_casetag<Modifiers, lower || upper>::type
, true
> result_type;
template <typename T_>
result_type operator()(T_ i, unused_type) const
{
return result_type(T(i));
}
};
}
template <typename Modifiers>
struct make_primitive<float, Modifiers>
: detail::basic_real_literal<float, Modifiers> {};
template <typename Modifiers>
struct make_primitive<double, Modifiers>
: detail::basic_real_literal<double, Modifiers> {};
template <typename Modifiers>
struct make_primitive<long double, Modifiers>
: detail::basic_real_literal<long double, Modifiers> {};
// lit(double)
template <typename Modifiers, typename A0>
struct make_primitive<
terminal_ex<tag::lit, fusion::vector1<A0> >
, Modifiers
, typename enable_if<traits::is_real<A0> >::type>
{
static bool const lower =
has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
static bool const upper =
has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
typedef literal_real_generator<
typename remove_const<A0>::type, real_policies<A0>
, typename spirit::detail::get_encoding_with_case<
Modifiers, unused_type, lower || upper>::type
, typename detail::get_casetag<Modifiers, lower || upper>::type
, true
> result_type;
template <typename Terminal>
result_type operator()(Terminal const& term, unused_type) const
{
return result_type(fusion::at_c<0>(term.args));
}
};
}}}
#endif // defined(BOOST_SPIRIT_KARMA_REAL_FEB_26_2007_0512PM)
| 38.460352 | 107 | 0.577516 | [
"vector"
] |
cd112a81c0af1b750f9239e5109bcb2c52f09680 | 482 | cpp | C++ | leetcode/120.cpp | Moonshile/MyAlgorithmCandy | e1ab006a5abe7d2749ae564ad2bffc4a628ed31b | [
"Apache-2.0"
] | 2 | 2016-11-26T02:56:35.000Z | 2019-06-17T04:09:02.000Z | leetcode/120.cpp | Moonshile/MyAlgorithmCandy | e1ab006a5abe7d2749ae564ad2bffc4a628ed31b | [
"Apache-2.0"
] | null | null | null | leetcode/120.cpp | Moonshile/MyAlgorithmCandy | e1ab006a5abe7d2749ae564ad2bffc4a628ed31b | [
"Apache-2.0"
] | 3 | 2016-07-18T14:13:20.000Z | 2019-06-17T04:08:32.000Z | class Solution {
public:
int minimumTotal(vector<vector<int> > &triangle) {
vector<int> sums(triangle.size(), 0);
int res = 0;
for (auto &nums: triangle) {
res = INT_MAX;
for (int n = nums.size(), j = n - 1; j >= 0; --j) {
sums[j] = (j == 0 ? sums[j] : (j == n - 1 ? sums[j - 1] : min(sums[j], sums[j - 1]))) + nums[j];
res = min(res, sums[j]);
}
}
return res;
}
};
| 30.125 | 112 | 0.421162 | [
"vector"
] |
9982fd2550d7f1ce435db7c169b8bf8e56c621f2 | 16,979 | cpp | C++ | procgen/src/games/road_network.cpp | rgilman33/carlita | 74e7415aa04e11bd9cf91b11e8397d55aa9b3813 | [
"MIT"
] | null | null | null | procgen/src/games/road_network.cpp | rgilman33/carlita | 74e7415aa04e11bd9cf91b11e8397d55aa9b3813 | [
"MIT"
] | null | null | null | procgen/src/games/road_network.cpp | rgilman33/carlita | 74e7415aa04e11bd9cf91b11e8397d55aa9b3813 | [
"MIT"
] | null | null | null |
#include "../randgen.h"
#include "../basic-abstract-game.h"
#include "../assetgen.h"
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
float LANE_WIDTH = 12;
// for waypoint types
const int WP_NORMAL = 0;
const int WP_STOP_SIGN = 1;
const int WP_AVOIDING_OBSTACLE = 2;
const float OBSTACLE_PROB = 0.f;
const float STOP_SIGN_PROB = 0.0f;
class Node;
class Edge;
struct Waypoint {
float x;
float y;
int type = WP_NORMAL;
float painter_x;
float painter_y;
};
class Node {
public:
int node_id;
float m_x;
float m_y;
QPointF q_point;
Node(){}
Node(float x, float y) : m_x(x), m_y(y)
{
this->node_id = node_id;
this->q_point = QPointF(x,y);
}
};
class Edge {
public:
int m_n1;
int m_n2;
Node n1_node;
Node n2_node;
QPointF b1;
QPointF b2;
QPainterPath m_q_path;
vector<Waypoint> m_waypoints;
int edge_type = 0;
bool ends_in_stopsign = false;
bool has_obstacle = false;
pair<float,float> obstacle_location;
Edge(Node &n1, Node &n2) : m_n1 (n1.node_id), m_n2 (n2.node_id), n1_node (n1), n2_node (n2)
{
b1 = QPointF(n1.m_x, n1.m_y);
b2 = QPointF(n2.m_x, n2.m_y);
}
void create_wps ()
{
// Make waypoints as x, y coords. Half a lane width to the right of the center line
int num_waypoints = ceil(m_q_path.length() / 5.);
float wp_dist = 1./num_waypoints;
for (float i=(wp_dist*1.5); i<(1.0-(wp_dist*1.5)); i+=wp_dist) {
QPointF slightly_previous_point = m_q_path.pointAtPercent(i-(wp_dist/10.f));
QPointF q_point = m_q_path.pointAtPercent(i);
float angle = atan2((slightly_previous_point.y() - q_point.y()), (slightly_previous_point.x() - q_point.x() ));
angle += 3.14/2.;
int edge_distance = LANE_WIDTH * .75f;
float xx = q_point.x() + (edge_distance * cos(angle));
float yy = q_point.y() + (edge_distance * sin(angle));
Waypoint wp;
wp.x = xx * (50./500.);
wp.y = yy * (50./500.);
wp.painter_x = xx;
wp.painter_y = yy;
m_waypoints.push_back(wp);
}
int s = m_waypoints.size();
if (ends_in_stopsign) {
if (s > 10) {
for (int i=4; i < 6; i++) {
m_waypoints.at(s-i).type = WP_STOP_SIGN;
}
} else {
ends_in_stopsign = false;
}
}
if (has_obstacle) {
if (s > 14) {
obstacle_location.first = m_waypoints.at(8).painter_x;
obstacle_location.second = m_waypoints.at(8).painter_y;
for (int i=10; i > 8; i--) {
Waypoint prev_wp = m_waypoints.at(i-1);
m_waypoints.at(i).type = WP_AVOIDING_OBSTACLE;
float angle = atan2(prev_wp.painter_y-m_waypoints.at(i).painter_y, prev_wp.painter_x-m_waypoints.at(i).painter_x);
angle -= 3.14/2.;
float avoid_dist = LANE_WIDTH * 1.6;
m_waypoints.at(i).painter_x = m_waypoints.at(i).painter_x + avoid_dist*cos(angle);
m_waypoints.at(i).painter_y = m_waypoints.at(i).painter_y + avoid_dist*sin(angle);
m_waypoints.at(i).x = m_waypoints.at(i).painter_x * (50./500.);
m_waypoints.at(i).y = m_waypoints.at(i).painter_y * (50./500.);
}
} else {
has_obstacle = false;
}
}
}
};
class RoadNetwork {
public:
vector<Node> nodes;
vector<Edge> edges;
int node_id_counter = 0; // This must always be perfectly incremented. Brittle.
RandGen rand_gen;
float width = 500.0f;
float height = 500.0f;
float MIN_INTERSECTION_ANGLE = 80.f; //60.0f;
float BASE_EDGE_DISTANCE = width / 8.0f;
float MIN_MERGE_DISTANCE = BASE_EDGE_DISTANCE * 1.8f;
float MIN_ALLOWABLE_DIST = BASE_EDGE_DISTANCE * 1.f;
float MARGIN = width / 20.f;
int NUM_GROW_ITERS = 200;
QColor road_color;
QColor sidewalk_color;
RoadNetwork () {}
RoadNetwork (RandGen & rand_gen_in, QColor road_color_in, QColor sidewalk_color_in)
: rand_gen (rand_gen_in), road_color (road_color_in), sidewalk_color (sidewalk_color_in)
{}
int add_node(Node &node)
{
node.node_id = node_id_counter;
nodes.push_back(node);
node_id_counter += 1;
return node.node_id;
}
void add_edge(Edge &edge)
{
edges.push_back(edge);
}
vector<int> get_neighboring_nodes (Node &n)
{
vector<int> neighboring_nodes;
for (Edge &e : edges) {
if (e.m_n1==n.node_id){
int mn2 = e.m_n2;
neighboring_nodes.push_back(mn2);
} else if (e.m_n2==n.node_id) {
int mn1 = e.m_n1;
if (mn1 < 0 | mn1 > INT16_MAX) {
std::cout<<"What the hell impossible node id";
} else {
neighboring_nodes.push_back(mn1);
}
}
}
return neighboring_nodes;
}
int GetAngleABC( Node &a, Node &b, Node &c )
{
pair<float,float> ab;// = { b.x - a.x, b.y - a.y };
ab.first = b.m_x - a.m_x;
ab.second = b.m_y - a.m_y;
pair<float,float> cb; //= { b.x - c.x, b.y - c.y };
cb.first = b.m_x - c.m_x;
cb.second = b.m_y - c.m_y;
float dot = (ab.first * cb.first + ab.second * cb.second); // dot product
float cross = (ab.first * cb.second - ab.second * cb.first); // cross product
float alpha = atan2(cross, dot);
float angle = (int) abs(floor(alpha * 180. / 3.14159 + 0.5));
return angle;
}
float get_distance(Node &n1, Node &n2)
{
float dx = n1.m_x - n2.m_x;
float dy = n1.m_y - n2.m_y;
return sqrt(dx*dx + dy*dy);
}
float det(float dx1, float dx2, float dy1, float dy2)
{
return (dx1 * dy2) - (dy1 * dx2);
}
bool isIntersecting(Node& p1, Node& p2, Node& q1, Node& q2) {
return (((q1.m_x-p1.m_x)*(p2.m_y-p1.m_y) - (q1.m_y-p1.m_y)*(p2.m_x-p1.m_x))
* ((q2.m_x-p1.m_x)*(p2.m_y-p1.m_y) - (q2.m_y-p1.m_y)*(p2.m_x-p1.m_x)) < 0)
&&
(((p1.m_x-q1.m_x)*(q2.m_y-q1.m_y) - (p1.m_y-q1.m_y)*(q2.m_x-q1.m_x))
* ((p2.m_x-q1.m_x)*(q2.m_y-q1.m_y) - (p2.m_y-q1.m_y)*(q2.m_x-q1.m_x)) < 0);
}
bool intersects_existing_edge(Node &n1, Node &n2)
{
for (Edge &e : edges) {
// If edges share a node, don't compare bc don't want 'intersection' flagged at join point
// TODO is this doing anything
if (e.m_n1==n1.node_id || e.m_n2==n1.node_id){continue;}
int n3_id = e.m_n1;
int n4_id = e.m_n2;
// TODO why the hell would this ever happen? Happens every blue moon, which is too often... Hack to allow continuing dev
if (n3_id < 0 || n4_id < 0) {
cout << " what the hell unrealistic node id! ";
return true;
}
Node &n3 = get_node(n3_id);
Node &n4 = get_node(n4_id); // THIS DOESN"T WORK. IX != ID.
if (isIntersecting(n1, n2, n3, n4)) {
return true;
}
}
return false;
}
bool angle_too_small(Node &n1, Node &n2)
// the first angle is the ref
{
vector<int> neighboring_nodes = get_neighboring_nodes(n1);
for (int node_id : neighboring_nodes) { // TODO these should also be incoming
if (node_id==n2.node_id) {continue;}
if (node_id<0){
cout << " what the hell unrealistic node id! ";
return true;
}
Node o = get_node(node_id);
float a = GetAngleABC(n2, n1, o);
if (a < MIN_INTERSECTION_ANGLE) {
return true;
}
}
return false;
}
bool outside_bounds(float x, float y) {
return x < MARGIN || x > width-MARGIN || y < MARGIN || y > height-MARGIN;
}
void trim_danglers() {
// Get rid of reverse edges or duplicates. DOESN"T DO ANYTHING
for (int i = edges.size()-1; i >= 0; i--) {
Edge &e = edges.at(i);
for (int ii = i-1; ii>=0; ii--) {
Edge &o = edges.at(ii);
if ((e.m_n1==o.m_n2 && e.m_n2==o.m_n1) || (e.m_n1==o.m_n1 && e.m_n2==o.m_n2)) {
edges.erase(edges.begin()+i);
//cout<<"found double edge";
break;
}
}
}
// This chunk breaks it. Removes necessary nodes somehow.
// // Get rid of duplicate nodes. DOESN"T DO ANYTHING CURRENTLY
// for (int i = nodes.size()-1; i >= 0; i--) {
// Node &n = nodes[i];
// for (int ii = i-1; ii>=0; ii--) {
// Node &o = nodes[ii];
// if (round(n.m_x)==round(o.m_x) && round(n.m_y)==round(o.m_y)) {
// nodes.erase(nodes.begin()+i);
// cout<<"found double NODE";
// break;
// }
// }
// }
int TRIM_ITERS = 100;
for (int _ = 0; _ < TRIM_ITERS; _++) {
// Get rid of dangling nodes
vector<int> removed_nodes;
for (int i = nodes.size()-1; i >= 0; i--) {
if (get_neighboring_nodes(nodes.at(i)).size()==1) {
removed_nodes.push_back(nodes.at(i).node_id);
nodes.erase(nodes.begin()+i);
}
}
// Get rid of edges w no node
for (int i = edges.size()-1; i >= 0; i--) {
Edge &e = edges[i];
if ((std::find(removed_nodes.begin(), removed_nodes.end(), e.m_n2) != removed_nodes.end()) ||
(std::find(removed_nodes.begin(), removed_nodes.end(), e.m_n1) != removed_nodes.end())) {
edges.erase(edges.begin()+i);
}
}
}
}
void generate_network()
{
nodes.clear();
edges.clear();
edges.reserve(10000);
nodes.reserve(10000); // this appears to solve a bug? was getting segfault few lines below when adding first edge to edges. Only sometimes.
node_id_counter = 0;
// Initial spine
//rand_gen.seed(345);
Node n1 = Node(MARGIN, MARGIN);
int n1_id = add_node(n1);
Node n2 = Node(MARGIN+BASE_EDGE_DISTANCE, MARGIN+BASE_EDGE_DISTANCE);
int n2_id = add_node(n2);
Edge e = Edge(n1, n2);
add_edge(e);
float angle = atan2((n2.m_y - n1.m_y), (n2.m_x - n1.m_x));
int n_spine_iters = 10;
for (int i; i<n_spine_iters; i++){
//angle *= rand_gen.randrange(.8f, 1.2f);
int edge_distance = rand_gen.randint(BASE_EDGE_DISTANCE, BASE_EDGE_DISTANCE*1.5);
float xx = n2.m_x + (edge_distance * cos(angle));
float yy = n2.m_y + (edge_distance * sin(angle));
Node n3 = Node(xx, yy);
int n3_id = add_node(n3);
Edge e = Edge(n2, n3);
add_edge(e);
n2 = n3;
}
//////////////////////////////////
// Growing segments off the spine
for (int i=0; i<NUM_GROW_ITERS; i++){
Node &n4 = nodes.at(rand_gen.randn(nodes.size()));
float angle = rand_gen.randrange(.0f, 6.28f);
int edge_distance = rand_gen.randint(BASE_EDGE_DISTANCE, BASE_EDGE_DISTANCE*1.5);
float xx = n4.m_x + (edge_distance * cos(angle));
float yy = n4.m_y + (edge_distance * sin(angle));
if (outside_bounds(xx,yy)) { continue; }
Node n5 = Node(xx, yy); // the proposed node
if (angle_too_small(n4,n5)) { continue; }
if (intersects_existing_edge(n4,n5)) { continue; }
int n5_id = add_node(n5);
Edge e = Edge(n4,n5);
add_edge(e);
int n_gen_iters = 2;
for (int ii=0; ii<n_gen_iters; ii++){
angle *= rand_gen.randrange(.8f, 1.2f);
int edge_distance = rand_gen.randint(BASE_EDGE_DISTANCE, BASE_EDGE_DISTANCE*1.5);
float xx = n5.m_x + (edge_distance * cos(angle));
float yy = n5.m_y + (edge_distance * sin(angle));
Node candidate_node = Node(xx,yy);
if (outside_bounds(xx,yy)) { continue; }
Node n6; // Remember this will be a copy of the node, can't do anything TO it
// If there is a close node, use it. If not, create new one
vector<int> close_nodes;
bool using_existing_node = false;
for (Node & o : nodes) {
float dist = get_distance(candidate_node, o);
if (dist < MIN_MERGE_DISTANCE) {
close_nodes.push_back(o.node_id);
}
}
if (close_nodes.size() > 0){
// If close node, check to see if makes an acceptable angle
int ix = close_nodes.at(rand_gen.randn(close_nodes.size()));
n6 = nodes.at(ix);
using_existing_node = true;
if (angle_too_small(n6, n5) || angle_too_small(n5, n6)) { continue; }
} else {
// No close node found, using the newly created one
n6 = candidate_node;
}
// We now have our candidate node but nothing has been added officially to the road network
// Run the gauntlet of tests to see if new node will be used
// If has overlap w another edge, skip iter
if (intersects_existing_edge(n5, n6)) { continue; }
if (get_distance(n5,n6) < MIN_ALLOWABLE_DIST) { continue; }
// Passed the gauntlet! Add the node and edge to the network
// Register new node if that's the one we're using
if (!using_existing_node) {
add_node(n6);
}
Edge e = Edge(n5,n6);
add_edge(e);
n5 = n6;
}
}
trim_danglers();
// Prep edges for curviness
for (Node &n : nodes) {
vector<int> o = get_neighboring_nodes(n);
if (o.size()==2) {
Node e2_end_node = get_node(o.at(1));
Edge &e1 = get_edge(n.node_id, o.at(0));
Edge &e2 = get_edge(n.node_id, e2_end_node.node_id);
e1.edge_type = 1;
float angle = atan2((n.m_y - e2_end_node.m_y), (n.m_x - e2_end_node.m_x));
int b_dist = 20;
float xx = n.m_x + (b_dist * cos(angle));
float yy = n.m_y + (b_dist * sin(angle));
e1.b2 = QPointF(xx, yy); // TODO do we need to check whether to alter b1 or b2?
}
}
add_opposite_direction_edges_for_all();
// Create paths
for (Edge &e : edges) {
e.m_q_path.moveTo(e.n1_node.q_point);
e.m_q_path.cubicTo(e.b1, e.b2, e.n2_node.q_point);
}
for (Edge &e : edges) {
Node end_node = get_node(e.m_n2);
int num_outgoing_edges = get_neighboring_nodes(end_node).size();
if (num_outgoing_edges > 4) { // 4 bc edges are reversed and added again. Actually is two.
e.ends_in_stopsign = rand_gen.randrange(0.,1.) > (1.-STOP_SIGN_PROB);
} else {
e.has_obstacle = rand_gen.randrange(0.,1.) > (1.-OBSTACLE_PROB);
}
}
// Calculate waypoints
for (Edge &e : edges) {
e.create_wps();
}
}
void draw (QPainter &painter)
{
QColor color = road_color; //QColor(rand_gen.randint(200,255), rand_gen.randint(200, 255), rand_gen.randint(200, 255));
// Sidewalk / shoulder
painter.save();
painter.setPen(QPen(sidewalk_color, LANE_WIDTH*2*2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
for (Edge &e : edges) {
painter.drawPath(e.m_q_path);
}
painter.restore();
painter.save();
painter.setOpacity(1.0);
for (Edge &e : edges) {
//QColor color = QColor("Green");
painter.setPen(QPen(color, LANE_WIDTH*2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
painter.drawPath(e.m_q_path);
}
painter.restore();
painter.save();
for (Edge &e : edges) {
// Stopsigns
//painter.setBrush(QColor(200, 10, 10));
// int s = e.m_waypoints.size();
// if (e.ends_in_stopsign && s > 10) {
// painter.setPen(QPen(QColor(200, 10, 10), LANE_WIDTH/2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
// Waypoint wp_1 = e.m_waypoints.at(s - 8);
// Waypoint wp_2 = e.m_waypoints.at(s - 5);
// painter.drawLine(wp_1.painter_x, wp_1.painter_y, wp_2.painter_x, wp_2.painter_y);
// }
vector<Waypoint> wps = e.m_waypoints;
for (Waypoint & wp : wps) {
if (wp.type==WP_STOP_SIGN){
painter.setPen(QPen(QColor(200, 10, 10), LANE_WIDTH/2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
painter.drawPoint(wp.painter_x, wp.painter_y);
}
// Obstacles
// else if (wp.type==WP_AVOIDING_OBSTACLE) {
// painter.setPen(QPen(QColor(0, 10, 100), LANE_WIDTH/2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
// painter.drawPoint(wp.painter_x, wp.painter_y);
// }
}
if (e.has_obstacle) {
painter.setPen(QPen(QColor(200, 10, 50), LANE_WIDTH/2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
painter.drawPoint(e.obstacle_location.first, e.obstacle_location.second);
}
}
painter.restore();
// center line
color = QColor(std::max(road_color.red()-10, 0), std::max(road_color.green()-10, 0), std::max(road_color.blue()-10, 0));
painter.setPen(QPen(color, 1, Qt::DashLine, Qt::FlatCap, Qt::MiterJoin));
for (Edge &e : edges) {
painter.drawPath(e.m_q_path);
}
}
vector<Edge> get_outgoing_edges(int node_id)
{
vector<Edge> outgoing_edges;
for (Edge & e : edges) {
if (e.m_n1 == node_id) {
outgoing_edges.push_back(e);
}
}
return outgoing_edges;
}
void add_opposite_direction_edges_for_all()
{
for (int i = edges.size()-1; i >= 0; i--) {
Edge &e = edges.at(i);
Edge reversed_edge = Edge(get_node(e.m_n2), get_node(e.m_n1));
reversed_edge.b1 = e.b2;
reversed_edge.b2 = e.b1;
add_edge(reversed_edge);
}
}
Node& get_node(int node_id)
{
for (Node &n : nodes) {
if (n.node_id==node_id) {
return n;
}
}
// flag if nothing returned
std::cout << "no node?";
//return nodes.at(0);
}
Edge& get_edge(int node_id_1, int node_id_2)
// doesn't matter which order give node ids
{
for (Edge &e : edges) {
if ((e.m_n1==node_id_1 && e.m_n2==node_id_2) || (e.m_n1==node_id_2 && e.m_n2==node_id_1)) {
return e;
}
}
// flag if nothing returned
}
vector<Waypoint> get_more_wps (int& last_node_id, int ¤t_route_end_node_id)
{
vector<Edge> upcoming_candidate_edges = get_outgoing_edges(current_route_end_node_id);
// flag if none
if (upcoming_candidate_edges.size()>1) {
for (int i = upcoming_candidate_edges.size()-1; i >=0; i--) {
if (upcoming_candidate_edges.at(i).m_n2==last_node_id){
upcoming_candidate_edges.erase(upcoming_candidate_edges.begin()+i);
}
}
}
Edge edge = upcoming_candidate_edges.at(rand_gen.randn(upcoming_candidate_edges.size()));
last_node_id = current_route_end_node_id;
current_route_end_node_id = edge.m_n2;
return edge.m_waypoints;
}
}; | 27.123003 | 142 | 0.632016 | [
"vector"
] |
998a8db8e513d2c36b212df379aa288e8625eea5 | 4,369 | cpp | C++ | vtsd/src/vtsd/delivery/vts/tdt2vts/convertors.cpp | Melown/vts-vtsd | b3fd26d91791ceb68e51a97b456f97ae1cade550 | [
"BSD-2-Clause"
] | 4 | 2017-07-04T09:14:57.000Z | 2018-12-05T21:40:02.000Z | vtsd/src/vtsd/delivery/vts/tdt2vts/convertors.cpp | melowntech/vts-vtsd | 126f10f453dd2f235c43d3c1e4464a3acf911742 | [
"BSD-2-Clause"
] | 5 | 2020-03-03T00:27:43.000Z | 2021-08-18T09:30:34.000Z | vtsd/src/vtsd/delivery/vts/tdt2vts/convertors.cpp | Melown/vts-vtsd | b3fd26d91791ceb68e51a97b456f97ae1cade550 | [
"BSD-2-Clause"
] | 1 | 2019-09-26T06:25:57.000Z | 2019-09-26T06:25:57.000Z | /**
* Copyright (c) 2021 Melown Technologies SE
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "dbglog/dbglog.hpp"
#include "3dtiles/support.hpp"
#include "../../../error.hpp"
#include "convertors.hpp"
namespace vts = vtslibs::vts;
namespace vr = vtslibs::registry;
namespace vts2tdt {
PerThreadConvertors::PerThreadConvertors(const vr::ReferenceFrame &rf)
: physical_(rf.model.physicalSrs)
, boundingVolume_(Convertors::BoundingVolume::box)
{
const auto physical(vr::system.srs.get(rf.model.physicalSrs));
// we need to have physical->region system
srsSet_.insert(rf.model.physicalSrs);
for (const auto &item : rf.division.nodes) {
const auto &node(item.second);
if (!node.real()) { continue; }
srsSet_.insert(node.srs);
}
const auto *body = vr::system.bodies.get(rf.body);
if (body && body->srs) {
// this applies only to Earth (or any body that uses WGS84)
if (body->srs->flags.count("wgs84")) {
boundingVolumeSrs_ = threedtiles::Wgs84Rad;
boundingVolume_ = Convertors::BoundingVolume::region;
}
// this RF is mapped to a celestial body with valid SRS definition
if (body->srs->geocentric != physical_) {
// we need to convert meshes when physical system is different from
// world's geocentric (cartesian) system
world_ = vr::system.srs.get(body->srs->geocentric).srsDef;
}
} else {
// generic body, convert meshes if world is not cartesian system
if (physical.type != vr::Srs::Type::cartesian) {
world_ = geo::geocentric(physical.srsDef);
}
}
if (boundingVolumeSrs_.empty()) {
// we did not set bounding volume properly, use world system
if (world_.empty()) {
// we use physical system as world
boundingVolumeSrs_ = physical.srsDef;
} else {
// we have special world system
boundingVolumeSrs_ = world_;
}
}
}
Convertors PerThreadConvertors::get()
const
{
if (auto csMap = csMap_.get()) { return { csMap, boundingVolume_ }; }
// new thread -> initialize mapping
auto csMap(new CsMap());
csMap_.reset(csMap);
if (world_.srs.empty()) {
// world is in model physical system -> no conversion
csMap->insert(CsMap::value_type());
} else {
// needs conversion
csMap->insert
(CsMap::value_type({}, vts::CsConvertor(physical_, world_)));
}
// we can use Region bounding volumes
for (const auto &srs : srsSet_) {
csMap->insert
(CsMap::value_type
(srs, vts::CsConvertor(srs, boundingVolumeSrs_)));
}
return { csMap, boundingVolume_ };
}
const vts::CsConvertor& Convertors::get(const std::string &srsId) const
{
// lookup
auto fcsMap(csMap_->find(srsId));
if (fcsMap == csMap_->end()) {
LOGTHROW(err2, Error)
<< "vts2tdt: Convertor from <" << srsId << "> not found.";
}
return fcsMap->second;
}
} // namespace vts2tdt
| 34.401575 | 79 | 0.657359 | [
"model"
] |
9990caaa61b6f38c0495f82a1cdac2afb36fbd7b | 162,956 | cpp | C++ | renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp | yangzhengxing/renderdoc | 214450227ea96df0b2b079632b1f20e23a3fd8fe | [
"MIT"
] | null | null | null | renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp | yangzhengxing/renderdoc | 214450227ea96df0b2b079632b1f20e23a3fd8fe | [
"MIT"
] | null | null | null | renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp | yangzhengxing/renderdoc | 214450227ea96df0b2b079632b1f20e23a3fd8fe | [
"MIT"
] | null | null | null | /******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015-2017 Baldur Karlsson
* Copyright (c) 2014 Crytek
*
* 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 "../gl_driver.h"
#include "3rdparty/tinyfiledialogs/tinyfiledialogs.h"
#include "common/common.h"
#include "serialise/string_utils.h"
#pragma region Buffers
bool WrappedOpenGL::Serialise_glGenBuffers(GLsizei n, GLuint *buffers)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(BufferRes(GetCtx(), *buffers)));
if(m_State == READING)
{
GLuint real = 0;
m_Real.glGenBuffers(1, &real);
GLResource res = BufferRes(GetCtx(), real);
ResourceId live = m_ResourceManager->RegisterResource(res);
GetResourceManager()->AddLiveResource(id, res);
m_Buffers[live].resource = res;
m_Buffers[live].curType = eGL_NONE;
}
return true;
}
void WrappedOpenGL::glGenBuffers(GLsizei n, GLuint *buffers)
{
m_Real.glGenBuffers(n, buffers);
for(GLsizei i = 0; i < n; i++)
{
GLResource res = BufferRes(GetCtx(), buffers[i]);
ResourceId id = GetResourceManager()->RegisterResource(res);
if(m_State >= WRITING)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(GEN_BUFFER);
Serialise_glGenBuffers(1, buffers + i);
chunk = scope.Get();
}
GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
RDCASSERT(record);
record->AddChunk(chunk);
}
else
{
GetResourceManager()->AddLiveResource(id, res);
m_Buffers[id].resource = res;
m_Buffers[id].curType = eGL_NONE;
}
}
}
bool WrappedOpenGL::Serialise_glCreateBuffers(GLsizei n, GLuint *buffers)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(BufferRes(GetCtx(), *buffers)));
if(m_State == READING)
{
GLuint real = 0;
m_Real.glCreateBuffers(1, &real);
GLResource res = BufferRes(GetCtx(), real);
ResourceId live = m_ResourceManager->RegisterResource(res);
GetResourceManager()->AddLiveResource(id, res);
m_Buffers[live].resource = res;
m_Buffers[live].curType = eGL_NONE;
}
return true;
}
void WrappedOpenGL::glCreateBuffers(GLsizei n, GLuint *buffers)
{
m_Real.glCreateBuffers(n, buffers);
for(GLsizei i = 0; i < n; i++)
{
GLResource res = BufferRes(GetCtx(), buffers[i]);
ResourceId id = GetResourceManager()->RegisterResource(res);
if(m_State >= WRITING)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(CREATE_BUFFER);
Serialise_glCreateBuffers(1, buffers + i);
chunk = scope.Get();
}
GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
RDCASSERT(record);
record->AddChunk(chunk);
}
else
{
GetResourceManager()->AddLiveResource(id, res);
m_Buffers[id].resource = res;
m_Buffers[id].curType = eGL_NONE;
}
}
}
bool WrappedOpenGL::Serialise_glBindBuffer(GLenum target, GLuint buffer)
{
SERIALISE_ELEMENT(GLenum, Target, target);
SERIALISE_ELEMENT(ResourceId, Id, (buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer))
: ResourceId()));
if(m_State >= WRITING)
{
if(Id != ResourceId())
GetResourceManager()->GetResourceRecord(Id)->datatype = Target;
}
else if(m_State < WRITING)
{
if(Target == eGL_NONE)
{
// ...
}
else if(Id == ResourceId())
{
m_Real.glBindBuffer(Target, 0);
}
else
{
// if we're just reading, make sure not to trample state (e.g. element array buffer
// binding in a VAO), since this is just a bind-to-create chunk.
GLuint prevbuf = 0;
if(m_State == READING && m_CurEventID == 0 && Target != eGL_NONE)
m_Real.glGetIntegerv(BufferBinding(Target), (GLint *)&prevbuf);
GLResource res = GetResourceManager()->GetLiveResource(Id);
m_Real.glBindBuffer(Target, res.name);
m_Buffers[GetResourceManager()->GetLiveID(Id)].curType = Target;
if(m_State == READING && m_CurEventID == 0 && Target != eGL_NONE)
m_Real.glBindBuffer(Target, prevbuf);
}
}
return true;
}
void WrappedOpenGL::glBindBuffer(GLenum target, GLuint buffer)
{
m_Real.glBindBuffer(target, buffer);
ContextData &cd = GetCtxData();
size_t idx = BufferIdx(target);
if(m_State == WRITING_CAPFRAME)
{
Chunk *chunk = NULL;
if(buffer == 0)
cd.m_BufferRecord[idx] = NULL;
else
cd.m_BufferRecord[idx] = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(target, buffer);
chunk = scope.Get();
}
if(buffer)
{
FrameRefType refType = eFrameRef_Read;
// these targets write to the buffer
if(target == eGL_ATOMIC_COUNTER_BUFFER || target == eGL_COPY_WRITE_BUFFER ||
target == eGL_PIXEL_PACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_TRANSFORM_FEEDBACK_BUFFER)
refType = eFrameRef_ReadBeforeWrite;
GetResourceManager()->MarkResourceFrameReferenced(cd.m_BufferRecord[idx]->GetResourceID(),
refType);
}
m_ContextRecord->AddChunk(chunk);
}
if(buffer == 0)
{
cd.m_BufferRecord[idx] = NULL;
return;
}
if(m_State >= WRITING)
{
GLResourceRecord *r = cd.m_BufferRecord[idx] =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
if(!r)
{
RDCERR("Invalid/unrecognised buffer passed: glBindBuffer(%s, %u)", ToStr::Get(target).c_str(),
buffer);
return;
}
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
if(r->datatype != target)
{
Chunk *chunk = NULL;
r->LockChunks();
for(;;)
{
Chunk *end = r->GetLastChunk();
if(end->GetChunkType() == BIND_BUFFER)
{
SAFE_DELETE(end);
r->PopChunk();
continue;
}
break;
}
r->UnlockChunks();
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(target, buffer);
chunk = scope.Get();
}
r->AddChunk(chunk);
}
// element array buffer binding is vertex array record state, record there (if we've not just
// stopped)
if(m_State == WRITING_IDLE && target == eGL_ELEMENT_ARRAY_BUFFER &&
RecordUpdateCheck(cd.m_VertexArrayRecord))
{
GLuint vao = cd.m_VertexArrayRecord->Resource.name;
// use glVertexArrayElementBuffer to ensure the vertex array is bound when we bind the
// element buffer
SCOPED_SERIALISE_CONTEXT(VAO_ELEMENT_BUFFER);
Serialise_glVertexArrayElementBuffer(vao, buffer);
cd.m_VertexArrayRecord->AddChunk(scope.Get());
}
// store as transform feedback record state
if(m_State == WRITING_IDLE && target == eGL_TRANSFORM_FEEDBACK_BUFFER &&
RecordUpdateCheck(cd.m_FeedbackRecord))
{
GLuint feedback = cd.m_FeedbackRecord->Resource.name;
// use glTransformFeedbackBufferBase to ensure the feedback object is bound when we bind the
// buffer
SCOPED_SERIALISE_CONTEXT(FEEDBACK_BUFFER_BASE);
Serialise_glTransformFeedbackBufferBase(feedback, 0, buffer);
cd.m_FeedbackRecord->AddChunk(scope.Get());
}
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
if(target == eGL_TRANSFORM_FEEDBACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_ATOMIC_COUNTER_BUFFER)
{
if(m_State == WRITING_IDLE)
GetResourceManager()->MarkDirtyResource(r->GetResourceID());
else
m_MissingTracks.insert(r->GetResourceID());
}
}
else
{
m_Buffers[GetResourceManager()->GetID(BufferRes(GetCtx(), buffer))].curType = target;
}
}
bool WrappedOpenGL::Serialise_glNamedBufferStorageEXT(GLuint buffer, GLsizeiptr size,
const void *data, GLbitfield flags)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
SERIALISE_ELEMENT(uint64_t, Bytesize, (uint64_t)size);
// for satisfying GL_MIN_MAP_BUFFER_ALIGNMENT
m_pSerialiser->AlignNextBuffer(64);
SERIALISE_ELEMENT_BUF(byte *, bytes, data, (size_t)Bytesize);
uint64_t offs = m_pSerialiser->GetOffset();
SERIALISE_ELEMENT(uint32_t, Flags, flags);
if(m_State < WRITING)
{
// remove persistent flag - we will never persistently map so this is a nice
// hint. It helps especially when self-hosting, as we don't want tons of
// overhead added when we won't use it.
Flags &= ~GL_MAP_PERSISTENT_BIT;
// can't have coherent without persistent, so remove as well
Flags &= ~GL_MAP_COHERENT_BIT;
GLResource res = GetResourceManager()->GetLiveResource(id);
m_Real.glNamedBufferStorageEXT(res.name, (GLsizeiptr)Bytesize, bytes, Flags);
m_Buffers[GetResourceManager()->GetLiveID(id)].size = Bytesize;
SAFE_DELETE_ARRAY(bytes);
}
else if(m_State >= WRITING)
{
GetResourceManager()->GetResourceRecord(id)->SetDataOffset(offs - Bytesize);
}
return true;
}
void WrappedOpenGL::Common_glNamedBufferStorageEXT(ResourceId id, GLsizeiptr size, const void *data,
GLbitfield flags)
{
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(id);
RDCASSERTMSG("Couldn't identify object used in function. Unbound or bad GLuint?", record);
if(record == NULL)
return;
SCOPED_SERIALISE_CONTEXT(BUFFERSTORAGE);
Serialise_glNamedBufferStorageEXT(record->Resource.name, size, data, flags);
Chunk *chunk = scope.Get();
{
record->AddChunk(chunk);
record->SetDataPtr(chunk->GetData());
record->Length = (int32_t)size;
record->DataInSerialiser = true;
}
// We immediately map the whole range with appropriate flags, to be copied into whenever we
// need to propogate changes. Note: Coherent buffers are not mapped coherent, but this is
// because the user code isn't writing into them anyway and we're inserting invisible sync
// points - so there's no need for it to be coherently mapped (and there's no requirement
// that a buffer declared as coherent must ALWAYS be mapped as coherent).
if(flags & GL_MAP_PERSISTENT_BIT)
{
record->Map.persistentPtr = (byte *)m_Real.glMapNamedBufferRangeEXT(
record->Resource.name, 0, size,
GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT);
RDCASSERT(record->Map.persistentPtr);
// persistent maps always need both sets of shadow storage, so allocate up front.
record->AllocShadowStorage(size);
// ensure shadow pointers have up to date data for diffing
memcpy(record->GetShadowPtr(0), data, size);
memcpy(record->GetShadowPtr(1), data, size);
}
}
else
{
m_Buffers[id].size = size;
}
}
void WrappedOpenGL::glNamedBufferStorageEXT(GLuint buffer, GLsizeiptr size, const void *data,
GLbitfield flags)
{
byte *dummy = NULL;
if(m_State >= WRITING && data == NULL)
{
dummy = new byte[size];
memset(dummy, 0xdd, size);
data = dummy;
}
m_Real.glNamedBufferStorageEXT(buffer, size, data, flags);
Common_glNamedBufferStorageEXT(GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)), size,
data, flags);
SAFE_DELETE_ARRAY(dummy);
}
void WrappedOpenGL::glNamedBufferStorage(GLuint buffer, GLsizeiptr size, const void *data,
GLbitfield flags)
{
// only difference to EXT function is size parameter, so just upcast
glNamedBufferStorageEXT(buffer, size, data, flags);
}
void WrappedOpenGL::glBufferStorage(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags)
{
byte *dummy = NULL;
if(m_State >= WRITING && data == NULL)
{
dummy = new byte[size];
memset(dummy, 0xdd, size);
data = dummy;
}
m_Real.glBufferStorage(target, size, data, flags);
if(m_State >= WRITING)
Common_glNamedBufferStorageEXT(GetCtxData().m_BufferRecord[BufferIdx(target)]->GetResourceID(),
size, data, flags);
else
RDCERR("Internal buffers should be allocated via dsa interfaces");
SAFE_DELETE_ARRAY(dummy);
}
bool WrappedOpenGL::Serialise_glNamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const void *data,
GLenum usage)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
SERIALISE_ELEMENT(uint64_t, Bytesize, (uint64_t)size);
// for satisfying GL_MIN_MAP_BUFFER_ALIGNMENT
m_pSerialiser->AlignNextBuffer(64);
SERIALISE_ELEMENT_BUF(byte *, bytes, data, (size_t)Bytesize);
uint64_t offs = m_pSerialiser->GetOffset();
SERIALISE_ELEMENT(GLenum, Usage, usage);
if(m_State < WRITING)
{
GLResource res = GetResourceManager()->GetLiveResource(id);
m_Real.glNamedBufferDataEXT(res.name, (GLsizeiptr)Bytesize, bytes, Usage);
m_Buffers[GetResourceManager()->GetLiveID(id)].size = Bytesize;
SAFE_DELETE_ARRAY(bytes);
}
else if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(id);
record->DataInSerialiser = true;
record->SetDataOffset(offs - Bytesize);
}
return true;
}
void WrappedOpenGL::glNamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const void *data,
GLenum usage)
{
byte *dummy = NULL;
if(m_State >= WRITING && data == NULL)
{
dummy = new byte[size];
memset(dummy, 0xdd, size);
data = dummy;
}
m_Real.glNamedBufferDataEXT(buffer, size, data, usage);
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
RDCASSERTMSG("Couldn't identify object passed to function. Mismatched or bad GLuint?", record,
buffer);
if(record == NULL)
return;
// detect buffer orphaning and just update backing store
if(m_State == WRITING_IDLE && record->HasDataPtr() && size == (GLsizeiptr)record->Length &&
usage == record->usage)
{
if(data)
memcpy(record->GetDataPtr(), data, (size_t)size);
else
memset(record->GetDataPtr(), 0xbe, (size_t)size);
SAFE_DELETE_ARRAY(dummy);
return;
}
// if we're recreating the buffer, clear the record and add new chunks. Normally
// we would just mark this record as dirty and pick it up on the capture frame as initial
// data, but we don't support (if it's even possible) querying out size etc.
// we need to add only the chunks required - glGenBuffers, glBindBuffer to current target,
// and this buffer storage. All other chunks have no effect
if(m_State == WRITING_IDLE &&
(record->HasDataPtr() || (record->Length > 0 && size != (GLsizeiptr)record->Length)))
{
// we need to maintain chunk ordering, so fetch the first two chunk IDs.
// We should have at least two by this point - glGenBuffers and whatever gave the record
// a size before.
RDCASSERT(record->NumChunks() >= 2);
// remove all but the first two chunks
while(record->NumChunks() > 2)
{
Chunk *c = record->GetLastChunk();
SAFE_DELETE(c);
record->PopChunk();
}
int32_t id2 = record->GetLastChunkID();
{
Chunk *c = record->GetLastChunk();
SAFE_DELETE(c);
record->PopChunk();
}
int32_t id1 = record->GetLastChunkID();
{
Chunk *c = record->GetLastChunk();
SAFE_DELETE(c);
record->PopChunk();
}
RDCASSERT(!record->HasChunks());
// add glGenBuffers chunk
{
SCOPED_SERIALISE_CONTEXT(GEN_BUFFER);
Serialise_glGenBuffers(1, &buffer);
record->AddChunk(scope.Get(), id1);
}
// add glBindBuffer chunk
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(record->datatype, buffer);
record->AddChunk(scope.Get(), id2);
}
// we're about to add the buffer data chunk
}
SCOPED_SERIALISE_CONTEXT(BUFFERDATA);
Serialise_glNamedBufferDataEXT(buffer, size, data, usage);
Chunk *chunk = scope.Get();
// if we've already created this is a renaming/data updating call. It should go in
// the frame record so we can 'update' the buffer as it goes in the frame.
// if we haven't created the buffer at all, it could be a mid-frame create and we
// should place it in the resource record, to happen before the frame.
if(m_State == WRITING_CAPFRAME && record->HasDataPtr())
{
// we could perhaps substitute this for a 'fake' glBufferSubData chunk?
m_ContextRecord->AddChunk(chunk);
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(), eFrameRef_Write);
}
else
{
record->AddChunk(chunk);
record->SetDataPtr(chunk->GetData());
record->Length = (int32_t)size;
record->usage = usage;
record->DataInSerialiser = true;
}
}
else
{
m_Buffers[GetResourceManager()->GetID(BufferRes(GetCtx(), buffer))].size = size;
}
SAFE_DELETE_ARRAY(dummy);
}
void WrappedOpenGL::glNamedBufferData(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage)
{
// only difference to EXT function is size parameter, so just upcast
glNamedBufferDataEXT(buffer, size, data, usage);
}
void WrappedOpenGL::glBufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
{
byte *dummy = NULL;
if(m_State >= WRITING && data == NULL)
{
dummy = new byte[size];
memset(dummy, 0xdd, size);
data = dummy;
}
m_Real.glBufferData(target, size, data, usage);
size_t idx = BufferIdx(target);
if(m_State >= WRITING)
{
GLResourceRecord *record = GetCtxData().m_BufferRecord[idx];
RDCASSERTMSG("Couldn't identify implicit object at binding. Mismatched or bad GLuint?", record,
target);
if(record == NULL)
return;
// detect buffer orphaning and just update backing store
if(m_State == WRITING_IDLE && record->HasDataPtr() && size == (GLsizeiptr)record->Length &&
usage == record->usage)
{
if(data)
memcpy(record->GetDataPtr(), data, (size_t)size);
else
memset(record->GetDataPtr(), 0xbe, (size_t)size);
SAFE_DELETE_ARRAY(dummy);
return;
}
GLuint buffer = record->Resource.name;
// if we're recreating the buffer, clear the record and add new chunks. Normally
// we would just mark this record as dirty and pick it up on the capture frame as initial
// data, but we don't support (if it's even possible) querying out size etc.
// we need to add only the chunks required - glGenBuffers, glBindBuffer to current target,
// and this buffer storage. All other chunks have no effect
if(m_State == WRITING_IDLE &&
(record->HasDataPtr() || (record->Length > 0 && size != (GLsizeiptr)record->Length)))
{
// we need to maintain chunk ordering, so fetch the first two chunk IDs.
// We should have at least two by this point - glGenBuffers and whatever gave the record
// a size before.
RDCASSERT(record->NumChunks() >= 2);
// remove all but the first two chunks
while(record->NumChunks() > 2)
{
Chunk *c = record->GetLastChunk();
SAFE_DELETE(c);
record->PopChunk();
}
int32_t id2 = record->GetLastChunkID();
{
Chunk *c = record->GetLastChunk();
SAFE_DELETE(c);
record->PopChunk();
}
int32_t id1 = record->GetLastChunkID();
{
Chunk *c = record->GetLastChunk();
SAFE_DELETE(c);
record->PopChunk();
}
RDCASSERT(!record->HasChunks());
// add glGenBuffers chunk
{
SCOPED_SERIALISE_CONTEXT(GEN_BUFFER);
Serialise_glGenBuffers(1, &buffer);
record->AddChunk(scope.Get(), id1);
}
// add glBindBuffer chunk
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(record->datatype, buffer);
record->AddChunk(scope.Get(), id2);
}
// we're about to add the buffer data chunk
}
SCOPED_SERIALISE_CONTEXT(BUFFERDATA);
Serialise_glNamedBufferDataEXT(buffer, size, data, usage);
Chunk *chunk = scope.Get();
// if we've already created this is a renaming/data updating call. It should go in
// the frame record so we can 'update' the buffer as it goes in the frame.
// if we haven't created the buffer at all, it could be a mid-frame create and we
// should place it in the resource record, to happen before the frame.
if(m_State == WRITING_CAPFRAME && record->GetDataPtr())
{
// we could perhaps substitute this for a 'fake' glBufferSubData chunk?
m_ContextRecord->AddChunk(chunk);
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(), eFrameRef_Write);
}
else
{
record->AddChunk(chunk);
record->SetDataPtr(chunk->GetData());
record->Length = size;
record->usage = usage;
record->DataInSerialiser = true;
}
}
else
{
RDCERR("Internal buffers should be allocated via dsa interfaces");
}
SAFE_DELETE_ARRAY(dummy);
}
bool WrappedOpenGL::Serialise_glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset,
GLsizeiptr size, const void *data)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
SERIALISE_ELEMENT(uint64_t, Offset, (uint64_t)offset);
SERIALISE_ELEMENT(uint64_t, Bytesize, (uint64_t)size);
SERIALISE_ELEMENT_BUF(byte *, bytes, data, (size_t)Bytesize);
if(m_State < WRITING)
{
GLResource res = GetResourceManager()->GetLiveResource(id);
m_Real.glNamedBufferSubDataEXT(res.name, (GLintptr)Offset, (GLsizeiptr)Bytesize, bytes);
SAFE_DELETE_ARRAY(bytes);
}
return true;
}
void WrappedOpenGL::glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsizeiptr size,
const void *data)
{
m_Real.glNamedBufferSubDataEXT(buffer, offset, size, data);
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
RDCASSERTMSG("Couldn't identify object passed to function. Mismatched or bad GLuint?", record);
if(record == NULL)
return;
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() &&
m_State != WRITING_CAPFRAME)
return;
SCOPED_SERIALISE_CONTEXT(BUFFERSUBDATA);
Serialise_glNamedBufferSubDataEXT(buffer, offset, size, data);
Chunk *chunk = scope.Get();
if(m_State == WRITING_CAPFRAME)
{
m_ContextRecord->AddChunk(chunk);
m_MissingTracks.insert(record->GetResourceID());
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(),
eFrameRef_ReadBeforeWrite);
}
else
{
record->AddChunk(chunk);
record->UpdateCount++;
if(record->UpdateCount > 10)
{
m_HighTrafficResources.insert(record->GetResourceID());
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
}
}
}
}
void WrappedOpenGL::glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size,
const void *data)
{
// only difference to EXT function is size parameter, so just upcast
glNamedBufferSubDataEXT(buffer, offset, size, data);
}
void WrappedOpenGL::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void *data)
{
m_Real.glBufferSubData(target, offset, size, data);
if(m_State >= WRITING)
{
GLResourceRecord *record = GetCtxData().m_BufferRecord[BufferIdx(target)];
RDCASSERTMSG("Couldn't identify implicit object at binding. Mismatched or bad GLuint?", record,
target);
if(record == NULL)
return;
GLResource res = record->Resource;
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() &&
m_State != WRITING_CAPFRAME)
return;
SCOPED_SERIALISE_CONTEXT(BUFFERSUBDATA);
Serialise_glNamedBufferSubDataEXT(res.name, offset, size, data);
Chunk *chunk = scope.Get();
if(m_State == WRITING_CAPFRAME)
{
m_ContextRecord->AddChunk(chunk);
m_MissingTracks.insert(record->GetResourceID());
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(),
eFrameRef_ReadBeforeWrite);
}
else
{
record->AddChunk(chunk);
record->UpdateCount++;
if(record->UpdateCount > 10)
{
m_HighTrafficResources.insert(record->GetResourceID());
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
}
}
}
}
bool WrappedOpenGL::Serialise_glNamedCopyBufferSubDataEXT(GLuint readBuffer, GLuint writeBuffer,
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size)
{
SERIALISE_ELEMENT(ResourceId, readid, GetResourceManager()->GetID(BufferRes(GetCtx(), readBuffer)));
SERIALISE_ELEMENT(ResourceId, writeid,
GetResourceManager()->GetID(BufferRes(GetCtx(), writeBuffer)));
SERIALISE_ELEMENT(uint64_t, ReadOffset, (uint64_t)readOffset);
SERIALISE_ELEMENT(uint64_t, WriteOffset, (uint64_t)writeOffset);
SERIALISE_ELEMENT(uint64_t, Bytesize, (uint64_t)size);
if(m_State < WRITING)
{
GLResource readres = GetResourceManager()->GetLiveResource(readid);
GLResource writeres = GetResourceManager()->GetLiveResource(writeid);
m_Real.glNamedCopyBufferSubDataEXT(readres.name, writeres.name, (GLintptr)ReadOffset,
(GLintptr)WriteOffset, (GLsizeiptr)Bytesize);
}
return true;
}
void WrappedOpenGL::glNamedCopyBufferSubDataEXT(GLuint readBuffer, GLuint writeBuffer,
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size)
{
CoherentMapImplicitBarrier();
m_Real.glNamedCopyBufferSubDataEXT(readBuffer, writeBuffer, readOffset, writeOffset, size);
if(m_State >= WRITING)
{
GLResourceRecord *readrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), readBuffer));
GLResourceRecord *writerecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), writeBuffer));
RDCASSERT(readrecord && writerecord);
if(m_HighTrafficResources.find(writerecord->GetResourceID()) != m_HighTrafficResources.end() &&
m_State != WRITING_CAPFRAME)
return;
if(GetResourceManager()->IsResourceDirty(readrecord->GetResourceID()) &&
m_State != WRITING_CAPFRAME)
{
m_HighTrafficResources.insert(writerecord->GetResourceID());
GetResourceManager()->MarkDirtyResource(writerecord->GetResourceID());
return;
}
SCOPED_SERIALISE_CONTEXT(COPYBUFFERSUBDATA);
Serialise_glNamedCopyBufferSubDataEXT(readBuffer, writeBuffer, readOffset, writeOffset, size);
Chunk *chunk = scope.Get();
if(m_State == WRITING_CAPFRAME)
{
m_ContextRecord->AddChunk(chunk);
m_MissingTracks.insert(writerecord->GetResourceID());
GetResourceManager()->MarkResourceFrameReferenced(writerecord->GetResourceID(),
eFrameRef_ReadBeforeWrite);
}
else
{
writerecord->AddChunk(chunk);
writerecord->AddParent(readrecord);
writerecord->UpdateCount++;
if(writerecord->UpdateCount > 60)
{
m_HighTrafficResources.insert(writerecord->GetResourceID());
GetResourceManager()->MarkDirtyResource(writerecord->GetResourceID());
}
}
}
}
void WrappedOpenGL::glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer,
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size)
{
glNamedCopyBufferSubDataEXT(readBuffer, writeBuffer, readOffset, writeOffset, size);
}
void WrappedOpenGL::glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
GLintptr writeOffset, GLsizeiptr size)
{
CoherentMapImplicitBarrier();
m_Real.glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
if(m_State >= WRITING)
{
GLResourceRecord *readrecord = GetCtxData().m_BufferRecord[BufferIdx(readTarget)];
GLResourceRecord *writerecord = GetCtxData().m_BufferRecord[BufferIdx(writeTarget)];
RDCASSERT(readrecord && writerecord);
if(m_HighTrafficResources.find(writerecord->GetResourceID()) != m_HighTrafficResources.end() &&
m_State != WRITING_CAPFRAME)
return;
if(GetResourceManager()->IsResourceDirty(readrecord->GetResourceID()) &&
m_State != WRITING_CAPFRAME)
{
m_HighTrafficResources.insert(writerecord->GetResourceID());
GetResourceManager()->MarkDirtyResource(writerecord->GetResourceID());
return;
}
SCOPED_SERIALISE_CONTEXT(COPYBUFFERSUBDATA);
Serialise_glNamedCopyBufferSubDataEXT(readrecord->Resource.name, writerecord->Resource.name,
readOffset, writeOffset, size);
Chunk *chunk = scope.Get();
if(m_State == WRITING_CAPFRAME)
{
m_ContextRecord->AddChunk(chunk);
m_MissingTracks.insert(writerecord->GetResourceID());
GetResourceManager()->MarkResourceFrameReferenced(writerecord->GetResourceID(),
eFrameRef_ReadBeforeWrite);
}
else
{
writerecord->AddChunk(chunk);
writerecord->AddParent(readrecord);
writerecord->UpdateCount++;
if(writerecord->UpdateCount > 60)
{
m_HighTrafficResources.insert(writerecord->GetResourceID());
GetResourceManager()->MarkDirtyResource(writerecord->GetResourceID());
}
}
}
}
bool WrappedOpenGL::Serialise_glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
{
SERIALISE_ELEMENT(GLenum, Target, target);
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(ResourceId, id, (buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer))
: ResourceId()));
if(m_State < WRITING)
{
if(id == ResourceId())
{
m_Real.glBindBuffer(Target, 0);
}
else
{
GLResource res = GetResourceManager()->GetLiveResource(id);
m_Real.glBindBufferBase(Target, Index, res.name);
}
}
return true;
}
void WrappedOpenGL::glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
{
ContextData &cd = GetCtxData();
if(m_State >= WRITING)
{
size_t idx = BufferIdx(target);
GLResourceRecord *r = NULL;
if(buffer == 0)
r = cd.m_BufferRecord[idx] = NULL;
else
r = cd.m_BufferRecord[idx] =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
if(buffer && m_State == WRITING_CAPFRAME)
{
FrameRefType refType = eFrameRef_Read;
// these targets write to the buffer
if(target == eGL_ATOMIC_COUNTER_BUFFER || target == eGL_COPY_WRITE_BUFFER ||
target == eGL_PIXEL_PACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_TRANSFORM_FEEDBACK_BUFFER)
refType = eFrameRef_ReadBeforeWrite;
GetResourceManager()->MarkResourceFrameReferenced(cd.m_BufferRecord[idx]->GetResourceID(),
refType);
}
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
if(r && r->datatype != target)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(target, buffer);
chunk = scope.Get();
}
r->AddChunk(chunk);
}
// store as transform feedback record state
if(m_State == WRITING_IDLE && target == eGL_TRANSFORM_FEEDBACK_BUFFER &&
RecordUpdateCheck(cd.m_FeedbackRecord))
{
GLuint feedback = cd.m_FeedbackRecord->Resource.name;
// use glTransformFeedbackBufferBase to ensure the feedback object is bound when we bind the
// buffer
SCOPED_SERIALISE_CONTEXT(FEEDBACK_BUFFER_BASE);
Serialise_glTransformFeedbackBufferBase(feedback, index, buffer);
cd.m_FeedbackRecord->AddChunk(scope.Get());
}
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
if(r && (target == eGL_TRANSFORM_FEEDBACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_ATOMIC_COUNTER_BUFFER))
{
if(m_State == WRITING_CAPFRAME)
m_MissingTracks.insert(r->GetResourceID());
else
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
}
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER_BASE);
Serialise_glBindBufferBase(target, index, buffer);
m_ContextRecord->AddChunk(scope.Get());
}
}
m_Real.glBindBufferBase(target, index, buffer);
}
bool WrappedOpenGL::Serialise_glBindBufferRange(GLenum target, GLuint index, GLuint buffer,
GLintptr offset, GLsizeiptr size)
{
SERIALISE_ELEMENT(GLenum, Target, target);
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(ResourceId, id, (buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer))
: ResourceId()));
SERIALISE_ELEMENT(uint64_t, Offset, (uint64_t)offset);
SERIALISE_ELEMENT(uint64_t, Size, (uint64_t)size);
if(m_State < WRITING)
{
if(id == ResourceId())
{
m_Real.glBindBuffer(Target, 0);
}
else
{
GLResource res = GetResourceManager()->GetLiveResource(id);
m_Real.glBindBufferRange(Target, Index, res.name, (GLintptr)Offset, (GLsizeiptr)Size);
}
}
return true;
}
void WrappedOpenGL::glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset,
GLsizeiptr size)
{
ContextData &cd = GetCtxData();
if(m_State >= WRITING)
{
size_t idx = BufferIdx(target);
GLResourceRecord *r = NULL;
if(buffer == 0)
r = cd.m_BufferRecord[idx] = NULL;
else
r = cd.m_BufferRecord[idx] =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
if(buffer && m_State == WRITING_CAPFRAME)
{
FrameRefType refType = eFrameRef_Read;
// these targets write to the buffer
if(target == eGL_ATOMIC_COUNTER_BUFFER || target == eGL_COPY_WRITE_BUFFER ||
target == eGL_PIXEL_PACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_TRANSFORM_FEEDBACK_BUFFER)
refType = eFrameRef_ReadBeforeWrite;
GetResourceManager()->MarkResourceFrameReferenced(cd.m_BufferRecord[idx]->GetResourceID(),
refType);
}
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
if(r && r->datatype != target)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(target, buffer);
chunk = scope.Get();
}
r->AddChunk(chunk);
}
// store as transform feedback record state
if(m_State == WRITING_IDLE && target == eGL_TRANSFORM_FEEDBACK_BUFFER &&
RecordUpdateCheck(cd.m_FeedbackRecord))
{
GLuint feedback = cd.m_FeedbackRecord->Resource.name;
// use glTransformFeedbackBufferRange to ensure the feedback object is bound when we bind the
// buffer
SCOPED_SERIALISE_CONTEXT(FEEDBACK_BUFFER_RANGE);
Serialise_glTransformFeedbackBufferRange(feedback, index, buffer, offset, (GLsizei)size);
cd.m_FeedbackRecord->AddChunk(scope.Get());
}
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
if(r && (target == eGL_TRANSFORM_FEEDBACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_ATOMIC_COUNTER_BUFFER))
{
if(m_State == WRITING_CAPFRAME)
m_MissingTracks.insert(r->GetResourceID());
else
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
}
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER_RANGE);
Serialise_glBindBufferRange(target, index, buffer, offset, size);
m_ContextRecord->AddChunk(scope.Get());
}
}
m_Real.glBindBufferRange(target, index, buffer, offset, size);
}
bool WrappedOpenGL::Serialise_glBindBuffersBase(GLenum target, GLuint first, GLsizei count,
const GLuint *buffers)
{
SERIALISE_ELEMENT(GLenum, Target, target);
SERIALISE_ELEMENT(uint32_t, First, first);
SERIALISE_ELEMENT(int32_t, Count, count);
GLuint *bufs = NULL;
if(m_State <= EXECUTING)
bufs = new GLuint[Count];
for(int32_t i = 0; i < Count; i++)
{
SERIALISE_ELEMENT(ResourceId, id,
buffers && buffers[i]
? GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i]))
: ResourceId());
if(m_State <= EXECUTING)
{
if(id != ResourceId())
bufs[i] = GetResourceManager()->GetLiveResource(id).name;
else
bufs[i] = 0;
}
}
if(m_State <= EXECUTING)
{
m_Real.glBindBuffersBase(Target, First, Count, bufs);
delete[] bufs;
}
return true;
}
void WrappedOpenGL::glBindBuffersBase(GLenum target, GLuint first, GLsizei count,
const GLuint *buffers)
{
m_Real.glBindBuffersBase(target, first, count, buffers);
ContextData &cd = GetCtxData();
if(m_State >= WRITING && buffers && count > 0)
{
size_t idx = BufferIdx(target);
GLResourceRecord *r = NULL;
if(buffers[0] == 0)
r = cd.m_BufferRecord[idx] = NULL;
else
r = cd.m_BufferRecord[idx] =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[0]));
if(m_State == WRITING_CAPFRAME)
{
FrameRefType refType = eFrameRef_Read;
// these targets write to the buffer
if(target == eGL_ATOMIC_COUNTER_BUFFER || target == eGL_COPY_WRITE_BUFFER ||
target == eGL_PIXEL_PACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_TRANSFORM_FEEDBACK_BUFFER)
refType = eFrameRef_ReadBeforeWrite;
for(GLsizei i = 0; i < count; i++)
{
if(buffers[i])
{
ResourceId id = GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i]));
GetResourceManager()->MarkResourceFrameReferenced(id, eFrameRef_ReadBeforeWrite);
m_MissingTracks.insert(id);
}
}
}
for(int i = 0; i < count; i++)
{
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[i]));
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
if(bufrecord->datatype != target)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(target, buffers[i]);
chunk = scope.Get();
}
bufrecord->AddChunk(chunk);
}
}
// store as transform feedback record state
if(m_State == WRITING_IDLE && target == eGL_TRANSFORM_FEEDBACK_BUFFER &&
RecordUpdateCheck(cd.m_FeedbackRecord))
{
GLuint feedback = cd.m_FeedbackRecord->Resource.name;
for(int i = 0; i < count; i++)
{
// use glTransformFeedbackBufferBase to ensure the feedback object is bound when we bind the
// buffer
SCOPED_SERIALISE_CONTEXT(FEEDBACK_BUFFER_BASE);
Serialise_glTransformFeedbackBufferBase(feedback, first + i, buffers[i]);
cd.m_FeedbackRecord->AddChunk(scope.Get());
}
}
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
if(r && (target == eGL_TRANSFORM_FEEDBACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_ATOMIC_COUNTER_BUFFER))
{
if(m_State == WRITING_IDLE)
{
for(int i = 0; i < count; i++)
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffers[i]));
}
}
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFERS_BASE);
Serialise_glBindBuffersBase(target, first, count, buffers);
m_ContextRecord->AddChunk(scope.Get());
}
}
}
bool WrappedOpenGL::Serialise_glBindBuffersRange(GLenum target, GLuint first, GLsizei count,
const GLuint *buffers, const GLintptr *offsets,
const GLsizeiptr *sizes)
{
SERIALISE_ELEMENT(GLenum, Target, target);
SERIALISE_ELEMENT(uint32_t, First, first);
SERIALISE_ELEMENT(int32_t, Count, count);
GLuint *bufs = NULL;
GLintptr *offs = NULL;
GLsizeiptr *sz = NULL;
if(m_State <= EXECUTING)
{
bufs = new GLuint[Count];
offs = new GLintptr[Count];
sz = new GLsizeiptr[Count];
}
for(int32_t i = 0; i < Count; i++)
{
SERIALISE_ELEMENT(ResourceId, id,
buffers && buffers[i]
? GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i]))
: ResourceId());
SERIALISE_ELEMENT(uint64_t, offset, buffers ? (uint64_t)offsets[i] : 0);
SERIALISE_ELEMENT(uint64_t, size, buffers ? (uint64_t)sizes[i] : 0);
if(m_State <= EXECUTING)
{
if(id != ResourceId())
bufs[i] = GetResourceManager()->GetLiveResource(id).name;
else
bufs[i] = 0;
offs[i] = (GLintptr)offset;
sz[i] = (GLsizeiptr)size;
}
}
if(m_State <= EXECUTING)
{
m_Real.glBindBuffersRange(Target, First, Count, bufs, offs, sz);
delete[] bufs;
delete[] offs;
delete[] sz;
}
return true;
}
void WrappedOpenGL::glBindBuffersRange(GLenum target, GLuint first, GLsizei count,
const GLuint *buffers, const GLintptr *offsets,
const GLsizeiptr *sizes)
{
m_Real.glBindBuffersRange(target, first, count, buffers, offsets, sizes);
ContextData &cd = GetCtxData();
if(m_State >= WRITING && buffers && count > 0)
{
size_t idx = BufferIdx(target);
if(buffers[0] == 0)
cd.m_BufferRecord[idx] = NULL;
else
cd.m_BufferRecord[idx] =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[0]));
if(m_State == WRITING_CAPFRAME)
{
FrameRefType refType = eFrameRef_Read;
// these targets write to the buffer
if(target == eGL_ATOMIC_COUNTER_BUFFER || target == eGL_COPY_WRITE_BUFFER ||
target == eGL_PIXEL_PACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_TRANSFORM_FEEDBACK_BUFFER)
refType = eFrameRef_ReadBeforeWrite;
for(GLsizei i = 0; i < count; i++)
{
if(buffers[i])
{
ResourceId id = GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i]));
GetResourceManager()->MarkResourceFrameReferenced(id, eFrameRef_ReadBeforeWrite);
m_MissingTracks.insert(id);
}
}
}
else
{
for(int i = 0; i < count; i++)
{
GLResourceRecord *r =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[i]));
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
if(r->datatype != target)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
Serialise_glBindBuffer(target, buffers[i]);
chunk = scope.Get();
}
r->AddChunk(chunk);
}
}
}
// store as transform feedback record state
if(m_State == WRITING_IDLE && target == eGL_TRANSFORM_FEEDBACK_BUFFER &&
RecordUpdateCheck(cd.m_FeedbackRecord))
{
GLuint feedback = cd.m_FeedbackRecord->Resource.name;
for(int i = 0; i < count; i++)
{
// use glTransformFeedbackBufferRange to ensure the feedback object is bound when we bind
// the
// buffer
SCOPED_SERIALISE_CONTEXT(FEEDBACK_BUFFER_RANGE);
Serialise_glTransformFeedbackBufferRange(feedback, first + i, buffers[i], offsets[i],
(GLsizei)sizes[i]);
cd.m_FeedbackRecord->AddChunk(scope.Get());
}
}
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
if(target == eGL_TRANSFORM_FEEDBACK_BUFFER || target == eGL_SHADER_STORAGE_BUFFER ||
target == eGL_ATOMIC_COUNTER_BUFFER)
{
if(m_State == WRITING_IDLE)
{
for(int i = 0; i < count; i++)
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffers[i]));
}
}
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFERS_RANGE);
Serialise_glBindBuffersRange(target, first, count, buffers, offsets, sizes);
m_ContextRecord->AddChunk(scope.Get());
}
}
}
void WrappedOpenGL::glInvalidateBufferData(GLuint buffer)
{
m_Real.glInvalidateBufferData(buffer);
if(m_State == WRITING_IDLE)
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
else
m_MissingTracks.insert(GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
}
void WrappedOpenGL::glInvalidateBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr length)
{
m_Real.glInvalidateBufferSubData(buffer, offset, length);
if(m_State == WRITING_IDLE)
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
else
m_MissingTracks.insert(GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
}
#pragma endregion
#pragma region Mapping
/************************************************************************
*
* Mapping tends to be the most complex/dense bit of the capturing process, as there are a lot of
* carefully considered use cases and edge cases to be aware of.
*
* The primary motivation is, obviously, correctness - where we have to sacrifice performance,
* clarity for correctness, we do. Second to that, we try and keep things simple/clear where the
* performance sacrifice will be minimal, and generally we try to remove overhead entirely for
* high-traffic maps, such that we only step in where necessary.
*
* We'll consider "normal" maps of buffers, and persistent maps, separately. Note that in all cases
* we can guarantee that the buffer being mapped has correctly-sized backing store available,
* created in the glBufferData or glBufferStorage call. We also only need to consider the case of
* glMapNamedBufferRangeEXT, glUnmapNamedBufferEXT and glFlushMappedNamedBufferRange - all other
* entry points are mapped to one of these in a fairly simple fashion.
*
*
* glMapNamedBufferRangeEXT:
*
* For a normal map, we decide to either record/intercept it, or to step out of the way and allow
* the application to map directly to the GL buffer. We can only map directly when idle capturing,
* when capturing a frame we must capture all maps to be correct. Generally we perform a direct map
* either if this resource is being mapped often and we want to remove overhead, or if the map
* interception would be more complex than it's worth.
*
* The first checks are to see if we've already "given up" on a buffer, in which case we map
* directly again.
*
* Next, if the map is for write and the buffer is not invalidated, we also map directly.
* [NB: Since our buffer contents should be perfect at this point, we may not need to worry about
* non-invalidating maps. Potential future improvement.]
*
* At this point, if the map is to be done directly, we pass the parameters onto GL and return
* the result, marking the map with status GLResourceRecord::Mapped_Ignore_Real. Note that this
* means we have no idea what happens with the map, and the buffer contents after that are to us
* undefined.
*
* If not, we will be intercepting the map. If it's read-only this is relatively simple to satisfy,
* as we just need to fetch the current buffer contents and return the appropriately offsetted
* pointer. [NB: Again our buffer contents should still be perfect here, this fetch may be
* redundant.] The map status is recorded as GLResourceRecord::Mapped_Read
*
* At this point we are intercepting a map for write, and it depends on whether or not we are
* capturing a frame or just idle.
*
* If idle the handling is relatively simple, we just offset the pointer and return, marking the
* map as GLResourceRecord::Mapped_Write. Note that here we also increment a counter, and if this
* counter reaches a high enough number (arbitrary limit), we mark the buffer as high-traffic so
* that we'll stop intercepting maps and reduce overhead on this buffer.
*
* If frame capturing it is more complex. The backing store of the buffer must be preserved as it
* will contain the contents at the start of the frame. Instead we allocate two shadow storage
* copies on first use. Shadow storage [1] contains the 'current' contents of the buffer -
* when first allocated, if the map is non-invalidating, it will be filled with the buffer contents
* at that point. If the map is invalidating, it will be reset to 0xcc to help find bugs caused by
* leaving valid data behind in invalidated buffer memory.
*
* Shadow buffer [0] is the buffer that is returned to the user code. Every time it is updated
* with the contents of [1]. This way both buffers are always identical and contain the latest
* buffer contents. These buffers are used later in unmap, but Map() will return the appropriately
* offsetted pointer, and mark the map as GLResourceRecord::Mapped_Write.
*
*
* glUnmapNamedBufferEXT:
*
* The unmap becomes an actual chunk for serialisation when necessary, so we'll discuss the handling
* of the unmap call, and then how it is serialised.
*
* Unmap's handling varies depending on the status of the map, as set above in
*glMapNamedBufferRangeEXT.
*
* GLResourceRecord::Unmapped is an error case, indicating we haven't had a corresponding Map()
*call.
*
* GLResourceRecord::Mapped_Read is a no-op as we can just discard it, the pointer we returned from
*Map()
* was into our backing store.
*
* GLResourceRecord::Mapped_Ignore_Real is likewise a no-op as the GL pointer was updated directly
*by
* user code, we weren't involved. However if we are now capturing a frame, it indicates a Map()
*was
* made before this frame began, so this frame cannot be captured - we will need to try again next
* frame, where a map will not be allowed to go into GLResourceRecord::Mapped_Ignore_Real.
*
* GLResourceRecord::Mapped_Write is the only case that will generate a serialised unmap chunk. If
*we
* are idle, then all we need to do is map the 'real' GL buffer, copy across our backing store,
*and
* unmap. We only map the range that was modified. Then everything is complete as the user code
*updated
* our backing store. If we are capturing a frame, then we go into the serialise function and
*serialise
* out a chunk.
*
* Finally we set the map status back to GLResourceRecord::Unmapped.
*
* When serialising out a map, we serialise the details of the map (which buffer, offset, length)
*and
* then for non-invalidating maps of >512 byte buffers we perform a difference compare between the
*two
* shadow storage buffers that were set up in glMapNamedBufferRangeEXT. We then serialise out a
*buffer
* of the difference segment, and on replay we map and update this segment of the buffer.
*
* The reason for finding the actual difference segment is that many maps will be of a large region
* or even the whole buffer, but only update a small section, perhaps once per drawcall. So
*serialising
* the entirety of a large buffer many many times can rapidly inflate the size of the log. The
*savings
* from this can be many GBs as if a 4MB buffer is updated 1000 times, each time only updating 1KB,
* this is a difference between 1MB and 4000MB in written data, most of which is redundant in the
*last
* case.
*
*
* glFlushMappedNamedBufferRangeEXT:
*
* Now consider the specialisation of the above, for maps that have GL_MAP_FLUSH_EXPLICIT_BIT
*enabled.
*
* For the most part, these maps can be treated very similarly to normal maps, however in the case
*of
* unmapping we will skip creating an unmap chunk and instead just allow the unmap to be discarded.
* Instead we will serialise out a chunk for each glFlushMappedNamedBufferRangeEXT call. We will
*also
* include flush explicit maps along with the others that we choose to map directly when possible -
*so
* if we're capturing idle a flush explicit map will go straight to GL and be handled as with
* GLResourceRecord::Mapped_Ignore_Real above.
*
* For this reason, if a map status is GLResourceRecord::Mapped_Ignore_Real then we simply pass the
* flush range along to real GL. Again if we are capturing a frame now, this map has been 'missed'
*and
* we must try again next frame to capture. Likewise as with Unmap GLResourceRecord::Unmapped is an
* error, and for flushing we do not need to consider GLResourceRecord::Mapped_Read (it doesn't make
* sense for this case).
*
* So we only serialise out a flush chunk if we are capturing a frame, and the map is correctly
* GLResourceRecord::Mapped_Write. We clamp the flushed range to the size of the map (in case the
*user
* code didn't do this). Unlike map we do not perform any difference compares, but rely on the user
*to
* only flush the minimal range, and serialise the entire range out as a buffer. We also update the
* shadow storage buffers so that if the buffer is subsequently mapped without flush explicit, we
*have
* the 'current' contents to perform accurate compares with.
*
*
*
*
*
* Persistant maps:
*
* The above process handles "normal" maps that happen between other GL commands that use the buffer
* contents. Maps that are persistent need to be handled carefully since there are other knock-ons
*for
* correctness and proper tracking. They come in two major forms - coherent and non-coherent.
*
* Non-coherent maps are the 'easy' case, and in all cases should be recommended whenever users do
* persistent mapping. Indeed because of the implementation details, coherent maps may come at a
* performance penalty even when RenderDoc is not used and it is simply the user code using GL
*directly.
*
* The important thing is that persistent maps *must always* be intercepted regardless of
*circumstance,
* as in theory they may never be mapped again. We get hints to help us with these maps, as the
*buffers
* must have been created with glBufferStorage and must have the matching persistent and optionally
* coherent bits set in the flags bitfield.
*
* Note also that non-coherent maps tend to go hand in hand with flush explicit maps (although this
*is
* not guaranteed, it is highly likely).
*
* Non-coherent mappable buffers are GL-mapped on creation, and remain GL-mapped until their
*destruction
* regardless of what user code does. We keep this 'real' GL-mapped buffer around permanently but it
*is
* never returned to user code. Instead we handle maps otherwise as above (taking care to always
* intercept), and return the user a pointer to our backing store. Then every time a map flush
*happens
* instead of temporarily mapping and unmapping the GL buffer, we copy into the appropriate place in
*our
* persistent map pointer. If an unmap happens and the map wasn't flush-explicit, we copy the mapped
* region then. In this way we maintain correctness - the copies are "delayed" by the time between
* user code writing into our memory, and us copying into the real memory. However this is valid as
*it
* happens synchronously with a flush, unmap or other event and by definition non-coherent maps
*aren't
* visible to the GPU until after those operations.
*
* There is also the function glMemoryBarrier with bit GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT. This has
*the
* effect of acting as if all currently persistent-mapped regions were simultaneously flushed. This
*is
* exactly how we implement it - we store a list of all current user persistent maps and any time
*this
* bit is passed to glMemoryBarrier, we manually call into glFlushMappedNamedBufferRangeEXT() with
*the
* appropriate parameters and handling is otherwise identical.
*
* The final piece of the puzzle is coherent mapped buffers. Since we must break the coherency
*carefully
* (see below), we map coherent buffers as non-coherent at creation time, the same as above.
*
* To satisfy the demands of being coherent, we need to transparently propogate any changes between
*the
* user written data and the 'real' memory, without any call to intercept - there would be no need
*to
* call glMemoryBarrier or glFlushMappedNamedBufferRangeEXT. To do this, we have shadow storage
* allocated as in the "normal" mapping path all the time, and we insert a manual call to
*essentially
* the same code as glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT) in every intercepted
*function
* call that could depend on the results of the buffer. We then check if any write/change has
*happened
* by comparing to the shadow storage, and if so we perform a manual flush of that changed region
*and
* update the shadow storage for next time.
*
* This "fake coherency" is the reason we can map the buffer as non-coherent, since we will be
*performing
* copies and flushes manually to emulate the coherency to allow our interception in the middle.
*
* By definition, there will be *many* of these places where the buffer results could be used, not
*least
* any buffer copy, any texture copy (since a texture buffer could be created), any draw or
*dispatch,
* etc. At each of these points there will be a cost for each coherent map of checking for changes
*and it
* will scale with the size of the buffers. This is a large performance penalty but one that can't
*be
* easily avoided. This is another reason why coherent maps should be avoided.
*
* Note that this also involves a behaviour change that affects correctness - a user write to memory
*is
* not visible as soon as the write happens, but only on the next api point where the write could
*have
* an effect. In correct code this should not be a problem as relying on any other behaviour would
*be
* impossible - if you wrote into memory expecting commands in flight to be affected you could not
*ensure
* correct ordering. However, obvious from that description, this is precisely a race condition bug
*if
* user code did do that - which means race condition bugs will be hidden by the nature of this
*tracing.
* This is unavoidable without the extreme performance hit of making all coherent maps read-write,
*and
* performing a read-back at every sync point to find every change. Which by itself may also hide
*race
* conditions anyway.
*
*
* Implementation notes:
*
* The record->Map.ptr is the *offsetted* pointer, ie. a pointer to the beginning of the mapped
*region,
* at record->Map.offset bytes from the start of the buffer.
*
* record->Map.persistentPtr points to the *base* of the buffer, not offsetted by any current map.
*
* Likewise the shadow storage pointers point to the base of a buffer-sized allocation each.
*
************************************************************************/
void *WrappedOpenGL::glMapNamedBufferRangeEXT(GLuint buffer, GLintptr offset, GLsizeiptr length,
GLbitfield access)
{
// see above for high-level explanation of how mapping is handled
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
bool directMap = false;
// first check if we've already given up on these buffers
if(m_State != WRITING_CAPFRAME &&
m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end())
directMap = true;
if(!directMap && m_State != WRITING_CAPFRAME &&
GetResourceManager()->IsResourceDirty(record->GetResourceID()))
directMap = true;
bool invalidateMap = (access & (GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_INVALIDATE_RANGE_BIT)) != 0;
bool flushExplicitMap = (access & GL_MAP_FLUSH_EXPLICIT_BIT) != 0;
// if this map is writing and doesn't invalidate, or is flush explicit, map directly
if(!directMap && (!invalidateMap || flushExplicitMap) && (access & GL_MAP_WRITE_BIT) &&
m_State != WRITING_CAPFRAME)
directMap = true;
// persistent maps must ALWAYS be intercepted
if((access & GL_MAP_PERSISTENT_BIT) || record->Map.persistentPtr)
directMap = false;
bool verifyWrite = (RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites != 0);
// must also intercept to verify writes
if(verifyWrite)
directMap = false;
if(directMap)
{
m_HighTrafficResources.insert(record->GetResourceID());
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
}
record->Map.offset = offset;
record->Map.length = length;
record->Map.access = access;
record->Map.invalidate = invalidateMap;
record->Map.verifyWrite = verifyWrite;
// store a list of all persistent maps, and subset of all coherent maps
if(access & GL_MAP_PERSISTENT_BIT)
{
Atomic::Inc64(&record->Map.persistentMaps);
m_PersistentMaps.insert(record);
if(record->Map.access & GL_MAP_COHERENT_BIT)
m_CoherentMaps.insert(record);
}
// if we're doing a direct map, pass onto GL and return
if(directMap)
{
record->Map.ptr = (byte *)m_Real.glMapNamedBufferRangeEXT(buffer, offset, length, access);
record->Map.status = GLResourceRecord::Mapped_Ignore_Real;
return record->Map.ptr;
}
// only squirrel away read-only maps, read-write can just be treated as write-only
if((access & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) == GL_MAP_READ_BIT)
{
byte *ptr = record->GetDataPtr();
if(record->Map.persistentPtr)
ptr = record->GetShadowPtr(0);
RDCASSERT(ptr);
ptr += offset;
m_Real.glGetNamedBufferSubDataEXT(buffer, offset, length, ptr);
record->Map.ptr = ptr;
record->Map.status = GLResourceRecord::Mapped_Read;
return ptr;
}
// below here, handle write maps to the backing store
byte *ptr = record->GetDataPtr();
RDCASSERT(ptr);
{
// persistent maps get particular handling
if(access & GL_MAP_PERSISTENT_BIT)
{
// persistent pointers are always into the shadow storage, this way we can use the backing
// store for 'initial' buffer contents as with any other buffer. We also need to keep a
// comparison & modified buffer in case the application calls glMemoryBarrier(..) at any
// time.
// if we're invalidating, mark the whole range as 0xcc
if(invalidateMap)
{
memset(record->GetShadowPtr(0) + offset, 0xcc, length);
memset(record->GetShadowPtr(1) + offset, 0xcc, length);
}
record->Map.ptr = ptr = record->GetShadowPtr(0) + offset;
record->Map.status = GLResourceRecord::Mapped_Write;
}
else if(m_State == WRITING_CAPFRAME)
{
byte *shadow = (byte *)record->GetShadowPtr(0);
// if we don't have a shadow pointer, need to allocate & initialise
if(shadow == NULL)
{
GLint buflength;
m_Real.glGetNamedBufferParameterivEXT(buffer, eGL_BUFFER_SIZE, &buflength);
// allocate our shadow storage
record->AllocShadowStorage(buflength);
shadow = (byte *)record->GetShadowPtr(0);
// if we're not invalidating, we need the existing contents
if(!invalidateMap)
{
// need to fetch the whole buffer's contents, not just the mapped range,
// as next time we won't re-fetch and might need the rest of the contents
if(GetResourceManager()->IsResourceDirty(record->GetResourceID()))
{
// Perhaps we could get these contents from the frame initial state buffer?
m_Real.glGetNamedBufferSubDataEXT(buffer, 0, buflength, shadow);
}
else
{
memcpy(shadow, record->GetDataPtr(), buflength);
}
}
// copy into second shadow buffer ready for comparison later
memcpy(record->GetShadowPtr(1), shadow, buflength);
}
// if we're invalidating, mark the whole range as 0xcc
if(invalidateMap)
{
memset(shadow + offset, 0xcc, length);
memset(record->GetShadowPtr(1) + offset, 0xcc, length);
}
record->Map.ptr = ptr = shadow;
record->Map.status = GLResourceRecord::Mapped_Write;
}
else if(m_State == WRITING_IDLE)
{
if(verifyWrite)
{
byte *shadow = record->GetShadowPtr(0);
GLint buflength;
m_Real.glGetNamedBufferParameterivEXT(buffer, eGL_BUFFER_SIZE, &buflength);
// if we don't have a shadow pointer, need to allocate & initialise
if(shadow == NULL)
{
// allocate our shadow storage
record->AllocShadowStorage(buflength);
shadow = (byte *)record->GetShadowPtr(0);
}
// if we're not invalidating, we need the existing contents
if(!invalidateMap)
memcpy(shadow, record->GetDataPtr(), buflength);
else
memset(shadow + offset, 0xcc, length);
ptr = shadow;
}
// return buffer backing store pointer, offsetted
ptr += offset;
record->Map.ptr = ptr;
record->Map.status = GLResourceRecord::Mapped_Write;
record->UpdateCount++;
// mark as high-traffic if we update it often enough
if(record->UpdateCount > 60)
{
m_HighTrafficResources.insert(record->GetResourceID());
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
}
}
}
return ptr;
}
return m_Real.glMapNamedBufferRangeEXT(buffer, offset, length, access);
}
void *WrappedOpenGL::glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length,
GLbitfield access)
{
// only difference to EXT function is size parameter, so just upcast
return glMapNamedBufferRangeEXT(buffer, offset, length, access);
}
void *WrappedOpenGL::glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
GLbitfield access)
{
// see above glMapNamedBufferRangeEXT for high-level explanation of how mapping is handled
if(m_State >= WRITING)
{
GLResourceRecord *record = GetCtxData().m_BufferRecord[BufferIdx(target)];
RDCASSERTMSG("Couldn't identify implicit object at binding. Mismatched or bad GLuint?", record,
target);
if(record)
return glMapNamedBufferRangeEXT(record->Resource.name, offset, length, access);
RDCERR("glMapBufferRange: Couldn't get resource record for target %x - no buffer bound?", target);
}
return m_Real.glMapBufferRange(target, offset, length, access);
}
// the glMapBuffer functions are equivalent to glMapBufferRange - so we just pass through
void *WrappedOpenGL::glMapNamedBufferEXT(GLuint buffer, GLenum access)
{
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
RDCASSERTMSG("Couldn't identify object passed to function. Mismatched or bad GLuint?", record,
buffer);
if(record)
{
GLbitfield accessBits = 0;
if(access == eGL_READ_ONLY)
accessBits = eGL_MAP_READ_BIT;
else if(access == eGL_WRITE_ONLY)
accessBits = eGL_MAP_WRITE_BIT;
else if(access == eGL_READ_WRITE)
accessBits = eGL_MAP_READ_BIT | eGL_MAP_WRITE_BIT;
return glMapNamedBufferRangeEXT(record->Resource.name, 0, (GLsizeiptr)record->Length,
accessBits);
}
RDCERR("glMapNamedBufferEXT: Couldn't get resource record for buffer %x!", buffer);
}
return m_Real.glMapNamedBufferEXT(buffer, access);
}
void *WrappedOpenGL::glMapBuffer(GLenum target, GLenum access)
{
// see above glMapNamedBufferRangeEXT for high-level explanation of how mapping is handled
if(m_State >= WRITING)
{
GLResourceRecord *record = GetCtxData().m_BufferRecord[BufferIdx(target)];
if(record)
{
GLbitfield accessBits = 0;
if(access == eGL_READ_ONLY)
accessBits = eGL_MAP_READ_BIT;
else if(access == eGL_WRITE_ONLY)
accessBits = eGL_MAP_WRITE_BIT;
else if(access == eGL_READ_WRITE)
accessBits = eGL_MAP_READ_BIT | eGL_MAP_WRITE_BIT;
return glMapNamedBufferRangeEXT(record->Resource.name, 0, (GLsizeiptr)record->Length,
accessBits);
}
RDCERR("glMapBuffer: Couldn't get resource record for target %s - no buffer bound?",
ToStr::Get(target).c_str());
}
return m_Real.glMapBuffer(target, access);
}
bool WrappedOpenGL::Serialise_glUnmapNamedBufferEXT(GLuint buffer)
{
// see above glMapNamedBufferRangeEXT for high-level explanation of how mapping is handled
GLResourceRecord *record = NULL;
if(m_State >= WRITING)
record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
SERIALISE_ELEMENT(ResourceId, bufID, record->GetResourceID());
SERIALISE_ELEMENT(uint64_t, offs, record->Map.offset);
SERIALISE_ELEMENT(uint64_t, len, record->Map.length);
size_t diffStart = 0;
size_t diffEnd = (size_t)len;
if(m_State == WRITING_CAPFRAME &&
// don't bother checking diff range for tiny buffers
len > 512 &&
// if the map has a sub-range specified, trust the user to have specified
// a minimal range, similar to glFlushMappedBufferRange, so don't find diff
// range.
record->Map.offset == 0 && record->Map.length == (GLsizeiptr)record->Length &&
// similarly for invalidate maps, we want to update the whole buffer
!record->Map.invalidate)
{
bool found = FindDiffRange(record->Map.ptr, record->GetShadowPtr(1) + offs, (size_t)len,
diffStart, diffEnd);
if(found)
{
static size_t saved = 0;
saved += (size_t)len - (diffEnd - diffStart);
RDCDEBUG("Mapped resource size %u, difference: %u -> %u. Total bytes saved so far: %u",
(uint32_t)len, (uint32_t)diffStart, (uint32_t)diffEnd, (uint32_t)saved);
len = diffEnd - diffStart;
}
else
{
diffStart = 0;
diffEnd = 0;
len = 1;
}
}
if(m_State == WRITING_CAPFRAME && record->GetShadowPtr(1))
{
memcpy(record->GetShadowPtr(1) + diffStart, record->Map.ptr + diffStart, diffEnd - diffStart);
}
if(m_State == WRITING_IDLE)
{
diffStart = 0;
diffEnd = (size_t)len;
}
SERIALISE_ELEMENT(uint32_t, DiffStart, (uint32_t)diffStart);
SERIALISE_ELEMENT(uint32_t, DiffEnd, (uint32_t)diffEnd);
SERIALISE_ELEMENT_BUF(byte *, data, record->Map.ptr + diffStart, (size_t)len);
if(m_State < WRITING)
{
GLResource res = GetResourceManager()->GetLiveResource(bufID);
buffer = res.name;
}
if(DiffEnd > DiffStart)
{
if(record && record->Map.persistentPtr)
{
// if we have a persistent mapped pointer, copy the range into the 'real' memory and
// do a flush. Note the persistent pointer is always to the base of the buffer so we
// need to account for the offset
memcpy(record->Map.persistentPtr + offs + DiffStart, record->Map.ptr + DiffStart,
DiffEnd - DiffStart);
m_Real.glFlushMappedNamedBufferRangeEXT(buffer, GLintptr(offs + DiffStart),
DiffEnd - DiffStart);
}
else
{
void *ptr = m_Real.glMapNamedBufferRangeEXT(
buffer, (GLintptr)(offs + DiffStart), GLsizeiptr(DiffEnd - DiffStart), GL_MAP_WRITE_BIT);
memcpy(ptr, data, size_t(DiffEnd - DiffStart));
m_Real.glUnmapNamedBufferEXT(buffer);
}
}
if(m_State < WRITING)
delete[] data;
return true;
}
GLboolean WrappedOpenGL::glUnmapNamedBufferEXT(GLuint buffer)
{
// see above glMapNamedBufferRangeEXT for high-level explanation of how mapping is handled
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
auto status = record->Map.status;
if(m_State == WRITING_CAPFRAME)
{
m_MissingTracks.insert(record->GetResourceID());
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(),
eFrameRef_ReadBeforeWrite);
}
GLboolean ret = GL_TRUE;
switch(status)
{
case GLResourceRecord::Unmapped:
RDCERR("Unmapped buffer being passed to glUnmapBuffer");
break;
case GLResourceRecord::Mapped_Read:
// can ignore
break;
case GLResourceRecord::Mapped_Ignore_Real:
if(m_State == WRITING_CAPFRAME)
{
RDCERR(
"Failed to cap frame - we saw an Unmap() that we didn't capture the corresponding "
"Map() for");
m_SuccessfulCapture = false;
m_FailureReason = CaptureFailed_UncappedUnmap;
}
// need to do the real unmap
ret = m_Real.glUnmapNamedBufferEXT(buffer);
break;
case GLResourceRecord::Mapped_Write:
{
if(record->Map.verifyWrite)
{
if(!record->VerifyShadowStorage())
{
string msg = StringFormat::Fmt(
"Overwrite of %llu byte Map()'d buffer detected\n"
"Breakpoint now to see callstack,\nor click 'Yes' to debugbreak.",
record->Length);
int res =
tinyfd_messageBox("Map() overwrite detected!", msg.c_str(), "yesno", "error", 1);
if(res == 1)
{
OS_DEBUG_BREAK();
}
}
// copy from shadow to backing store, so we're consistent
memcpy(record->GetDataPtr() + record->Map.offset, record->Map.ptr, record->Map.length);
}
if(record->Map.access & GL_MAP_FLUSH_EXPLICIT_BIT)
{
// do nothing, any flushes that happened were handled,
// and we won't do any other updates here or make a chunk.
}
else if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(UNMAP);
Serialise_glUnmapNamedBufferEXT(buffer);
m_ContextRecord->AddChunk(scope.Get());
}
else if(m_State == WRITING_IDLE)
{
if(record->Map.persistentPtr)
{
// if we have a persistent mapped pointer, copy the range into the 'real' memory and
// do a flush. Note the persistent pointer is always to the base of the buffer so we
// need to account for the offset
memcpy(record->Map.persistentPtr + record->Map.offset, record->Map.ptr,
record->Map.length);
m_Real.glFlushMappedNamedBufferRangeEXT(buffer, record->Map.offset, record->Map.length);
// update shadow storage
memcpy(record->GetShadowPtr(1) + record->Map.offset, record->Map.ptr, record->Map.length);
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
}
else
{
// if we are here for WRITING_IDLE, the app wrote directly into our backing
// store memory. Just need to copy the data across to GL, no other work needed
void *ptr =
m_Real.glMapNamedBufferRangeEXT(buffer, (GLintptr)record->Map.offset,
GLsizeiptr(record->Map.length), GL_MAP_WRITE_BIT);
memcpy(ptr, record->Map.ptr, record->Map.length);
m_Real.glUnmapNamedBufferEXT(buffer);
}
}
break;
}
}
// keep list of persistent & coherent maps up to date if we've
// made the last unmap to a buffer
if(record->Map.access & GL_MAP_PERSISTENT_BIT)
{
int64_t ref = Atomic::Dec64(&record->Map.persistentMaps);
if(ref == 0)
{
m_PersistentMaps.erase(record);
if(record->Map.access & GL_MAP_COHERENT_BIT)
m_CoherentMaps.erase(record);
}
}
record->Map.status = GLResourceRecord::Unmapped;
return ret;
}
return m_Real.glUnmapNamedBufferEXT(buffer);
}
GLboolean WrappedOpenGL::glUnmapBuffer(GLenum target)
{
// see above glMapNamedBufferRangeEXT for high-level explanation of how mapping is handled
if(m_State >= WRITING)
{
GLResourceRecord *record = GetCtxData().m_BufferRecord[BufferIdx(target)];
if(record)
return glUnmapNamedBufferEXT(record->Resource.name);
RDCERR("glUnmapBuffer: Couldn't get resource record for target %s - no buffer bound?",
ToStr::Get(target).c_str());
}
return m_Real.glUnmapBuffer(target);
}
bool WrappedOpenGL::Serialise_glFlushMappedNamedBufferRangeEXT(GLuint buffer, GLintptr offset,
GLsizeiptr length)
{
// see above glMapNamedBufferRangeEXT for high-level explanation of how mapping is handled
GLResourceRecord *record = NULL;
if(m_State >= WRITING)
record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
SERIALISE_ELEMENT(ResourceId, ID, record->GetResourceID());
SERIALISE_ELEMENT(uint64_t, offs, offset);
SERIALISE_ELEMENT(uint64_t, len, length);
// serialise out the flushed chunk of the shadow pointer
SERIALISE_ELEMENT_BUF(byte *, data, record->Map.ptr + offs, (size_t)len);
// update the comparison buffer in case this buffer is subsequently mapped and we want to find
// the difference region
if(m_State == WRITING_CAPFRAME && record->GetShadowPtr(1))
{
memcpy(record->GetShadowPtr(1) + offs, record->Map.ptr + offs, (size_t)len);
}
GLResource res;
if(m_State < WRITING)
res = GetResourceManager()->GetLiveResource(ID);
else
res = GetResourceManager()->GetCurrentResource(ID);
if(record && record->Map.persistentPtr)
{
// if we have a persistent mapped pointer, copy the range into the 'real' memory and
// do a flush. Note the persistent pointer is always to the base of the buffer so we
// need to account for the offset
memcpy(record->Map.persistentPtr + offs, record->Map.ptr - record->Map.offset + offs,
(size_t)len);
m_Real.glFlushMappedNamedBufferRangeEXT(buffer, (GLintptr)offs, (GLsizeiptr)len);
}
else
{
// perform a map of the range and copy the data, to emulate the modified region being flushed
void *ptr =
m_Real.glMapNamedBufferRangeEXT(res.name, (GLintptr)offs, (GLsizeiptr)len, GL_MAP_WRITE_BIT);
memcpy(ptr, data, (size_t)len);
m_Real.glUnmapNamedBufferEXT(res.name);
}
if(m_State < WRITING)
SAFE_DELETE_ARRAY(data);
return true;
}
void WrappedOpenGL::glFlushMappedNamedBufferRangeEXT(GLuint buffer, GLintptr offset, GLsizeiptr length)
{
// see above glMapNamedBufferRangeEXT for high-level explanation of how mapping is handled
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
RDCASSERTMSG("Couldn't identify object passed to function. Mismatched or bad GLuint?", record,
buffer);
// only need to pay attention to flushes when in capframe. Otherwise (see above) we
// treat the map as a normal map, and let ALL modified regions go through, flushed or not,
// as this is legal - modified but unflushed regions are 'undefined' so we can just say
// that modifications applying is our undefined behaviour.
// note that we only want to flush the range with GL if we've actually
// mapped it. Otherwise the map is 'virtual' and just pointing to our backing store data
if(record && record->Map.status == GLResourceRecord::Mapped_Ignore_Real)
{
m_Real.glFlushMappedNamedBufferRangeEXT(buffer, offset, length);
}
if(m_State == WRITING_CAPFRAME)
{
if(record)
{
m_MissingTracks.insert(record->GetResourceID());
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(),
eFrameRef_ReadBeforeWrite);
if(record->Map.status == GLResourceRecord::Unmapped)
{
RDCWARN("Unmapped buffer being flushed, ignoring");
}
else if(record->Map.status == GLResourceRecord::Mapped_Ignore_Real)
{
RDCERR(
"Failed to cap frame - we saw an FlushMappedBuffer() that we didn't capture the "
"corresponding Map() for");
m_SuccessfulCapture = false;
m_FailureReason = CaptureFailed_UncappedUnmap;
}
else if(record->Map.status == GLResourceRecord::Mapped_Write)
{
if(offset < record->Map.offset || offset + length > record->Map.offset + record->Map.length)
{
RDCWARN("Flushed buffer range is outside of mapped range, clamping");
// maintain the length/end boundary of the flushed range if the flushed offset
// is below the mapped range
if(offset < record->Map.offset)
{
offset += (record->Map.offset - offset);
length -= (record->Map.offset - offset);
}
// clamp the length if it's beyond the mapped range.
if(offset + length > record->Map.offset + record->Map.length)
{
length = (record->Map.offset + record->Map.length - offset);
}
}
SCOPED_SERIALISE_CONTEXT(FLUSHMAP);
Serialise_glFlushMappedNamedBufferRangeEXT(buffer, offset, length);
m_ContextRecord->AddChunk(scope.Get());
}
// other statuses is GLResourceRecord::Mapped_Read
}
}
else if(m_State == WRITING_IDLE)
{
// if this is a flush of a persistent map, we need to copy through to
// the real pointer and perform a real flush.
if(record && record->Map.persistentPtr)
{
memcpy(record->Map.persistentPtr + offset, record->Map.ptr - record->Map.offset + offset,
length);
m_Real.glFlushMappedNamedBufferRangeEXT(buffer, offset, length);
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
}
}
}
void WrappedOpenGL::glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length)
{
// only difference to EXT function is size parameter, so just upcast
glFlushMappedNamedBufferRangeEXT(buffer, offset, length);
}
void WrappedOpenGL::glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
{
if(m_State >= WRITING)
{
GLResourceRecord *record = GetCtxData().m_BufferRecord[BufferIdx(target)];
RDCASSERTMSG("Couldn't identify implicit object at binding. Mismatched or bad GLuint?", record,
target);
if(record)
return glFlushMappedNamedBufferRangeEXT(record->Resource.name, offset, length);
RDCERR(
"glFlushMappedBufferRange: Couldn't get resource record for target %x - no buffer bound?",
target);
}
return m_Real.glFlushMappedBufferRange(target, offset, length);
}
void WrappedOpenGL::PersistentMapMemoryBarrier(const set<GLResourceRecord *> &maps)
{
// this function iterates over all the maps, checking for any changes between
// the shadow pointers, and propogates that to 'real' GL
for(set<GLResourceRecord *>::const_iterator it = maps.begin(); it != maps.end(); ++it)
{
GLResourceRecord *record = *it;
RDCASSERT(record && record->Map.persistentPtr);
size_t diffStart = 0, diffEnd = 0;
bool found = FindDiffRange(record->GetShadowPtr(0), record->GetShadowPtr(1),
(size_t)record->Length, diffStart, diffEnd);
if(found)
{
// update the modified region in the 'comparison' shadow buffer for next check
memcpy(record->GetShadowPtr(1) + diffStart, record->GetShadowPtr(0) + diffStart,
diffEnd - diffStart);
// we use our own flush function so it will serialise chunks when necessary, and it
// also handles copying into the persistent mapped pointer and flushing the real GL
// buffer
glFlushMappedNamedBufferRangeEXT(record->Resource.name, GLintptr(diffStart),
GLsizeiptr(diffEnd - diffStart));
}
}
}
#pragma endregion
#pragma region Transform Feedback
bool WrappedOpenGL::Serialise_glGenTransformFeedbacks(GLsizei n, GLuint *ids)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(FeedbackRes(GetCtx(), *ids)));
if(m_State == READING)
{
GLuint real = 0;
m_Real.glGenTransformFeedbacks(1, &real);
m_Real.glBindTransformFeedback(eGL_TRANSFORM_FEEDBACK, real);
m_Real.glBindTransformFeedback(eGL_TRANSFORM_FEEDBACK, 0);
GLResource res = FeedbackRes(GetCtx(), real);
m_ResourceManager->RegisterResource(res);
GetResourceManager()->AddLiveResource(id, res);
}
return true;
}
void WrappedOpenGL::glGenTransformFeedbacks(GLsizei n, GLuint *ids)
{
m_Real.glGenTransformFeedbacks(n, ids);
for(GLsizei i = 0; i < n; i++)
{
GLResource res = FeedbackRes(GetCtx(), ids[i]);
ResourceId id = GetResourceManager()->RegisterResource(res);
if(m_State >= WRITING)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(GEN_FEEDBACK);
Serialise_glGenTransformFeedbacks(1, ids + i);
chunk = scope.Get();
}
GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
RDCASSERT(record);
record->AddChunk(chunk);
}
else
{
GetResourceManager()->AddLiveResource(id, res);
}
}
}
bool WrappedOpenGL::Serialise_glCreateTransformFeedbacks(GLsizei n, GLuint *ids)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(FeedbackRes(GetCtx(), *ids)));
if(m_State == READING)
{
GLuint real = 0;
m_Real.glCreateTransformFeedbacks(1, &real);
GLResource res = FeedbackRes(GetCtx(), real);
m_ResourceManager->RegisterResource(res);
GetResourceManager()->AddLiveResource(id, res);
}
return true;
}
void WrappedOpenGL::glCreateTransformFeedbacks(GLsizei n, GLuint *ids)
{
m_Real.glCreateTransformFeedbacks(n, ids);
for(GLsizei i = 0; i < n; i++)
{
GLResource res = FeedbackRes(GetCtx(), ids[i]);
ResourceId id = GetResourceManager()->RegisterResource(res);
if(m_State >= WRITING)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(CREATE_FEEDBACK);
Serialise_glCreateTransformFeedbacks(1, ids + i);
chunk = scope.Get();
}
GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
RDCASSERT(record);
record->AddChunk(chunk);
}
else
{
GetResourceManager()->AddLiveResource(id, res);
}
}
}
void WrappedOpenGL::glDeleteTransformFeedbacks(GLsizei n, const GLuint *ids)
{
for(GLsizei i = 0; i < n; i++)
{
GLResource res = FeedbackRes(GetCtx(), ids[i]);
if(GetResourceManager()->HasCurrentResource(res))
{
GetResourceManager()->MarkCleanResource(res);
if(GetResourceManager()->HasResourceRecord(res))
GetResourceManager()->GetResourceRecord(res)->Delete(GetResourceManager());
GetResourceManager()->UnregisterResource(res);
}
}
m_Real.glDeleteTransformFeedbacks(n, ids);
}
bool WrappedOpenGL::Serialise_glTransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer)
{
SERIALISE_ELEMENT(uint32_t, idx, index);
SERIALISE_ELEMENT(ResourceId, xid, GetResourceManager()->GetID(FeedbackRes(GetCtx(), xfb)));
SERIALISE_ELEMENT(ResourceId, bid, GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
if(m_State <= EXECUTING)
{
xfb = GetResourceManager()->GetLiveResource(xid).name;
// use ARB_direct_state_access functions here as we use EXT_direct_state_access elsewhere. If
// we are running without ARB_dsa support, these functions are emulated in the trivial way. This
// is
// necessary since these functions can be serialised even if ARB_dsa was not used originally,
// and
// we need to support this case.
if(bid == ResourceId())
m_Real.glTransformFeedbackBufferBase(xfb, idx, 0);
else
m_Real.glTransformFeedbackBufferBase(xfb, idx, GetResourceManager()->GetLiveResource(bid).name);
}
return true;
}
void WrappedOpenGL::glTransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer)
{
m_Real.glTransformFeedbackBufferBase(xfb, index, buffer);
if(m_State >= WRITING)
{
SCOPED_SERIALISE_CONTEXT(FEEDBACK_BUFFER_BASE);
Serialise_glTransformFeedbackBufferBase(xfb, index, buffer);
if(m_State == WRITING_CAPFRAME)
{
m_ContextRecord->AddChunk(scope.Get());
GetResourceManager()->MarkResourceFrameReferenced(BufferRes(GetCtx(), buffer),
eFrameRef_ReadBeforeWrite);
}
else if(xfb != 0)
{
GLResourceRecord *fbrecord =
GetResourceManager()->GetResourceRecord(FeedbackRes(GetCtx(), xfb));
fbrecord->AddChunk(scope.Get());
if(buffer != 0)
fbrecord->AddParent(GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer)));
}
}
}
bool WrappedOpenGL::Serialise_glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer,
GLintptr offset, GLsizeiptr size)
{
SERIALISE_ELEMENT(uint32_t, idx, index);
SERIALISE_ELEMENT(ResourceId, xid, GetResourceManager()->GetID(FeedbackRes(GetCtx(), xfb)));
SERIALISE_ELEMENT(ResourceId, bid, GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
SERIALISE_ELEMENT(uint64_t, offs, (uint64_t)offset);
SERIALISE_ELEMENT(uint64_t, sz, (uint64_t)size);
if(m_State <= EXECUTING)
{
xfb = GetResourceManager()->GetLiveResource(xid).name;
// use ARB_direct_state_access functions here as we use EXT_direct_state_access elsewhere. If
// we are running without ARB_dsa support, these functions are emulated in the obvious way. This
// is
// necessary since these functions can be serialised even if ARB_dsa was not used originally,
// and
// we need to support this case.
if(bid == ResourceId())
m_Real.glTransformFeedbackBufferBase(xfb, idx,
0); // if we're unbinding, offset/size don't matter
else
m_Real.glTransformFeedbackBufferRange(
xfb, idx, GetResourceManager()->GetLiveResource(bid).name, (GLintptr)offs, (GLsizei)sz);
}
return true;
}
void WrappedOpenGL::glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer,
GLintptr offset, GLsizeiptr size)
{
m_Real.glTransformFeedbackBufferRange(xfb, index, buffer, offset, size);
if(m_State >= WRITING)
{
SCOPED_SERIALISE_CONTEXT(FEEDBACK_BUFFER_RANGE);
Serialise_glTransformFeedbackBufferRange(xfb, index, buffer, offset, size);
if(m_State == WRITING_CAPFRAME)
{
m_ContextRecord->AddChunk(scope.Get());
GetResourceManager()->MarkResourceFrameReferenced(BufferRes(GetCtx(), buffer),
eFrameRef_ReadBeforeWrite);
}
else if(xfb != 0)
{
GLResourceRecord *fbrecord =
GetResourceManager()->GetResourceRecord(FeedbackRes(GetCtx(), xfb));
fbrecord->AddChunk(scope.Get());
if(buffer != 0)
fbrecord->AddParent(GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer)));
}
}
}
bool WrappedOpenGL::Serialise_glBindTransformFeedback(GLenum target, GLuint id)
{
SERIALISE_ELEMENT(GLenum, Target, target);
SERIALISE_ELEMENT(ResourceId, fid, GetResourceManager()->GetID(FeedbackRes(GetCtx(), id)));
if(m_State <= EXECUTING)
{
if(fid != ResourceId())
m_Real.glBindTransformFeedback(Target, GetResourceManager()->GetLiveResource(fid).name);
else
m_Real.glBindTransformFeedback(Target, 0);
}
return true;
}
void WrappedOpenGL::glBindTransformFeedback(GLenum target, GLuint id)
{
m_Real.glBindTransformFeedback(target, id);
GLResourceRecord *record = NULL;
if(m_State >= WRITING)
{
if(id == 0)
{
GetCtxData().m_FeedbackRecord = record = NULL;
}
else
{
GetCtxData().m_FeedbackRecord = record =
GetResourceManager()->GetResourceRecord(FeedbackRes(GetCtx(), id));
}
}
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(BIND_FEEDBACK);
Serialise_glBindTransformFeedback(target, id);
m_ContextRecord->AddChunk(scope.Get());
if(record)
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(), eFrameRef_Read);
}
}
bool WrappedOpenGL::Serialise_glBeginTransformFeedback(GLenum primitiveMode)
{
SERIALISE_ELEMENT(GLenum, Mode, primitiveMode);
if(m_State <= EXECUTING)
{
m_Real.glBeginTransformFeedback(Mode);
m_ActiveFeedback = true;
}
return true;
}
void WrappedOpenGL::glBeginTransformFeedback(GLenum primitiveMode)
{
m_Real.glBeginTransformFeedback(primitiveMode);
m_ActiveFeedback = true;
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(BEGIN_FEEDBACK);
Serialise_glBeginTransformFeedback(primitiveMode);
m_ContextRecord->AddChunk(scope.Get());
}
}
bool WrappedOpenGL::Serialise_glPauseTransformFeedback()
{
if(m_State <= EXECUTING)
{
m_Real.glPauseTransformFeedback();
}
return true;
}
void WrappedOpenGL::glPauseTransformFeedback()
{
m_Real.glPauseTransformFeedback();
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(PAUSE_FEEDBACK);
Serialise_glPauseTransformFeedback();
m_ContextRecord->AddChunk(scope.Get());
}
}
bool WrappedOpenGL::Serialise_glResumeTransformFeedback()
{
if(m_State <= EXECUTING)
{
m_Real.glResumeTransformFeedback();
}
return true;
}
void WrappedOpenGL::glResumeTransformFeedback()
{
m_Real.glResumeTransformFeedback();
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(RESUME_FEEDBACK);
Serialise_glResumeTransformFeedback();
m_ContextRecord->AddChunk(scope.Get());
}
}
bool WrappedOpenGL::Serialise_glEndTransformFeedback()
{
if(m_State <= EXECUTING)
{
m_Real.glEndTransformFeedback();
m_ActiveFeedback = false;
}
return true;
}
void WrappedOpenGL::glEndTransformFeedback()
{
m_Real.glEndTransformFeedback();
m_ActiveFeedback = false;
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(END_FEEDBACK);
Serialise_glEndTransformFeedback();
m_ContextRecord->AddChunk(scope.Get());
}
}
#pragma endregion
#pragma region Vertex Arrays
// NOTE: In each of the vertex array object functions below, we might not have the live buffer
// resource
// if it's is a pre-capture chunk, and the buffer was never referenced at all in the actual frame.
// The reason for this is that the VAO record doesn't add a parent of the buffer record - because
// that
// parent tracking quickly becomes stale with high traffic VAOs ignoring updates etc, so we don't
// rely
// on the parent connection and manually reference the buffer wherever it is actually uesd.
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribOffsetEXT(GLuint vaobj, GLuint buffer,
GLuint index, GLint size,
GLenum type, GLboolean normalized,
GLsizei stride, GLintptr offset)
{
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(int32_t, Size, size);
SERIALISE_ELEMENT(GLenum, Type, type);
SERIALISE_ELEMENT(uint8_t, Norm, normalized);
SERIALISE_ELEMENT(uint32_t, Stride, stride);
SERIALISE_ELEMENT(uint64_t, Offset, (uint64_t)offset);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
SERIALISE_ELEMENT(ResourceId, bid,
buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)) : ResourceId());
if(m_State < WRITING)
{
vaobj = (id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO;
buffer = (bid != ResourceId() && GetResourceManager()->HasLiveResource(bid))
? GetResourceManager()->GetLiveResource(bid).name
: 0;
// some intel drivers don't properly update query states (like GL_VERTEX_ATTRIB_ARRAY_SIZE)
// unless the VAO is also bound when performing EXT_dsa functions :(
GLuint prevVAO = 0;
m_Real.glGetIntegerv(eGL_VERTEX_ARRAY_BINDING, (GLint *)&prevVAO);
m_Real.glBindVertexArray(vaobj);
// seems buggy when mixed and matched with new style vertex attrib binding, which we use for VAO
// initial states.
// Since the spec defines how this function should work in terms of new style bindings, just do
// that ourselves.
// m_Real.glVertexArrayVertexAttribOffsetEXT(vaobj, buffer, Index, Size, Type, Norm, Stride,
// (GLintptr)Offset);
m_Real.glVertexArrayVertexAttribFormatEXT(vaobj, Index, Size, Type, Norm, 0);
m_Real.glVertexArrayVertexAttribBindingEXT(vaobj, Index, Index);
if(Stride == 0)
{
GLenum SizeEnum = Size == 1 ? eGL_RED : Size == 2 ? eGL_RG : Size == 3 ? eGL_RGB : eGL_RGBA;
Stride = (uint32_t)GetByteSize(1, 1, 1, SizeEnum, Type);
}
m_Real.glVertexArrayBindVertexBufferEXT(vaobj, Index, buffer, (GLintptr)Offset, Stride);
m_Real.glBindVertexArray(prevVAO);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index,
GLint size, GLenum type, GLboolean normalized,
GLsizei stride, GLintptr offset)
{
m_Real.glVertexArrayVertexAttribOffsetEXT(vaobj, buffer, index, size, type, normalized, stride,
offset);
if(m_State >= WRITING)
{
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBPOINTER);
Serialise_glVertexArrayVertexAttribOffsetEXT(vaobj, buffer, index, size, type, normalized,
stride, offset);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribPointer(GLuint index, GLint size, GLenum type,
GLboolean normalized, GLsizei stride, const void *pointer)
{
m_Real.glVertexAttribPointer(index, size, type, normalized, stride, pointer);
if(m_State >= WRITING)
{
ContextData &cd = GetCtxData();
GLResourceRecord *bufrecord = cd.m_BufferRecord[BufferIdx(eGL_ARRAY_BUFFER)];
GLResourceRecord *varecord = cd.m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBPOINTER);
Serialise_glVertexArrayVertexAttribOffsetEXT(
varecord ? varecord->Resource.name : 0, bufrecord ? bufrecord->Resource.name : 0, index,
size, type, normalized, stride, (GLintptr)pointer);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribIOffsetEXT(GLuint vaobj, GLuint buffer,
GLuint index, GLint size,
GLenum type, GLsizei stride,
GLintptr offset)
{
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(int32_t, Size, size);
SERIALISE_ELEMENT(GLenum, Type, type);
SERIALISE_ELEMENT(uint32_t, Stride, stride);
SERIALISE_ELEMENT(uint64_t, Offset, (uint64_t)offset);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
SERIALISE_ELEMENT(ResourceId, bid,
buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)) : ResourceId());
if(m_State < WRITING)
{
vaobj = (id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO;
buffer = (bid != ResourceId() && GetResourceManager()->HasLiveResource(bid))
? GetResourceManager()->GetLiveResource(bid).name
: 0;
// seems buggy when mixed and matched with new style vertex attrib binding, which we use for VAO
// initial states.
// Since the spec defines how this function should work in terms of new style bindings, just do
// that ourselves.
// m_Real.glVertexArrayVertexAttribIOffsetEXT(vaobj, buffer, Index, Size, Type, Stride,
// (GLintptr)Offset);
m_Real.glVertexArrayVertexAttribIFormatEXT(vaobj, Index, Size, Type, 0);
m_Real.glVertexArrayVertexAttribBindingEXT(vaobj, Index, Index);
if(Stride == 0)
{
GLenum SizeEnum = Size == 1 ? eGL_RED : Size == 2 ? eGL_RG : Size == 3 ? eGL_RGB : eGL_RGBA;
Stride = (uint32_t)GetByteSize(1, 1, 1, SizeEnum, Type);
}
m_Real.glVertexArrayBindVertexBufferEXT(vaobj, Index, buffer, (GLintptr)Offset, Stride);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribIOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index,
GLint size, GLenum type, GLsizei stride,
GLintptr offset)
{
m_Real.glVertexArrayVertexAttribIOffsetEXT(vaobj, buffer, index, size, type, stride, offset);
if(m_State >= WRITING)
{
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBIPOINTER);
Serialise_glVertexArrayVertexAttribIOffsetEXT(vaobj, buffer, index, size, type, stride,
offset);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride,
const void *pointer)
{
m_Real.glVertexAttribIPointer(index, size, type, stride, pointer);
if(m_State >= WRITING)
{
ContextData &cd = GetCtxData();
GLResourceRecord *bufrecord = cd.m_BufferRecord[BufferIdx(eGL_ARRAY_BUFFER)];
GLResourceRecord *varecord = cd.m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBIPOINTER);
Serialise_glVertexArrayVertexAttribIOffsetEXT(varecord ? varecord->Resource.name : 0,
bufrecord ? bufrecord->Resource.name : 0,
index, size, type, stride, (GLintptr)pointer);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribLOffsetEXT(GLuint vaobj, GLuint buffer,
GLuint index, GLint size,
GLenum type, GLsizei stride,
GLintptr pointer)
{
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(int32_t, Size, size);
SERIALISE_ELEMENT(GLenum, Type, type);
SERIALISE_ELEMENT(uint32_t, Stride, stride);
SERIALISE_ELEMENT(uint64_t, Offset, (uint64_t)pointer);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
SERIALISE_ELEMENT(ResourceId, bid,
buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)) : ResourceId());
if(m_State < WRITING)
{
vaobj = (id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO;
buffer = (bid != ResourceId() && GetResourceManager()->HasLiveResource(bid))
? GetResourceManager()->GetLiveResource(bid).name
: 0;
// seems buggy when mixed and matched with new style vertex attrib binding, which we use for VAO
// initial states.
// Since the spec defines how this function should work in terms of new style bindings, just do
// that ourselves.
// m_Real.glVertexArrayVertexAttribLOffsetEXT(vaobj, buffer, Index, Size, Type, Stride,
// (GLintptr)Offset);
m_Real.glVertexArrayVertexAttribLFormatEXT(vaobj, Index, Size, Type, 0);
m_Real.glVertexArrayVertexAttribBindingEXT(vaobj, Index, Index);
if(Stride == 0)
{
GLenum SizeEnum = Size == 1 ? eGL_RED : Size == 2 ? eGL_RG : Size == 3 ? eGL_RGB : eGL_RGBA;
Stride = (uint32_t)GetByteSize(1, 1, 1, SizeEnum, Type);
}
m_Real.glVertexArrayBindVertexBufferEXT(vaobj, Index, buffer, (GLintptr)Offset, Stride);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribLOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index,
GLint size, GLenum type, GLsizei stride,
GLintptr pointer)
{
m_Real.glVertexArrayVertexAttribLOffsetEXT(vaobj, buffer, index, size, type, stride, pointer);
if(m_State >= WRITING)
{
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBLPOINTER);
Serialise_glVertexArrayVertexAttribLOffsetEXT(vaobj, buffer, index, size, type, stride,
pointer);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribLPointer(GLuint index, GLint size, GLenum type, GLsizei stride,
const void *pointer)
{
m_Real.glVertexAttribLPointer(index, size, type, stride, pointer);
if(m_State >= WRITING)
{
ContextData &cd = GetCtxData();
GLResourceRecord *bufrecord = cd.m_BufferRecord[BufferIdx(eGL_ARRAY_BUFFER)];
GLResourceRecord *varecord = cd.m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBLPOINTER);
Serialise_glVertexArrayVertexAttribLOffsetEXT(varecord ? varecord->Resource.name : 0,
bufrecord ? bufrecord->Resource.name : 0,
index, size, type, stride, (GLintptr)pointer);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribBindingEXT(GLuint vaobj, GLuint attribindex,
GLuint bindingindex)
{
SERIALISE_ELEMENT(uint32_t, aidx, attribindex);
SERIALISE_ELEMENT(uint32_t, bidx, bindingindex);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State < WRITING)
{
m_Real.glVertexArrayVertexAttribBindingEXT(
(id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO, aidx,
bidx);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribBindingEXT(GLuint vaobj, GLuint attribindex,
GLuint bindingindex)
{
m_Real.glVertexArrayVertexAttribBindingEXT(vaobj, attribindex, bindingindex);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBBINDING);
Serialise_glVertexArrayVertexAttribBindingEXT(vaobj, attribindex, bindingindex);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribBinding(GLuint attribindex, GLuint bindingindex)
{
m_Real.glVertexAttribBinding(attribindex, bindingindex);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBBINDING);
Serialise_glVertexArrayVertexAttribBindingEXT(varecord ? varecord->Resource.name : 0,
attribindex, bindingindex);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribFormatEXT(GLuint vaobj, GLuint attribindex,
GLint size, GLenum type,
GLboolean normalized,
GLuint relativeoffset)
{
SERIALISE_ELEMENT(uint32_t, Index, attribindex);
SERIALISE_ELEMENT(int32_t, Size, size);
SERIALISE_ELEMENT(bool, Norm, normalized ? true : false);
SERIALISE_ELEMENT(GLenum, Type, type);
SERIALISE_ELEMENT(uint32_t, Offset, relativeoffset);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State < WRITING)
{
vaobj = (id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO;
m_Real.glVertexArrayVertexAttribFormatEXT(vaobj, Index, Size, Type, Norm, Offset);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribFormatEXT(GLuint vaobj, GLuint attribindex, GLint size,
GLenum type, GLboolean normalized,
GLuint relativeoffset)
{
m_Real.glVertexArrayVertexAttribFormatEXT(vaobj, attribindex, size, type, normalized,
relativeoffset);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBFORMAT);
Serialise_glVertexArrayVertexAttribFormatEXT(vaobj, attribindex, size, type, normalized,
relativeoffset);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type,
GLboolean normalized, GLuint relativeoffset)
{
m_Real.glVertexAttribFormat(attribindex, size, type, normalized, relativeoffset);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBFORMAT);
Serialise_glVertexArrayVertexAttribFormatEXT(varecord ? varecord->Resource.name : 0,
attribindex, size, type, normalized,
relativeoffset);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribIFormatEXT(GLuint vaobj, GLuint attribindex,
GLint size, GLenum type,
GLuint relativeoffset)
{
SERIALISE_ELEMENT(uint32_t, Index, attribindex);
SERIALISE_ELEMENT(int32_t, Size, size);
SERIALISE_ELEMENT(GLenum, Type, type);
SERIALISE_ELEMENT(uint32_t, Offset, relativeoffset);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State < WRITING)
{
vaobj = (id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO;
m_Real.glVertexArrayVertexAttribIFormatEXT(vaobj, Index, Size, Type, Offset);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribIFormatEXT(GLuint vaobj, GLuint attribindex, GLint size,
GLenum type, GLuint relativeoffset)
{
m_Real.glVertexArrayVertexAttribIFormatEXT(vaobj, attribindex, size, type, relativeoffset);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBIFORMAT);
Serialise_glVertexArrayVertexAttribIFormatEXT(vaobj, attribindex, size, type, relativeoffset);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type,
GLuint relativeoffset)
{
m_Real.glVertexAttribIFormat(attribindex, size, type, relativeoffset);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBIFORMAT);
Serialise_glVertexArrayVertexAttribIFormatEXT(varecord ? varecord->Resource.name : 0,
attribindex, size, type, relativeoffset);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribLFormatEXT(GLuint vaobj, GLuint attribindex,
GLint size, GLenum type,
GLuint relativeoffset)
{
SERIALISE_ELEMENT(uint32_t, Index, attribindex);
SERIALISE_ELEMENT(int32_t, Size, size);
SERIALISE_ELEMENT(GLenum, Type, type);
SERIALISE_ELEMENT(uint32_t, Offset, relativeoffset);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State < WRITING)
{
vaobj = (id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO;
m_Real.glVertexArrayVertexAttribLFormatEXT(vaobj, Index, Size, Type, Offset);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribLFormatEXT(GLuint vaobj, GLuint attribindex, GLint size,
GLenum type, GLuint relativeoffset)
{
m_Real.glVertexArrayVertexAttribLFormatEXT(vaobj, attribindex, size, type, relativeoffset);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBLFORMAT);
Serialise_glVertexArrayVertexAttribLFormatEXT(vaobj, attribindex, size, type, relativeoffset);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribLFormat(GLuint attribindex, GLint size, GLenum type,
GLuint relativeoffset)
{
m_Real.glVertexAttribLFormat(attribindex, size, type, relativeoffset);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBLFORMAT);
Serialise_glVertexArrayVertexAttribLFormatEXT(varecord ? varecord->Resource.name : 0,
attribindex, size, type, relativeoffset);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexAttribDivisorEXT(GLuint vaobj, GLuint index,
GLuint divisor)
{
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(uint32_t, Divisor, divisor);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State < WRITING)
{
vaobj = (id != ResourceId()) ? GetResourceManager()->GetLiveResource(id).name : m_FakeVAO;
// at the time of writing, AMD driver seems to not have this entry point
if(m_Real.glVertexArrayVertexAttribDivisorEXT)
{
m_Real.glVertexArrayVertexAttribDivisorEXT(vaobj, Index, Divisor);
}
else
{
GLuint VAO = 0;
m_Real.glGetIntegerv(eGL_VERTEX_ARRAY_BINDING, (GLint *)&VAO);
m_Real.glBindVertexArray(vaobj);
m_Real.glVertexAttribDivisor(Index, Divisor);
m_Real.glBindVertexArray(VAO);
}
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexAttribDivisorEXT(GLuint vaobj, GLuint index, GLuint divisor)
{
m_Real.glVertexArrayVertexAttribDivisorEXT(vaobj, index, divisor);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBDIVISOR);
Serialise_glVertexArrayVertexAttribDivisorEXT(vaobj, index, divisor);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexAttribDivisor(GLuint index, GLuint divisor)
{
m_Real.glVertexAttribDivisor(index, divisor);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIBDIVISOR);
Serialise_glVertexArrayVertexAttribDivisorEXT(varecord ? varecord->Resource.name : 0, index,
divisor);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glEnableVertexArrayAttribEXT(GLuint vaobj, GLuint index)
{
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State < WRITING)
{
if(m_State == READING)
{
if(id != ResourceId())
{
GLResource res = GetResourceManager()->GetLiveResource(id);
m_Real.glBindVertexArray(res.name);
}
else
{
m_Real.glBindVertexArray(m_FakeVAO);
}
}
m_Real.glEnableVertexAttribArray(Index);
}
return true;
}
void WrappedOpenGL::glEnableVertexArrayAttribEXT(GLuint vaobj, GLuint index)
{
m_Real.glEnableVertexArrayAttribEXT(vaobj, index);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(ENABLEVERTEXATTRIBARRAY);
Serialise_glEnableVertexArrayAttribEXT(vaobj, index);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glEnableVertexAttribArray(GLuint index)
{
m_Real.glEnableVertexAttribArray(index);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(ENABLEVERTEXATTRIBARRAY);
Serialise_glEnableVertexArrayAttribEXT(varecord ? varecord->Resource.name : 0, index);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glDisableVertexArrayAttribEXT(GLuint vaobj, GLuint index)
{
SERIALISE_ELEMENT(uint32_t, Index, index);
SERIALISE_ELEMENT(
ResourceId, id,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State < WRITING)
{
if(m_State == READING)
{
if(id != ResourceId())
{
GLResource res = GetResourceManager()->GetLiveResource(id);
m_Real.glBindVertexArray(res.name);
}
else
{
m_Real.glBindVertexArray(m_FakeVAO);
}
}
m_Real.glDisableVertexAttribArray(Index);
}
return true;
}
void WrappedOpenGL::glDisableVertexArrayAttribEXT(GLuint vaobj, GLuint index)
{
m_Real.glDisableVertexArrayAttribEXT(vaobj, index);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(DISABLEVERTEXATTRIBARRAY);
Serialise_glDisableVertexArrayAttribEXT(vaobj, index);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glDisableVertexAttribArray(GLuint index)
{
m_Real.glDisableVertexAttribArray(index);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(DISABLEVERTEXATTRIBARRAY);
Serialise_glDisableVertexArrayAttribEXT(varecord ? varecord->Resource.name : 0, index);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glGenVertexArrays(GLsizei n, GLuint *arrays)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(VertexArrayRes(GetCtx(), *arrays)));
if(m_State == READING)
{
GLuint real = 0;
m_Real.glGenVertexArrays(1, &real);
m_Real.glBindVertexArray(real);
m_Real.glBindVertexArray(0);
GLResource res = VertexArrayRes(GetCtx(), real);
m_ResourceManager->RegisterResource(res);
GetResourceManager()->AddLiveResource(id, res);
}
return true;
}
void WrappedOpenGL::glGenVertexArrays(GLsizei n, GLuint *arrays)
{
m_Real.glGenVertexArrays(n, arrays);
for(GLsizei i = 0; i < n; i++)
{
GLResource res = VertexArrayRes(GetCtx(), arrays[i]);
ResourceId id = GetResourceManager()->RegisterResource(res);
if(m_State >= WRITING)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(GEN_VERTEXARRAY);
Serialise_glGenVertexArrays(1, arrays + i);
chunk = scope.Get();
}
GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
RDCASSERT(record);
record->AddChunk(chunk);
}
else
{
GetResourceManager()->AddLiveResource(id, res);
}
}
}
bool WrappedOpenGL::Serialise_glCreateVertexArrays(GLsizei n, GLuint *arrays)
{
SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(VertexArrayRes(GetCtx(), *arrays)));
if(m_State == READING)
{
GLuint real = 0;
m_Real.glCreateVertexArrays(1, &real);
GLResource res = VertexArrayRes(GetCtx(), real);
m_ResourceManager->RegisterResource(res);
GetResourceManager()->AddLiveResource(id, res);
}
return true;
}
void WrappedOpenGL::glCreateVertexArrays(GLsizei n, GLuint *arrays)
{
m_Real.glCreateVertexArrays(n, arrays);
for(GLsizei i = 0; i < n; i++)
{
GLResource res = VertexArrayRes(GetCtx(), arrays[i]);
ResourceId id = GetResourceManager()->RegisterResource(res);
if(m_State >= WRITING)
{
Chunk *chunk = NULL;
{
SCOPED_SERIALISE_CONTEXT(CREATE_VERTEXARRAY);
Serialise_glCreateVertexArrays(1, arrays + i);
chunk = scope.Get();
}
GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
RDCASSERT(record);
record->AddChunk(chunk);
}
else
{
GetResourceManager()->AddLiveResource(id, res);
}
}
}
bool WrappedOpenGL::Serialise_glBindVertexArray(GLuint array)
{
SERIALISE_ELEMENT(
ResourceId, id,
(array ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), array)) : ResourceId()));
if(m_State <= EXECUTING)
{
if(id == ResourceId())
{
m_Real.glBindVertexArray(m_FakeVAO);
}
else
{
GLuint live = GetResourceManager()->GetLiveResource(id).name;
m_Real.glBindVertexArray(live);
}
}
return true;
}
void WrappedOpenGL::glBindVertexArray(GLuint array)
{
m_Real.glBindVertexArray(array);
GLResourceRecord *record = NULL;
if(m_State >= WRITING)
{
if(array == 0)
{
GetCtxData().m_VertexArrayRecord = record = NULL;
}
else
{
GetCtxData().m_VertexArrayRecord = record =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), array));
}
}
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(BIND_VERTEXARRAY);
Serialise_glBindVertexArray(array);
m_ContextRecord->AddChunk(scope.Get());
if(record)
GetResourceManager()->MarkVAOReferenced(record->Resource, eFrameRef_ReadBeforeWrite);
}
}
bool WrappedOpenGL::Serialise_glVertexArrayElementBuffer(GLuint vaobj, GLuint buffer)
{
SERIALISE_ELEMENT(
ResourceId, vid,
(vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId()));
SERIALISE_ELEMENT(
ResourceId, bid,
(buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)) : ResourceId()));
if(m_State <= EXECUTING)
{
vaobj = 0;
if(vid != ResourceId())
vaobj = GetResourceManager()->GetLiveResource(vid).name;
buffer = 0;
// might not have the live resource if this is a pre-capture chunk, and the buffer was never
// referenced
// at all in the actual frame
if(bid != ResourceId() && GetResourceManager()->HasLiveResource(bid))
{
buffer = GetResourceManager()->GetLiveResource(bid).name;
m_Buffers[GetResourceManager()->GetLiveID(bid)].curType = eGL_ELEMENT_ARRAY_BUFFER;
}
// use ARB_direct_state_access functions here as we use EXT_direct_state_access elsewhere. If
// we are running without ARB_dsa support, these functions are emulated in the obvious way. This
// is
// necessary since these functions can be serialised even if ARB_dsa was not used originally,
// and
// we need to support this case.
m_Real.glVertexArrayElementBuffer(vaobj, buffer);
}
return true;
}
void WrappedOpenGL::glVertexArrayElementBuffer(GLuint vaobj, GLuint buffer)
{
m_Real.glVertexArrayElementBuffer(vaobj, buffer);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(VAO_ELEMENT_BUFFER);
Serialise_glVertexArrayElementBuffer(vaobj, buffer);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayBindVertexBufferEXT(GLuint vaobj, GLuint bindingindex,
GLuint buffer, GLintptr offset,
GLsizei stride)
{
SERIALISE_ELEMENT(uint32_t, idx, bindingindex);
SERIALISE_ELEMENT(ResourceId, id, (buffer ? GetResourceManager()->GetID(BufferRes(GetCtx(), buffer))
: ResourceId()));
SERIALISE_ELEMENT(uint64_t, offs, offset);
SERIALISE_ELEMENT(uint64_t, str, stride);
SERIALISE_ELEMENT(
ResourceId, vid,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
if(m_State <= EXECUTING)
{
vaobj = (vid != ResourceId()) ? GetResourceManager()->GetLiveResource(vid).name : m_FakeVAO;
GLuint live = 0;
if(id != ResourceId() && GetResourceManager()->HasLiveResource(id))
{
live = GetResourceManager()->GetLiveResource(id).name;
m_Buffers[GetResourceManager()->GetLiveID(id)].curType = eGL_ARRAY_BUFFER;
}
m_Real.glVertexArrayBindVertexBufferEXT(vaobj, idx, live, (GLintptr)offs, (GLsizei)str);
}
return true;
}
void WrappedOpenGL::glVertexArrayBindVertexBufferEXT(GLuint vaobj, GLuint bindingindex,
GLuint buffer, GLintptr offset, GLsizei stride)
{
m_Real.glVertexArrayBindVertexBufferEXT(vaobj, bindingindex, buffer, offset, stride);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(BIND_VERTEXBUFFER);
Serialise_glVertexArrayBindVertexBufferEXT(vaobj, bindingindex, buffer, offset, stride);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset,
GLsizei stride)
{
m_Real.glBindVertexBuffer(bindingindex, buffer, offset, stride);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
if(m_State == WRITING_CAPFRAME && bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(), eFrameRef_Read);
{
SCOPED_SERIALISE_CONTEXT(BIND_VERTEXBUFFER);
Serialise_glVertexArrayBindVertexBufferEXT(varecord ? varecord->Resource.name : 0,
bindingindex, buffer, offset, stride);
r->AddChunk(scope.Get());
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexBuffers(GLuint vaobj, GLuint first, GLsizei count,
const GLuint *buffers,
const GLintptr *offsets,
const GLsizei *strides)
{
SERIALISE_ELEMENT(uint32_t, First, first);
SERIALISE_ELEMENT(int32_t, Count, count);
SERIALISE_ELEMENT(
ResourceId, vid,
vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId());
GLuint *bufs = NULL;
GLintptr *offs = NULL;
GLsizei *str = NULL;
if(m_State <= EXECUTING)
{
bufs = new GLuint[Count];
offs = new GLintptr[Count];
str = new GLsizei[Count];
}
for(int32_t i = 0; i < Count; i++)
{
SERIALISE_ELEMENT(ResourceId, id,
buffers && buffers[i]
? GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i]))
: ResourceId());
SERIALISE_ELEMENT(uint64_t, offset, buffers ? 0 : (uint64_t)offsets[i]);
SERIALISE_ELEMENT(uint64_t, stride, buffers ? 0 : (uint64_t)strides[i]);
if(m_State <= EXECUTING)
{
if(id != ResourceId() && GetResourceManager()->HasLiveResource(id))
{
bufs[i] = GetResourceManager()->GetLiveResource(id).name;
m_Buffers[GetResourceManager()->GetLiveID(id)].curType = eGL_ARRAY_BUFFER;
}
else
{
bufs[i] = 0;
}
offs[i] = (GLintptr)offset;
str[i] = (GLsizei)stride;
}
}
if(m_State <= EXECUTING)
{
if(vid != ResourceId())
vaobj = GetResourceManager()->GetLiveResource(vid).name;
else
vaobj = m_FakeVAO;
// use ARB_direct_state_access functions here as we use EXT_direct_state_access elsewhere. If
// we are running without ARB_dsa support, these functions are emulated in the obvious way. This
// is
// necessary since these functions can be serialised even if ARB_dsa was not used originally,
// and
// we need to support this case.
m_Real.glVertexArrayVertexBuffers(vaobj, First, Count, bufs, offs, str);
delete[] bufs;
delete[] offs;
delete[] str;
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexBuffers(GLuint vaobj, GLuint first, GLsizei count,
const GLuint *buffers, const GLintptr *offsets,
const GLsizei *strides)
{
m_Real.glVertexArrayVertexBuffers(vaobj, first, count, buffers, offsets, strides);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(BIND_VERTEXBUFFERS);
Serialise_glVertexArrayVertexBuffers(vaobj, first, count, buffers, offsets, strides);
r->AddChunk(scope.Get());
}
if(m_State == WRITING_CAPFRAME)
{
for(GLsizei i = 0; i < count; i++)
{
if(buffers != NULL && buffers[i] != 0)
{
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[i]));
if(bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(),
eFrameRef_Read);
}
}
}
}
}
}
void WrappedOpenGL::glBindVertexBuffers(GLuint first, GLsizei count, const GLuint *buffers,
const GLintptr *offsets, const GLsizei *strides)
{
m_Real.glBindVertexBuffers(first, count, buffers, offsets, strides);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(BIND_VERTEXBUFFERS);
Serialise_glVertexArrayVertexBuffers(varecord ? varecord->Resource.name : 0, first, count,
buffers, offsets, strides);
r->AddChunk(scope.Get());
}
if(m_State == WRITING_CAPFRAME)
{
for(GLsizei i = 0; i < count; i++)
{
if(buffers != NULL && buffers[i] != 0)
{
GLResourceRecord *bufrecord =
GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[i]));
if(bufrecord)
GetResourceManager()->MarkResourceFrameReferenced(bufrecord->GetResourceID(),
eFrameRef_Read);
}
}
}
}
}
}
bool WrappedOpenGL::Serialise_glVertexArrayVertexBindingDivisorEXT(GLuint vaobj, GLuint bindingindex,
GLuint divisor)
{
SERIALISE_ELEMENT(uint32_t, idx, bindingindex);
SERIALISE_ELEMENT(uint32_t, d, divisor);
SERIALISE_ELEMENT(
ResourceId, vid,
(vaobj ? GetResourceManager()->GetID(VertexArrayRes(GetCtx(), vaobj)) : ResourceId()));
if(m_State <= EXECUTING)
{
vaobj = (vid != ResourceId()) ? GetResourceManager()->GetLiveResource(vid).name : m_FakeVAO;
m_Real.glVertexArrayVertexBindingDivisorEXT(vaobj, idx, d);
}
return true;
}
void WrappedOpenGL::glVertexArrayVertexBindingDivisorEXT(GLuint vaobj, GLuint bindingindex,
GLuint divisor)
{
m_Real.glVertexArrayVertexBindingDivisorEXT(vaobj, bindingindex, divisor);
if(m_State >= WRITING)
{
GLResourceRecord *varecord =
GetResourceManager()->GetResourceRecord(VertexArrayRes(GetCtx(), vaobj));
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXBINDINGDIVISOR);
Serialise_glVertexArrayVertexBindingDivisorEXT(vaobj, bindingindex, divisor);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glVertexBindingDivisor(GLuint bindingindex, GLuint divisor)
{
m_Real.glVertexBindingDivisor(bindingindex, divisor);
if(m_State >= WRITING)
{
GLResourceRecord *varecord = GetCtxData().m_VertexArrayRecord;
GLResourceRecord *r = m_State == WRITING_CAPFRAME ? m_ContextRecord : varecord;
if(r)
{
if(m_State == WRITING_IDLE && !RecordUpdateCheck(varecord))
return;
if(m_State == WRITING_CAPFRAME && varecord)
GetResourceManager()->MarkVAOReferenced(varecord->Resource, eFrameRef_ReadBeforeWrite);
{
SCOPED_SERIALISE_CONTEXT(VERTEXBINDINGDIVISOR);
Serialise_glVertexArrayVertexBindingDivisorEXT(varecord ? varecord->Resource.name : 0,
bindingindex, divisor);
r->AddChunk(scope.Get());
}
}
}
}
void WrappedOpenGL::glDeleteBuffers(GLsizei n, const GLuint *buffers)
{
for(GLsizei i = 0; i < n; i++)
{
GLResource res = BufferRes(GetCtx(), buffers[i]);
if(GetResourceManager()->HasCurrentResource(res))
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(res);
if(record)
{
// if we have a persistent pointer, make sure to unmap it
if(record->Map.persistentPtr)
{
m_PersistentMaps.erase(record);
if(record->Map.access & GL_MAP_COHERENT_BIT)
m_CoherentMaps.erase(record);
m_Real.glUnmapNamedBufferEXT(res.name);
}
// free any shadow storage
record->FreeShadowStorage();
}
GetResourceManager()->MarkCleanResource(res);
if(GetResourceManager()->HasResourceRecord(res))
GetResourceManager()->GetResourceRecord(res)->Delete(GetResourceManager());
GetResourceManager()->UnregisterResource(res);
}
}
m_Real.glDeleteBuffers(n, buffers);
}
void WrappedOpenGL::glDeleteVertexArrays(GLsizei n, const GLuint *arrays)
{
for(GLsizei i = 0; i < n; i++)
{
GLResource res = VertexArrayRes(GetCtx(), arrays[i]);
if(GetResourceManager()->HasCurrentResource(res))
{
GetResourceManager()->MarkCleanResource(res);
if(GetResourceManager()->HasResourceRecord(res))
GetResourceManager()->GetResourceRecord(res)->Delete(GetResourceManager());
GetResourceManager()->UnregisterResource(res);
}
}
m_Real.glDeleteVertexArrays(n, arrays);
}
#pragma endregion
#pragma region Horrible glVertexAttrib variants
bool WrappedOpenGL::Serialise_glVertexAttrib(GLuint index, int count, GLenum type,
GLboolean normalized, const void *value, int attribtype)
{
SERIALISE_ELEMENT(uint32_t, idx, index);
SERIALISE_ELEMENT(int32_t, Count, count);
SERIALISE_ELEMENT(int, Type, attribtype);
SERIALISE_ELEMENT(bool, norm, normalized == GL_TRUE);
SERIALISE_ELEMENT(GLenum, packedType, type);
AttribType attr = AttribType(Type & Attrib_typemask);
size_t elemSize = 1;
switch(attr)
{
case Attrib_GLdouble: elemSize = 8; break;
case Attrib_GLfloat:
case Attrib_GLint:
case Attrib_GLuint:
case Attrib_packed: elemSize = 4; break;
case Attrib_GLshort:
case Attrib_GLushort: elemSize = 2; break;
default:
case Attrib_GLbyte:
case Attrib_GLubyte: elemSize = 1; break;
}
size_t valueSize = elemSize * Count;
if(Type == Attrib_packed)
valueSize = sizeof(uint32_t);
if(m_State >= WRITING)
{
m_pSerialiser->RawWriteBytes(value, valueSize);
}
else if(m_State <= EXECUTING)
{
value = m_pSerialiser->RawReadBytes(valueSize);
if(Type == Attrib_packed)
{
if(Count == 1)
m_Real.glVertexAttribP1uiv(idx, packedType, norm, (GLuint *)value);
else if(Count == 2)
m_Real.glVertexAttribP2uiv(idx, packedType, norm, (GLuint *)value);
else if(Count == 3)
m_Real.glVertexAttribP3uiv(idx, packedType, norm, (GLuint *)value);
else if(Count == 4)
m_Real.glVertexAttribP4uiv(idx, packedType, norm, (GLuint *)value);
}
else if(Type & Attrib_I)
{
if(Count == 1)
{
if(attr == Attrib_GLint)
m_Real.glVertexAttribI1iv(idx, (GLint *)value);
else if(attr == Attrib_GLuint)
m_Real.glVertexAttribI1uiv(idx, (GLuint *)value);
}
else if(Count == 2)
{
if(attr == Attrib_GLint)
m_Real.glVertexAttribI2iv(idx, (GLint *)value);
else if(attr == Attrib_GLuint)
m_Real.glVertexAttribI2uiv(idx, (GLuint *)value);
}
else if(Count == 3)
{
if(attr == Attrib_GLint)
m_Real.glVertexAttribI3iv(idx, (GLint *)value);
else if(attr == Attrib_GLuint)
m_Real.glVertexAttribI3uiv(idx, (GLuint *)value);
}
else
{
if(attr == Attrib_GLbyte)
m_Real.glVertexAttribI4bv(idx, (GLbyte *)value);
else if(attr == Attrib_GLint)
m_Real.glVertexAttribI4iv(idx, (GLint *)value);
else if(attr == Attrib_GLshort)
m_Real.glVertexAttribI4sv(idx, (GLshort *)value);
else if(attr == Attrib_GLubyte)
m_Real.glVertexAttribI4ubv(idx, (GLubyte *)value);
else if(attr == Attrib_GLuint)
m_Real.glVertexAttribI4uiv(idx, (GLuint *)value);
else if(attr == Attrib_GLushort)
m_Real.glVertexAttribI4usv(idx, (GLushort *)value);
}
}
else if(Type & Attrib_L)
{
if(Count == 1)
m_Real.glVertexAttribL1dv(idx, (GLdouble *)value);
else if(Count == 2)
m_Real.glVertexAttribL2dv(idx, (GLdouble *)value);
else if(Count == 3)
m_Real.glVertexAttribL3dv(idx, (GLdouble *)value);
else if(Count == 4)
m_Real.glVertexAttribL4dv(idx, (GLdouble *)value);
}
else if(Type & Attrib_N)
{
if(attr == Attrib_GLbyte)
m_Real.glVertexAttrib4Nbv(idx, (GLbyte *)value);
else if(attr == Attrib_GLint)
m_Real.glVertexAttrib4Niv(idx, (GLint *)value);
else if(attr == Attrib_GLshort)
m_Real.glVertexAttrib4Nsv(idx, (GLshort *)value);
else if(attr == Attrib_GLubyte)
m_Real.glVertexAttrib4Nubv(idx, (GLubyte *)value);
else if(attr == Attrib_GLuint)
m_Real.glVertexAttrib4Nuiv(idx, (GLuint *)value);
else if(attr == Attrib_GLushort)
m_Real.glVertexAttrib4Nusv(idx, (GLushort *)value);
}
else
{
if(Count == 1)
{
if(attr == Attrib_GLdouble)
m_Real.glVertexAttrib1dv(idx, (GLdouble *)value);
else if(attr == Attrib_GLfloat)
m_Real.glVertexAttrib1fv(idx, (GLfloat *)value);
else if(attr == Attrib_GLshort)
m_Real.glVertexAttrib1sv(idx, (GLshort *)value);
}
else if(Count == 2)
{
if(attr == Attrib_GLdouble)
m_Real.glVertexAttrib2dv(idx, (GLdouble *)value);
else if(attr == Attrib_GLfloat)
m_Real.glVertexAttrib2fv(idx, (GLfloat *)value);
else if(attr == Attrib_GLshort)
m_Real.glVertexAttrib2sv(idx, (GLshort *)value);
}
else if(Count == 3)
{
if(attr == Attrib_GLdouble)
m_Real.glVertexAttrib3dv(idx, (GLdouble *)value);
else if(attr == Attrib_GLfloat)
m_Real.glVertexAttrib3fv(idx, (GLfloat *)value);
else if(attr == Attrib_GLshort)
m_Real.glVertexAttrib3sv(idx, (GLshort *)value);
}
else
{
if(attr == Attrib_GLdouble)
m_Real.glVertexAttrib4dv(idx, (GLdouble *)value);
else if(attr == Attrib_GLfloat)
m_Real.glVertexAttrib4fv(idx, (GLfloat *)value);
else if(attr == Attrib_GLbyte)
m_Real.glVertexAttrib4bv(idx, (GLbyte *)value);
else if(attr == Attrib_GLint)
m_Real.glVertexAttrib4iv(idx, (GLint *)value);
else if(attr == Attrib_GLshort)
m_Real.glVertexAttrib4sv(idx, (GLshort *)value);
else if(attr == Attrib_GLubyte)
m_Real.glVertexAttrib4ubv(idx, (GLubyte *)value);
else if(attr == Attrib_GLuint)
m_Real.glVertexAttrib4uiv(idx, (GLuint *)value);
else if(attr == Attrib_GLushort)
m_Real.glVertexAttrib4usv(idx, (GLushort *)value);
}
}
}
return true;
}
#define ATTRIB_FUNC(count, suffix, TypeOr, paramtype, ...) \
\
void WrappedOpenGL::CONCAT(glVertexAttrib, suffix)(GLuint index, __VA_ARGS__) \
\
{ \
m_Real.CONCAT(glVertexAttrib, suffix)(index, ARRAYLIST); \
\
if(m_State >= WRITING_CAPFRAME) \
{ \
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIB_GENERIC); \
const paramtype vals[] = {ARRAYLIST}; \
Serialise_glVertexAttrib(index, count, eGL_NONE, GL_FALSE, vals, \
TypeOr | CONCAT(Attrib_, paramtype)); \
\
m_ContextRecord->AddChunk(scope.Get()); \
} \
}
#define ARRAYLIST x
ATTRIB_FUNC(1, 1f, 0, GLfloat, GLfloat x)
ATTRIB_FUNC(1, 1s, 0, GLshort, GLshort x)
ATTRIB_FUNC(1, 1d, 0, GLdouble, GLdouble x)
ATTRIB_FUNC(1, L1d, Attrib_L, GLdouble, GLdouble x)
ATTRIB_FUNC(1, I1i, Attrib_I, GLint, GLint x)
ATTRIB_FUNC(1, I1ui, Attrib_I, GLuint, GLuint x)
#undef ARRAYLIST
#define ARRAYLIST x, y
ATTRIB_FUNC(2, 2f, 0, GLfloat, GLfloat x, GLfloat y)
ATTRIB_FUNC(2, 2s, 0, GLshort, GLshort x, GLshort y)
ATTRIB_FUNC(2, 2d, 0, GLdouble, GLdouble x, GLdouble y)
ATTRIB_FUNC(2, L2d, Attrib_L, GLdouble, GLdouble x, GLdouble y)
ATTRIB_FUNC(2, I2i, Attrib_I, GLint, GLint x, GLint y)
ATTRIB_FUNC(2, I2ui, Attrib_I, GLuint, GLuint x, GLuint y)
#undef ARRAYLIST
#define ARRAYLIST x, y, z
ATTRIB_FUNC(3, 3f, 0, GLfloat, GLfloat x, GLfloat y, GLfloat z)
ATTRIB_FUNC(3, 3s, 0, GLshort, GLshort x, GLshort y, GLshort z)
ATTRIB_FUNC(3, 3d, 0, GLdouble, GLdouble x, GLdouble y, GLdouble z)
ATTRIB_FUNC(3, L3d, Attrib_L, GLdouble, GLdouble x, GLdouble y, GLdouble z)
ATTRIB_FUNC(3, I3i, Attrib_I, GLint, GLint x, GLint y, GLint z)
ATTRIB_FUNC(3, I3ui, Attrib_I, GLuint, GLuint x, GLuint y, GLuint z)
#undef ARRAYLIST
#define ARRAYLIST x, y, z, w
ATTRIB_FUNC(4, 4f, 0, GLfloat, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
ATTRIB_FUNC(4, 4s, 0, GLshort, GLshort x, GLshort y, GLshort z, GLshort w)
ATTRIB_FUNC(4, 4d, 0, GLdouble, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
ATTRIB_FUNC(4, L4d, Attrib_L, GLdouble, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
ATTRIB_FUNC(4, I4i, Attrib_I, GLint, GLint x, GLint y, GLint z, GLint w)
ATTRIB_FUNC(4, I4ui, Attrib_I, GLuint, GLuint x, GLuint y, GLuint z, GLuint w)
ATTRIB_FUNC(4, 4Nub, Attrib_N, GLubyte, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
#undef ATTRIB_FUNC
#define ATTRIB_FUNC(count, suffix, TypeOr, paramtype) \
\
void WrappedOpenGL::CONCAT(glVertexAttrib, suffix)(GLuint index, const paramtype *value) \
\
{ \
m_Real.CONCAT(glVertexAttrib, suffix)(index, value); \
\
if(m_State >= WRITING_CAPFRAME) \
{ \
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIB_GENERIC); \
Serialise_glVertexAttrib(index, count, eGL_NONE, GL_FALSE, value, \
TypeOr | CONCAT(Attrib_, paramtype)); \
\
m_ContextRecord->AddChunk(scope.Get()); \
} \
}
ATTRIB_FUNC(1, 1dv, 0, GLdouble)
ATTRIB_FUNC(2, 2dv, 0, GLdouble)
ATTRIB_FUNC(3, 3dv, 0, GLdouble)
ATTRIB_FUNC(4, 4dv, 0, GLdouble)
ATTRIB_FUNC(1, 1sv, 0, GLshort)
ATTRIB_FUNC(2, 2sv, 0, GLshort)
ATTRIB_FUNC(3, 3sv, 0, GLshort)
ATTRIB_FUNC(4, 4sv, 0, GLshort)
ATTRIB_FUNC(1, 1fv, 0, GLfloat)
ATTRIB_FUNC(2, 2fv, 0, GLfloat)
ATTRIB_FUNC(3, 3fv, 0, GLfloat)
ATTRIB_FUNC(4, 4fv, 0, GLfloat)
ATTRIB_FUNC(4, 4bv, 0, GLbyte)
ATTRIB_FUNC(4, 4iv, 0, GLint)
ATTRIB_FUNC(4, 4uiv, 0, GLuint)
ATTRIB_FUNC(4, 4usv, 0, GLushort)
ATTRIB_FUNC(4, 4ubv, 0, GLubyte)
ATTRIB_FUNC(1, L1dv, Attrib_L, GLdouble)
ATTRIB_FUNC(2, L2dv, Attrib_L, GLdouble)
ATTRIB_FUNC(3, L3dv, Attrib_L, GLdouble)
ATTRIB_FUNC(4, L4dv, Attrib_L, GLdouble)
ATTRIB_FUNC(1, I1iv, Attrib_I, GLint)
ATTRIB_FUNC(1, I1uiv, Attrib_I, GLuint)
ATTRIB_FUNC(2, I2iv, Attrib_I, GLint)
ATTRIB_FUNC(2, I2uiv, Attrib_I, GLuint)
ATTRIB_FUNC(3, I3iv, Attrib_I, GLint)
ATTRIB_FUNC(3, I3uiv, Attrib_I, GLuint)
ATTRIB_FUNC(4, I4bv, Attrib_I, GLbyte)
ATTRIB_FUNC(4, I4iv, Attrib_I, GLint)
ATTRIB_FUNC(4, I4sv, Attrib_I, GLshort)
ATTRIB_FUNC(4, I4ubv, Attrib_I, GLubyte)
ATTRIB_FUNC(4, I4uiv, Attrib_I, GLuint)
ATTRIB_FUNC(4, I4usv, Attrib_I, GLushort)
ATTRIB_FUNC(4, 4Nbv, Attrib_N, GLbyte)
ATTRIB_FUNC(4, 4Niv, Attrib_N, GLint)
ATTRIB_FUNC(4, 4Nsv, Attrib_N, GLshort)
ATTRIB_FUNC(4, 4Nubv, Attrib_N, GLubyte)
ATTRIB_FUNC(4, 4Nuiv, Attrib_N, GLuint)
ATTRIB_FUNC(4, 4Nusv, Attrib_N, GLushort)
#undef ATTRIB_FUNC
#define ATTRIB_FUNC(count, suffix, funcparam, passparam) \
\
void WrappedOpenGL::CONCAT(CONCAT(glVertexAttribP, count), suffix)( \
GLuint index, GLenum type, GLboolean normalized, funcparam) \
\
{ \
m_Real.CONCAT(CONCAT(glVertexAttribP, count), suffix)(index, type, normalized, value); \
\
if(m_State >= WRITING_CAPFRAME) \
{ \
SCOPED_SERIALISE_CONTEXT(VERTEXATTRIB_GENERIC); \
Serialise_glVertexAttrib(index, count, type, normalized, passparam, Attrib_packed); \
\
m_ContextRecord->AddChunk(scope.Get()); \
} \
}
ATTRIB_FUNC(1, ui, GLuint value, &value)
ATTRIB_FUNC(2, ui, GLuint value, &value)
ATTRIB_FUNC(3, ui, GLuint value, &value)
ATTRIB_FUNC(4, ui, GLuint value, &value)
ATTRIB_FUNC(1, uiv, const GLuint *value, value)
ATTRIB_FUNC(2, uiv, const GLuint *value, value)
ATTRIB_FUNC(3, uiv, const GLuint *value, value)
ATTRIB_FUNC(4, uiv, const GLuint *value, value)
#pragma endregion
| 34.328207 | 103 | 0.650372 | [
"object",
"transform",
"3d"
] |
9994263176cb45434616246616d39f44811ccbef | 1,861 | cc | C++ | tests/test_filters.cc | buffyanamin/clang-uml | 7ca70d97eecc0f3ab1267b024771edc6131950fb | [
"Apache-2.0"
] | null | null | null | tests/test_filters.cc | buffyanamin/clang-uml | 7ca70d97eecc0f3ab1267b024771edc6131950fb | [
"Apache-2.0"
] | null | null | null | tests/test_filters.cc | buffyanamin/clang-uml | 7ca70d97eecc0f3ab1267b024771edc6131950fb | [
"Apache-2.0"
] | null | null | null | /**
* tests/test_filters.cc
*
* Copyright (c) 2021-2022 Bartek Kryza <bkryza@gmail.com>
*
* 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.
*/
#define CATCH_CONFIG_MAIN
#include "catch.h"
#include "common/model/diagram_filter.h"
#include "common/model/source_file.h"
#include "config/config.h"
#include "include_diagram/model/diagram.h"
#include <filesystem>
TEST_CASE("Test diagram paths filter", "[unit-test]")
{
using clanguml::common::model::diagram_filter;
using clanguml::common::model::source_file;
auto make_path = [](std::string_view p) {
return source_file{
std::filesystem::current_path() / "test_config_data" / p};
};
auto cfg = clanguml::config::load("./test_config_data/filters.yml");
CHECK(cfg.diagrams.size() == 1);
auto &config = *cfg.diagrams["include_test"];
clanguml::include_diagram::model::diagram diagram;
diagram_filter filter(diagram, config);
CHECK(filter.should_include(make_path("dir1/file1.h")));
CHECK(filter.should_include(make_path("dir1/dir2/file1.h")));
CHECK(filter.should_include(make_path("dir1/dir2/dir3/dir4/file1.h")));
CHECK_FALSE(filter.should_include(make_path("dir1/file9.h")));
CHECK_FALSE(filter.should_include(make_path("dir1/dir3/file1.h")));
CHECK_FALSE(filter.should_include(make_path("dir2/dir1/file9.h")));
}
| 33.836364 | 75 | 0.716819 | [
"model"
] |
999678ee22c49d6c262fe407207aac5fceeacd3a | 1,436 | hpp | C++ | game/code/ios/audio/format/iosformat.hpp | justinctlam/MarbleStrike | 64fe36a5a4db2b299983b0e2556ab1cd8126259b | [
"MIT"
] | null | null | null | game/code/ios/audio/format/iosformat.hpp | justinctlam/MarbleStrike | 64fe36a5a4db2b299983b0e2556ab1cd8126259b | [
"MIT"
] | null | null | null | game/code/ios/audio/format/iosformat.hpp | justinctlam/MarbleStrike | 64fe36a5a4db2b299983b0e2556ab1cd8126259b | [
"MIT"
] | 2 | 2019-03-08T03:02:45.000Z | 2019-05-14T08:41:26.000Z | #ifndef IOS_FORMAT_HPP
#define IOS_FORMAT_HPP
#ifdef PLAT_IOS
//////////////////////////////////////////////////////
// INCLUDES
//////////////////////////////////////////////////////
#include "common/engine/audio/format/iaudiostaticformat.hpp"
#include "ios/audio/format/iosformatinterface.hpp"
#include <vector>
//////////////////////////////////////////////////////
// FORWARD DECLARATIONS
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
// CONSTANTS
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
// STRUCTURES
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
// CLASSES
//////////////////////////////////////////////////////
namespace Audio
{
class iOSFormat : public IAudioStaticFormat
{
public:
iOSFormat();
virtual ~iOSFormat();
void Load( const char* filename );
int GetChannels()
{
return miOSFormatInterface.GetChannels();
}
int GetSamplesPerSecond()
{
return miOSFormatInterface.GetSamplesPerSecond();
}
int GetBitsPerSample()
{
return miOSFormatInterface.GetBitsPerSample();
}
int GetDataSize()
{
return miOSFormatInterface.GetDataSize();
}
char* GetData()
{
return mData;
}
private:
char* mData;
iOSFormatInterface miOSFormatInterface;
};
}
#endif
#endif | 18.894737 | 60 | 0.439415 | [
"vector"
] |
9996e2701ae3fb6551bc8566d1d9b9448df47f47 | 142,481 | cpp | C++ | gencpu/cputest.cpp | emoon/m68k_cpu_tester_api | 025b999239800357e95065fe5b9a15ea5b300fa7 | [
"MIT"
] | 4 | 2019-10-28T21:23:37.000Z | 2020-06-05T21:26:58.000Z | gencpu/cputest.cpp | emoon/m68k_cpu_tester_api | 025b999239800357e95065fe5b9a15ea5b300fa7 | [
"MIT"
] | null | null | null | gencpu/cputest.cpp | emoon/m68k_cpu_tester_api | 025b999239800357e95065fe5b9a15ea5b300fa7 | [
"MIT"
] | null | null | null |
#include "cputest.h"
#include "cputbl_test.h"
#include "readcpu.h"
#include "disasm.h"
#include "ini.h"
#include "fpp.h"
#include "string_wrappers.h"
//#include "zlib.h"
#include "options.h"
#define MAX_REGISTERS 16
static uae_u32 registers[] =
{
0x00000010,
0x00000000,
0xffffffff,
0xffffff00,
0xffff0000,
0x80008080,
0x7fff7fff,
0xaaaaaaaa,
0x00000000,
0x00000080,
0x00008000,
0x00007fff,
0xfffffffe,
0xffffff00,
0x00000000, // replaced with opcode memory
0x00000000 // replaced with stack
};
static floatx80 fpuregisters[8];
static uae_u32 fpu_fpiar, fpu_fpcr, fpu_fpsr;
const int areg_byteinc[] = { 1, 1, 1, 1, 1, 1, 1, 2 };
const int imm8_table[] = { 8, 1, 2, 3, 4, 5, 6, 7 };
int movem_index1[256];
int movem_index2[256];
int movem_next[256];
int hardware_bus_error, hardware_bus_error_fake;
struct mmufixup mmufixup[2];
cpuop_func *cpufunctbl[65536];
struct cputbl_data
{
uae_s16 length;
uae_s8 disp020[2];
uae_u8 branch;
};
static struct cputbl_data cpudatatbl[65536];
struct regstruct regs;
struct flag_struct regflags;
int cpu_cycles;
static int verbose = 1;
static int feature_exception3_data = 0;
static int feature_exception3_instruction = 0;
static int feature_sr_mask = 0;
static int feature_min_interrupt_mask = 0;
static int feature_loop_mode = 0;
static int feature_loop_mode_register = -1;
static int feature_loop_mode_68010 = 0;
static int feature_full_extension_format = 0;
static int feature_test_rounds = 2;
static int feature_flag_mode = 0;
static int feature_usp = 0;
static int feature_exception_vectors = 0;
static int feature_interrupts = 0;
static int feature_randomize = 0;
static TCHAR *feature_instruction_size = NULL;
static uae_u32 feature_addressing_modes[2];
static int feature_gzip = 0;
static int ad8r[2], pc8r[2];
static int multi_mode;
#define MAX_TARGET_EA 20
static uae_u32 feature_target_ea[MAX_TARGET_EA][3];
static int target_ea_src_cnt, target_ea_dst_cnt, target_ea_opcode_cnt;
static int target_ea_src_max, target_ea_dst_max, target_ea_opcode_max;
static uae_u32 target_ea[3];
static int maincpu[6];
#define HIGH_MEMORY_START (addressing_mask == 0xffffffff ? 0xffff8000 : 0x00ff8000)
// large enough for RTD
#define STACK_SIZE (0x8000 + 8)
#define RESERVED_SUPERSTACK 1024
// space between superstack and USP
#define RESERVED_USERSTACK_EXTRA 64
// space for extra exception, not part of test region
#define EXTRA_RESERVED_SPACE 1024
static uae_u32 test_low_memory_start;
static uae_u32 test_low_memory_end;
static uae_u32 test_high_memory_start;
static uae_u32 test_high_memory_end;
static uae_u32 low_memory_size = 32768;
static uae_u32 high_memory_size = 32768;
static uae_u32 safe_memory_start;
static uae_u32 safe_memory_end;
static int safe_memory_mode;
static uae_u32 user_stack_memory, super_stack_memory;
static uae_u32 user_stack_memory_use;
static uae_u8 *low_memory, *high_memory, *test_memory;
static uae_u8 *low_memory_temp, *high_memory_temp, *test_memory_temp;
static uae_u8 dummy_memory[4];
static uaecptr test_memory_start, test_memory_end, opcode_memory_start;
static uae_u32 test_memory_size;
static int hmem_rom, lmem_rom;
static uae_u8 *opcode_memory;
static uae_u8 *storage_buffer;
static char inst_name[16+1];
static int storage_buffer_watermark_size;
static int storage_buffer_watermark;
static int max_storage_buffer;
static bool out_of_test_space;
static uaecptr out_of_test_space_addr;
static int forced_immediate_mode;
static int test_exception;
static int test_exception_extra;
static int exception_stack_frame_size;
static uae_u8 exception_extra_frame[100];
static int exception_extra_frame_size, exception_extra_frame_type;
static uaecptr test_exception_addr;
static int test_exception_3_w;
static int test_exception_3_fc;
static int test_exception_3_size;
static int test_exception_3_di;
static int test_exception_opcode;
static uae_u32 trace_store_pc;
static uae_u16 trace_store_sr;
static uae_u8 imm8_cnt;
static uae_u16 imm16_cnt;
static uae_u32 imm32_cnt;
static uae_u32 immabsl_cnt;
static uae_u32 addressing_mask;
static int opcodecnt;
static int cpu_stopped;
static int cpu_halted;
static int cpu_lvl = 0;
static int test_count;
static int testing_active;
static uae_u16 testing_active_opcode;
static time_t starttime;
static int filecount;
static uae_u16 sr_undefined_mask;
static int low_memory_accessed;
static int high_memory_accessed;
static int test_memory_accessed;
static uae_u16 extra_or, extra_and;
static uae_u32 cur_registers[MAX_REGISTERS];
static uae_u16 read_buffer_prev;
static int interrupt_count;
struct uae_prefs currprefs;
struct accesshistory
{
uaecptr addr;
uae_u32 val;
uae_u32 oldval;
int size;
bool donotsave;
};
static int ahcnt_current, ahcnt_written;
static int noaccesshistory = 0;
#define MAX_ACCESSHIST 16000
static struct accesshistory ahist[MAX_ACCESSHIST];
static int is_superstack_use_required(void)
{
switch (testing_active_opcode)
{
case 0x4e73: // RTE
return 1;
}
return 0;
}
#define OPCODE_AREA 32
#define BRANCHTARGET_AREA 4
static bool valid_address(uaecptr addr, int size, int w)
{
addr &= addressing_mask;
size--;
if (low_memory_size != 0xffffffff && addr + size < low_memory_size) {
if (addr < test_low_memory_start || test_low_memory_start == 0xffffffff)
goto oob;
// exception vectors needed during tests
if ((addr + size >= 0x08 && addr < 0x30 || (addr + size >= 0x80 && addr < 0xc0)) && regs.vbr == 0)
goto oob;
if (addr + size >= test_low_memory_end)
goto oob;
if (w && lmem_rom)
goto oob;
low_memory_accessed = w ? -1 : 1;
return 1;
}
if (high_memory_size != 0xffffffff && addr >= HIGH_MEMORY_START && addr <= HIGH_MEMORY_START + 0x7fff) {
if (addr < test_high_memory_start || test_high_memory_start == 0xffffffff)
goto oob;
if (addr + size >= test_high_memory_end)
goto oob;
if (w && hmem_rom)
goto oob;
high_memory_accessed = w ? -1 : 1;
return 1;
}
if (addr >= super_stack_memory - RESERVED_SUPERSTACK && addr + size < super_stack_memory) {
// allow only instructions that have to access super stack, for example RTE
// read-only
if (w) {
goto oob;
}
if (testing_active) {
if (is_superstack_use_required()) {
test_memory_accessed = 1;
return 1;
}
}
goto oob;
}
if (addr >= test_memory_end && addr + size < test_memory_end + EXTRA_RESERVED_SPACE) {
if (testing_active < 0)
return 1;
}
if (addr >= test_memory_start && addr + size < test_memory_end) {
// make sure we don't modify our test instruction
if (testing_active && w) {
if (addr >= opcode_memory_start && addr + size < opcode_memory_start + OPCODE_AREA)
goto oob;
}
test_memory_accessed = w ? -1 : 1;
return 1;
}
oob:
return 0;
}
static bool is_nowrite_address(uaecptr addr, int size)
{
return addr + size > safe_memory_start && addr < safe_memory_end;
}
static void validate_addr(uaecptr addr, int size)
{
if (valid_address(addr, size, 0))
return;
wprintf(_T(" Trying to store invalid memory address %08x!?\n"), addr);
abort();
}
static uae_u8 *get_addr(uaecptr addr, int size, int w)
{
// allow debug output to read memory even if oob condition
if (w >= 0 && out_of_test_space)
goto oob;
if (!valid_address(addr, 1, w))
goto oob;
if (size > 1) {
if (!valid_address(addr + size - 1, 1, w))
goto oob;
}
addr &= addressing_mask;
size--;
if (low_memory_size != 0xffffffff && addr + size < low_memory_size) {
return low_memory + addr;
} else if (high_memory_size != 0xffffffff && addr >= HIGH_MEMORY_START && addr <= HIGH_MEMORY_START + 0x7fff) {
return high_memory + (addr - HIGH_MEMORY_START);
} else if (addr >= test_memory_start && addr + size < test_memory_end + EXTRA_RESERVED_SPACE) {
return test_memory + (addr - test_memory_start);
}
oob:
if (w >= 0) {
if (!out_of_test_space) {
out_of_test_space = true;
out_of_test_space_addr = addr;
}
}
dummy_memory[0] = 0;
dummy_memory[1] = 0;
dummy_memory[2] = 0;
dummy_memory[3] = 0;
return dummy_memory;
}
void do_cycles_test(int cycles)
{
if (!testing_active)
return;
cpu_cycles += cycles;
}
static void add_memory_cycles(int c)
{
if (!testing_active)
return;
if (trace_store_pc != 0xffffffff)
return;
cpu_cycles += c * 4;
}
static void check_bus_error(uaecptr addr, int write, int fc)
{
if (!testing_active)
return;
if (safe_memory_start == 0xffffffff && safe_memory_end == 0xffffffff)
return;
if (addr >= safe_memory_start && addr < safe_memory_end) {
hardware_bus_error_fake = -1;
if ((safe_memory_mode & 4) && !write && (fc & 2)) {
hardware_bus_error |= 4;
hardware_bus_error_fake |= 1;
} else if ((safe_memory_mode & 1) && !write && !(fc & 2)) {
hardware_bus_error |= 1;
hardware_bus_error_fake |= 1;
} else if ((safe_memory_mode & 2) && write) {
hardware_bus_error |= 2;
hardware_bus_error_fake |= 2;
}
if (!write && (fc & 2) && feature_usp == 3) {
out_of_test_space = true;
out_of_test_space_addr = addr;
}
}
}
static uae_u8 get_ibyte_test(uaecptr addr)
{
check_bus_error(addr, 0, regs.s ? 5 : 1);
uae_u8 *p = get_addr(addr, 1, 0);
add_memory_cycles(1);
return *p;
}
static uae_u16 get_iword_test(uaecptr addr)
{
check_bus_error(addr, 0, regs.s ? 6 : 2);
if (addr & 1) {
return (get_ibyte_test(addr + 0) << 8) | (get_ibyte_test(addr + 1) << 0);
} else {
uae_u8 *p = get_addr(addr, 2, 0);
add_memory_cycles(1);
return (p[0] << 8) | (p[1]);
}
}
uae_u16 get_word_test_prefetch(int o)
{
// no real prefetch
if (cpu_lvl < 2)
o -= 2;
add_memory_cycles(-1);
regs.irc = get_iword_test(m68k_getpci() + o + 2);
read_buffer_prev = regs.read_buffer;
regs.read_buffer = regs.irc;
return get_iword_test(m68k_getpci() + o);
}
static void previoussame(uaecptr addr, int size)
{
if (!ahcnt_current || ahcnt_current == ahcnt_written)
return;
// Move from SR does two writes to same address.
// Loop mode can write different values to same address.
// Mark old values as do not save.
for (int i = ahcnt_written; i < ahcnt_current; i++) {
struct accesshistory *ah = &ahist[i];
if (ah->size == size && ah->addr == addr) {
ah->donotsave = true;
}
if (size == sz_long) {
if (ah->size == sz_word && ah->addr == addr) {
ah->donotsave = true;
}
if (ah->size == sz_word && ah->addr == addr + 2) {
ah->donotsave = true;
}
}
}
}
void put_byte_test(uaecptr addr, uae_u32 v)
{
if (!testing_active && is_nowrite_address(addr, 1))
return;
check_bus_error(addr, 1, regs.s ? 5 : 1);
uae_u8 *p = get_addr(addr, 1, 1);
if (!out_of_test_space && !noaccesshistory && !hardware_bus_error_fake) {
previoussame(addr, sz_byte);
if (ahcnt_current >= MAX_ACCESSHIST) {
wprintf(_T(" ahist overflow!"));
abort();
}
struct accesshistory *ah = &ahist[ahcnt_current++];
ah->addr = addr;
ah->val = v & 0xff;
ah->oldval = *p;
ah->size = sz_byte;
ah->donotsave = false;
}
regs.write_buffer &= 0xff00;
regs.write_buffer |= v & 0xff;
*p = v;
add_memory_cycles(1);
}
void put_word_test(uaecptr addr, uae_u32 v)
{
if (!testing_active && is_nowrite_address(addr, 1))
return;
check_bus_error(addr, 1, regs.s ? 5 : 1);
if (addr & 1) {
put_byte_test(addr + 0, v >> 8);
put_byte_test(addr + 1, v >> 0);
} else {
uae_u8 *p = get_addr(addr, 2, 1);
if (!out_of_test_space && !noaccesshistory && !hardware_bus_error_fake) {
previoussame(addr, sz_word);
if (ahcnt_current >= MAX_ACCESSHIST) {
wprintf(_T(" ahist overflow!"));
abort();
}
struct accesshistory *ah = &ahist[ahcnt_current++];
ah->addr = addr;
ah->val = v & 0xffff;
ah->oldval = (p[0] << 8) | p[1];
ah->size = sz_word;
ah->donotsave = false;
}
p[0] = v >> 8;
p[1] = v & 0xff;
}
regs.write_buffer = v;
add_memory_cycles(1);
}
void put_long_test(uaecptr addr, uae_u32 v)
{
if (!testing_active && is_nowrite_address(addr, 1))
return;
check_bus_error(addr, 1, regs.s ? 5 : 1);
if (addr & 1) {
put_byte_test(addr + 0, v >> 24);
put_word_test(addr + 1, v >> 8);
put_byte_test(addr + 3, v >> 0);
} else if (addr & 2) {
put_word_test(addr + 0, v >> 16);
put_word_test(addr + 2, v >> 0);
} else {
uae_u8 *p = get_addr(addr, 4, 1);
if (!out_of_test_space && !noaccesshistory && !hardware_bus_error_fake) {
previoussame(addr, sz_long);
if (ahcnt_current >= MAX_ACCESSHIST) {
wprintf(_T(" ahist overflow!"));
abort();
}
struct accesshistory *ah = &ahist[ahcnt_current++];
ah->addr = addr;
ah->val = v;
ah->oldval = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
ah->size = sz_long;
ah->donotsave = false;
}
p[0] = v >> 24;
p[1] = v >> 16;
p[2] = v >> 8;
p[3] = v >> 0;
add_memory_cycles(2);
}
regs.write_buffer = v;
}
static void undo_memory(struct accesshistory *ahp, int end)
{
out_of_test_space = 0;
noaccesshistory = 1;
for (int i = ahcnt_current - 1; i >= end; i--) {
struct accesshistory *ah = &ahp[i];
switch (ah->size)
{
case sz_byte:
put_byte_test(ah->addr, ah->oldval);
break;
case sz_word:
put_word_test(ah->addr, ah->oldval);
break;
case sz_long:
put_long_test(ah->addr, ah->oldval);
break;
}
}
noaccesshistory = 0;
if (out_of_test_space) {
wprintf(_T(" undo_memory out of test space fault!?\n"));
abort();
}
ahcnt_current = end;
}
uae_u32 get_byte_test(uaecptr addr)
{
check_bus_error(addr, 0, regs.s ? 5 : 1);
uae_u8 *p = get_addr(addr, 1, 0);
read_buffer_prev = regs.read_buffer;
regs.read_buffer &= 0xff00;
regs.read_buffer |= *p;
add_memory_cycles(1);
return *p;
}
uae_u32 get_word_test(uaecptr addr)
{
uae_u16 v;
check_bus_error(addr, 0, regs.s ? 5 : 1);
if (addr & 1) {
v = (get_byte_test(addr + 0) << 8) | (get_byte_test(addr + 1) << 0);
} else {
uae_u8 *p = get_addr(addr, 2, 0);
v = (p[0] << 8) | (p[1]);
}
read_buffer_prev = regs.read_buffer;
regs.read_buffer = v;
add_memory_cycles(1);
return v;
}
uae_u32 get_long_test(uaecptr addr)
{
uae_u32 v;
check_bus_error(addr, 0, regs.s ? 5 : 1);
if (addr & 1) {
uae_u8 v0 = get_byte_test(addr + 0);
uae_u16 v1 = get_word_test(addr + 1);
uae_u8 v3 = get_byte_test(addr + 3);
v = (v0 << 24) | (v1 << 8) | (v3 << 0);
} else if (addr & 2) {
uae_u16 v0 = get_word_test(addr + 0);
uae_u16 v1 = get_word_test(addr + 2);
v = (v0 << 16) | (v1 << 0);
} else {
uae_u8 *p = get_addr(addr, 4, 0);
v = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]);
add_memory_cycles(2);
}
read_buffer_prev = regs.read_buffer;
regs.read_buffer = v;
return v;
}
uae_u32 get_byte_debug(uaecptr addr)
{
uae_u8 *p = get_addr(addr, 1, -1);
return *p;
}
uae_u32 get_word_debug(uaecptr addr)
{
uae_u8 *p = get_addr(addr, 2, -1);
return (p[0] << 8) | (p[1]);
}
uae_u32 get_long_debug(uaecptr addr)
{
uae_u8 *p = get_addr(addr, 4, -1);
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]);
}
uae_u32 get_iword_debug(uaecptr addr)
{
return get_word_debug(addr);
}
uae_u32 get_ilong_debug(uaecptr addr)
{
return get_long_debug(addr);
}
uae_u32 get_byte_cache_debug(uaecptr addr, bool *cached)
{
*cached = false;
return get_byte_test(addr);
}
uae_u32 get_word_cache_debug(uaecptr addr, bool *cached)
{
*cached = false;
return get_word_test(addr);
}
uae_u32 get_long_cache_debug(uaecptr addr, bool *cached)
{
*cached = false;
return get_long_test(addr);
}
uae_u32 sfc_nommu_get_byte(uaecptr addr)
{
return get_byte_test(addr);
}
uae_u32 sfc_nommu_get_word(uaecptr addr)
{
return get_word_test(addr);
}
uae_u32 sfc_nommu_get_long(uaecptr addr)
{
return get_long_test(addr);
}
void dfc_nommu_put_byte(uaecptr addr, uae_u32 v)
{
put_byte_test(addr, v);
}
void dfc_nommu_put_word(uaecptr addr, uae_u32 v)
{
put_word_test(addr, v);
}
void dfc_nommu_put_long(uaecptr addr, uae_u32 v)
{
put_long_test(addr, v);
}
uae_u16 get_wordi_test(int o)
{
uae_u32 v = get_word_test_prefetch(o);
regs.pc += 2;
return v;
}
uae_u32 memory_get_byte(uaecptr addr)
{
return get_byte_test(addr);
}
uae_u32 memory_get_word(uaecptr addr)
{
return get_word_test(addr);
}
uae_u32 memory_get_wordi(uaecptr addr)
{
return get_word_test(addr);
}
uae_u32 memory_get_long(uaecptr addr)
{
return get_long_test(addr);
}
uae_u32 memory_get_longi(uaecptr addr)
{
return get_long_test(addr);
}
void memory_put_long(uaecptr addr, uae_u32 v)
{
put_long_test(addr, v);
}
void memory_put_word(uaecptr addr, uae_u32 v)
{
put_word_test(addr, v);
}
void memory_put_byte(uaecptr addr, uae_u32 v)
{
put_byte_test(addr, v);
}
uae_u8 *memory_get_real_address(uaecptr addr)
{
return NULL;
}
uae_u32 next_iword_test(void)
{
uae_u32 v = get_word_test_prefetch(0);
regs.pc += 2;
return v;
}
uae_u32 next_ilong_test(void)
{
uae_u32 v = get_word_test_prefetch(0) << 16;
v |= get_word_test_prefetch(2);
regs.pc += 4;
return v;
}
bool mmu_op30(uaecptr pc, uae_u32 opcode, uae_u16 extra, uaecptr extraa)
{
m68k_setpc(pc);
op_illg(opcode);
return true;
}
bool is_cycle_ce(uaecptr addr)
{
return 0;
}
void ipl_fetch(void)
{
}
int intlev(void)
{
return 0;
}
uae_u32(*x_get_long)(uaecptr);
uae_u32(*x_get_word)(uaecptr);
uae_u32(*x_get_byte)(uaecptr);
void (*x_put_long)(uaecptr, uae_u32);
void (*x_put_word)(uaecptr, uae_u32);
void (*x_put_byte)(uaecptr, uae_u32);
uae_u32(*x_cp_get_long)(uaecptr);
uae_u32(*x_cp_get_word)(uaecptr);
uae_u32(*x_cp_get_byte)(uaecptr);
void (*x_cp_put_long)(uaecptr, uae_u32);
void (*x_cp_put_word)(uaecptr, uae_u32);
void (*x_cp_put_byte)(uaecptr, uae_u32);
uae_u32(*x_cp_next_iword)(void);
uae_u32(*x_cp_next_ilong)(void);
uae_u32(*x_next_iword)(void);
uae_u32(*x_next_ilong)(void);
void (*x_do_cycles)(unsigned long);
uae_u32(REGPARAM3 *x_cp_get_disp_ea_020)(uae_u32 base, int idx) REGPARAM;
void m68k_do_rts_ce(void)
{
uaecptr pc;
pc = x_get_word(m68k_areg(regs, 7)) << 16;
pc |= x_get_word(m68k_areg(regs, 7) + 2);
m68k_areg(regs, 7) += 4;
m68k_setpci(pc);
}
void m68k_do_bsr_ce(uaecptr oldpc, uae_s32 offset)
{
m68k_areg(regs, 7) -= 4;
x_put_word(m68k_areg(regs, 7), oldpc >> 16);
x_put_word(m68k_areg(regs, 7) + 2, oldpc);
m68k_incpci(offset);
}
void m68k_do_jsr_ce(uaecptr oldpc, uaecptr dest)
{
m68k_areg(regs, 7) -= 4;
x_put_word(m68k_areg(regs, 7), oldpc >> 16);
x_put_word(m68k_areg(regs, 7) + 2, oldpc);
m68k_setpci(dest);
}
static int SPCFLAG_TRACE, SPCFLAG_DOTRACE;
uae_u32 get_disp_ea_test(uae_u32 base, uae_u32 dp)
{
int reg = (dp >> 12) & 15;
uae_s32 regd = regs.regs[reg];
if ((dp & 0x800) == 0)
regd = (uae_s32)(uae_s16)regd;
return base + (uae_s8)dp + regd;
}
static void activate_trace(void)
{
SPCFLAG_TRACE = 0;
SPCFLAG_DOTRACE = 1;
}
static void do_trace(void)
{
regs.trace_pc = regs.pc;
if (regs.t0 && !regs.t1 && currprefs.cpu_model >= 68020) {
// this is obsolete
return;
}
if (regs.t1) {
activate_trace();
}
}
void REGPARAM2 MakeSR(void)
{
regs.sr = ((regs.t1 << 15) | (regs.t0 << 14)
| (regs.s << 13) | (regs.m << 12) | (regs.intmask << 8)
| (GET_XFLG() << 4) | (GET_NFLG() << 3)
| (GET_ZFLG() << 2) | (GET_VFLG() << 1)
| GET_CFLG());
}
void MakeFromSR_x(int t0trace)
{
int oldm = regs.m;
int olds = regs.s;
int oldt0 = regs.t0;
int oldt1 = regs.t1;
SET_XFLG((regs.sr >> 4) & 1);
SET_NFLG((regs.sr >> 3) & 1);
SET_ZFLG((regs.sr >> 2) & 1);
SET_VFLG((regs.sr >> 1) & 1);
SET_CFLG(regs.sr & 1);
if (regs.t1 == ((regs.sr >> 15) & 1) &&
regs.t0 == ((regs.sr >> 14) & 1) &&
regs.s == ((regs.sr >> 13) & 1) &&
regs.m == ((regs.sr >> 12) & 1) &&
regs.intmask == ((regs.sr >> 8) & 7))
return;
regs.t1 = (regs.sr >> 15) & 1;
regs.t0 = (regs.sr >> 14) & 1;
regs.s = (regs.sr >> 13) & 1;
regs.m = (regs.sr >> 12) & 1;
regs.intmask = (regs.sr >> 8) & 7;
if (currprefs.cpu_model >= 68020) {
/* 68060 does not have MSP but does have M-bit.. */
if (currprefs.cpu_model >= 68060)
regs.msp = regs.isp;
if (olds != regs.s) {
if (olds) {
if (oldm)
regs.msp = m68k_areg (regs, 7);
else
regs.isp = m68k_areg (regs, 7);
m68k_areg (regs, 7) = regs.usp;
} else {
regs.usp = m68k_areg (regs, 7);
m68k_areg (regs, 7) = regs.m ? regs.msp : regs.isp;
}
} else if (olds && oldm != regs.m) {
if (oldm) {
regs.msp = m68k_areg (regs, 7);
m68k_areg (regs, 7) = regs.isp;
} else {
regs.isp = m68k_areg (regs, 7);
m68k_areg (regs, 7) = regs.msp;
}
}
if (currprefs.cpu_model >= 68060)
regs.t0 = 0;
} else {
regs.t0 = regs.m = 0;
if (olds != regs.s) {
if (olds) {
regs.isp = m68k_areg (regs, 7);
m68k_areg (regs, 7) = regs.usp;
} else {
regs.usp = m68k_areg (regs, 7);
m68k_areg (regs, 7) = regs.isp;
}
}
}
if (regs.t1 || regs.t0) {
SPCFLAG_TRACE = 1;
} else {
/* Keep SPCFLAG_DOTRACE, we still want a trace exception for
SR-modifying instructions (including STOP). */
SPCFLAG_TRACE = 0;
}
// STOP SR-modification does not generate T0
// If this SR modification set Tx bit, no trace until next instruction.
if ((oldt0 && t0trace && currprefs.cpu_model >= 68020) || oldt1) {
// Always trace if Tx bits were already set, even if this SR modification cleared them.
activate_trace();
}
}
void REGPARAM2 MakeFromSR_T0(void)
{
MakeFromSR_x(1);
}
void REGPARAM2 MakeFromSR(void)
{
MakeFromSR_x(0);
}
void cpu_halt(int halt)
{
cpu_halted = halt;
}
void m68k_setstopped(void)
{
/* A traced STOP instruction drops through immediately without
actually stopping. */
if (SPCFLAG_DOTRACE == 0) {
cpu_stopped = 1;
} else {
cpu_stopped = 0;
}
}
void check_t0_trace(void)
{
if (regs.t0 && !regs.t1 && currprefs.cpu_model >= 68020) {
SPCFLAG_TRACE = 0;
SPCFLAG_DOTRACE = 1;
}
}
void cpureset(void)
{
cpu_halted = -1;
}
static void doexcstack2(void)
{
// generate exception but don't store it with test results
int noac = noaccesshistory;
int ta = testing_active;
int cycs = cpu_cycles;
noaccesshistory = 1;
testing_active = -1;
int opcode = (opcode_memory[0] << 8) | (opcode_memory[1]);
if (test_exception_opcode >= 0) {
opcode = test_exception_opcode;
}
if (SPCFLAG_DOTRACE && test_exception == 9) {
SPCFLAG_DOTRACE = 0;
}
int sv = regs.s;
uaecptr tmp = m68k_areg(regs, 7);
m68k_areg(regs, 7) = test_memory_end + EXTRA_RESERVED_SPACE;
if (cpu_lvl == 0) {
if (test_exception == 2 || test_exception == 3) {
uae_u16 mode = (sv ? 4 : 0) | test_exception_3_fc;
mode |= test_exception_3_w ? 0 : 16;
Exception_build_68000_address_error_stack_frame(mode, opcode, test_exception_addr, regs.pc);
SPCFLAG_DOTRACE = 0;
}
} else if (cpu_lvl == 1) {
if (test_exception == 2 || test_exception == 3) {
uae_u16 ssw = (sv ? 4 : 0) | test_exception_3_fc;
ssw |= test_exception_3_di > 0 ? 0x0000 : (test_exception_3_di < 0 ? (0x2000 | 0x1000) : 0x2000);
ssw |= (!test_exception_3_w && test_exception_3_di) ? 0x1000 : 0x000; // DF
ssw |= (test_exception_opcode & 0x10000) ? 0x0400 : 0x0000; // HB
ssw |= test_exception_3_size == 0 ? 0x0200 : 0x0000; // BY
ssw |= test_exception_3_w ? 0x0000 : 0x0100; // RW
ssw |= (test_exception_opcode & 0x80000) ? 0x0800 : 0x0000; // RM
regs.mmu_fault_addr = test_exception_addr;
Exception_build_stack_frame(regs.instruction_pc, regs.pc, ssw, test_exception, 0x08);
SPCFLAG_DOTRACE = 0;
} else {
Exception_build_stack_frame_common(regs.instruction_pc, regs.pc, 0, test_exception);
}
} else if (cpu_lvl == 2 || cpu_lvl == 3) {
if (test_exception == 3) {
uae_u16 ssw = (sv ? 4 : 0) | test_exception_3_fc;
ssw |= 0x20;
regs.mmu_fault_addr = test_exception_addr;
Exception_build_stack_frame(regs.instruction_pc, regs.pc, ssw, test_exception, 0x0b);
} else {
Exception_build_stack_frame_common(regs.instruction_pc, regs.pc, 0, test_exception);
}
} else {
if (test_exception == 3) {
if (currprefs.cpu_model >= 68040)
test_exception_addr &= ~1;
Exception_build_stack_frame(test_exception_addr, regs.pc, 0, test_exception, 0x02);
} else {
Exception_build_stack_frame_common(regs.instruction_pc, regs.pc, 0, test_exception);
}
}
exception_stack_frame_size = test_memory_end + EXTRA_RESERVED_SPACE - m68k_areg(regs, 7);
m68k_areg(regs, 7) = tmp;
testing_active = ta;
noaccesshistory = noac;
cpu_cycles = cycs;
}
static void doexcstack(void)
{
bool g1 = generates_group1_exception(regs.ir);
doexcstack2();
if (test_exception < 4)
return;
// did we got bus error or address error
// when fetching exception vector?
// (bus error not yet tested)
if (!feature_exception_vectors)
return;
int interrupt = test_exception >= 24 && test_exception < 24 + 8;
int original_exception = test_exception;
// odd exception vector
test_exception = 3;
test_exception_addr = feature_exception_vectors;
// store original exception stack (which may not be complete)
uae_u8 *sf = test_memory + test_memory_size + EXTRA_RESERVED_SPACE - exception_stack_frame_size;
exception_extra_frame_size = exception_stack_frame_size;
exception_extra_frame_type = original_exception;
memcpy(exception_extra_frame, sf, exception_extra_frame_size);
MakeSR();
regs.sr |= 0x2000;
regs.sr &= ~0x8000;
MakeFromSR();
int flags = 0;
if (cpu_lvl == 1) {
// IF = 1
flags |= 0x40000;
// low word of address
regs.irc = (uae_u16)test_exception_addr;
// low word of address
regs.read_buffer = regs.irc;
// vector offset (not vbr + offset)
regs.write_buffer = original_exception * 4;
}
if (interrupt) {
regs.intmask = original_exception - 24;
regs.ir = original_exception;
if (cpu_lvl == 0) {
flags |= 0x10000 | 0x20000;
} else {
flags |= 0x20000;
}
}
// set I/N if original exception was group 1 exception.
flags |= 0x20000;
if (g1 && cpu_lvl == 0) {
flags |= 0x10000;
}
exception3_read(regs.ir | flags, test_exception_addr, 1, 2);
}
uae_u32 REGPARAM2 op_illg_1(uae_u32 opcode)
{
if ((opcode & 0xf000) == 0xf000) {
if (currprefs.cpu_model == 68030) {
// mmu instruction extra check
// because mmu checks following word to detect if addressing mode is supported,
// we can't test any MMU opcodes without parsing following word. TODO.
if ((opcode & 0xfe00) == 0xf000) {
test_exception = -1;
return 0;
}
}
test_exception = 11;
if (privileged_copro_instruction(opcode)) {
test_exception = 8;
}
} else if ((opcode & 0xf000) == 0xa000) {
test_exception = 10;
} else {
test_exception = 4;
}
doexcstack();
return 0;
}
void REGPARAM2 op_unimpl(uae_u32 opcode)
{
test_exception = 61;
doexcstack();
}
uae_u32 REGPARAM2 op_unimpl_1(uae_u32 opcode)
{
if ((opcode & 0xf000) == 0xf000 || currprefs.cpu_model < 68060)
op_illg(opcode);
else
op_unimpl(opcode);
return 0;
}
uae_u32 REGPARAM2 op_illg(uae_u32 opcode)
{
return op_illg_1(opcode);
}
static void exception2_fetch_common(uae_u32 opcode, int offset)
{
test_exception = 2;
test_exception_3_w = 0;
test_exception_addr = m68k_getpci() + offset;
test_exception_opcode = opcode;
test_exception_3_fc = 2;
test_exception_3_size = sz_word;
test_exception_3_di = 0;
if (currprefs.cpu_model == 68000) {
if (generates_group1_exception(regs.ir) && !(opcode & 0x20000)) {
test_exception_3_fc |= 8; // set N/I
}
if (opcode & 0x10000)
test_exception_3_fc |= 8;
}
}
void exception2_fetch(uae_u32 opcode, int offset)
{
exception2_fetch_common(opcode, offset);
doexcstack();
}
void exception2_fetch_opcode(uae_u32 opcode, int offset)
{
exception2_fetch_common(opcode, offset);
if (currprefs.cpu_model == 68010) {
test_exception_3_di = -1;
}
doexcstack();
}
void exception2_read(uae_u32 opcode, uaecptr addr, int size, int fc)
{
test_exception = 2;
test_exception_3_w = 0;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_fc = fc;
test_exception_3_size = size;
test_exception_3_di = 1;
if (currprefs.cpu_model == 68000) {
if (generates_group1_exception(regs.ir) && !(opcode & 0x20000)) {
test_exception_3_fc |= 8; // set N/I
}
if (opcode & 0x10000)
test_exception_3_fc |= 8;
if (!(opcode & 0x20000))
test_exception_opcode = regs.ir;
}
doexcstack();
}
void exception2_write(uae_u32 opcode, uaecptr addr, int size, uae_u32 val, int fc)
{
test_exception = 2;
test_exception_3_w = 1;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_fc = fc;
test_exception_3_size = size;
if (size == sz_byte) {
regs.write_buffer &= 0xff00;
regs.write_buffer |= val & 0xff;
} else {
regs.write_buffer = val;
}
test_exception_3_di = 1;
if (currprefs.cpu_model == 68000) {
if (generates_group1_exception(regs.ir) && !(opcode & 0x20000)) {
test_exception_3_fc |= 8; // set N/I
}
if (opcode & 0x10000)
test_exception_3_fc |= 8;
if (!(opcode & 0x20000))
test_exception_opcode = regs.ir;
}
doexcstack();
}
void exception3_read(uae_u32 opcode, uae_u32 addr, int size, int fc)
{
test_exception = 3;
test_exception_3_w = 0;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_fc = fc;
test_exception_3_size = size;
test_exception_3_di = 1;
if (currprefs.cpu_model == 68000) {
if (generates_group1_exception(regs.ir) && !(opcode & 0x20000)) {
test_exception_3_fc |= 8; // set N/I
}
if (opcode & 0x10000)
test_exception_3_fc |= 8;
test_exception_opcode = regs.ir;
}
if (currprefs.cpu_model == 68010) {
if (opcode & 0x40000) {
test_exception_3_di = 0;
}
}
doexcstack();
}
void exception3_write(uae_u32 opcode, uae_u32 addr, int size, uae_u32 val, int fc)
{
test_exception = 3;
test_exception_3_w = 1;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_fc = fc;
test_exception_3_size = size;
regs.write_buffer = val;
test_exception_3_di = 1;
if (currprefs.cpu_model == 68000) {
if (generates_group1_exception(regs.ir) && !(opcode & 0x20000)) {
test_exception_3_fc |= 8; // set N/I
}
if (opcode & 0x10000)
test_exception_3_fc |= 8;
test_exception_opcode = regs.ir;
}
doexcstack();
}
// load to irc only
void exception3_read_prefetch_only(uae_u32 opcode, uae_u32 addr)
{
if (cpu_lvl == 1) {
uae_u16 prev = regs.read_buffer;
get_word_test(addr & ~1);
regs.irc = regs.read_buffer;
regs.read_buffer = prev;
} else {
add_memory_cycles(1);
}
test_exception = 3;
test_exception_3_w = 0;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_fc = 2;
test_exception_3_size = sz_word;
test_exception_3_di = 0;
doexcstack();
}
void exception3_read_prefetch(uae_u32 opcode, uae_u32 addr)
{
if (cpu_lvl == 1) {
get_word_test(addr & ~1);
} else {
add_memory_cycles(1);
}
test_exception = 3;
test_exception_3_w = 0;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_fc = 2;
test_exception_3_size = sz_word;
test_exception_3_di = 0;
doexcstack();
}
void exception3_read_access2(uae_u32 opcode, uae_u32 addr, int size, int fc)
{
get_word_test(addr & ~1);
get_word_test(addr & ~1);
exception3_read(opcode, addr, size, fc);
}
void exception3_read_access(uae_u32 opcode, uae_u32 addr, int size, int fc)
{
if (cpu_lvl == 1) {
get_word_test(addr & ~1);
} else {
add_memory_cycles(1);
}
exception3_read(opcode, addr, size, fc);
}
void exception3_write_access(uae_u32 opcode, uae_u32 addr, int size, uae_u32 val, int fc)
{
add_memory_cycles(1);
exception3_write(opcode, addr, size, val, fc);
}
uae_u16 exception3_word_read(uaecptr addr)
{
add_memory_cycles(1);
return 0;
}
void REGPARAM2 Exception(int n)
{
test_exception = n;
test_exception_addr = m68k_getpci();
test_exception_opcode = -1;
doexcstack();
}
void REGPARAM2 Exception_cpu(int n)
{
test_exception = n;
test_exception_addr = m68k_getpci();
test_exception_opcode = -1;
bool t0 = currprefs.cpu_model >= 68020 && regs.t0 && !regs.t1;
// check T0 trace
if (t0) {
activate_trace();
}
doexcstack();
}
void exception3i(uae_u32 opcode, uaecptr addr)
{
test_exception = 3;
test_exception_3_fc = 2;
test_exception_3_w = 0;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_di = 0;
test_exception_3_size = sz_word;
doexcstack();
}
void exception3b(uae_u32 opcode, uaecptr addr, bool w, bool i, uaecptr pc)
{
test_exception = 3;
test_exception_3_fc = i ? 2 : 1;
test_exception_3_w = w;
test_exception_addr = addr;
test_exception_opcode = opcode;
test_exception_3_di = 0;
test_exception_3_size = sz_word;
doexcstack();
}
int cctrue(int cc)
{
uae_u32 cznv = regflags.cznv;
switch (cc) {
case 0: return 1; /* T */
case 1: return 0; /* F */
case 2: return (cznv & (FLAGVAL_C | FLAGVAL_Z)) == 0; /* !CFLG && !ZFLG HI */
case 3: return (cznv & (FLAGVAL_C | FLAGVAL_Z)) != 0; /* CFLG || ZFLG LS */
case 4: return (cznv & FLAGVAL_C) == 0; /* !CFLG CC */
case 5: return (cznv & FLAGVAL_C) != 0; /* CFLG CS */
case 6: return (cznv & FLAGVAL_Z) == 0; /* !ZFLG NE */
case 7: return (cznv & FLAGVAL_Z) != 0; /* ZFLG EQ */
case 8: return (cznv & FLAGVAL_V) == 0; /* !VFLG VC */
case 9: return (cznv & FLAGVAL_V) != 0; /* VFLG VS */
case 10: return (cznv & FLAGVAL_N) == 0; /* !NFLG PL */
case 11: return (cznv & FLAGVAL_N) != 0; /* NFLG MI */
case 12: /* NFLG == VFLG GE */
return ((cznv >> FLAGBIT_N) & 1) == ((cznv >> FLAGBIT_V) & 1);
case 13: /* NFLG != VFLG LT */
return ((cznv >> FLAGBIT_N) & 1) != ((cznv >> FLAGBIT_V) & 1);
case 14: /* !GET_ZFLG && (GET_NFLG == GET_VFLG); GT */
return !(cznv & FLAGVAL_Z) && (((cznv >> FLAGBIT_N) & 1) == ((cznv >> FLAGBIT_V) & 1));
case 15: /* GET_ZFLG || (GET_NFLG != GET_VFLG); LE */
return (cznv & FLAGVAL_Z) || (((cznv >> FLAGBIT_N) & 1) != ((cznv >> FLAGBIT_V) & 1));
}
return 0;
}
static uae_u32 xorshiftstate;
static uae_u32 xorshift32(void)
{
uae_u32 x = xorshiftstate;
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
xorshiftstate = x;
return xorshiftstate;
}
static int rand16_cnt;
static uae_u16 rand16(void)
{
int cnt = rand16_cnt & 15;
uae_u16 v = 0;
rand16_cnt++;
if (cnt < 15) {
v = (uae_u16)xorshift32();
if (cnt <= 6)
v &= ~0x8000;
else
v |= 0x8000;
}
if (forced_immediate_mode == 1)
v &= ~1;
if (forced_immediate_mode == 2)
v |= 1;
return v;
}
static int rand32_cnt;
static uae_u32 rand32(void)
{
int cnt = rand32_cnt & 31;
uae_u32 v = 0;
rand32_cnt++;
if (cnt < 31) {
v = xorshift32();
if (cnt <= 14)
v &= ~0x80000000;
else
v |= 0x80000000;
}
if (forced_immediate_mode == 1)
v &= ~1;
if (forced_immediate_mode == 2)
v |= 1;
return v;
}
// first 3 values: positive
// next 4 values: negative
// last: zero
static int rand8_cnt;
static uae_u8 rand8(void)
{
int cnt = rand8_cnt & 7;
uae_u8 v = 0;
rand8_cnt++;
if (cnt < 7) {
v = (uae_u8)xorshift32();
if (cnt <= 2)
v &= ~0x80;
else
v |= 0x80;
}
if (forced_immediate_mode == 1)
v &= ~1;
if (forced_immediate_mode == 2)
v |= 1;
return v;
}
static uae_u8 frand8(void)
{
return (uae_u8)xorshift32();
}
static void fill_memory_buffer(uae_u8 *p, int size)
{
for (int i = 0; i < size; i++) {
p[i] = frand8();
}
// fill extra zeros
for (int i = 0; i < size; i++) {
if (frand8() < 0x70)
p[i] = 0x00;
}
}
static void fill_memory(void)
{
if (low_memory_temp)
fill_memory_buffer(low_memory_temp, low_memory_size);
if (high_memory_temp)
fill_memory_buffer(high_memory_temp, high_memory_size);
fill_memory_buffer(test_memory_temp, test_memory_size);
}
static void compressfile(TCHAR *path, int flags)
{
if (feature_gzip & flags) {
printf("compressfile: not supported!\n");
FILE *f = _tfopen(path, _T("rb"));
fseek(f, 0, SEEK_END);
int size = ftell(f);
fseek(f, 0, SEEK_SET);
uae_u8 *mem = (uae_u8 *)malloc(size);
fread(mem, 1, size, f);
fclose(f);
_tunlink(path);
_tcscat(path, _T(".gz"));
_tunlink(path);
f = _tfopen(path, _T("wb"));
int fd = fileno(f);
//gzFile gz = gzdopen(dup(fd), "wb9");
//gzwrite(gz, mem, size);
//gzclose(gz);
fclose(f);
free(mem);
} else {
_tcscat(path, _T(".gz"));
_tunlink(path);
}
}
static void compressfiles(const TCHAR *dir)
{
for (int i = 1; i < filecount; i++) {
TCHAR path[1000];
_stprintf(path, _T("%s/%04d.dat"), dir, i);
compressfile(path, 1);
}
}
static void save_memory(const TCHAR *path, const TCHAR *name, uae_u8 *p, int size)
{
TCHAR fname[1000];
_stprintf(fname, _T("%s%s"), path, name);
FILE *f = _tfopen(fname, _T("wb"));
if (!f) {
wprintf(_T("Couldn't open '%s'\n"), fname);
abort();
}
fwrite(p, 1, size, f);
fclose(f);
compressfile(fname, 2);
}
static uae_u8 *store_rel(uae_u8 *dst, uae_u8 mode, uae_u32 s, uae_u32 d, int ordered)
{
int diff = (uae_s32)d - (uae_s32)s;
if (diff == 0) {
if (!ordered)
return dst;
*dst++ = CT_EMPTY;
return dst;
}
if (diff >= -128 && diff < 128) {
*dst++ = mode | CT_RELATIVE_START_BYTE;
*dst++ = diff & 0xff;
} else if (diff >= -32768 && diff < 32767) {
*dst++ = mode | CT_RELATIVE_START_WORD;
*dst++ = (diff >> 8) & 0xff;
*dst++ = diff & 0xff;
} else if (d < 0x8000) {
*dst++ = mode | CT_ABSOLUTE_WORD;
*dst++ = (d >> 8) & 0xff;
*dst++ = d & 0xff;
} else if ((d & ~addressing_mask) == ~addressing_mask && (d & addressing_mask) >= (HIGH_MEMORY_START & addressing_mask)) {
*dst++ = mode | CT_ABSOLUTE_WORD;
*dst++ = (d >> 8) & 0xff;
*dst++ = d & 0xff;
} else {
*dst++ = mode | CT_ABSOLUTE_LONG;
*dst++ = (d >> 24) & 0xff;
*dst++ = (d >> 16) & 0xff;
*dst++ = (d >> 8) & 0xff;
*dst++ = d & 0xff;
}
return dst;
}
static uae_u8 *store_fpureg(uae_u8 *dst, uae_u8 mode, floatx80 d)
{
*dst++ = mode | CT_SIZE_FPU;
*dst++ = (d.high >> 8) & 0xff;
*dst++ = (d.high >> 0) & 0xff;
*dst++ = (d.low >> 56) & 0xff;
*dst++ = (d.low >> 48) & 0xff;
*dst++ = (d.low >> 40) & 0xff;
*dst++ = (d.low >> 32) & 0xff;
*dst++ = (d.low >> 24) & 0xff;
*dst++ = (d.low >> 16) & 0xff;
*dst++ = (d.low >> 8) & 0xff;
*dst++ = (d.low >> 0) & 0xff;
return dst;
}
static uae_u8 *store_reg(uae_u8 *dst, uae_u8 mode, uae_u32 s, uae_u32 d, int size)
{
if (s == d && size == -1)
return dst;
if (((s & 0xffffff00) == (d & 0xffffff00) && size < 0) || size == sz_byte) {
*dst++ = mode | CT_SIZE_BYTE;
*dst++ = d & 0xff;
} else if (((s & 0xffff0000) == (d & 0xffff0000) && size < 0) || size == sz_word) {
*dst++ = mode | CT_SIZE_WORD;
*dst++ = (d >> 8) & 0xff;
*dst++ = d & 0xff;
} else {
*dst++ = mode | CT_SIZE_LONG;
*dst++ = (d >> 24) & 0xff;
*dst++ = (d >> 16) & 0xff;
*dst++ = (d >> 8) & 0xff;
*dst++ = d & 0xff;
}
return dst;
}
static uae_u8 *store_mem_bytes(uae_u8 *dst, uaecptr start, int len, uae_u8 *old, bool header)
{
if (!len)
return dst;
if (len > 32) {
wprintf(_T(" too long byte count!\n"));
abort();
}
if (is_nowrite_address(start, 1) || is_nowrite_address(start + len - 1, 1)) {
wprintf(_T(" store_mem_bytes accessing safe memory area! (%08x - %08x)\n"), start, start + len - 1);
abort();
}
uaecptr oldstart = start;
uae_u8 offset = 0;
// start
if (old) {
for (int i = 0; i < len; i++) {
uae_u8 v = get_byte_test(start);
if (v != *old)
break;
start++;
old++;
}
}
// end
offset = start - oldstart;
if (offset > 7) {
start -= (offset - 7);
offset = 7;
}
len -= offset;
if (old) {
for (int i = len - 1; i >= 0; i--) {
uae_u8 v = get_byte_test(start + i);
if (v != old[i])
break;
len--;
}
}
if (!len)
return dst;
if (header) {
*dst++ = CT_MEMWRITES | CT_PC_BYTES;
}
*dst++ = (offset << 5) | (uae_u8)(len == 32 ? 0 : len);
for (int i = 0; i < len; i++) {
*dst++ = get_byte_test(start);
start++;
}
return dst;
}
static uae_u8 *store_mem_writes(uae_u8 *dst, int storealways)
{
if (ahcnt_current == ahcnt_written)
return dst;
for (int i = ahcnt_written; i < ahcnt_current; i++) {
struct accesshistory *ah = &ahist[i];
if (ah->oldval == ah->val && !storealways)
continue;
if (ah->donotsave)
continue;
validate_addr(ah->addr, 1 << ah->size);
uaecptr addr = ah->addr;
addr &= addressing_mask;
if (is_nowrite_address(addr, 1)) {
wprintf(_T("attempting to save safe memory address %08x!\n"), addr);
abort();
}
if (addr < 0x8000) {
*dst++ = CT_MEMWRITE | CT_ABSOLUTE_WORD;
*dst++ = (addr >> 8) & 0xff;
*dst++ = addr & 0xff;
} else if (addr >= HIGH_MEMORY_START) {
*dst++ = CT_MEMWRITE | CT_ABSOLUTE_WORD;
*dst++ = (addr >> 8) & 0xff;
*dst++ = addr & 0xff;
} else if (addr >= opcode_memory_start && addr < opcode_memory_start + 32768) {
*dst++ = CT_MEMWRITE | CT_RELATIVE_START_WORD;
uae_u16 diff = addr - opcode_memory_start;
*dst++ = (diff >> 8) & 0xff;
*dst++ = diff & 0xff;
} else if (addr < opcode_memory_start && addr >= opcode_memory_start - 32768) {
*dst++ = CT_MEMWRITE | CT_RELATIVE_START_WORD;
uae_u16 diff = addr - opcode_memory_start;
*dst++ = (diff >> 8) & 0xff;
*dst++ = diff & 0xff;
} else {
*dst++ = CT_MEMWRITE | CT_ABSOLUTE_LONG;
*dst++ = (addr >> 24) & 0xff;
*dst++ = (addr >> 16) & 0xff;
*dst++ = (addr >> 8) & 0xff;
*dst++ = addr & 0xff;
}
dst = store_reg(dst, CT_MEMWRITE, 0, ah->oldval, ah->size);
dst = store_reg(dst, CT_MEMWRITE, 0, ah->val, ah->size);
}
ahcnt_written = ahcnt_current;
return dst;
}
static void pl(uae_u8 *p, uae_u32 v)
{
p[0] = v >> 24;
p[1] = v >> 16;
p[2] = v >> 8;
p[3] = v >> 0;
}
static uae_u32 gl(uae_u8 *p)
{
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3] << 0);
}
static uae_u32 gw(uae_u8 *p)
{
return (p[0] << 8) | (p[1] << 0);
}
static bool load_file(const TCHAR *path, const TCHAR *file, uae_u8 *p, int size, int offset)
{
TCHAR fname[1000];
if (path) {
_stprintf(fname, _T("%s%s"), path, file);
} else {
_tcscpy(fname, file);
}
FILE *f = _tfopen(fname, _T("rb"));
if (!f)
return false;
if (offset < 0) {
fseek(f, -size, SEEK_END);
} else {
fseek(f, offset, SEEK_SET);
}
int lsize = fread(p, 1, size, f);
if (lsize != size) {
wprintf(_T("Couldn't read file '%s'\n"), fname);
exit(0);
}
fclose(f);
return true;
}
static void markfile(const TCHAR *dir)
{
TCHAR path[1000];
if (filecount <= 1)
return;
_stprintf(path, _T("%s/%04d.dat"), dir, filecount - 1);
FILE *f = _tfopen(path, _T("r+b"));
if (f) {
fseek(f, -1, SEEK_END);
uae_u8 b = CT_END_FINISH;
fwrite(&b, 1, 1, f);
fclose(f);
}
}
static void save_data(uae_u8 *dst, const TCHAR *dir)
{
TCHAR path[1000];
if (dst == storage_buffer)
return;
if (dst - storage_buffer > max_storage_buffer) {
wprintf(_T("data buffer overrun!\n"));
abort();
}
_wmkdir(dir);
_stprintf(path, _T("%s/%04d.dat"), dir, filecount);
FILE *f = _tfopen(path, _T("wb"));
if (!f) {
wprintf(_T("couldn't open '%s'\n"), path);
abort();
}
wprintf(_T("%s\n"), path);
if (filecount == 0) {
uae_u8 data[4];
pl(data, DATA_VERSION);
fwrite(data, 1, 4, f);
pl(data, (uae_u32)starttime);
fwrite(data, 1, 4, f);
pl(data, ((hmem_rom | (test_high_memory_start == 0xffffffff ? 0x8000 : 0x0000)) << 16) |
(lmem_rom | (test_low_memory_start == 0xffffffff ? 0x8000 : 0x0000)));
fwrite(data, 1, 4, f);
pl(data, test_memory_start);
fwrite(data, 1, 4, f);
pl(data, test_memory_size);
fwrite(data, 1, 4, f);
pl(data, opcode_memory_start);
fwrite(data, 1, 4, f);
pl(data, (cpu_lvl << 16) | sr_undefined_mask | (addressing_mask == 0xffffffff ? 0x80000000 : 0) |
(feature_min_interrupt_mask << 20) | (safe_memory_mode << 23) | (feature_interrupts << 26) | (feature_randomize << 28));
fwrite(data, 1, 4, f);
pl(data, currprefs.fpu_model);
fwrite(data, 1, 4, f);
pl(data, test_low_memory_start);
fwrite(data, 1, 4, f);
pl(data, test_low_memory_end);
fwrite(data, 1, 4, f);
pl(data, test_high_memory_start);
fwrite(data, 1, 4, f);
pl(data, test_high_memory_end);
fwrite(data, 1, 4, f);
pl(data, safe_memory_start);
fwrite(data, 1, 4, f);
pl(data, safe_memory_end);
fwrite(data, 1, 4, f);
pl(data, user_stack_memory_use);
fwrite(data, 1, 4, f);
pl(data, super_stack_memory);
fwrite(data, 1, 4, f);
pl(data, feature_exception_vectors);
fwrite(data, 1, 4, f);
data[0] = data[1] = data[2] = data[3] = 0;
fwrite(data, 1, 4, f);
fwrite(data, 1, 4, f);
fwrite(data, 1, 4, f);
fwrite(inst_name, 1, sizeof(inst_name) - 1, f);
data[0] = CT_END_FINISH;
data[1] = 0;
fwrite(data, 1, 2, f);
fclose(f);
filecount++;
save_data(dst, dir);
} else {
uae_u8 data[4];
pl(data, DATA_VERSION);
fwrite(data, 1, 4, f);
pl(data, (uae_u32)starttime);
fwrite(data, 1, 4, f);
pl(data, 0);
fwrite(data, 1, 4, f);
fwrite(data, 1, 4, f);
*dst++ = CT_END_FINISH;
*dst++ = filecount;
fwrite(storage_buffer, 1, dst - storage_buffer, f);
fclose(f);
filecount++;
}
}
static int full_format_cnt;
static uaecptr putfpuimm(uaecptr pc, int opcodesize, int *isconstant)
{
// TODO: generate sane FPU immediates
switch (opcodesize)
{
case 0: // L
put_long_test(pc, rand32());
pc += 4;
break;
case 4: // W
put_word_test(pc, rand16());
pc += 2;
break;
case 6: // B
put_word_test(pc, rand16());
pc += 2;
break;
case 1: // S
put_long(pc, rand32());
pc += 4;
break;
case 2: // X
put_long(pc, rand32());
put_long(pc + 4, rand32());
put_long(pc + 8, rand32());
pc += 12;
break;
case 3: // P
put_long(pc, rand32());
put_long(pc + 4, rand32());
put_long(pc + 8, rand32());
pc += 12;
break;
case 5: // D
put_long(pc, rand32());
put_long(pc + 4, rand32());
pc += 8;
break;
}
return pc;
}
static int ea_state_found[3];
static void reset_ea_state(void)
{
ea_state_found[0] = 0;
ea_state_found[1] = 0;
ea_state_found[2] = 0;
}
// if other EA is target EA, don't point this EA
// to same address space.
static bool other_targetea_same(int srcdst, uae_u32 v)
{
if (target_ea[srcdst ^ 1] == 0xffffffff)
return false;
if (!is_nowrite_address(target_ea[srcdst ^ 1], 1))
return false;
if (!is_nowrite_address(v, 1))
return false;
return true;
}
// attempt to find at least one zero, positive and negative source value
static int analyze_address(struct instr *dp, int srcdst, uae_u32 addr)
{
uae_u32 v;
uae_u32 mask;
if (srcdst)
return 1;
if (dp->size == sz_byte) {
v = get_byte_test(addr);
mask = 0x80;
} else if (dp->size == sz_word) {
v = get_word_test(addr);
mask = 0x8000;
} else {
v = get_long_test(addr);
mask = 0x80000000;
}
if (out_of_test_space) {
out_of_test_space = false;
return 0;
}
if (ea_state_found[0] >= 2 && ea_state_found[1] >= 2 && ea_state_found[2] >= 2) {
ea_state_found[0] = ea_state_found[1] = ea_state_found[2] = 0;
}
// zero
if (v == 0) {
if (ea_state_found[0] >= 2 && (ea_state_found[1] < 2 || ea_state_found[2] < 2))
return 0;
ea_state_found[0]++;
}
// negative value
if (v & mask) {
if (ea_state_found[1] >= 2 && (ea_state_found[0] < 2 || ea_state_found[2] < 2))
return 0;
ea_state_found[1]++;
}
// positive value
if (v < mask && v > 0) {
if (ea_state_found[2] >= 2 && (ea_state_found[0] < 2 || ea_state_found[1] < 2))
return 0;
ea_state_found[2]++;
}
return 1;
}
// generate mostly random EA.
static int create_ea_random(uae_u16 *opcodep, uaecptr pc, int mode, int reg, struct instr *dp, int *isconstant, int srcdst, int fpuopcode, int opcodesize, uae_u32 *eap)
{
uaecptr old_pc = pc;
uae_u16 opcode = *opcodep;
// feature_full_extension_format = 2 and 68020 addressing modes enabled: do not generate any normal addressing modes
if (feature_full_extension_format == 2 && (ad8r[srcdst] || pc8r[srcdst]) && (mode != Ad8r && mode != PC8r))
return -1;
switch (mode)
{
case Dreg:
if (reg == feature_loop_mode_register) {
if (((dp->sduse & 0x20) && !srcdst) || ((dp->sduse & 0x02) && srcdst)) {
int pos = srcdst ? dp->dpos : dp->spos;
opcode &= ~(7 << pos);
opcode |= ((reg + 1) & 7) << pos;
}
}
break;
case Areg:
case Aind:
case Aipi:
*eap = cur_registers[reg + 8];
break;
case Apdi:
*eap = cur_registers[reg + 8] - (1 << dp->size);
break;
case Ad16:
{
uae_u16 v;
uae_u32 addr;
int maxcnt = 1000;
for (;;) {
v = rand16();
addr = cur_registers[reg + 8] + (uae_s16)v;
if (analyze_address(dp, srcdst, addr))
break;
maxcnt--;
if (maxcnt < 0)
break;
}
put_word_test(pc, v);
*isconstant = 16;
pc += 2;
*eap = addr;
break;
}
case PC16:
{
uae_u32 pct = pc + 2 - 2;
uae_u16 v;
uae_u32 addr;
int maxcnt = 1000;
for (;;) {
v = rand16();
addr = pct + (uae_s16)v;
if (analyze_address(dp, srcdst, addr))
break;
maxcnt--;
if (maxcnt < 0)
break;
}
put_word_test(pc, v);
*isconstant = 16;
pc += 2;
*eap = 1;
break;
}
case Ad8r:
case PC8r:
{
uae_u32 addr;
uae_u16 v = rand16() & 0x0100;
if (!feature_full_extension_format)
v &= ~0x100;
if (mode == Ad8r) {
if ((ad8r[srcdst] & 3) == 1)
v &= ~0x100;
if ((ad8r[srcdst] & 3) == 2)
v |= 0x100;
} else if (mode == PC8r) {
if ((pc8r[srcdst] & 3) == 1)
v &= ~0x100;
if ((pc8r[srcdst] & 3) == 2)
v |= 0x100;
}
if (currprefs.cpu_model < 68020 || (v & 0x100) == 0) {
// brief format extension
uae_u32 add = 0;
int maxcnt = 1000;
for (;;) {
v = rand16();
if (currprefs.cpu_model >= 68020)
v &= ~0x100;
addr = mode == PC8r ? pc + 2 - 2 : cur_registers[reg + 8];
add = cur_registers[v >> 12];
if (v & 0x0800) {
// L
addr += add;
} else {
// W
addr += (uae_s16)add;
}
if (currprefs.cpu_model >= 68020) {
add <<= (v >> 9) & 3; // SCALE
}
addr += (uae_s8)(v & 0xff); // DISPLACEMENT
if (other_targetea_same(srcdst, addr))
continue;
if (analyze_address(dp, srcdst, addr))
break;
maxcnt--;
if (maxcnt < 0)
break;
}
*isconstant = 16;
put_word_test(pc, v);
pc += 2;
*eap = addr;
} else {
// full format extension
// attempt to generate every possible combination,
// one by one.
v |= rand16() & ~0x100;
for (;;) {
v &= 0xff00;
v |= full_format_cnt & 0xff;
// skip reserved combinations for now
int is = (v >> 6) & 1;
int iis = v & 7;
int sz = (v >> 4) & 3;
int bit3 = (v >> 3) & 1;
if ((is && iis >= 4) || iis == 4 || sz == 0 || bit3 == 1) {
full_format_cnt++;
continue;
}
break;
}
put_word_test(pc, v);
uaecptr pce = pc;
pc += 2;
// calculate lenght of extension
ShowEA_disp(&pce, mode == Ad8r ? regs.regs[reg + 8] : pce, NULL, NULL);
while (pc < pce) {
v = rand16();
put_word_test(pc, v);
pc += 2;
}
*isconstant = 128;
*eap = 1;
}
break;
}
case absw:
{
uae_u32 v;
if (!high_memory && !low_memory)
return -1;
for (;;) {
v = rand16();
if (v >= 0x8000)
v |= 0xffff0000;
if (other_targetea_same(srcdst, (uae_s32)(uae_s16)v))
continue;
if (analyze_address(dp, srcdst, v))
break;
}
put_word_test(pc, v);
*isconstant = 16;
pc += 2;
*eap = v >= 0x8000 ? (0xffff0000 | v) : v;
break;
}
case absl:
{
uae_u32 v;
for (;;) {
v = rand32();
if ((immabsl_cnt & 7) == 0) {
v &= 0x00007fff;
} else if ((immabsl_cnt & 7) == 1) {
v &= 0x00007fff;
v = 0xffff8000 | v;
} else if ((immabsl_cnt & 7) >= 5) {
int offset = 0;
for (;;) {
offset = (uae_s16)rand16();
if (offset < -OPCODE_AREA || offset > OPCODE_AREA)
break;
}
v = opcode_memory_start + offset;
}
immabsl_cnt++;
if (other_targetea_same(srcdst, v))
continue;
if (analyze_address(dp, srcdst, v))
break;
}
put_long_test(pc, v);
*isconstant = 32;
pc += 4;
*eap = v;
break;
}
case imm:
if (fpuopcode >= 0 && opcodesize < 8) {
pc = putfpuimm(pc, opcodesize, isconstant);
} else {
if (dp->size == sz_long) {
put_long_test(pc, rand32());
*isconstant = 32;
pc += 4;
}
else {
put_word_test(pc, rand16());
*isconstant = 16;
pc += 2;
}
}
break;
case imm0:
{
// byte immediate but randomly fill also upper byte
uae_u16 v = rand16();
if ((imm8_cnt & 15) == 0) {
v = 0;
} else if ((imm8_cnt & 3) == 0) {
v &= 0xff;
}
imm8_cnt++;
put_word_test(pc, v);
*isconstant = 16;
pc += 2;
break;
}
case imm1:
{
// word immediate
if (fpuopcode >= 0) {
uae_u16 v = 0;
if (opcodesize == 7) {
// FMOVECR
v = 0x4000;
v |= opcodesize << 10;
v |= imm16_cnt & 0x3ff;
imm16_cnt++;
if ((opcode & 0x3f) != 0)
return -1;
*isconstant = 0;
if (imm16_cnt < 0x400)
*isconstant = -1;
} else if (opcodesize == 8) {
// FMOVEM/FMOVE to/from control registers
v |= 0x8000;
v |= (imm16_cnt & 15) << 11;
v |= rand16() & 0x07ff;
imm16_cnt++;
if (imm16_cnt >= 32)
*isconstant = 0;
else
*isconstant = -1;
} else {
v |= fpuopcode;
if (imm16_cnt & 1) {
// EA to FP reg
v |= 0x4000;
v |= opcodesize << 10;
imm16_cnt++;
} else {
// FP reg to FP reg
v |= ((imm16_cnt >> 1) & 7) << 10;
// clear mode/reg field
opcode &= ~0x3f;
imm16_cnt++;
if (opcodesize != 2) {
// not X: skip
return -2;
}
}
*isconstant = 16;
}
put_word_test(pc, v);
pc += 2;
} else {
if (opcodecnt == 1) {
// STOP #xxxx: test all combinations
// (also includes RTD)
if (dp->mnemo == i_LPSTOP) {
uae_u16 lp = 0x01c0;
if (imm16_cnt & (0x40 | 0x80)) {
for (;;) {
lp = rand16();
if (lp != 0x01c0)
break;
}
}
put_word_test(pc, lp);
put_word_test(pc + 2, imm16_cnt++);
pc += 2;
if (imm16_cnt == 0)
*isconstant = 0;
else
*isconstant = -1;
} else if (dp->mnemo == i_MOVE2C || dp->mnemo == i_MOVEC2) {
uae_u16 c = (imm16_cnt >> 1) & 0xfff;
opcode = 0x4e7a;
put_word_test(pc, 0x1000 | c); // movec rc,d1
pc += 2;
uae_u32 val = (imm16_cnt & 1) ? 0xffffffff : 0x00000000;
switch (c)
{
case 0x003: // TC
case 0x004: // ITT0
case 0x005: // ITT1
case 0x006: // DTT0
case 0x007: // DTT1
val &= ~0x8000;
break;
case 0x808: // PCR
val &= ~(0x80 | 0x40 | 0x20 | 0x10 | 0x08 | 0x04);
break;
}
put_word_test(pc, 0x203c); // move.l #x,d0
pc += 2;
put_long_test(pc, val);
pc += 4;
put_long_test(pc, 0x4e7b0000 | c); // movec d0,rc
pc += 4;
put_long_test(pc, 0x4e7a2000 | c); // movec rc,d2
pc += 4;
put_long_test(pc, 0x4e7b1000 | c); // movec d1,rc
pc += 4;
put_word_test(pc, 0x7200); // moveq #0,d0
pc += 2;
imm16_cnt++;
multi_mode = 1;
pc -= 2;
if (imm16_cnt == 0x1000)
*isconstant = 0;
else
*isconstant = -1;
} else if (dp->mnemo == i_BSR || dp->mnemo == i_DBcc || dp->mnemo == i_Bcc ||
dp->mnemo == i_ORSR || dp->mnemo == i_ANDSR || dp->mnemo == i_EORSR) {
// don't try to test all 65536 possibilies..
uae_u16 i16 = imm16_cnt;
put_word_test(pc, imm16_cnt);
imm16_cnt += rand16() & 127;
if (i16 > imm16_cnt)
*isconstant = 0;
else
*isconstant = -1;
} else {
put_word_test(pc, imm16_cnt++);
if (imm16_cnt == 0)
*isconstant = 0;
else
*isconstant = -1;
}
} else {
uae_u16 v = rand16();
if ((imm16_cnt & 7) == 0) {
v &= 0x00ff;
} else if ((imm16_cnt & 15) == 0) {
v = 0;
}
imm16_cnt++;
put_word_test(pc, v);
*isconstant = 16;
}
pc += 2;
}
break;
}
case imm2:
{
// long immediate
uae_u32 v = rand32();
if ((imm32_cnt & 63) == 0) {
v = 0;
} else if ((imm32_cnt & 7) == 0) {
v &= 0x0000ffff;
}
imm32_cnt++;
put_long_test(pc, v);
if (imm32_cnt < 256)
*isconstant = -1;
else
*isconstant = 32;
pc += 4;
break;
}
}
*opcodep = opcode;
return pc - old_pc;
}
static int ea_exact_cnt;
// generate exact EA (for bus error test)
static int create_ea_exact(uae_u16 *opcodep, uaecptr pc, int mode, int reg, struct instr *dp, int *isconstant, int srcdst, int fpuopcode, int opcodesize, uae_u32 *eap)
{
uae_u32 target = target_ea[srcdst];
ea_exact_cnt++;
switch (mode)
{
// always allow modes that don't have EA
case Areg:
case Dreg:
return 0;
case Aind:
case Aipi:
{
if (cur_registers[reg + 8] == target) {
*eap = target;
return 0;
}
return -2;
}
case Apdi:
{
if (cur_registers[reg + 8] == target + (1 << dp->size)) {
*eap = target;
return 0;
}
return -2;
}
case Ad16:
{
uae_u32 v = cur_registers[reg + 8];
if (target <= v + 0x7ffe && (target >= v - 0x8000 || v < 0x8000)) {
put_word_test(pc, target - v);
*eap = target;
return 2;
}
return -2;
}
case PC16:
{
uae_u32 pct = pc + 2 - 2;
if (target <= pct + 0x7ffe && target >= pct - 0x8000) {
put_word_test(pc, target - pct);
*eap = target;
return 2;
}
return -2;
}
case Ad8r:
{
for (int r = 0; r < 16; r++) {
uae_u32 aval = cur_registers[reg + 8];
int rn = ((ea_exact_cnt >> 1) + r) & 15;
for (int i = 0; i < 2; i++) {
if ((ea_exact_cnt & 1) == 0 || i == 1) {
uae_s32 val32 = cur_registers[rn];
uae_u32 addr = aval + val32;
if (target <= addr + 0x7f && target >= addr - 0x80) {
put_word_test(pc, (rn << 12) | 0x0800 | ((target - addr) & 0xff));
*eap = target;
return 2;
}
} else {
uae_s16 val16 = (uae_s16)cur_registers[rn];
uae_u32 addr = aval + val16;
if (target <= addr + 0x7f && target >= addr - 0x80) {
put_word_test(pc, (rn << 12) | 0x0000 | ((target - addr) & 0xff));
*eap = target;
return 2;
}
}
}
}
return -2;
}
case PC8r:
{
for (int r = 0; r < 16; r++) {
uae_u32 aval = pc + 2 - 2;
int rn = ((ea_exact_cnt >> 1) + r) & 15;
for (int i = 0; i < 2; i++) {
if ((ea_exact_cnt & 1) == 0 || i == 1) {
uae_s32 val32 = cur_registers[rn];
uae_u32 addr = aval + val32;
if (target <= addr + 0x7f && target >= addr - 0x80) {
put_word_test(pc, (rn << 12) | 0x0800 | ((target - addr) & 0xff));
*eap = target;
return 2;
}
} else {
uae_s16 val16 = (uae_s16)cur_registers[rn];
uae_u32 addr = aval + val16;
if (target <= addr + 0x7f && target >= addr - 0x80) {
put_word_test(pc, (rn << 12) | 0x0000 | ((target - addr) & 0xff));
*eap = target;
return 2;
}
}
}
}
return -2;
}
case absw:
{
if (target >= test_low_memory_start && target < test_low_memory_end) {
put_word_test(pc, target);
*eap = target;
return 2;
}
return -2;
}
case absl:
{
if (target >= test_low_memory_start && target < test_low_memory_end) {
put_long_test(pc, target);
*eap = target;
return 4;
}
if (target >= test_high_memory_start && target < test_high_memory_end) {
put_long_test(pc, target);
*eap = target;
return 4;
}
if (target >= test_memory_start && target < test_memory_end) {
put_long_test(pc, target);
*eap = target;
return 4;
}
return -2;
}
case imm:
if (srcdst)
return -2;
if (dp->size == sz_long) {
put_long_test(pc, rand32());
return 4;
} else {
put_word_test(pc, rand16());
return 2;
}
break;
case imm0:
{
uae_u16 v;
if (srcdst)
return -2;
v = rand16();
if ((imm8_cnt & 3) == 0)
v &= 0xff;
imm8_cnt++;
put_word_test(pc, v);
return 2;
}
case imm1:
{
bool vgot = false;
uae_u16 v;
if (dp->mnemo == i_MOVES) {
v = imm16_cnt << 11;
v |= rand16() & 0x07ff;
imm16_cnt++;
*isconstant = 32;
put_word_test(pc, v);
return 2;
}
if (srcdst) {
if (dp->mnemo != i_DBcc)
return -2;
}
if (dp->mnemo == i_DBcc || dp->mnemo == i_BSR || dp->mnemo == i_Bcc) {
uae_u32 pct = pc + 2 - 2;
if (target <= pct + 0x7ffe && target >= pct - 0x8000) {
v = target - pct;
*eap = target;
vgot = true;
} else {
return -2;
}
}
if (!vgot)
v = rand16();
put_word_test(pc, v);
return 2;
}
case imm2:
{
bool vgot = false;
uae_u32 v;
if (srcdst)
return -2;
if (dp->mnemo == i_BSR || dp->mnemo == i_Bcc) {
if (currprefs.cpu_model < 68020)
return -2;
uae_u32 pct = pc + 2 - 2;
v = target - pct;
*eap = target;
vgot = true;
}
if (!vgot) {
v = rand32();
}
put_long_test(pc, v);
return 4;
}
case immi:
{
uae_u8 v = (*opcodep) & 0xff;
if (srcdst)
return -2;
if (dp->mnemo == i_BSR || dp->mnemo == i_Bcc) {
uae_u32 pct = pc - 2 + 2;
if (pct + v == target) {
*eap = target;
return 0;
}
}
return -2;
}
}
return -2;
}
static int create_ea(uae_u16 *opcodep, uaecptr pc, int mode, int reg, struct instr *dp, int *isconstant, int srcdst, int fpuopcode, int opcodesize, uae_u32 *ea)
{
int am = mode >= imm ? imm : mode;
if (!((1 << am) & feature_addressing_modes[srcdst]))
return -1;
if (target_ea[srcdst] == 0xffffffff) {
return create_ea_random(opcodep, pc, mode, reg, dp, isconstant, srcdst, fpuopcode, opcodesize, ea);
} else {
return create_ea_exact(opcodep, pc, mode, reg, dp, isconstant, srcdst, fpuopcode, opcodesize, ea);
}
}
static int imm_special;
static int handle_specials_preea(uae_u16 opcode, uaecptr pc, struct instr *dp)
{
if (dp->mnemo == i_FTRAPcc) {
uae_u16 v = rand16();
v &= ~7;
v |= imm_special;
put_word_test(pc, v);
imm_special++;
return 2;
}
if (dp->mnemo == i_MOVE16) {
if (opcode & 0x20) {
uae_u16 v = 0;
v |= imm_special << 12;
put_word_test(pc, v);
imm_special++;
return 2;
}
}
return 0;
}
static int handle_specials_branch(uae_u16 opcode, uaecptr pc, struct instr *dp, int *isconstant)
{
// 68020 BCC.L is BCC.B to odd address if 68000/010
if ((opcode & 0xf0ff) == 0x60ff) {
if (currprefs.cpu_model >= 68020) {
return 0;
}
return -2;
} else if (dp->mnemo == i_FDBcc) {
// FDBcc jump offset
uae_u16 v = rand16();
put_word_test(pc, v);
*isconstant = 16;
return 2;
}
return 0;
}
static int handle_specials_misc(uae_u16 opcode, uaecptr pc, struct instr *dp, int *isconstant)
{
// PACK and UNPK has third parameter
if (dp->mnemo == i_PACK || dp->mnemo == i_UNPK) {
uae_u16 v = rand16();
put_word_test(pc, v);
*isconstant = 16;
return 2;
} else if (dp->mnemo == i_CALLM) {
// CALLM has extra parameter
uae_u16 v = rand16();
put_word_test(pc, v);
*isconstant = 16;
return 2;
}
return 0;
}
static uaecptr handle_specials_extra(uae_u16 opcode, uaecptr pc, struct instr *dp)
{
// CAS undocumented (marked as zero in document) fields do something weird, for example
// setting bit 9 will make "Du" address register but results are not correct.
// so lets make sure unused zero bits are zeroed.
switch (dp->mnemo)
{
case i_CAS:
{
uae_u16 extra = get_word_test(opcode_memory_start + 2);
uae_u16 extra2 = extra;
extra &= (7 << 6) | (7 << 0);
if (extra != extra2) {
put_word_test(opcode_memory_start + 2, extra);
}
break;
}
case i_CAS2:
{
uae_u16 extra = get_word_test(opcode_memory_start + 2);
uae_u16 extra2 = extra;
extra &= (7 << 6) | (7 << 0) | (15 << 12);
if (extra != extra2) {
put_word_test(opcode_memory_start + 2, extra);
}
extra = get_word_test(opcode_memory_start + 4);
extra2 = extra;
extra &= (7 << 6) | (7 << 0) | (15 << 12);
if (extra != extra2) {
put_word_test(opcode_memory_start + 4, extra);
}
break;
}
case i_CHK2: // also CMP2
{
uae_u16 extra = get_word_test(opcode_memory_start + 2);
uae_u16 extra2 = extra;
extra &= (31 << 11);
if (extra != extra2) {
put_word_test(opcode_memory_start + 2, extra);
}
break;
}
case i_BFINS:
case i_BFFFO:
case i_BFEXTS:
case i_BFEXTU:
{
if (cpu_lvl >= 4) {
// 68040+ and extra word bit 15 not zero (hidden A/D field):
// REGISTER field becomes address register in some internal
// operations, results are also wrong. So clear it here..
uae_u16 extra = get_word_test(opcode_memory_start + 2);
if (extra & 0x8000) {
extra &= ~0x8000;
put_word_test(opcode_memory_start + 2, extra);
}
}
break;
}
case i_DIVL:
case i_MULL:
{
if (cpu_lvl >= 4) {
// same as BF instructions but also other bits need clearing
// or results are unexplained..
uae_u16 extra = get_word_test(opcode_memory_start + 2);
if (extra & 0x83f8) {
extra &= ~0x83f8;
put_word_test(opcode_memory_start + 2, extra);
}
}
break;
}
}
return pc;
}
static uae_u32 generate_stack_return(int cnt)
{
uae_u32 v;
// if target sp mode: always generate valid address
if (target_ea[0] != 0xffffffff && feature_usp < 3) {
v = target_ea[0];
} else {
v = rand32();
switch (cnt & 3)
{
case 0:
case 3:
v = opcode_memory_start + 32768;
break;
case 1:
v &= 0xffff;
if (test_low_memory_start == 0xffffffff)
v |= 0x8000;
if (test_high_memory_start == 0xffffffff)
v &= 0x7fff;
break;
case 2:
v = opcode_memory_start + (uae_s16)v;
break;
}
if (!feature_exception3_instruction)
v &= ~1;
}
return v;
}
static int handle_rte(uae_u16 opcode, uaecptr pc, struct instr *dp, int *isconstant, uaecptr addr)
{
// skip bus error/address error frames because internal fields can't be simply randomized
int offset = 2;
int frame, v;
imm_special++;
for (;;) {
frame = (imm_special >> 2) & 15;
// 68010 bus/address error
if (cpu_lvl == 1 && (frame == 8)) {
imm_special += 4;
continue;
}
if ((cpu_lvl == 2 || cpu_lvl == 3) && (frame == 9 || frame == 10 || frame == 11)) {
imm_special += 4;
continue;
}
// 68040 FP post-instruction, FP unimplemented, Address error
if (cpu_lvl == 4 && (frame == 3 || frame == 4 || frame == 7)) {
imm_special += 4;
continue;
}
// 68060 access fault/FP disabled, FP post-instruction
if (cpu_lvl == 5 && (frame == 3 || frame == 4)) {
imm_special += 4;
continue;
}
// throwaway frame
if (frame == 1) {
imm_special += 4;
continue;
}
break;
}
v = imm_special >> 6;
uae_u16 sr = v & 31;
sr |= (v >> 5) << 12;
put_word_test(addr, sr);
addr += 2 + 4;
// frame + vector offset
put_word_test(addr, (frame << 12) | (rand16() & 0x0fff));
addr += 2;
#if 0
if (frame == 1) {
int imm_special_tmp = imm_special;
imm_special &= ~(15 << 2);
if (rand8() & 1)
imm_special |= 2 << 2;
handle_rte(opcode, addr, dp, isconstant, addr);
imm_special = imm_special_tmp;
v = generate_stack_return(imm_special);
put_long_test(addr + 2, v);
offset += 8 + 2;
#endif
if (frame == 2) {
put_long_test(addr, rand32());
}
return offset;
}
static int handle_specials_stack(uae_u16 opcode, uaecptr pc, struct instr *dp, int *isconstant)
{
int offset = 0;
if (dp->mnemo == i_RTE || dp->mnemo == i_RTD || dp->mnemo == i_RTS || dp->mnemo == i_RTR || dp->mnemo == i_UNLK) {
uae_u32 v;
uaecptr addr = regs.regs[15];
// RTE, RTD, RTS and RTR
if (dp->mnemo == i_RTR) {
// RTR
v = imm_special++;
uae_u16 ccr = v & 31;
ccr |= rand16() & ~31;
put_word_test(addr, ccr);
addr += 2;
offset += 2;
*isconstant = imm_special >= (1 << (0 + 5)) * 4 ? 0 : -1;
} else if (dp->mnemo == i_RTE) {
// RTE
if (currprefs.cpu_model == 68000) {
imm_special++;
v = imm_special >> 2;
uae_u16 sr = 0;
if (v & 32)
sr |= 0x2000;
if (v & 64)
sr |= 0x8000;
// fill also unused bits
sr |= sr >> 1;
sr |= v & 31;
sr |= (v & 7) << 5;
sr |= feature_min_interrupt_mask << 8;
put_word_test(addr, sr);
addr += 2;
offset += 2;
*isconstant = imm_special >= (1 << (2 + 5)) * 4 ? 0 : -1;
} else {
offset += handle_rte(opcode, pc, dp, isconstant, addr);
addr += 2;
*isconstant = imm_special >= (1 << (4 + 5)) * 4 ? 0 : -1;
}
} else if (dp->mnemo == i_RTS) {
// RTS
imm_special++;
*isconstant = imm_special >= 256 ? 0 : -1;
}
v = generate_stack_return(imm_special);
put_long_test(addr, v);
if (out_of_test_space) {
wprintf(_T(" handle_specials out of bounds access!?"));
abort();
}
}
return offset;
}
static const int interrupt_levels[] =
{
1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 0
};
static void execute_ins(uaecptr endpc, uaecptr targetpc, struct instr *dp)
{
uae_u16 opc = regs.ir;
uae_u16 opw1 = (opcode_memory[2] << 8) | (opcode_memory[3] << 0);
uae_u16 opw2 = (opcode_memory[4] << 8) | (opcode_memory[5] << 0);
if (opc == 0x199c
&& opw1 == 0x2808
//&& opw2 == 0x4afc
)
printf("");
if (regs.sr & 0x2000)
printf("");
if (regs.sr & 0x8000)
printf("");
if (regs.sr & 0x4000)
printf("");
// execute instruction
SPCFLAG_TRACE = 0;
SPCFLAG_DOTRACE = 0;
trace_store_pc = 0xffffffff;
mmufixup[0].reg = -1;
mmufixup[1].reg = -1;
MakeFromSR();
low_memory_accessed = 0;
high_memory_accessed = 0;
test_memory_accessed = 0;
testing_active = 1;
testing_active_opcode = opc;
hardware_bus_error = 0;
hardware_bus_error_fake = 0;
read_buffer_prev = regs.irc;
regs.read_buffer = regs.irc;
regs.write_buffer = 0xf00d;
exception_extra_frame_size = 0;
exception_extra_frame_type = 0;
cpu_cycles = 0;
regs.loop_mode = 0;
int cnt = (feature_loop_mode + 1) * 2;
if (multi_mode)
cnt = 100;
for (;;) {
// if supervisor stack is odd: exit
if (regs.s && (regs.isp & 1)) {
test_exception = -1;
break;
}
if (cnt <= 0) {
wprintf(_T(" Loop mode didn't end!?\n"));
abort();
}
if (SPCFLAG_TRACE) {
do_trace();
}
if (feature_interrupts) {
int ic = interrupt_count;
interrupt_count++;
interrupt_count &= 15;
int lvl = interrupt_levels[ic];
if (lvl > 0 && lvl > feature_min_interrupt_mask) {
Exception(lvl + 24);
break;
}
}
regs.instruction_pc = regs.pc;
uaecptr a7 = regs.regs[15];
int s = regs.s;
(*cpufunctbl[opc])(opc);
// Test did one or more out of bounds memory accesses
// or CPU stopped or was reset: skip
if (out_of_test_space || cpu_stopped) {
break;
}
// Supervisor mode and A7 was modified and not RTE+stack mode: skip this test round.
if (s && regs.regs[15] != a7 && (dp->mnemo != i_RTE || feature_usp < 3)) {
// but not if RTE
if (!is_superstack_use_required()) {
test_exception = -1;
break;
}
}
// skip test if SR interrupt mask got too low
if (regs.intmask < feature_min_interrupt_mask) {
test_exception = -1;
break;
}
if (!SPCFLAG_DOTRACE && cpu_stopped && regs.s == 0 && currprefs.cpu_model <= 68010) {
// 68000/68010 undocumented special case:
// if STOP clears S-bit and T was not set:
// cause privilege violation exception, PC pointing to following instruction.
// If T was set before STOP: STOP works as documented.
cpu_stopped = 0;
Exception(8);
}
// Amiga Chip ram does not support TAS or MOVE16
if ((dp->mnemo == i_TAS || dp->mnemo == i_MOVE16) && low_memory_accessed) {
test_exception = -1;
break;
}
if (regs.pc == endpc || regs.pc == targetpc) {
// Trace is only added as an exception if there was no other exceptions
// Trace stacked with other exception is handled later
if (SPCFLAG_DOTRACE && !test_exception) {
Exception(9);
}
break;
}
if (test_exception)
break;
if (!valid_address(regs.pc, 2, 0))
break;
if (!feature_loop_mode) {
// trace after NOP
if (SPCFLAG_DOTRACE) {
MakeSR();
// store only first
if (trace_store_pc == 0xffffffff) {
trace_store_pc = regs.pc;
trace_store_sr = regs.sr;
SPCFLAG_DOTRACE = 0;
}
// STOP can only end with exception, fake prefetch here.
if (dp->mnemo == i_STOP) {
regs.ir = get_word_test(regs.pc + 0);
regs.irc = get_word_test(regs.pc + 2);
}
}
if (currprefs.cpu_model >= 68020) {
regs.ir = get_word_test(regs.pc + 0);
regs.irc = get_word_test(regs.pc + 2);
}
opc = regs.ir;
continue;
}
cnt--;
if (!feature_loop_mode && !multi_mode && opc != 0x4e71) {
wprintf(_T(" Test instruction didn't finish in single step in non-loop mode!?\n"));
abort();
}
if (!regs.loop_mode)
regs.ird = opc;
if (currprefs.cpu_model >= 68020) {
regs.ir = get_word_test(regs.pc + 0);
regs.irc = get_word_test(regs.pc + 2);
}
opc = regs.ir;
}
testing_active = 0;
if (regs.s) {
regs.regs[15] = regs.usp;
}
}
// instruction that reads or writes stack
static int stackinst(struct instr *dp)
{
switch (dp->mnemo)
{
case i_RTS:
case i_RTR:
case i_RTD:
case i_RTE:
case i_UNLK:
return 1;
case i_BSR:
case i_JSR:
case i_LINK:
case i_PEA:
return 2;
}
return 0;
}
// any instruction that can branch execution
static int isbranchinst(struct instr *dp)
{
switch (dp->mnemo)
{
case i_Bcc:
case i_BSR:
case i_JMP:
case i_JSR:
return 1;
case i_RTS:
case i_RTR:
case i_RTD:
case i_RTE:
return 2;
case i_DBcc:
case i_FBcc:
case i_FDBcc:
return -1;
}
return 0;
}
static int isunsupported(struct instr *dp)
{
switch (dp->mnemo)
{
case i_MOVE2C:
case i_FSAVE:
case i_FRESTORE:
case i_PFLUSH:
case i_PFLUSHA:
case i_PFLUSHAN:
case i_PFLUSHN:
case i_PTESTR:
case i_PTESTW:
case i_CPUSHA:
case i_CPUSHL:
case i_CPUSHP:
case i_CINVA:
case i_CINVL:
case i_CINVP:
case i_PLPAR:
case i_PLPAW:
case i_CALLM:
case i_RTM:
return 1;
}
return 0;
}
static int noregistercheck(struct instr *dp)
{
return 0;
}
static uae_u8 last_exception[256];
static int last_exception_len;
static int last_exception_extra;
// save expected exception stack frame
static uae_u8 *save_exception(uae_u8 *p, struct instr *dp)
{
uae_u8 *op = p;
p++;
*p++ = test_exception_extra | (exception_extra_frame_type ? 0x40 : 0x00);
// bus/address error aborted group 2 exception
if (exception_extra_frame_type) {
*p++ = exception_extra_frame_type;
}
// Separate, non-stacked Trace
if (test_exception_extra & 0x80) {
*p++ = trace_store_sr >> 8;
*p++ = trace_store_sr;
p = store_rel(p, 0, opcode_memory_start, trace_store_pc, 1);
}
uae_u8 *sf = NULL;
if (test_exception > 0) {
sf = test_memory + test_memory_size + EXTRA_RESERVED_SPACE - exception_stack_frame_size;
// parse exception and store fields that are unique
// SR and PC was already saved with non-exception data
if (cpu_lvl == 0) {
if (test_exception == 2 || test_exception == 3) {
// status
uae_u8 st = sf[1];
// save also current opcode if different than stacked opcode
// used by basic exception check
if (((sf[6] << 8) | sf[7]) != regs.opcode) {
st |= 0x20;
}
*p++ = st;
// opcode (which is not necessarily current opcode!)
*p++ = sf[6];
*p++ = sf[7];
if (st & 0x20) {
*p++ = regs.opcode >> 8;
*p++ = regs.opcode;
}
// access address
p = store_rel(p, 0, opcode_memory_start, gl(sf + 2), 1);
}
} else if (cpu_lvl > 0) {
uae_u8 ccrmask = 0;
uae_u16 frame = (sf[6] << 8) | sf[7];
// frame + vector offset
*p++ = sf[6];
*p++ = sf[7];
switch (frame >> 12)
{
case 0:
break;
case 2:
// instruction address
p = store_rel(p, 0, opcode_memory_start, gl(sf + 8), 1);
break;
case 3:
// effective address
p = store_rel(p, 0, opcode_memory_start, gl(sf + 8), 1);
break;
case 4: // floating point unimplemented (68040/060)
// fault/effective address
p = store_rel(p, 0, opcode_memory_start, gl(sf + 8), 1);
// FSLW or PC of faulted instruction
p = store_rel(p, 0, opcode_memory_start, gl(sf + 12), 1);
break;
case 8: // 68010 address/bus error
// SSW
*p++ = sf[8];
*p++ = sf[9];
// fault address
p = store_rel(p, 0, opcode_memory_start, gl(sf + 10), 1);
// data output
*p++ = sf[16];
*p++ = sf[17];
// data input
*p++ = sf[20];
*p++ = sf[21];
// instruction
*p++ = sf[24];
*p++ = sf[25];
// optional data input (some hardware does real memory fetch when CPU does the dummy fetch, some don't)
*p++ = read_buffer_prev >> 8;
*p++ = read_buffer_prev;
break;
case 0x0a: // 68020/030 address error.
case 0x0b: // Don't save anything extra, too many undefined fields and bits..
exception_stack_frame_size = 0x08;
break;
default:
wprintf(_T(" Unknown frame %04x!\n"), frame);
abort();
}
}
}
if (last_exception_len > 0 && last_exception_len == exception_stack_frame_size && test_exception_extra == last_exception_extra && (!sf || !memcmp(sf, last_exception, exception_stack_frame_size))) {
// stack frame was identical to previous
p = op;
*p++ = 0xff;
} else {
int datalen = (p - op) - 1;
last_exception_len = exception_stack_frame_size;
last_exception_extra = test_exception_extra;
*op = (uae_u8)datalen;
if (sf) {
memcpy(last_exception, sf, exception_stack_frame_size);
}
}
return p;
}
static uae_u16 get_ccr_ignore(struct instr *dp, uae_u16 extra)
{
uae_u16 ccrignoremask = 0;
if ((cpu_lvl == 2 || cpu_lvl == 3) && (test_exception == 5 || exception_extra_frame_type == 5)) {
if ((dp->mnemo == i_DIVS) || (dp->mnemo == i_DIVL && (extra & 0x0800) && !(extra & 0x0400))) {
// 68020/030 DIVS.W/.L + Divide by Zero: V state is not stable.
ccrignoremask |= 2; // mask CCR=V
}
}
return ccrignoremask;
}
static int isfpp(int mnemo)
{
switch (mnemo)
{
case i_FPP:
case i_FBcc:
case i_FDBcc:
case i_FTRAPcc:
case i_FScc:
case i_FRESTORE:
case i_FSAVE:
return 1;
}
return 0;
}
static void generate_target_registers(uae_u32 target_address, uae_u32 *out)
{
uae_u32 *a = out + 8;
a[0] = target_address;
a[1] = target_address + 1;
a[2] = target_address + 2;
a[3] = target_address + 4;
a[4] = target_address - 6;
a[5] = target_address + 6;
for (int i = 0; i < 7; i++) {
out[i] = i - 4;
}
out[7] = target_address - opcode_memory_start;
}
static const TCHAR *sizes[] = { _T("B"), _T("W"), _T("L") };
static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfilename, int opcodesize, int fpuopcode)
{
TCHAR dir[1000];
uae_u8 *dst = NULL;
int mn;
int size;
bool fpumode = 0;
uae_u32 test_cnt = 0;
if (mnemo == NULL || mnemo[0] == 0)
return;
size = 3;
if (fpuopcode < 0) {
if (opcodesize == 0)
size = 2;
else if (opcodesize == 4)
size = 1;
else if (opcodesize == 6)
size = 0;
}
filecount = 0;
struct mnemolookup *lookup = NULL;
for (int i = 0; lookuptab[i].name; i++) {
lookup = &lookuptab[i];
if (!_tcsicmp(lookup->name, mnemo) || (lookup->friendlyname && !_tcsicmp(lookup->friendlyname, mnemo)))
break;
}
if (!lookup) {
wprintf(_T("'%s' not found.\n"), mnemo);
return;
}
mn = lookup->mnemo;
xorshiftstate = lookup - lookuptab;
const TCHAR *mns = lookup->name;
if (fpuopcode >= 0) {
xorshiftstate = 128 + fpuopcode;
mns = fpuopcodes[fpuopcode];
if (opcodesize == 7) {
mns = _T("FMOVECR");
xorshiftstate = 128 + 64;
} else if (opcodesize == 8) {
mns = _T("FMOVEM");
xorshiftstate = 128 + 64 + 1;
}
}
xorshiftstate += 256 * opcodesize;
if (ovrfilename) {
mns = ovrfilename;
for (int i = 0; i < _tcslen(ovrfilename); i++) {
xorshiftstate <<= 1;
xorshiftstate ^= ovrfilename[i];
}
}
int pathlen = _tcslen(path);
_stprintf(dir, _T("%s%s"), path, mns);
if (fpuopcode < 0) {
if (size < 3) {
_tcscat(dir, _T("."));
_tcscat(dir, sizes[size]);
}
} else {
_tcscat(dir, _T("."));
_tcscat(dir, fpsizes[opcodesize < 7 ? opcodesize : 2]);
}
memset(inst_name, 0, sizeof(inst_name));
strncpy(inst_name, dir + pathlen, sizeof(inst_name));
opcodecnt = 0;
for (int opcode = 0; opcode < 65536; opcode++) {
struct instr *dp = table68k + opcode;
// match requested mnemonic
if (dp->mnemo != lookup->mnemo)
continue;
// match requested size
if ((size >= 0 && size <= 2) && (size != dp->size || dp->unsized))
continue;
if (size == 3 && !dp->unsized)
continue;
// skip all unsupported instructions if not specifically testing i_ILLG
if (lookup->mnemo != i_ILLG) {
if (dp->clev > cpu_lvl)
continue;
if (isunsupported(dp))
return;
if (isfpp(lookup->mnemo) && !currprefs.fpu_model)
return;
}
opcodecnt++;
fpumode = currprefs.fpu_model && isfpp(lookup->mnemo);
}
if (!opcodecnt)
return;
wprintf(_T("%s\n"), dir);
int quick = 0;
int rounds = feature_test_rounds;
int subtest_count = 0;
int data_saved = 0;
int first_cycles = 1;
int count = 0;
registers[8 + 6] = opcode_memory_start - 0x100;
registers[15] = user_stack_memory_use;
uae_u32 target_address = 0xffffffff;
uae_u32 target_opcode_address = 0xffffffff;
uae_u32 target_usp_address = 0xffffffff;
target_ea[0] = 0xffffffff;
target_ea[1] = 0xffffffff;
target_ea[2] = 0xffffffff;
if (feature_target_ea[0][2] && feature_target_ea[0][2] != 0xffffffff) {
if (feature_usp == 3) {
target_usp_address = feature_target_ea[0][2];
target_ea[2] = target_usp_address;
target_usp_address += opcode_memory_start;
} else {
target_opcode_address = feature_target_ea[0][2];
target_ea[2] = target_opcode_address;
}
}
if (feature_target_ea[0][0] != 0xffffffff) {
target_address = feature_target_ea[0][0];
target_ea[0] = target_address;
} else if (feature_target_ea[0][1] != 0xffffffff) {
target_address = feature_target_ea[0][1];
target_ea[1] = target_address;
}
target_ea_src_cnt = 0;
target_ea_dst_cnt = 0;
target_ea_opcode_cnt = 0;
// 1.0
fpuregisters[0].high = 0x3fff;
fpuregisters[0].low = 0x8000000000000000;
// -1.0
fpuregisters[1].high = 0xbfff;
fpuregisters[1].low = 0x8000000000000000;
// 0.0
fpuregisters[2].high = 0x0000;
fpuregisters[2].low = 0x0000000000000000;
// NaN
fpuregisters[3].high = 0x7fff;
fpuregisters[3].low = 0xffffffffffffffff;
// inf+
fpuregisters[4].high = 0x7fff;
fpuregisters[4].low = 0x0000000000000000;
// inf-
fpuregisters[5].high = 0xffff;
fpuregisters[5].low = 0x0000000000000000;
for (int i = 6; i < 8; i++) {
fpuregisters[i].high = rand16();
fpuregisters[i].low = (((uae_u64)rand32()) << 32) | (rand32());
}
for (int i = 0; i < MAX_REGISTERS; i++) {
cur_registers[i] = registers[i];
}
floatx80 cur_fpuregisters[8];
for (int i = 0; i < 8; i++) {
cur_fpuregisters[i] = fpuregisters[i];
}
if (target_address != 0xffffffff) {
generate_target_registers(target_address, cur_registers);
}
dst = storage_buffer;
if (low_memory) {
memcpy(low_memory, low_memory_temp, low_memory_size);
}
if (high_memory) {
memcpy(high_memory, high_memory_temp, high_memory_size);
}
memcpy(test_memory, test_memory_temp, test_memory_size);
memset(storage_buffer, 0xdd, 1000);
full_format_cnt = 0;
last_exception_len = -1;
interrupt_count = 0;
int sr_override = 0;
uae_u32 target_ea_bak[3], target_address_bak, target_opcode_address_bak;
for (;;) {
target_ea_bak[0] = target_ea[0];
target_ea_bak[1] = target_ea[1];
target_ea_bak[2] = target_ea[2];
target_address_bak = target_address;
target_opcode_address_bak = target_opcode_address;
uae_u32 opcode_memory_address = opcode_memory_start;
uae_u8 *opcode_memory_ptr = opcode_memory;
if (target_opcode_address != 0xffffffff) {
opcode_memory_address += target_opcode_address;
opcode_memory_ptr = get_addr(opcode_memory_address, 2, 0);
if (opcode_memory_address >= safe_memory_start && opcode_memory_address < safe_memory_end)
break;
}
if (quick)
break;
if (feature_loop_mode) {
regs.regs[feature_loop_mode_register] &= 0xffff0000;
regs.regs[feature_loop_mode_register] |= feature_loop_mode - 1;
cur_registers[feature_loop_mode_register] = regs.regs[feature_loop_mode_register];
}
for (int i = 0; i < MAX_REGISTERS; i++) {
dst = store_reg(dst, CT_DREG + i, 0, cur_registers[i], -1);
regs.regs[i] = cur_registers[i];
}
for (int i = 0; i < 8; i++) {
if (fpumode) {
dst = store_fpureg(dst, CT_FPREG + i, cur_fpuregisters[i]);
}
regs.fp[i].fpx = cur_fpuregisters[i];
}
regs.sr = feature_min_interrupt_mask << 8;
uae_u32 srcaddr_old = 0xffffffff;
uae_u32 dstaddr_old = 0xffffffff;
uae_u32 srcaddr = 0xffffffff;
uae_u32 dstaddr = 0xffffffff;
uae_u32 branchtarget_old = 0xffffffff;
uae_u32 instructionendpc_old = opcode_memory_start;
uae_u32 startpc_old = opcode_memory_start;
int branch_target_swap_mode_old = 0;
if (verbose) {
if (target_ea[0] != 0xffffffff)
wprintf(_T(" Target EA SRC=%08x\n"), target_ea[0]);
if (target_ea[1] != 0xffffffff)
wprintf(_T(" Target EA DST=%08x\n"), target_ea[1]);
if (target_ea[2] != 0xffffffff)
wprintf(_T(" Target EA OPCODE=%08x\n"), target_ea[2]);
}
for (int opcode = 0; opcode < 65536; opcode++) {
struct instr *dp = table68k + opcode;
// match requested mnemonic
if (dp->mnemo != lookup->mnemo)
continue;
if (lookup->mnemo != i_ILLG) {
// match requested size
if ((size >= 0 && size <= 2) && (size != dp->size || dp->unsized))
continue;
if (size == 3 && !dp->unsized)
continue;
// skip all unsupported instructions if not specifically testing i_ILLG
if (dp->clev > cpu_lvl)
continue;
}
if (feature_loop_mode_68010) {
if (!opcode_loop_mode(opcode))
continue;
if (dp->mnemo == i_DBcc)
continue;
}
target_ea[0] = target_ea_bak[0];
target_ea[1] = target_ea_bak[1];
target_ea[2] = target_ea_bak[2];
target_address = target_address_bak;
target_opcode_address = target_opcode_address_bak;
int extra_loops = 3;
while (extra_loops-- > 0) {
// force both odd and even immediate values
// for better address error testing
forced_immediate_mode = 0;
if ((currprefs.cpu_model == 68000 || currprefs.cpu_model == 68010) && (feature_exception3_data == 1 || feature_exception3_instruction == 1)) {
if (dp->size > 0) {
if (extra_loops == 1)
forced_immediate_mode = 1;
if (extra_loops == 0)
forced_immediate_mode = 2;
} else {
extra_loops = 0;
}
} else if (currprefs.cpu_model == 68020 && ((ad8r[0] & 3) == 2 || (pc8r[0] & 3) == 2 || (ad8r[1] & 3) == 2 || (pc8r[1] & 3) == 2)) {
; // if only 68020+ addressing modes: do extra loops
} else {
extra_loops = 0;
}
imm8_cnt = 0;
imm16_cnt = 0;
imm32_cnt = 0;
immabsl_cnt = 0;
imm_special = 0;
target_ea[0] = target_ea_bak[0];
target_ea[1] = target_ea_bak[1];
target_ea[2] = target_ea_bak[1];
target_address = target_address_bak;
target_opcode_address = target_opcode_address_bak;
reset_ea_state();
// retry few times if out of bounds access
int oob_retries = 10;
// if instruction has immediate(s), repeat instruction test multiple times
// each round generates new random immediate(s)
int constant_loops = 32;
if (dp->mnemo == i_ILLG) {
constant_loops = 1;
}
while (constant_loops-- > 0) {
uae_u8 oldcodebytes[OPCODE_AREA];
uae_u8 oldbcbytes[BRANCHTARGET_AREA];
uae_u8 *oldbcbytes_ptr = NULL;
int oldbcbytes_inuse = 0;
memcpy(oldcodebytes, opcode_memory, sizeof(oldcodebytes));
uae_u16 opc = opcode;
int isconstant_src = 0;
int isconstant_dst = 0;
int did_out_of_bounds = 0;
int prev_test_count = test_count;
int prev_subtest_count = subtest_count;
uae_u32 branch_target_swap_address = 0;
int branch_target_swap_mode = 0;
uae_u32 branch_target_data_original = 0x4afc4e71;
uae_u32 branch_target_data = branch_target_data_original;
out_of_test_space = 0;
noaccesshistory = 0;
hardware_bus_error_fake = 0;
hardware_bus_error = 0;
ahcnt_current = 0;
ahcnt_written = 0;
multi_mode = 0;
target_ea[0] = target_ea_bak[0];
target_ea[1] = target_ea_bak[1];
target_ea[2] = target_ea_bak[2];
target_address = target_address_bak;
target_opcode_address = target_opcode_address_bak;
if (target_usp_address != 0xffffffff) {
cur_registers[15] = target_usp_address;
regs.regs[15] = target_usp_address;
}
regs.usp = regs.regs[15];
regs.isp = super_stack_memory - 0x80;
if (opc == 0x0e51)
printf("");
if (subtest_count >= 700)
printf("");
uaecptr startpc = opcode_memory_start;
uaecptr pc = startpc + 2;
if (target_opcode_address != 0xffffffff) {
pc -= 2;
int cnt = 0;
while (pc - 2 != opcode_memory_address) {
put_word_test(pc, 0x4e71);
pc += 2;
cnt++;
if (cnt >= 16) {
wprintf(_T("opcode target is too far from opcode address\n"));
abort();
}
}
startpc = opcode_memory_address;
}
// Start address to start address + 3 must be accessible or
// jump prefetch would cause early bus error which we don't want
if (is_nowrite_address(startpc, 4)) {
goto nextopcode;
}
if (dp->mnemo != i_ILLG) {
pc += handle_specials_preea(opc, pc, dp);
uae_u32 srcea = 0xffffffff;
uae_u32 dstea = 0xffffffff;
// create source addressing mode
if (dp->suse) {
int o = create_ea(&opc, pc, dp->smode, dp->sreg, dp, &isconstant_src, 0, fpuopcode, opcodesize, &srcea);
if (o < 0) {
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
if (o == -1)
goto nextopcode;
continue;
}
pc += o;
}
uae_u8 *ao = opcode_memory_ptr + 2;
uae_u16 apw1 = (ao[0] << 8) | (ao[1] << 0);
uae_u16 apw2 = (ao[2] << 8) | (ao[3] << 0);
if (opc == 0x4662
// && apw1 == 0x0000
//&& apw2 == 0x7479
)
printf("");
if (target_address != 0xffffffff && (dp->mnemo == i_MVMEL || dp->mnemo == i_MVMLE)) {
// if MOVEM and more than 1 register: randomize address so that any MOVEM
// access can hit target address
uae_u16 mask = (opcode_memory_ptr[2] << 8) | opcode_memory_ptr[3];
int count = 0;
for (int i = 0; i < 16; i++) {
if (mask & (1 << i))
count++;
}
if (count > 0) {
int diff = (rand8() % count);
if (dp->dmode == Apdi) {
diff = -diff;
}
uae_u32 ta = target_address;
target_address -= diff * (1 << dp->size);
if (target_ea[0] == ta)
target_ea[0] = target_address;
if (target_ea[1] == ta)
target_ea[1] = target_address;
}
}
// if source EA modified opcode
dp = table68k + opc;
// create destination addressing mode
if (dp->duse) {
int o = create_ea(&opc, pc, dp->dmode, dp->dreg, dp, &isconstant_dst, 1, fpuopcode, opcodesize, &dstea);
if (o < 0) {
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
if (o == -1)
goto nextopcode;
continue;
}
pc += o;
}
if (dp->mnemo == i_MOVES) {
// MOVES is stupid
if (!(get_word_test(pc - 2) & 0x0800)) {
uae_u32 vv = dstea;
dstea = srcea;
srcea = vv;
}
}
// requested target address but no EA? skip
if (target_address != 0xffffffff && isbranchinst(dp) != 2 && (feature_usp < 3 || !stackinst(dp))) {
if (srcea != target_address && dstea != target_address) {
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
continue;
}
}
pc = handle_specials_extra(opc, pc, dp);
// if destination EA modified opcode
dp = table68k + opc;
uae_u8 *bo = opcode_memory_ptr + 2;
uae_u16 bopw1 = (bo[0] << 8) | (bo[1] << 0);
uae_u16 bopw2 = (bo[2] << 8) | (bo[3] << 0);
if (opc == 0x0662
&& bopw1 == 0x3dec
//&& bopw2 == 0x2770
)
printf("");
// bcc.x
pc += handle_specials_branch(opc, pc, dp, &isconstant_src);
// misc
pc += handle_specials_misc(opc, pc, dp, &isconstant_src);
}
// if bus error stack checking and RTE: copy USP to ISP before RTE
if (dp->mnemo == i_RTE && feature_usp == 3) {
put_word_test(opcode_memory_address, 0x4e6f); // MOVE USP,A7
put_word_test(opcode_memory_address + 2, opc);
pc += 2;
} else {
put_word_test(opcode_memory_address, opc);
}
if (extra_or || extra_and) {
uae_u16 ew = get_word_test(opcode_memory_address + 2);
uae_u16 ew2 = (ew | extra_or) & ~extra_and;
if (ew2 != ew) {
put_word_test(opcode_memory_address + 2, ew2);
}
}
uae_u16 extraword = get_word_test(opcode_memory_address + 2);
// loop mode
if (feature_loop_mode) {
// dbf dn, opcode_memory_start
put_long_test(pc, ((0x51c8 | feature_loop_mode_register) << 16) | ((opcode_memory_address - pc - 2) & 0xffff));
pc += 4;
}
// if instruction was long enough to hit safe area, decrease pc until we are back to normal area
while (is_nowrite_address(pc - 1, 1)) {
pc -= 2;
}
// end word, needed to detect if instruction finished normally when
// running on real hardware.
uae_u32 originalendopcode = 0x4afc4e71;
uae_u32 endopcode = originalendopcode;
uae_u32 actualendpc = pc;
uae_u32 instructionendpc = pc;
if (isconstant_src < 0 || isconstant_dst < 0) {
constant_loops++;
quick = 1;
} else {
// the smaller the immediate, the less test loops
if (constant_loops > isconstant_src && constant_loops > isconstant_dst)
constant_loops = isconstant_dst > isconstant_src ? isconstant_dst : isconstant_src;
// don't do extra tests if no immediates
if (!isconstant_dst && !isconstant_src)
extra_loops = 0;
}
if (out_of_test_space) {
wprintf(_T( "Setting up test instruction generated out of bounds error!?\n"));
abort();
}
noaccesshistory++;
if (!is_nowrite_address(pc, 4)) {
put_long_test(pc, endopcode); // illegal instruction + nop
actualendpc += 4;
} else if (!is_nowrite_address(pc, 2)) {
put_word_test(pc, endopcode >> 16);
actualendpc += 2;
}
noaccesshistory--;
pc += 4;
if (out_of_test_space) {
wprintf(_T("out_of_test_space set!?\n"));
abort();
}
TCHAR out[256];
memset(out, 0, sizeof(out));
// disassemble and output generated instruction
for (int i = 0; i < MAX_REGISTERS; i++) {
regs.regs[i] = cur_registers[i];
}
for (int i = 0; i < 8; i++) {
regs.fp[i].fpx = cur_fpuregisters[i];
}
uaecptr nextpc;
srcaddr = 0xffffffff;
dstaddr = 0xffffffff;
uae_u32 dflags = m68k_disasm_2(out, sizeof(out) / sizeof(TCHAR), opcode_memory_address, &nextpc, 1, &srcaddr, &dstaddr, 0xffffffff, 0);
if (verbose) {
my_trim(out);
wprintf(_T("%08u %s"), subtest_count, out);
}
// disassembler may set this
out_of_test_space = false;
if ((dflags & 1) && target_ea[0] != 0xffffffff && srcaddr != 0xffffffff && srcaddr != target_ea[0]) {
if (verbose) {
wprintf(_T(" Source address mismatch %08x <> %08x\n"), target_ea[0], srcaddr);
}
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
continue;
}
if ((dflags & 2) && target_ea[1] != 0xffffffff && dstaddr != target_ea[1]) {
if (verbose) {
wprintf(_T(" Destination address mismatch %08x <> %08x\n"), target_ea[1], dstaddr);
}
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
continue;
}
if ((dflags & 1) && target_ea[0] == 0xffffffff && (srcaddr & addressing_mask) >= safe_memory_start - 4 && (srcaddr & addressing_mask) < safe_memory_end + 4) {
// random generated EA must never be inside safe memory
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
if (verbose) {
wprintf(_T("\n"));
}
continue;
}
if ((dflags & 2) && target_ea[1] == 0xffffffff && (dstaddr & addressing_mask) >= safe_memory_start - 4 && (dstaddr & addressing_mask) < safe_memory_end + 4) {
// random generated EA must never be inside safe memory
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
if (verbose) {
wprintf(_T("\n"));
}
continue;
}
#if 0
// can't test because dp may be empty if instruction is invalid
if (nextpc != pc - 2) {
wprintf(_T(" Disassembler/generator instruction length mismatch!\n"));
abort();
}
#endif
uaecptr branch_target = 0xffffffff;
uaecptr branch_target_pc = 0xffffffff;
int bc = isbranchinst(dp);
if (bc) {
if (bc < 0) {
srcaddr = dstaddr;
}
if (bc == 2) {
// RTS and friends
int stackoffset = handle_specials_stack(opc, pc, dp, &isconstant_src);
if (isconstant_src < 0 || isconstant_dst < 0) {
constant_loops++;
quick = 0;
}
srcaddr = get_long_test(regs.regs[15] + stackoffset);
}
// branch target is not accessible? skip.
if (((srcaddr >= cur_registers[15] - 16 && srcaddr <= cur_registers[15] + 16) && dp->mnemo != i_RTE) || ((srcaddr & 1) && !feature_exception3_instruction && feature_usp < 2)) {
// lets not jump directly to stack..
if (verbose) {
if (srcaddr & 1)
wprintf(_T(" Branch target is odd (%08x)\n"), srcaddr);
else
wprintf(_T(" Branch target is stack (%08x)\n"), srcaddr);
}
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
continue;
}
testing_active = 1;
if (!valid_address(srcaddr, 2, 1) || srcaddr + 2 == opcode_memory_start) {
if (verbose) {
wprintf(_T(" Branch target inaccessible (%08x)\n"), srcaddr);
}
testing_active = 0;
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
continue;
}
testing_active = 0;
}
// no exit continue or goto after this
uae_u8 *prev_dst = dst;
oldbcbytes_inuse = 0;
if (bc) {
branch_target = srcaddr;
// branch target = generate exception
if (!is_nowrite_address(branch_target, 4)) {
branch_target_swap_address = branch_target;
branch_target_swap_mode = 1;
if (!(branch_target & 1)) {
oldbcbytes_inuse = 4;
oldbcbytes_ptr = get_addr(branch_target, oldbcbytes_inuse, 0);
memcpy(oldbcbytes, oldbcbytes_ptr, oldbcbytes_inuse);
put_long_test(branch_target, branch_target_data);
}
} else if (!is_nowrite_address(branch_target, 2)) {
branch_target_swap_address = branch_target;
branch_target_swap_mode = 2;
if (!(branch_target & 1)) {
oldbcbytes_inuse = 2;
oldbcbytes_ptr = get_addr(branch_target, oldbcbytes_inuse, 0);
memcpy(oldbcbytes, oldbcbytes_ptr, oldbcbytes_inuse);
put_word_test(branch_target, branch_target_data >> 16);
}
}
}
// save opcode memory
dst = store_mem_bytes(dst, opcode_memory_start, instructionendpc - opcode_memory_start, oldcodebytes, true);
// store branch target and stack modifications (these needs to be rolled back after the test)
dst = store_mem_writes(dst, 1);
uae_u32 instructionendpc_old_prev = instructionendpc_old;
uae_u32 startpc_old_prev = startpc_old;
uae_u32 branchtarget_old_prev = branchtarget_old;
uae_u32 srcaddr_old_prev = srcaddr_old;
uae_u32 dstaddr_old_prev = dstaddr_old;
if (startpc != startpc_old) {
dst = store_reg(dst, CT_PC, startpc_old, startpc, -1);
startpc_old = startpc;
}
if (instructionendpc != instructionendpc_old) {
dst = store_reg(dst, CT_ENDPC, instructionendpc_old, instructionendpc, -1);
instructionendpc_old = instructionendpc;
}
if (srcaddr != srcaddr_old && (dflags & 1)) {
dst = store_reg(dst, CT_SRCADDR, srcaddr_old, srcaddr, -1);
srcaddr_old = srcaddr;
}
if (dstaddr != dstaddr_old && (dflags & 2)) {
dst = store_reg(dst, CT_DSTADDR, dstaddr_old, dstaddr, -1);
dstaddr_old = dstaddr;
}
if (branch_target != branchtarget_old || branch_target_swap_mode != branch_target_swap_mode_old) {
dst = store_reg(dst, CT_BRANCHTARGET, branchtarget_old, branch_target, -2);
branchtarget_old = branch_target;
*dst++ = branch_target_swap_mode;
}
if (feature_usp >= 3) {
dst = store_reg(dst, CT_AREG + 7, 0, target_usp_address, sz_long);
}
// pre-test data end
*dst++ = CT_END_INIT;
int exception_array[256] = { 0 };
int ok = 0;
int cnt_stopped = 0;
uae_u32 last_sr = 0;
uae_u32 last_pc = 0;
uae_u32 last_cpu_cycles = 0;
uae_u32 last_registers[MAX_REGISTERS];
floatx80 last_fpuregisters[8];
uae_u32 last_fpiar = 0;
uae_u32 last_fpsr = 0;
uae_u32 last_fpcr = 0;
int ccr_done = 0;
int prev_s_cnt = 0;
int s_cnt = 0;
int t_cnt = 0;
int extraccr = 0;
// extra loops for supervisor and trace
uae_u16 sr_allowed_mask = feature_sr_mask & 0xf000;
uae_u16 sr_mask_request = feature_sr_mask & 0xf000;
for (;;) {
uae_u16 sr_mask = 0;
int maxflag = fpumode ? 256 : 32;
// if cc-instruction: always do full test
if (feature_flag_mode == 1 && (dp->mnemo == i_ILLG || !dp->ccuse)) {
maxflag = fpumode ? 256 / 8 : 2;
}
if (extraccr & 1)
sr_mask |= 0x2000; // S
if (extraccr & 2)
sr_mask |= 0x4000; // T0
if (extraccr & 4)
sr_mask |= 0x8000; // T1
if (extraccr & 8)
sr_mask |= 0x1000; // M
if((sr_mask & ~sr_allowed_mask) || (sr_mask & ~sr_mask_request))
goto nextextra;
if (extraccr) {
*dst++ = (uae_u8)extraccr;
}
*dst++ = (uae_u8)maxflag;
// Test every CPU CCR or FPU SR/rounding/precision combination
for (int ccr = 0; ccr < maxflag; ccr++) {
bool skipped = false;
out_of_test_space = 0;
test_exception = 0;
test_exception_extra = 0;
cpu_stopped = 0;
cpu_halted = 0;
ahcnt_current = ahcnt_written;
int ahcnt_start = ahcnt_current;
memset(®s, 0, sizeof(regs));
// swap end opcode illegal/nop
noaccesshistory++;
endopcode = (endopcode >> 16) | (endopcode << 16);
int endopcodesize = 0;
if (!is_nowrite_address(pc - 4, 4)) {
put_long_test(pc - 4, endopcode);
endopcodesize = (endopcode >> 16) == 0x4e71 ? 2 : 4;
} else if (!is_nowrite_address(pc - 4, 2)) {
put_word_test(pc - 4, endopcode >> 16);
endopcodesize = 2;
}
noaccesshistory--;
// swap branch target illegal/nop
noaccesshistory++;
if (branch_target_swap_mode) {
branch_target_pc = branch_target;
if (branch_target_swap_mode == 1) {
if (!(branch_target_swap_address & 1)) {
branch_target_data = (branch_target_data >> 16) | (branch_target_data << 16);
put_long_test(branch_target_swap_address, branch_target_data);
if ((branch_target_data >> 16) == 0x4e71)
branch_target_pc = branch_target + 2;
else
branch_target_pc = branch_target;
}
} else if (branch_target_swap_mode == 2) {
if (!(branch_target_swap_address & 1)) {
branch_target_data = (branch_target_data >> 16) | (branch_target_data << 16);
put_word_test(branch_target_swap_address, branch_target_data >> 16);
}
}
} else {
branch_target_pc = branch_target;
}
noaccesshistory--;
// initialize CPU state
regs.pc = startpc;
regs.ir = get_word_test(regs.pc + 0);
regs.irc = get_word_test(regs.pc + 2);
if (regs.ir == 0x4afc && dp->mnemo != i_ILLG) {
wprintf(_T(" Illegal as starting opcode!?\n"));
abort();
}
// set up registers
for (int i = 0; i < MAX_REGISTERS; i++) {
regs.regs[i] = cur_registers[i];
}
if (fpumode) {
for (int i = 0; i < 8; i++) {
regs.fp[i].fpx = cur_fpuregisters[i];
}
regs.fpiar = regs.pc;
// condition codes
if (maxflag >= 32) {
fpp_set_fpsr((ccr & 15) << 24);
// precision and rounding
fpp_set_fpcr((ccr >> 4) << 4);
} else {
fpp_set_fpsr(((ccr & 1) ? 15 : 0) << 24);
// precision and rounding
fpp_set_fpcr((ccr >> 1) << 4);
}
}
// all CCR combinations or only all ones/all zeros?
if (maxflag >= 32) {
regs.sr = ccr | sr_mask;
} else {
regs.sr = ((ccr & 1) ? 31 : 0) | sr_mask;
}
regs.sr |= feature_min_interrupt_mask << 8;
regs.usp = regs.regs[15];
regs.isp = super_stack_memory - 0x80;
// copy user stack to super stack, for RTE etc support
memcpy(test_memory + (regs.isp - test_memory_start), test_memory + (regs.usp - test_memory_start), 0x20);
regs.msp = super_stack_memory;
// data size optimization, only store data
// if it is different than in previous round
if (!ccr && !extraccr) {
last_sr = regs.sr;
last_pc = regs.pc;
for (int i = 0; i < 16; i++) {
last_registers[i] = regs.regs[i];
}
for (int i = 0; i < 8; i++) {
last_fpuregisters[i] = regs.fp[i].fpx;
}
last_fpiar = regs.fpiar;
last_fpcr = regs.fpcr;
last_fpsr = regs.fpsr;
}
if (regs.sr & 0x2000)
prev_s_cnt++;
if (subtest_count == 2052)
printf("");
// execute test instruction(s)
execute_ins(pc - endopcodesize, branch_target_pc, dp);
if (regs.s)
s_cnt++;
// validate PC
uae_u8 *pcaddr = get_addr(regs.pc, 2, 0);
// examine results
// if only testing read bus errors, skip tests that generated only writes and vice-versa
// skip also all tests don't generate any bus errors
if ((hardware_bus_error == 0 && safe_memory_mode) ||
((hardware_bus_error & 4) && !(safe_memory_mode & 4)) ||
((hardware_bus_error & 1) && !(safe_memory_mode & 1)) ||
((hardware_bus_error & 2) && !(safe_memory_mode & 2))) {
skipped = 1;
}
// if testing bus errors: skip test if instruction under test didn't generate it
// (it could have been following nop/illegal used for aligning instruction before
// bus error boundary)
if (hardware_bus_error && safe_memory_mode && regs.instruction_pc != startpc) {
skipped = 1;
}
// skip if feature_target_opcode_offset mode and non-prefetch bus error
if (target_opcode_address != 0xffffffff && (hardware_bus_error & 3)) {
skipped = 1;
}
// exception 3 required but didn't get one?
if (test_exception != 3) {
if (feature_exception3_data == 2) {
skipped = 1;
}
if (feature_exception3_instruction == 2) {
skipped = 1;
}
if (feature_exception_vectors) {
skipped = 1;
}
} else {
// wanted read address error but got write
if (target_ea[0] != 0xffffffff && (target_ea[0] & 1) && target_ea[1] == 0xffffffff && test_exception_3_w) {
skipped = 1;
}
// wanted write address error but got read
if (target_ea[1] != 0xffffffff && (target_ea[1] & 1) && target_ea[0] == 0xffffffff && !test_exception_3_w) {
skipped = 1;
}
if (safe_memory_mode) {
skipped = 1;
}
}
if (feature_usp == 2) {
// need exception 3
if (test_exception != 3) {
skipped = 1;
}
}
if (cpu_stopped) {
cnt_stopped++;
// CPU stopped, skip test
skipped = 1;
} else if (cpu_halted) {
// CPU halted or reset, skip test
skipped = 1;
} else if (out_of_test_space) {
exception_array[0]++;
// instruction accessed memory out of test address space bounds
skipped = 1;
did_out_of_bounds = true;
} else if (test_exception < 0) {
// something happened that requires test skip
skipped = 1;
} else if (test_exception) {
// generated exception
exception_array[test_exception]++;
if (test_exception == 8 && !(sr_mask & 0x2000) && !(feature_sr_mask & 0x2000)) {
// Privilege violation exception and S mask not set? Switch to super mode in next round.
sr_mask_request |= 0x2000;
sr_allowed_mask |= 0x2000;
}
// got exception 3 but didn't want them?
if (test_exception == 3) {
if ((feature_usp != 1 && feature_usp != 2) && !feature_exception3_data && !(test_exception_3_fc & 2) && !feature_exception_vectors) {
skipped = 1;
}
if ((feature_usp != 1 && feature_usp != 2) && !feature_exception3_instruction && (test_exception_3_fc & 2) && !feature_exception_vectors) {
skipped = 1;
}
}
if (SPCFLAG_DOTRACE || test_exception == 9) {
t_cnt++;
}
} else if (!skipped) {
// instruction executed successfully
ok++;
// validate branch instructions
if (isbranchinst(dp)) {
if ((regs.pc != branch_target_pc && regs.pc != pc - endopcodesize)) {
wprintf(_T(" Branch instruction target fault\n"));
abort();
}
if (branch_target_pc < safe_memory_start || branch_target_pc >= safe_memory_end) {
if ((pcaddr[0] != 0x4a && pcaddr[1] != 0xfc) && (pcaddr[0] != 0x4e && pcaddr[1] != 0x71)) {
wprintf(_T(" Branch instruction target fault\n"));
abort();
}
}
}
}
// restore original branch target (This is not part of saved data)
noaccesshistory++;
put_long_test(pc - 4, originalendopcode);
if (branch_target_swap_mode && !(branch_target_swap_address & 1)) {
if (branch_target_swap_mode == 1) {
put_long_test(branch_target_swap_address, branch_target_data_original);
} else if (branch_target_swap_mode == 2) {
put_word_test(branch_target_swap_address, branch_target_data_original >> 16);
}
}
noaccesshistory--;
if (SPCFLAG_DOTRACE && test_exception_extra) {
wprintf(_T(" Trace and stored trace at the same time!\n"));
abort();
}
// did we have trace also active?
if (SPCFLAG_DOTRACE) {
if ((regs.t1 || regs.t0) && (test_exception == 5 || test_exception == 6 || test_exception == 7 || (test_exception >= 32 && test_exception <= 47) || (cpu_lvl == 1 && test_exception == 14))) {
test_exception_extra = 9;
} else {
test_exception_extra = 0;
}
}
if (trace_store_pc != 0xffffffff) {
test_exception_extra = 9 | 0x80;
}
MakeSR();
if (!skipped) {
bool storeregs = true;
// tell m68k code to skip register checks?
if (noregistercheck(dp)) {
*dst++ = CT_SKIP_REGS;
storeregs = false;
}
// save modified registers
for (int i = 0; i < MAX_REGISTERS; i++) {
uae_u32 s = last_registers[i];
uae_u32 d = regs.regs[i];
if (s != d) {
if (storeregs) {
dst = store_reg(dst, CT_DREG + i, s, d, -1);
}
last_registers[i] = d;
}
}
// SR/CCR
uae_u32 ccrignoremask = get_ccr_ignore(dp, extraword) << 16;
if ((regs.sr | ccrignoremask) != last_sr) {
dst = store_reg(dst, CT_SR, last_sr, regs.sr | ccrignoremask, -1);
last_sr = regs.sr | ccrignoremask;
}
// PC
if (regs.pc != last_pc) {
dst = store_rel(dst, CT_PC, last_pc, regs.pc, 0);
last_pc = regs.pc;
}
// FPU stuff
if (currprefs.fpu_model) {
for (int i = 0; i < 8; i++) {
floatx80 s = last_fpuregisters[i];
floatx80 d = regs.fp[i].fpx;
if (s.high != d.high || s.low != d.low) {
dst = store_fpureg(dst, CT_FPREG + i, d);
last_fpuregisters[i] = d;
}
}
if (regs.fpiar != last_fpiar) {
dst = store_rel(dst, CT_FPIAR, last_fpiar, regs.fpiar, 0);
last_fpiar = regs.fpiar;
}
if (regs.fpsr != last_fpsr) {
dst = store_reg(dst, CT_FPSR, last_fpsr, regs.fpsr, -1);
last_fpsr = regs.fpsr;
}
if (regs.fpcr != last_fpcr) {
dst = store_reg(dst, CT_FPCR, last_fpcr, regs.fpcr, -1);
last_fpcr = regs.fpcr;
}
}
if (cpu_lvl <= 1 && (last_cpu_cycles != cpu_cycles || first_cycles)) {
dst = store_reg(dst, CT_CYCLES, last_cpu_cycles, cpu_cycles, first_cycles ? 0 : -1);
last_cpu_cycles = cpu_cycles;
first_cycles = 0;
}
// store test instruction generated changes
dst = store_mem_writes(dst, 0);
// save exception, possible combinations:
// - any exception except trace
// - any exception except trace + trace stacked on top of previous exception
// - any exception except trace + following instruction generated trace
// - trace only
if (test_exception) {
*dst++ = CT_END | test_exception;
dst = save_exception(dst, dp);
} else if (test_exception_extra) {
*dst++ = CT_END | 1;
dst = save_exception(dst, dp);
} else {
*dst++ = CT_END;
}
test_count++;
subtest_count++;
ccr_done++;
} else {
*dst++ = CT_END_SKIP;
last_exception_len = -1;
}
// undo any test instruction generated memory modifications
undo_memory(ahist, ahcnt_start);
}
nextextra:
extraccr++;
if (extraccr >= 16)
break;
}
*dst++ = CT_END;
if (!ccr_done) {
// undo whole previous ccr/extra loop if all tests were skipped
dst = prev_dst;
memcpy(opcode_memory, oldcodebytes, sizeof(oldcodebytes));
if (oldbcbytes_inuse > 0)
memcpy(oldbcbytes_ptr, oldbcbytes, oldbcbytes_inuse);
oldbcbytes_inuse = 0;
test_count = prev_test_count;
subtest_count = prev_subtest_count;
last_exception_len = -1;
srcaddr_old = srcaddr_old_prev;
dstaddr_old = dstaddr_old_prev;
branchtarget_old = branchtarget_old_prev;
instructionendpc_old = instructionendpc_old_prev;
startpc_old = startpc_old_prev;
} else {
full_format_cnt++;
data_saved = 1;
}
if (verbose) {
wprintf(_T(" OK=%d OB=%d S=%d/%d T=%d STP=%d"), ok, exception_array[0], prev_s_cnt, s_cnt, t_cnt, cnt_stopped);
if (!ccr_done)
wprintf(_T(" X"));
for (int i = 2; i < 128; i++) {
if (exception_array[i])
wprintf(_T(" E%d=%d"), i, exception_array[i]);
}
}
// save to file and create new file if watermark reached
if (dst - storage_buffer >= storage_buffer_watermark) {
if (subtest_count > 0) {
save_data(dst, dir);
branchtarget_old = 0xffffffff;
srcaddr_old = 0xffffffff;
dstaddr_old = 0xffffffff;
instructionendpc_old = opcode_memory_start;
startpc_old = opcode_memory_start;
}
dst = storage_buffer;
for (int i = 0; i < MAX_REGISTERS; i++) {
dst = store_reg(dst, CT_DREG + i, 0, cur_registers[i], -1);
regs.regs[i] = cur_registers[i];
}
if (currprefs.fpu_model) {
for (int i = 0; i < 8; i++) {
dst = store_fpureg(dst, CT_FPREG + i, cur_fpuregisters[i]);
regs.fp[i].fpx = cur_fpuregisters[i];
}
}
}
if (verbose) {
wprintf(_T("\n"));
}
// if we got out of bounds access, add extra retries
if (did_out_of_bounds) {
if (oob_retries) {
oob_retries--;
constant_loops++;
} else {
full_format_cnt++;
}
}
}
}
nextopcode:;
}
if (data_saved) {
save_data(dst, dir);
data_saved = 0;
}
dst = storage_buffer;
if (opcodecnt == 1 && target_address == 0xffffffff && target_opcode_address == 0xffffffff && target_usp_address == 0xffffffff)
break;
if (lookup->mnemo == i_ILLG)
break;
bool nextround = false;
if (target_address != 0xffffffff) {
target_ea_src_cnt++;
if (target_ea_src_cnt >= target_ea_src_max) {
target_ea_src_cnt = 0;
if (target_ea_src_max > 0)
nextround = true;
}
target_ea_dst_cnt++;
if (target_ea_dst_cnt >= target_ea_dst_max) {
target_ea_dst_cnt = 0;
if (target_ea_dst_max > 0)
nextround = true;
}
target_ea[0] = 0xffffffff;
target_ea[1] = 0xffffffff;
if (feature_target_ea[target_ea_src_cnt][0] != 0xffffffff) {
target_address = feature_target_ea[target_ea_src_cnt][0];
target_ea[0] = target_address;
} else if (feature_target_ea[target_ea_dst_cnt][1] != 0xffffffff) {
target_address = feature_target_ea[target_ea_dst_cnt][1];
target_ea[1] = target_address;
}
generate_target_registers(target_address, cur_registers);
} else {
// randomize registers
for (int i = 0; i < 16 - 2; i++) {
cur_registers[i] = rand32();
}
nextround = true;
}
if (target_opcode_address != 0xffffffff || target_usp_address != 0xffffffff) {
nextround = false;
target_ea_opcode_cnt++;
if (target_ea_opcode_cnt >= target_ea_opcode_max) {
target_ea_opcode_cnt = 0;
if (target_ea_opcode_max > 0)
nextround = true;
} else {
quick = 0;
}
if (feature_usp == 3) {
target_usp_address = feature_target_ea[target_ea_opcode_cnt][2];
target_usp_address += opcode_memory_start;
target_ea[2] = target_usp_address;
} else {
target_opcode_address = feature_target_ea[target_ea_opcode_cnt][2];
target_ea[2] = opcode_memory_address + target_opcode_address;
}
}
if (nextround) {
rounds--;
if (rounds < 0)
break;
}
cur_registers[0] &= 0xffff;
cur_registers[8] &= 0xffff;
cur_registers[8 + 6]--;
cur_registers[15] -= 2;
if (fpumode) {
for (int i = 0; i < 8; i++) {
cur_fpuregisters[i].high = rand16();
cur_fpuregisters[i].low = (((uae_u64)rand32()) << 32) | (rand32());
if (rand16() & 1) {
cur_fpuregisters[i].low |= 0x8000000000000000;
}
}
}
}
markfile(dir);
compressfiles(dir);
wprintf(_T("- %d tests\n"), subtest_count);
}
static void test_mnemo_text(const TCHAR *path, const TCHAR *mode)
{
TCHAR modetxt[100];
int mnemo = -1;
int fpuopcode = -1;
int sizes = -1;
extra_and = 0;
extra_or = 0;
_tcscpy(modetxt, mode);
my_trim(modetxt);
TCHAR *s = _tcschr(modetxt, '.');
if (s || feature_instruction_size != NULL) {
TCHAR c = 0;
if (s) {
*s = 0;
c = _totlower(s[1]);
}
if (!c && feature_instruction_size) {
c = feature_instruction_size[0];
}
if (c == 'b' || c == 'B')
sizes = 6;
if (c == 'w' || c == 'W')
sizes = 4;
if (c == 'l' || c == 'L')
sizes = 0;
if (c == 'u' || c == 'U')
sizes = 8;
if (c == 's' || c == 'S')
sizes = 1;
if (c == 'x' || c == 'X')
sizes = 2;
if (c == 'p' || c == 'P')
sizes = 3;
if (c == 'd' || c == 'D')
sizes = 5;
}
const TCHAR *ovrname = NULL;
if (!_tcsicmp(modetxt, _T("DIVUL"))) {
_tcscpy(modetxt, _T("DIVL"));
extra_and = 0x0800;
extra_and |= 0x0400;
ovrname = _T("DIVUL");
} else if (!_tcsicmp(modetxt, _T("DIVSL"))) {
_tcscpy(modetxt, _T("DIVL"));
extra_or = 0x0800;
extra_and = 0x0400;
ovrname = _T("DIVSL");
} else if (!_tcsicmp(modetxt, _T("DIVS")) && sizes == 0) {
_tcscpy(modetxt, _T("DIVL"));
extra_or = 0x0800;
extra_or |= 0x0400;
ovrname = _T("DIVS");
} else if (!_tcsicmp(modetxt, _T("DIVU")) && sizes == 0) {
_tcscpy(modetxt, _T("DIVL"));
extra_and = 0x0800;
extra_or |= 0x0400;
ovrname = _T("DIVU");
} else if (!_tcsicmp(modetxt, _T("CHK2"))) {
_tcscpy(modetxt, _T("CHK2"));
extra_or = 0x0800;
ovrname = _T("CHK2");
} else if (!_tcsicmp(modetxt, _T("CMP2"))) {
_tcscpy(modetxt, _T("CHK2"));
extra_and = 0x0800;
ovrname = _T("CMP2");
} else if (!_tcsicmp(modetxt, _T("MULS")) && sizes == 0) {
_tcscpy(modetxt, _T("MULL"));
extra_or = 0x0800;
ovrname = _T("MULS");
} else if (!_tcsicmp(modetxt, _T("MULU")) && sizes == 0) {
_tcscpy(modetxt, _T("MULL"));
extra_and = 0x0800;
ovrname = _T("MULU");
} else if (!_tcsicmp(modetxt, _T("MOVEC"))) {
_tcscpy(modetxt, _T("MOVEC2"));
ovrname = _T("MOVEC");
}
for (int j = 0; lookuptab[j].name; j++) {
if (!_tcsicmp(modetxt, lookuptab[j].name)) {
mnemo = j;
break;
}
}
if (mnemo < 0) {
if (_totlower(modetxt[0]) == 'f') {
if (!_tcsicmp(modetxt, _T("fmovecr"))) {
mnemo = i_FPP;
sizes = 7;
fpuopcode = 0;
} else if (!_tcsicmp(modetxt, _T("fmovem"))) {
mnemo = i_FPP;
sizes = 8;
fpuopcode = 0;
} else {
for (int i = 0; i < 64; i++) {
if (fpuopcodes[i] && !_tcsicmp(modetxt, fpuopcodes[i])) {
mnemo = i_FPP;
fpuopcode = i;
break;
}
}
}
}
if (mnemo < 0) {
wprintf(_T("Couldn't find '%s'\n"), modetxt);
return;
}
}
if (mnemo >= 0 && sizes < 0) {
if (fpuopcode >= 0) {
for (int i = 0; i < 7; i++) {
test_mnemo(path, lookuptab[mnemo].name, ovrname, i, fpuopcode);
}
} else {
if (lookuptab[mnemo].mnemo == i_ILLG) {
test_mnemo(path, lookuptab[mnemo].name, ovrname, -1, -1);
} else {
test_mnemo(path, lookuptab[mnemo].name, ovrname, 0, -1);
test_mnemo(path, lookuptab[mnemo].name, ovrname, 4, -1);
test_mnemo(path, lookuptab[mnemo].name, ovrname, 6, -1);
test_mnemo(path, lookuptab[mnemo].name, ovrname, -1, -1);
}
}
} else {
test_mnemo(path, lookuptab[mnemo].name, ovrname, sizes, fpuopcode);
}
}
/*
static void my_trim(TCHAR *s)
{
int len;
while (_tcslen(s) > 0 && _tcscspn(s, _T("\t \r\n")) == 0)
memmove(s, s + 1, (_tcslen(s + 1) + 1) * sizeof(TCHAR));
len = _tcslen(s);
while (len > 0 && _tcscspn(s + len - 1, _T("\t \r\n")) == 0)
s[--len] = '\0';
}
*/
static int check_safe_memory(uae_u32 start, uae_u32 end)
{
if (start == 0xffffffff)
return 0;
if (safe_memory_start < start)
return 1;
if (safe_memory_end > end)
return 1;
return 0;
}
static const TCHAR *addrmodes[] =
{
_T("Dreg"), _T("Areg"), _T("Aind"), _T("Aipi"), _T("Apdi"), _T("Ad16"), _T("Ad8r"),
_T("absw"), _T("absl"), _T("PC16"), _T("PC8r"), _T("imm"), _T("Ad8rf"), _T("PC8rf"),
NULL
};
#define INISECTION _T("cputest")
static bool ini_getvalx(struct ini_data *ini, const TCHAR *sections, const TCHAR *key, int *val)
{
bool ret = false;
while (*sections) {
const TCHAR *sect = sections;
if (_tcsicmp(sections, INISECTION)) {
TCHAR *tout = NULL;
if (ini_getstring(ini, sections, key, &tout)) {
if (!_tcsicmp(tout, _T("*"))) {
sect = INISECTION;
}
xfree(tout);
}
}
if (ini_getval(ini, sect, key, val))
ret = true;
sections += _tcslen(sections) + 1;
}
if (ret)
wprintf(_T("%s=%08x (%d)\n"), key, *val, *val);
return ret;
}
static bool ini_getstringx(struct ini_data *ini, const TCHAR *sections, const TCHAR *key, TCHAR **out)
{
bool ret = false;
*out = NULL;
while (*sections) {
TCHAR *tout = NULL;
if (ini_getstring(ini, sections, key, &tout)) {
if (!_tcsicmp(tout, _T("*"))) {
xfree(tout);
if (!ini_getstring(ini, INISECTION, key, &tout)) {
tout = my_strdup(_T(""));
}
}
ret = true;
if (*out) {
free(*out);
}
*out = tout;
}
sections += _tcslen(sections) + 1;
}
if (ret)
wprintf(_T("%s=%s\n"), key, *out);
return ret;
}
static int cputoindex(int cpu)
{
if (cpu == 68000) {
return 0;
} else if (cpu == 68010) {
return 1;
} else if (cpu == 68020) {
return 2;
} else if (cpu == 68030) {
return 3;
} else if (cpu == 68040) {
return 4;
} else if (cpu == 68060) {
return 5;
}
return -1;
}
static int test(struct ini_data *ini, const TCHAR *sections, const TCHAR *testname)
{
const struct cputbl *tbl = NULL;
TCHAR path[1000], *vs;
int v;
wprintf(_T("Generating test '%s'\n"), testname);
v = 0;
ini_getvalx(ini, sections, _T("enabled"), &v);
if (!v) {
wprintf(_T("Test disabled\n"));
return 1;
}
bool cpufound = false;
if (ini_getstringx(ini, sections, _T("cpu"), &vs)) {
TCHAR *p = vs;
while (p && *p) {
TCHAR *pp1 = _tcschr(p, ',');
TCHAR *pp2 = _tcschr(p, '-');
if (pp1) {
*pp1++ = 0;
int idx = cputoindex(_tstol(p));
if (idx < 0) {
wprintf(_T("Invalid CPU string '%s'\n"), vs);
return 0;
}
if (maincpu[idx]) {
cpufound = true;
break;
}
p = pp1;
} else if (pp2) {
*pp2++ = 0;
int idx1 = cputoindex(_tstol(p));
int idx2 = cputoindex(_tstol(pp2));
if (idx1 < 0 || idx2 < 0) {
wprintf(_T("Invalid CPU string '%s'\n"), vs);
return 0;
}
for (int i = idx1; i <= idx2; i++) {
if (maincpu[i]) {
cpufound = true;
break;
}
}
if (cpufound) {
break;
}
p = pp2;
} else {
int idx = cputoindex(_tstol(p));
if (idx < 0) {
wprintf(_T("Invalid CPU string '%s'\n"), vs);
return 0;
}
if (maincpu[idx]) {
cpufound = true;
}
break;
}
}
xfree(vs);
}
if (!cpufound) {
wprintf(_T("Test skipped. CPU does not match.\n"));
return 1;
}
currprefs.address_space_24 = 1;
addressing_mask = 0x00ffffff;
v = 68030;
ini_getvalx(ini, sections, _T("cpu_address_space"), &v);
if (v < 68000) {
if (v == 32) {
currprefs.address_space_24 = 0;
addressing_mask = 0xffffffff;
}
} else if (currprefs.cpu_model >= v) {
currprefs.address_space_24 = 0;
addressing_mask = 0xffffffff;
}
currprefs.fpu_model = 0;
currprefs.fpu_mode = 1;
ini_getvalx(ini, sections, _T("fpu"), &currprefs.fpu_model);
if (currprefs.fpu_model && currprefs.cpu_model < 68020) {
wprintf(_T("FPU requires 68020+ CPU.\n"));
return 0;
}
if (currprefs.fpu_model != 0 && currprefs.fpu_model != 68881 && currprefs.fpu_model != 68882 && currprefs.fpu_model != 68040 && currprefs.fpu_model != 68060) {
wprintf(_T("Unsupported FPU model.\n"));
return 0;
}
verbose = 1;
ini_getvalx(ini, sections, _T("verbose"), &verbose);
feature_gzip = 0;
ini_getvalx(ini, sections, _T("feature_gzip"), &feature_gzip);
feature_addressing_modes[0] = 0xffffffff;
feature_addressing_modes[1] = 0xffffffff;
ad8r[0] = ad8r[1] = 1;
pc8r[0] = pc8r[1] = 1;
feature_exception3_data = 0;
ini_getvalx(ini, sections, _T("feature_exception3_data"), &feature_exception3_data);
feature_exception3_instruction = 0;
ini_getvalx(ini, sections, _T("feature_exception3_instruction"), &feature_exception3_instruction);
safe_memory_start = 0xffffffff;
if (ini_getvalx(ini, sections, _T("feature_safe_memory_start"), &v))
safe_memory_start = v;
safe_memory_end = 0xffffffff;
if (ini_getvalx(ini, sections, _T("feature_safe_memory_size"), &v))
safe_memory_end = safe_memory_start + v;
safe_memory_mode = 0;
if (ini_getstringx(ini, sections, _T("feature_safe_memory_mode"), &vs)) {
if (_totupper(vs[0]) == 'R')
safe_memory_mode |= 1;
if (_totupper(vs[0]) == 'W')
safe_memory_mode |= 2;
if (_totupper(vs[0]) == 'P')
safe_memory_mode |= 4;
xfree(vs);
}
if (safe_memory_start == 0xffffffff || safe_memory_end == 0xffffffff) {
safe_memory_end = 0xffffffff;
safe_memory_start = 0xffffffff;
safe_memory_mode = 0;
}
for (int i = 0; i < MAX_TARGET_EA; i++) {
feature_target_ea[i][0] = 0xffffffff;
feature_target_ea[i][1] = 0xffffffff;
feature_target_ea[i][2] = 0xffffffff;
}
for (int i = 0; i < 3; i++) {
if (ini_getstringx(ini, sections, i == 2 ? _T("feature_target_opcode_offset") : (i ? _T("feature_target_dst_ea") : _T("feature_target_src_ea")), &vs)) {
int cnt = 0;
TCHAR *p = vs;
int exp3cnt = 0;
while (p && *p) {
if (cnt >= MAX_TARGET_EA)
break;
TCHAR *pp = _tcschr(p, ',');
if (pp) {
*pp++ = 0;
}
TCHAR *endptr;
int radix = i == 2 ? 10 : 16;
if (_tcslen(p) > 2 && p[0] == '0' && _totupper(p[1]) == 'X') {
p += 2;
radix = 16;
}
feature_target_ea[cnt][i] = _tcstol(p, &endptr, radix);
if (feature_target_ea[cnt][i] & 1) {
exp3cnt++;
}
p = pp;
cnt++;
}
if (i == 2) {
target_ea_opcode_max = cnt;
if (cnt > 0) {
safe_memory_mode = 1 | 4;
}
} else if (i) {
target_ea_dst_max = cnt;
} else {
target_ea_src_max = cnt;
}
xfree(vs);
if (cnt > 0 && cpu_lvl <= 1) {
if (exp3cnt == cnt) {
if (feature_exception3_data < 2)
feature_exception3_data = 2;
if (feature_exception3_instruction < 2)
feature_exception3_instruction = 2;
} else {
feature_exception3_data = 3;
feature_exception3_instruction = 3;
}
}
}
}
feature_sr_mask = 0;
ini_getvalx(ini, sections, _T("feature_sr_mask"), &feature_sr_mask);
feature_min_interrupt_mask = 0;
ini_getvalx(ini, sections, _T("feature_min_interrupt_mask"), &feature_min_interrupt_mask);
feature_loop_mode = 0;
ini_getvalx(ini, sections, _T("feature_loop_mode"), &feature_loop_mode);
if (feature_loop_mode) {
feature_loop_mode_register = 7;
}
feature_loop_mode_68010 = 0;
ini_getvalx(ini, sections, _T("feature_loop_mode_68010"), &feature_loop_mode_68010);
feature_flag_mode = 0;
ini_getvalx(ini, sections, _T("feature_flags_mode"), &feature_flag_mode);
feature_usp = 0;
ini_getvalx(ini, sections, _T("feature_usp"), &feature_usp);
feature_exception_vectors = 0;
ini_getvalx(ini, sections, _T("feature_exception_vectors"), &feature_exception_vectors);
feature_interrupts = 0;
ini_getvalx(ini, sections, _T("feature_interrupts"), &feature_interrupts);
feature_randomize = 0;
ini_getvalx(ini, sections, _T("feature_randomize"), &feature_randomize);
feature_full_extension_format = 0;
if (currprefs.cpu_model >= 68020) {
ini_getvalx(ini, sections, _T("feature_full_extension_format"), &feature_full_extension_format);
if (feature_full_extension_format) {
ad8r[0] |= 2;
ad8r[1] |= 2;
pc8r[0] |= 2;
pc8r[1] |= 2;
}
}
for (int j = 0; j < 2; j++) {
TCHAR *am = NULL;
if (ini_getstringx(ini, sections, j ? _T("feature_addressing_modes_dst") : _T("feature_addressing_modes_src"), &am)) {
if (_tcslen(am) > 0) {
feature_addressing_modes[j] = 0;
ad8r[j] = 0;
pc8r[j] = 0;
TCHAR *p = am;
while (p && *p) {
TCHAR *pp = _tcschr(p, ',');
if (pp) {
*pp++ = 0;
}
TCHAR amtext[256];
_tcscpy(amtext, p);
my_trim(amtext);
for (int i = 0; addrmodes[i]; i++) {
if (!_tcsicmp(addrmodes[i], amtext)) {
feature_addressing_modes[j] |= 1 << i;
break;
}
}
p = pp;
}
if (feature_addressing_modes[j] & (1 << Ad8r))
ad8r[j] |= 1;
if (feature_addressing_modes[j] & (1 << imm0)) // Ad8rf
ad8r[j] |= 2;
if (feature_addressing_modes[j] & (1 << PC8r))
pc8r[j] |= 1;
if (feature_addressing_modes[j] & (1 << imm1)) // PC8rf
pc8r[j] |= 2;
if (ad8r[j])
feature_addressing_modes[j] |= 1 << Ad8r;
if (pc8r[j])
feature_addressing_modes[j] |= 1 << PC8r;
}
xfree(am);
}
}
TCHAR *mode = NULL;
ini_getstringx(ini, sections, _T("mode"), &mode);
TCHAR *ipath = NULL;
ini_getstringx(ini, sections, _T("path"), &ipath);
if (!ipath) {
_tcscpy(path, _T("data/"));
} else {
_tcscpy(path, ipath);
}
free(ipath);
_stprintf(path + _tcslen(path), _T("%lu_%s/"), currprefs.cpu_model, testname);
_wmkdir(path);
xorshiftstate = 1;
feature_test_rounds = 2;
ini_getvalx(ini, sections, _T("test_rounds"), &feature_test_rounds);
feature_instruction_size = NULL;
ini_getstringx(ini, sections, _T("feature_instruction_size"), &feature_instruction_size);
ini_getvalx(ini, sections, _T("feature_instruction_size"), &feature_test_rounds);
v = 0;
ini_getvalx(ini, sections, _T("test_memory_start"), &v);
if (!v) {
wprintf(_T("test_memory_start is required\n"));
return 0;
}
test_memory_start = v;
v = 0;
ini_getvalx(ini, sections, _T("test_memory_size"), &v);
if (!v) {
wprintf(_T("test_memory_start is required\n"));
return 0;
}
test_memory_size = v;
test_memory_end = test_memory_start + test_memory_size;
test_low_memory_start = 0xffffffff;
test_low_memory_end = 0xffffffff;
v = 0;
if (ini_getvalx(ini, sections, _T("test_low_memory_start"), &v))
test_low_memory_start = v;
v = 0;
if (ini_getvalx(ini, sections, _T("test_low_memory_end"), &v))
test_low_memory_end = v;
test_high_memory_start = 0xffffffff;
test_high_memory_end = 0xffffffff;
v = 0;
if (ini_getvalx(ini, sections, _T("test_high_memory_start"), &v))
test_high_memory_start = v;
v = 0;
if (ini_getvalx(ini, sections, _T("test_high_memory_end"), &v))
test_high_memory_end = v;
if ((addressing_mask == 0xffffffff && test_high_memory_end <= 0x01000000) || test_high_memory_start == 0xffffffff) {
test_high_memory_start = 0xffffffff;
test_high_memory_end = 0xffffffff;
high_memory_size = 0xffffffff;
}
if (safe_memory_start != 0xffffffff) {
int err = check_safe_memory(test_low_memory_start, test_low_memory_end);
err += check_safe_memory(test_low_memory_start, test_low_memory_end);
err += check_safe_memory(test_high_memory_start, test_high_memory_end);
if (err == 3) {
wprintf(_T("Safe_memory outside of all test memory regions!\n"));
return 0;
}
}
test_memory = (uae_u8 *)calloc(1, test_memory_size + EXTRA_RESERVED_SPACE);
test_memory_temp = (uae_u8 *)calloc(1, test_memory_size);
if (!test_memory || !test_memory_temp) {
wprintf(_T("Couldn't allocate test memory\n"));
return 0;
}
v = 0;
if (ini_getvalx(ini, sections, _T("opcode_memory_start"), &v)) {
opcode_memory_start = v;
opcode_memory = test_memory + (opcode_memory_start - test_memory_start);
} else {
opcode_memory = test_memory + test_memory_size / 2;
opcode_memory_start = test_memory_start + test_memory_size / 2;
}
if (opcode_memory_start < opcode_memory_start || opcode_memory_start > test_memory_start + test_memory_size - 256) {
wprintf(_T("Opcode memory out of bounds\n"));
return 0;
}
if (ini_getvalx(ini, sections, _T("feature_stack_memory"), &v)) {
super_stack_memory = v;
user_stack_memory = super_stack_memory - (RESERVED_SUPERSTACK + RESERVED_USERSTACK_EXTRA);
} else {
super_stack_memory = test_memory_start + (2 * RESERVED_SUPERSTACK + RESERVED_USERSTACK_EXTRA);
user_stack_memory = test_memory_start + RESERVED_SUPERSTACK;
}
user_stack_memory_use = user_stack_memory;
if (feature_usp == 1 || feature_usp == 2) {
user_stack_memory_use |= 1;
}
storage_buffer_watermark_size = 200000;
max_storage_buffer = 1000000;
ini_getvalx(ini, sections, _T("buffer_size"), &max_storage_buffer);
ini_getvalx(ini, sections, _T("watermark"), &storage_buffer_watermark_size);
max_storage_buffer += storage_buffer_watermark_size;
low_memory_size = test_low_memory_end;
if (low_memory_size < 0x8000)
low_memory_size = 0x8000;
if (low_memory_size != 0xffffffff) {
low_memory = (uae_u8 *)calloc(1, low_memory_size);
low_memory_temp = (uae_u8 *)calloc(1, low_memory_size);
}
if (high_memory_size != 0xffffffff) {
high_memory = (uae_u8 *)calloc(1, high_memory_size);
high_memory_temp = (uae_u8 *)calloc(1, high_memory_size);
}
fill_memory();
if (test_low_memory_start != 0xffffffff) {
TCHAR *lmem_rom_name = NULL;
ini_getstringx(ini, sections, _T("low_rom"), &lmem_rom_name);
if (lmem_rom_name) {
if (load_file(NULL, lmem_rom_name, low_memory_temp, low_memory_size, 0)) {
wprintf(_T("Low test memory ROM loaded\n"));
lmem_rom = 1;
}
}
free(lmem_rom_name);
save_memory(path, _T("lmem.dat"), low_memory_temp, low_memory_size);
}
if (test_high_memory_start != 0xffffffff) {
TCHAR *hmem_rom_name = NULL;
ini_getstringx(ini, sections, _T("high_rom"), &hmem_rom_name);
if (hmem_rom_name) {
if (load_file(NULL, hmem_rom_name, high_memory_temp, high_memory_size, -1)) {
wprintf(_T("High test memory ROM loaded\n"));
hmem_rom = 1;
}
}
free(hmem_rom_name);
save_memory(path, _T("hmem.dat"), high_memory_temp, high_memory_size);
}
save_memory(path, _T("tmem.dat"), test_memory_temp, test_memory_size);
storage_buffer = (uae_u8 *)calloc(max_storage_buffer + storage_buffer_watermark_size, 1);
// FMOVEM stores can use lots of memory
storage_buffer_watermark = max_storage_buffer - storage_buffer_watermark_size;
for (int i = 0; i < 256; i++) {
int j;
for (j = 0; j < 8; j++) {
if (i & (1 << j)) break;
}
movem_index1[i] = j;
movem_index2[i] = 7 - j;
movem_next[i] = i & (~(1 << j));
}
read_table68k();
do_merges();
if (currprefs.cpu_model == 68000) {
tbl = op_smalltbl_90_test_ff;
cpu_lvl = 0;
} else if (currprefs.cpu_model == 68010) {
tbl = op_smalltbl_91_test_ff;
cpu_lvl = 1;
} else if (currprefs.cpu_model == 68020) {
tbl = op_smalltbl_92_test_ff;
cpu_lvl = 2;
} else if (currprefs.cpu_model == 68030) {
tbl = op_smalltbl_93_test_ff;
cpu_lvl = 3;
} else if (currprefs.cpu_model == 68040 ) {
tbl = op_smalltbl_94_test_ff;
cpu_lvl = 4;
} else if (currprefs.cpu_model == 68060) {
tbl = op_smalltbl_95_test_ff;
cpu_lvl = 5;
} else {
wprintf(_T("Unsupported CPU model.\n"));
abort();
}
for (int opcode = 0; opcode < 65536; opcode++) {
cpufunctbl[opcode] = op_illg_1;
}
for (int i = 0; tbl[i].handler != NULL; i++) {
int opcode = tbl[i].opcode;
cpufunctbl[opcode] = tbl[i].handler;
cpudatatbl[opcode].length = tbl[i].length;
cpudatatbl[opcode].disp020[0] = tbl[i].disp020[0];
cpudatatbl[opcode].disp020[1] = tbl[i].disp020[1];
cpudatatbl[opcode].branch = tbl[i].branch;
}
currprefs.int_no_unimplemented = true;
currprefs.fpu_no_unimplemented = true;
for (int opcode = 0; opcode < 65536; opcode++) {
cpuop_func *f;
instr *table = &table68k[opcode];
if (table->mnemo == i_ILLG)
continue;
/* unimplemented opcode? */
if (table->unimpclev > 0 && cpu_lvl >= table->unimpclev) {
if (currprefs.cpu_model == 68060) {
// remove unimplemented integer instructions
// unimpclev == 5: not implemented in 68060,
// generates unimplemented instruction exception.
if (currprefs.int_no_unimplemented && table->unimpclev == 5) {
cpufunctbl[opcode] = op_unimpl_1;
continue;
}
// remove unimplemented instruction that were removed in previous models,
// generates normal illegal instruction exception.
// unimplclev < 5: instruction was removed in 68040 or previous model.
// clev=4: implemented in 68040 or later. unimpclev=5: not in 68060
if (table->unimpclev < 5 || (table->clev == 4 && table->unimpclev == 5)) {
cpufunctbl[opcode] = op_illg_1;
continue;
}
} else {
cpufunctbl[opcode] = op_illg_1;
continue;
}
}
if (table->clev > cpu_lvl) {
continue;
}
if (!currprefs.fpu_model) {
int fppskip = isfpp(table->mnemo);
if (fppskip)
continue;
}
if (table->handler != -1) {
int idx = table->handler;
f = cpufunctbl[idx];
if (f == op_illg_1)
abort();
cpufunctbl[opcode] = f;
memcpy(&cpudatatbl[opcode], &cpudatatbl[idx], sizeof(struct cputbl_data));
}
if (opcode_loop_mode(opcode)) {
loop_mode_table[opcode] = cpufunctbl[opcode];
}
}
x_get_long = get_long_test;
x_get_word = get_word_test;
x_get_byte = get_byte_test;
x_put_long = put_long_test;
x_put_word = put_word_test;
x_put_byte = put_byte_test;
x_next_iword = next_iword_test;
x_cp_next_iword = next_iword_test;
x_next_ilong = next_ilong_test;
x_cp_next_ilong = next_ilong_test;
x_cp_get_disp_ea_020 = x_get_disp_ea_020;
x_cp_get_long = get_long_test;
x_cp_get_word = get_word_test;
x_cp_get_byte = get_byte_test;
x_cp_put_long = put_long_test;
x_cp_put_word = put_word_test;
x_cp_put_byte = put_byte_test;
fpu_reset();
starttime = time(0);
if (!mode) {
wprintf(_T("Mode must be 'all', 'fall', 'branch', 'branchj', 'branchs' or '<mnemonic>'\n"));
return 0;
}
TCHAR *modep = mode;
while(modep) {
int all = 0;
if (!_tcsicmp(mode, _T("all"))) {
if (verbose == 1)
verbose = 0;
for (int j = 1; lookuptab[j].name[0]; j++) {
test_mnemo_text(path, lookuptab[j].name);
}
// Illegal instructions last. All currently selected CPU model's unsupported opcodes
// (Generates illegal instruction, a-line or f-line exception)
test_mnemo_text(path, _T("ILLEGAL"));
break;
}
if (!_tcsicmp(mode, _T("branch")) || !_tcsicmp(mode, _T("branchj")) || !_tcsicmp(mode, _T("branchs"))) {
static const TCHAR *branchs[] = {
_T("RTS"), _T("RTD"), _T("RTR"), _T("RTE"), _T("JSR"), _T("BSR"), NULL
};
static const TCHAR *branchj[] = {
_T("DBcc"), _T("Bcc"), _T("JMP"), _T("FDBcc"), _T("FBcc"), NULL
};
if (!_tcsicmp(mode, _T("branch")) || !_tcsicmp(mode, _T("branchj"))) {
for (int i = 0; branchj[i]; i++) {
test_mnemo_text(path, branchj[i]);
}
}
if (!_tcsicmp(mode, _T("branch")) || !_tcsicmp(mode, _T("branchs"))) {
for (int i = 0; branchs[i]; i++) {
test_mnemo_text(path, branchs[i]);
}
}
break;
}
if (!_tcsicmp(mode, _T("fall"))) {
if (verbose == 1)
verbose = 0;
test_mnemo_text(path, _T("FMOVECR"));
const TCHAR *prev = _T("");
for (int j = 0; j < 64; j++) {
if (fpuopcodes[j] && _tcscmp(prev, fpuopcodes[j])) {
test_mnemo_text(path, fpuopcodes[j]);
prev = fpuopcodes[j];
}
}
for (int j = 1; lookuptab[j].name; j++) {
if (lookuptab[j].name[0] == 'F' && _tcscmp(lookuptab[j].name, _T("FPP"))) {
test_mnemo_text(path, lookuptab[j].name);
}
}
test_mnemo_text(path, _T("FMOVEM"));
break;
}
TCHAR *sp = _tcschr(modep, ',');
if (sp)
*sp++ = 0;
test_mnemo_text(path, modep);
modep = sp;
}
xfree(low_memory);
xfree(low_memory_temp);
xfree(high_memory);
xfree(high_memory_temp);
xfree(test_memory);
xfree(test_memory_temp);
xfree(storage_buffer);
wprintf(_T("%d total tests generated\n"), test_count);
return 1;
}
static TCHAR sections[1000];
#ifndef _WIN32
#define __cdecl
#endif
int __cdecl main(int argc, char *argv[])
{
struct ini_data *ini = ini_load(_T("cputestgen.ini"), false);
if (!ini) {
wprintf(_T("Couldn't open cputestgen.ini\n"));
return 0;
}
TCHAR *sptr = sections;
_tcscpy(sections, INISECTION);
sptr += _tcslen(sptr) + 1;
int cpu;
if (!ini_getval(ini, INISECTION, _T("cpu"), &cpu)) {
wprintf(_T("CPU model is not set\n"));
return 0;
}
int cpuidx = cputoindex(cpu);
if (cpuidx < 0) {
wprintf(_T("Unsupport CPU model\n"));
return 0;
}
maincpu[cpuidx] = 1;
currprefs.cpu_model = cpu;
int idx = 0;
for (;;) {
TCHAR *section = NULL;
if (!ini_getsection(ini, idx, §ion))
break;
if (!_tcsnicmp(section, _T("test="), 5)) {
_tcscpy(sptr, section);
TCHAR testname[1000];
_tcscpy(testname, section + 5);
const TCHAR *p = _tcschr(testname, '|');
if (p) {
testname[p - testname] = 0;
}
if (!test(ini, sections, testname))
break;
}
idx++;
}
}
| 25.788416 | 198 | 0.6211 | [
"vector",
"model"
] |
999844e252c5575bf29003b31b7a1a1660868ffb | 1,149 | cpp | C++ | src/armnn/test/LayerValidateOutputTest.cpp | jnorwood/armnn | 774f6f1d7c862fc2b8e1783abef9a0bccdaf9d0c | [
"MIT"
] | 1 | 2019-06-26T23:00:46.000Z | 2019-06-26T23:00:46.000Z | src/armnn/test/LayerValidateOutputTest.cpp | jnorwood/armnn | 774f6f1d7c862fc2b8e1783abef9a0bccdaf9d0c | [
"MIT"
] | null | null | null | src/armnn/test/LayerValidateOutputTest.cpp | jnorwood/armnn | 774f6f1d7c862fc2b8e1783abef9a0bccdaf9d0c | [
"MIT"
] | null | null | null | //
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#include <armnn/ArmNN.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/test/unit_test.hpp>
#include <layers/BatchToSpaceNdLayer.hpp>
#include <Graph.hpp>
BOOST_AUTO_TEST_SUITE(LayerValidateOutput)
BOOST_AUTO_TEST_CASE(TestBatchToSpaceInferOutputShape)
{
armnn::Graph graph;
armnn::BatchToSpaceNdDescriptor descriptor;
descriptor.m_BlockShape = {2, 2};
descriptor.m_Crops = {{0, 0}, {2, 0}};
descriptor.m_DataLayout = armnn::DataLayout::NHWC;
armnn::BatchToSpaceNdLayer* const batchToSpaceLayer =
graph.AddLayer<armnn::BatchToSpaceNdLayer>(descriptor, "batchToSpace");
std::vector<armnn::TensorShape> shapes;
const std::vector<unsigned int> theDimSizes = {8, 1, 3, 1};
armnn::TensorShape shape(4, theDimSizes.data());
shapes.push_back(shape);
const std::vector<unsigned int> expectedDimSizes = {2, 2, 4, 1};
armnn::TensorShape expectedShape(4, expectedDimSizes.data());
BOOST_CHECK(expectedShape == batchToSpaceLayer->InferOutputShapes(shapes).at(0));
}
BOOST_AUTO_TEST_SUITE_END()
| 29.461538 | 85 | 0.73107 | [
"shape",
"vector"
] |
99a7fb94445c92f5bdf67ce80b7c1df8b0696b05 | 2,639 | cpp | C++ | src/MySQLDatabase.cpp | mark-grimes/CppSQL | 6e34c1bdf46beff92f1c5eb6a97ae52d1f0a19ac | [
"MIT"
] | null | null | null | src/MySQLDatabase.cpp | mark-grimes/CppSQL | 6e34c1bdf46beff92f1c5eb6a97ae52d1f0a19ac | [
"MIT"
] | null | null | null | src/MySQLDatabase.cpp | mark-grimes/CppSQL | 6e34c1bdf46beff92f1c5eb6a97ae52d1f0a19ac | [
"MIT"
] | null | null | null | #include "cppsql/MySQLDatabase.h"
cppsql::MySQLDatabase::MySQLDatabase( const char* host, const char* user, const char* password, const char* database )
: pDatabase_(nullptr)
{
pDatabase_=mysql_init(nullptr);
if( pDatabase_==nullptr )
{
throw std::runtime_error( std::string("Error initiating MySQL: ")+mysql_error(pDatabase_) );
}
if( mysql_real_connect( pDatabase_, host, user, password, database, 0, nullptr, 0 )==nullptr )
{
throw std::runtime_error( std::string("Can't open database: ")+mysql_error(pDatabase_));
}
}
cppsql::MySQLDatabase::~MySQLDatabase()
{
mysql_close(pDatabase_);
}
std::vector<std::string> cppsql::MySQLDatabase::tableNames() const
{
std::vector<std::string> returnValue;
cppsql::MySQLResult tableNamesResult( mysql_list_tables( pDatabase_, nullptr ) );
MYSQL_ROW tableNames;
while( (tableNames=mysql_fetch_row(tableNamesResult)) )
{
returnValue.emplace_back( tableNames[0] );
} // end of loop over table names
return returnValue;
}
void cppsql::MySQLDatabase::execute( const char* pCommand )
{
//std::cout << "Executing command " << pCommand << std::endl;
if( mysql_query( pDatabase_, pCommand ) )
{
throw std::runtime_error( std::string("Error performing query: ")+mysql_error(pDatabase_) );
}
}
cppsql::MySQLResult cppsql::MySQLDatabase::execute_new( const char* pCommand )
{
execute( pCommand );
return MySQLResult( mysql_store_result(pDatabase_) );
}
void cppsql::MySQLDatabase::execute( const char* pCommand, std::function<bool(int,const char* const[],const char* const[])> resultsCallback )
{
execute( pCommand );
MySQLResult result( mysql_store_result(pDatabase_) );
if( result==nullptr )
{
throw std::runtime_error(std::string("Error getting result: ")+mysql_error(pDatabase_) );
}
int num_fields=mysql_num_fields(result);
MYSQL_FIELD* fields=mysql_fetch_fields(result);
std::vector<const char*> fieldNames(num_fields);
for( size_t index=0; index<num_fields; ++index ) fieldNames[index]=fields[index].name;
MYSQL_ROW row;
bool keepGoing=true;
while( (row=mysql_fetch_row(result)) && keepGoing )
{
keepGoing=resultsCallback( num_fields, row, fieldNames.data() );
}
}
cppsql::MySQLStatement cppsql::MySQLDatabase::prepareStatement( const char* pStatement )
{
MYSQL_STMT* pHandle=mysql_stmt_init(pDatabase_);
if( pHandle==nullptr ) throw std::runtime_error("Couldn't initialise the statement handler");
if( mysql_stmt_prepare( pHandle, pStatement, std::char_traits<char>::length(pStatement) )!=0 )
{
throw std::runtime_error( std::string("Could not prepare statement: ")+mysql_stmt_error(pHandle) );
}
return MySQLStatement(pHandle);
}
| 30.333333 | 141 | 0.740811 | [
"vector"
] |
99a8819bed7cfadc824e84c1f9f49ac5b189866b | 2,579 | hpp | C++ | src/elona/lua_env/i18n_manager.hpp | nanbansenji/ElonaFoobar | ddbd6639db8698e89f09b2512526e855d8016e46 | [
"MIT"
] | 1 | 2020-09-11T05:09:53.000Z | 2020-09-11T05:09:53.000Z | src/elona/lua_env/i18n_manager.hpp | AFB111/elonafoobar | da7a3c86dd45e68e6e490fb260ead1d67c9fff5e | [
"MIT"
] | 4 | 2021-10-30T16:45:25.000Z | 2021-11-23T06:25:43.000Z | src/elona/lua_env/i18n_manager.hpp | nanbansenji/ElonaFoobar | ddbd6639db8698e89f09b2512526e855d8016e46 | [
"MIT"
] | null | null | null | #pragma once
#include "../eobject/forward.hpp"
#include "../optional.hpp"
#include "lua_submodule.hpp"
namespace elona
{
struct Item;
struct Character;
namespace lua
{
struct ModEnv;
class I18NManager : public LuaSubmodule
{
public:
explicit I18NManager(LuaEnv&);
void register_function(
const std::string& language,
const std::string& name,
sol::protected_function function);
void load(ModEnv& mod);
void load_string(const std::string& src, ModEnv& mod);
template <typename... Args>
sol::optional<std::string> get_optional(
const std::string& key,
Args&&... args)
{
using swallow = std::initializer_list<int>;
auto lua_args = lua_state()->create_table();
(void)swallow{(add_arg(lua_args, std::forward<Args>(args)), 0)...};
return env()["get_optional"](key, lua_args);
}
template <typename... Args>
sol::optional<std::string> get_data_text_optional(
const std::string& key,
Args&&... args)
{
using swallow = std::initializer_list<int>;
auto lua_args = lua_state()->create_table();
(void)swallow{(add_arg(lua_args, std::forward<Args>(args)), 0)...};
return env()["get_data_text_optional"](key, lua_args);
}
std::vector<std::string> get_list(const std::string& key)
{
sol::optional<std::vector<std::string>> ret = env()["get_list"](key);
if (ret)
{
return *ret;
}
else
{
return {};
}
}
// for testing
template <typename... Args>
std::string format(const std::string& fmt, Args&&... args)
{
using swallow = std::initializer_list<int>;
auto lua_args = lua_state()->create_table();
(void)swallow{(add_arg(lua_args, std::forward<Args>(args)), 0)...};
return env()["format"](fmt, lua_args);
}
private:
template <
typename T,
std::enable_if_t<std::is_arithmetic<T>::value, std::nullptr_t> =
nullptr>
void add_arg(sol::table args, T value)
{
args.add(value);
}
void add_arg(sol::table args, const char* value)
{
args.add(value);
}
void add_arg(sol::table args, const std::string& value)
{
args.add(value);
}
void add_arg(sol::table args, sol::object value)
{
args.add(value);
}
void add_arg(sol::table args, const ItemRef& value);
void add_arg(sol::table args, const Character& value);
};
} // namespace lua
} // namespace elona
| 22.232759 | 77 | 0.587049 | [
"object",
"vector"
] |
99a9eaf8ae8c094de9d08850ea57f707529b8905 | 3,622 | cpp | C++ | fluid/render/particlesrenderer.cpp | paivett/fluids | a319a7759526bd19fa6a8e29e139bc0e1aa3d08c | [
"MIT"
] | 5 | 2019-06-20T15:37:40.000Z | 2021-08-25T09:01:05.000Z | fluid/render/particlesrenderer.cpp | paivett/fluids | a319a7759526bd19fa6a8e29e139bc0e1aa3d08c | [
"MIT"
] | null | null | null | fluid/render/particlesrenderer.cpp | paivett/fluids | a319a7759526bd19fa6a8e29e139bc0e1aa3d08c | [
"MIT"
] | 2 | 2019-11-06T02:17:55.000Z | 2022-02-13T10:11:33.000Z | #include "particlesrenderer.h"
#include "runtimeexception.h"
#include <opencl/clenvironment.h>
#include <opengl/openglfunctions.h>
#include <CL/cl_gl.h>
#include <sstream>
using namespace std;
ParticlesRenderer::ParticlesRenderer(int viewport_width,
int viewport_height,
int particle_count,
GLuint vbo_particles) :
_vbo_particles(vbo_particles),
_particle_count(particle_count),
_viewport_w(viewport_width),
_viewport_h(viewport_height) {
auto& gl = OpenGLFunctions::getFunctions();
_shader = create_shader_program("shaders/particles.vert",
"shaders/particles.frag");
_shader->bind();
// Create a VAO for this stage
gl.glGenVertexArrays(1, &_vao);
gl.glBindVertexArray(_vao);
// Bind the VBO to the shader
auto particle_pos_loc = _shader->attributeLocation("particle_pos");
gl.glBindBuffer(GL_ARRAY_BUFFER, _vbo_particles);
gl.glVertexAttribPointer(particle_pos_loc,
4,
GL_FLOAT,
GL_TRUE,
0,
NULL);
_shader->enableAttributeArray(particle_pos_loc);
}
void ParticlesRenderer::render(const Camera& camera,
const vector<DirectionalLight>& dir_lights,
const QMatrix4x4& mv_matrix,
GLuint dest_fbo,
GLuint background_texture,
GLuint bkg_depth_texture,
GLuint cube_map_texture) {
auto& gl = OpenGLFunctions::getFunctions();
gl.glBindFramebuffer(GL_FRAMEBUFFER, dest_fbo);
_shader->bind();
// Configure shader uniforms
_shader->setUniformValue("mv_matrix", mv_matrix);
_shader->setUniformValue("pr_matrix", camera.projection());
// Configure directional lights
for (auto i=0; i < dir_lights.size(); ++i) {
stringstream ss;
ss << "dir_light[" << i << "]";
string base = ss.str();
_shader->setUniformValue((base + ".direction").c_str(), dir_lights[i].direction);
_shader->setUniformValue((base + ".diffuse").c_str(), dir_lights[i].diffuse_color);
_shader->setUniformValue((base + ".ambient").c_str(), dir_lights[i].ambient_color);
_shader->setUniformValue((base + ".specular").c_str(), dir_lights[i].specular_color);
}
// Set the number of directional lights
_shader->setUniformValue("dir_light_count", (GLint)dir_lights.size());
// Get perspective info to calculate point sprite size
auto perspective = camera.perspective();
_shader->setUniformValue("point_radius", 0.125f * 0.5f);
_shader->setUniformValue("point_scale", perspective.width * tanf(perspective.fov * (0.5f * 3.1415926535f/180.0f)));
_shader->setUniformValue("near_plane", perspective.nearPlane);
_shader->setUniformValue("far_plane", perspective.farPlane);
// Render particles as point sprites
gl.glEnable(GL_DEPTH_TEST);
gl.glEnable(GL_PROGRAM_POINT_SIZE);
// Bind vertex array and draw it
gl.glBindVertexArray(_vao);
gl.glDrawArrays(GL_POINTS, 0, _particle_count);
gl.glDisable(GL_PROGRAM_POINT_SIZE);
gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
void ParticlesRenderer::reset(int particle_count) {
_particle_count = particle_count;
}
ParticlesRenderer::~ParticlesRenderer() {
auto& gl = OpenGLFunctions::getFunctions();
gl.glDeleteVertexArrays(1, &_vao);
} | 36.585859 | 119 | 0.630867 | [
"render",
"vector"
] |
99afba4aed92dc3b5ffd48340a7b6fd9be2c0642 | 15,338 | cpp | C++ | eval/src/tests/eval/value_codec/value_codec_test.cpp | kashiish/vespa | 307de4bb24463d0f36cd8391a7b8df75bd0949b2 | [
"Apache-2.0"
] | null | null | null | eval/src/tests/eval/value_codec/value_codec_test.cpp | kashiish/vespa | 307de4bb24463d0f36cd8391a7b8df75bd0949b2 | [
"Apache-2.0"
] | null | null | null | eval/src/tests/eval/value_codec/value_codec_test.cpp | kashiish/vespa | 307de4bb24463d0f36cd8391a7b8df75bd0949b2 | [
"Apache-2.0"
] | null | null | null | // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <iostream>
#include <vespa/eval/eval/simple_value.h>
#include <vespa/eval/eval/test/gen_spec.h>
#include <vespa/eval/eval/value_codec.h>
#include <vespa/vespalib/data/memory.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/exceptions.h>
using namespace vespalib;
using namespace vespalib::eval;
using namespace vespalib::eval::test;
const ValueBuilderFactory &factory = SimpleValueBuilderFactory::get();
GenSpec G() { return GenSpec(); }
const std::vector<GenSpec> layouts = {
G(),
G().idx("x", 3),
G().idx("x", 3).idx("y", 5),
G().idx("x", 3).idx("y", 5).idx("z", 7),
G().map("x", {"a","b","c"}),
G().map("x", {"a","b","c"}).map("y", {"foo","bar"}),
G().map("x", {"a","b","c"}).map("y", {"foo","bar"}).map("z", {"i","j","k","l"}),
G().idx("x", 3).map("y", {"foo", "bar"}).idx("z", 7),
G().map("x", {"a","b","c"}).idx("y", 5).map("z", {"i","j","k","l"})
};
TEST(ValueCodecTest, simple_values_can_be_converted_from_and_to_tensor_spec) {
for (const auto &layout: layouts) {
for (CellType ct : CellTypeUtils::list_types()) {
auto expect = layout.cpy().cells(ct);
if (expect.bad_scalar()) continue;
std::unique_ptr<Value> value = value_from_spec(expect, factory);
TensorSpec actual = spec_from_value(*value);
EXPECT_EQ(actual, expect);
}
}
}
TEST(ValueCodecTest, simple_values_can_be_built_using_tensor_spec) {
TensorSpec spec("tensor(w{},x[2],y{},z[2])");
spec.add({{"w", "xxx"}, {"x", 0}, {"y", "xxx"}, {"z", 0}}, 1.0)
.add({{"w", "xxx"}, {"x", 0}, {"y", "yyy"}, {"z", 1}}, 2.0)
.add({{"w", "yyy"}, {"x", 1}, {"y", "xxx"}, {"z", 0}}, 3.0)
.add({{"w", "yyy"}, {"x", 1}, {"y", "yyy"}, {"z", 1}}, 4.0);
Value::UP tensor = value_from_spec(spec, factory);
TensorSpec full_spec("tensor(w{},x[2],y{},z[2])");
full_spec
.add({{"w", "xxx"}, {"x", 0}, {"y", "xxx"}, {"z", 0}}, 1.0)
.add({{"w", "xxx"}, {"x", 0}, {"y", "xxx"}, {"z", 1}}, 0.0)
.add({{"w", "xxx"}, {"x", 0}, {"y", "yyy"}, {"z", 0}}, 0.0)
.add({{"w", "xxx"}, {"x", 0}, {"y", "yyy"}, {"z", 1}}, 2.0)
.add({{"w", "xxx"}, {"x", 1}, {"y", "xxx"}, {"z", 0}}, 0.0)
.add({{"w", "xxx"}, {"x", 1}, {"y", "xxx"}, {"z", 1}}, 0.0)
.add({{"w", "xxx"}, {"x", 1}, {"y", "yyy"}, {"z", 0}}, 0.0)
.add({{"w", "xxx"}, {"x", 1}, {"y", "yyy"}, {"z", 1}}, 0.0)
.add({{"w", "yyy"}, {"x", 0}, {"y", "xxx"}, {"z", 0}}, 0.0)
.add({{"w", "yyy"}, {"x", 0}, {"y", "xxx"}, {"z", 1}}, 0.0)
.add({{"w", "yyy"}, {"x", 0}, {"y", "yyy"}, {"z", 0}}, 0.0)
.add({{"w", "yyy"}, {"x", 0}, {"y", "yyy"}, {"z", 1}}, 0.0)
.add({{"w", "yyy"}, {"x", 1}, {"y", "xxx"}, {"z", 0}}, 3.0)
.add({{"w", "yyy"}, {"x", 1}, {"y", "xxx"}, {"z", 1}}, 0.0)
.add({{"w", "yyy"}, {"x", 1}, {"y", "yyy"}, {"z", 0}}, 0.0)
.add({{"w", "yyy"}, {"x", 1}, {"y", "yyy"}, {"z", 1}}, 4.0);
Value::UP full_tensor = value_from_spec(full_spec, factory);
EXPECT_EQ(full_spec, spec_from_value(*tensor));
EXPECT_EQ(full_spec, spec_from_value(*full_tensor));
};
//-----------------------------------------------------------------------------
vespalib::string make_type_spec(bool use_float, const vespalib::string &dims) {
vespalib::string type_spec = "tensor";
if (use_float) {
type_spec.append("<float>");
}
type_spec.append(dims);
return type_spec;
}
struct TensorExample {
virtual ~TensorExample();
virtual TensorSpec make_spec(bool use_float) const = 0;
virtual std::unique_ptr<Value> make_tensor(bool use_float) const = 0;
virtual void encode_default(nbostream &dst) const = 0;
virtual void encode_with_double(nbostream &dst) const = 0;
virtual void encode_with_float(nbostream &dst) const = 0;
void verify_encode_decode(bool is_dense) const {
nbostream expect_default;
nbostream expect_double;
nbostream expect_float;
encode_default(expect_default);
encode_with_double(expect_double);
encode_with_float(expect_float);
nbostream data_double;
nbostream data_float;
encode_value(*make_tensor(false), data_double);
encode_value(*make_tensor(true), data_float);
if (is_dense) {
EXPECT_EQ(Memory(data_double.peek(), data_double.size()),
Memory(expect_default.peek(), expect_default.size()));
EXPECT_EQ(Memory(data_float.peek(), data_float.size()),
Memory(expect_float.peek(), expect_float.size()));
} else {
EXPECT_EQ(spec_from_value(*decode_value(data_double, factory)), make_spec(false));
EXPECT_EQ(spec_from_value(*decode_value(data_float, factory)), make_spec(true));
}
EXPECT_EQ(spec_from_value(*decode_value(expect_default, factory)), make_spec(false));
EXPECT_EQ(spec_from_value(*decode_value(expect_double, factory)), make_spec(false));
EXPECT_EQ(spec_from_value(*decode_value(expect_float, factory)), make_spec(true));
}
};
TensorExample::~TensorExample() = default;
//-----------------------------------------------------------------------------
struct SparseTensorExample : TensorExample {
TensorSpec make_spec(bool use_float) const override {
return TensorSpec(make_type_spec(use_float, "(x{},y{})"))
.add({{"x","a"},{"y","a"}}, 1)
.add({{"x","a"},{"y","b"}}, 2)
.add({{"x","b"},{"y","a"}}, 3);
}
std::unique_ptr<Value> make_tensor(bool use_float) const override {
return value_from_spec(make_spec(use_float), factory);
}
template <typename T>
void encode_inner(nbostream &dst) const {
dst.putInt1_4Bytes(2);
dst.writeSmallString("x");
dst.writeSmallString("y");
dst.putInt1_4Bytes(3);
dst.writeSmallString("a");
dst.writeSmallString("a");
dst << (T) 1;
dst.writeSmallString("a");
dst.writeSmallString("b");
dst << (T) 2;
dst.writeSmallString("b");
dst.writeSmallString("a");
dst << (T) 3;
}
void encode_default(nbostream &dst) const override {
dst.putInt1_4Bytes(1);
encode_inner<double>(dst);
}
void encode_with_double(nbostream &dst) const override {
dst.putInt1_4Bytes(5);
dst.putInt1_4Bytes(0);
encode_inner<double>(dst);
}
void encode_with_float(nbostream &dst) const override {
dst.putInt1_4Bytes(5);
dst.putInt1_4Bytes(1);
encode_inner<float>(dst);
}
};
TEST(ValueCodecTest, sparse_tensors_can_be_encoded_and_decoded) {
SparseTensorExample f1;
f1.verify_encode_decode(false);
}
//-----------------------------------------------------------------------------
struct DenseTensorExample : TensorExample {
TensorSpec make_spec(bool use_float) const override {
return TensorSpec(make_type_spec(use_float, "(x[3],y[2])"))
.add({{"x",0},{"y",0}}, 1)
.add({{"x",0},{"y",1}}, 2)
.add({{"x",1},{"y",0}}, 3)
.add({{"x",1},{"y",1}}, 4)
.add({{"x",2},{"y",0}}, 5)
.add({{"x",2},{"y",1}}, 6);
}
std::unique_ptr<Value> make_tensor(bool use_float) const override {
return value_from_spec(make_spec(use_float), factory);
}
template <typename T>
void encode_inner(nbostream &dst) const {
dst.putInt1_4Bytes(2);
dst.writeSmallString("x");
dst.putInt1_4Bytes(3);
dst.writeSmallString("y");
dst.putInt1_4Bytes(2);
dst << (T) 1;
dst << (T) 2;
dst << (T) 3;
dst << (T) 4;
dst << (T) 5;
dst << (T) 6;
}
void encode_default(nbostream &dst) const override {
dst.putInt1_4Bytes(2);
encode_inner<double>(dst);
}
void encode_with_double(nbostream &dst) const override {
dst.putInt1_4Bytes(6);
dst.putInt1_4Bytes(0);
encode_inner<double>(dst);
}
void encode_with_float(nbostream &dst) const override {
dst.putInt1_4Bytes(6);
dst.putInt1_4Bytes(1);
encode_inner<float>(dst);
}
};
TEST(ValueCodecTest, dense_tensors_can_be_encoded_and_decoded) {
DenseTensorExample f1;
f1.verify_encode_decode(true);
}
TEST(ValueCodecTest, dense_tensors_without_values_are_filled) {
TensorSpec empty_dense_spec("tensor(x[3],y[2])");
auto value = value_from_spec(empty_dense_spec, SimpleValueBuilderFactory::get());
EXPECT_EQ(value->cells().size, 6);
auto cells = value->cells().typify<double>();
EXPECT_EQ(cells[0], 0.0);
EXPECT_EQ(cells[1], 0.0);
EXPECT_EQ(cells[2], 0.0);
EXPECT_EQ(cells[3], 0.0);
EXPECT_EQ(cells[4], 0.0);
EXPECT_EQ(cells[5], 0.0);
}
//-----------------------------------------------------------------------------
struct MixedTensorExample : TensorExample {
TensorSpec make_spec(bool use_float) const override {
return TensorSpec(make_type_spec(use_float, "(x{},y{},z[2])"))
.add({{"x","a"},{"y","a"},{"z",0}}, 1)
.add({{"x","a"},{"y","a"},{"z",1}}, 2)
.add({{"x","a"},{"y","b"},{"z",0}}, 3)
.add({{"x","a"},{"y","b"},{"z",1}}, 4)
.add({{"x","b"},{"y","a"},{"z",0}}, 5)
.add({{"x","b"},{"y","a"},{"z",1}}, 6);
}
std::unique_ptr<Value> make_tensor(bool use_float) const override {
return value_from_spec(make_spec(use_float), factory);
}
template <typename T>
void encode_inner(nbostream &dst) const {
dst.putInt1_4Bytes(2);
dst.writeSmallString("x");
dst.writeSmallString("y");
dst.putInt1_4Bytes(1);
dst.writeSmallString("z");
dst.putInt1_4Bytes(2);
dst.putInt1_4Bytes(3);
dst.writeSmallString("a");
dst.writeSmallString("a");
dst << (T) 1;
dst << (T) 2;
dst.writeSmallString("a");
dst.writeSmallString("b");
dst << (T) 3;
dst << (T) 4;
dst.writeSmallString("b");
dst.writeSmallString("a");
dst << (T) 5;
dst << (T) 6;
}
void encode_default(nbostream &dst) const override {
dst.putInt1_4Bytes(3);
encode_inner<double>(dst);
}
void encode_with_double(nbostream &dst) const override {
dst.putInt1_4Bytes(7);
dst.putInt1_4Bytes(0);
encode_inner<double>(dst);
}
void encode_with_float(nbostream &dst) const override {
dst.putInt1_4Bytes(7);
dst.putInt1_4Bytes(1);
encode_inner<float>(dst);
}
};
TEST(ValueCodecTest, mixed_tensors_can_be_encoded_and_decoded) {
MixedTensorExample f1;
f1.verify_encode_decode(false);
}
//-----------------------------------------------------------------------------
struct BadSparseTensorExample : TensorExample {
TensorSpec make_spec(bool use_float) const override {
return TensorSpec(make_type_spec(use_float, "(x{},y{})"))
.add({{"x","a"},{"y","a"}}, 1)
.add({{"x","b"},{"y","a"}}, 3);
}
std::unique_ptr<Value> make_tensor(bool use_float) const override {
return value_from_spec(make_spec(use_float), factory);
}
template <typename T>
void encode_inner(nbostream &dst) const {
dst.putInt1_4Bytes(2);
dst.writeSmallString("x");
dst.writeSmallString("y");
dst.putInt1_4Bytes(12345678);
dst.writeSmallString("a");
dst.writeSmallString("a");
dst << (T) 1;
dst.writeSmallString("b");
dst.writeSmallString("a");
dst << (T) 3;
}
void encode_default(nbostream &dst) const override {
dst.putInt1_4Bytes(1);
encode_inner<double>(dst);
}
void encode_with_double(nbostream &dst) const override {
dst.putInt1_4Bytes(5);
dst.putInt1_4Bytes(0);
encode_inner<double>(dst);
}
void encode_with_float(nbostream &dst) const override {
dst.putInt1_4Bytes(5);
dst.putInt1_4Bytes(1);
encode_inner<float>(dst);
}
};
TEST(ValueCodecTest, bad_sparse_tensors_are_caught) {
BadSparseTensorExample bad;
nbostream data_default;
nbostream data_double;
nbostream data_float;
bad.encode_default(data_default);
bad.encode_with_double(data_double);
bad.encode_with_float(data_float);
VESPA_EXPECT_EXCEPTION(decode_value(data_default, factory), vespalib::eval::DecodeValueException,
"serialized input claims 12345678 blocks of size 1*8, but only");
VESPA_EXPECT_EXCEPTION(decode_value(data_double, factory), vespalib::eval::DecodeValueException,
"serialized input claims 12345678 blocks of size 1*8, but only");
VESPA_EXPECT_EXCEPTION(decode_value(data_float, factory), vespalib::eval::DecodeValueException,
"serialized input claims 12345678 blocks of size 1*4, but only");
}
//-----------------------------------------------------------------------------
struct BadDenseTensorExample : TensorExample {
TensorSpec make_spec(bool use_float) const override {
return TensorSpec(make_type_spec(use_float, "(x[3],y[2])"))
.add({{"x",0},{"y",0}}, 1)
.add({{"x",2},{"y",1}}, 6);
}
std::unique_ptr<Value> make_tensor(bool use_float) const override {
return value_from_spec(make_spec(use_float), factory);
}
template <typename T>
void encode_inner(nbostream &dst) const {
dst.putInt1_4Bytes(2);
dst.writeSmallString("x");
dst.putInt1_4Bytes(300);
dst.writeSmallString("y");
dst.putInt1_4Bytes(200);
dst << (T) 1;
dst << (T) 6;
}
void encode_default(nbostream &dst) const override {
dst.putInt1_4Bytes(2);
encode_inner<double>(dst);
}
void encode_with_double(nbostream &dst) const override {
dst.putInt1_4Bytes(6);
dst.putInt1_4Bytes(0);
encode_inner<double>(dst);
}
void encode_with_float(nbostream &dst) const override {
dst.putInt1_4Bytes(6);
dst.putInt1_4Bytes(1);
encode_inner<float>(dst);
}
};
TEST(ValueCodecTest, bad_dense_tensors_are_caught) {
BadDenseTensorExample bad;
nbostream data_default;
nbostream data_double;
nbostream data_float;
bad.encode_default(data_default);
bad.encode_with_double(data_double);
bad.encode_with_float(data_float);
VESPA_EXPECT_EXCEPTION(decode_value(data_default, factory), vespalib::eval::DecodeValueException,
"serialized input claims 1 blocks of size 60000*8, but only");
VESPA_EXPECT_EXCEPTION(decode_value(data_double, factory), vespalib::eval::DecodeValueException,
"serialized input claims 1 blocks of size 60000*8, but only");
VESPA_EXPECT_EXCEPTION(decode_value(data_float, factory), vespalib::eval::DecodeValueException,
"serialized input claims 1 blocks of size 60000*4, but only");
}
//-----------------------------------------------------------------------------
GTEST_MAIN_RUN_ALL_TESTS()
| 38.059553 | 112 | 0.565198 | [
"vector"
] |
99b64985f9289f29b3196a5d97b0164938a97397 | 3,421 | cpp | C++ | VulkanRenderer/VKShader.cpp | guimeixen/VulkanRenderer | 45cfd55320ee9a9b9b9a1a275e3805e79426f7bd | [
"MIT"
] | null | null | null | VulkanRenderer/VKShader.cpp | guimeixen/VulkanRenderer | 45cfd55320ee9a9b9b9a1a275e3805e79426f7bd | [
"MIT"
] | null | null | null | VulkanRenderer/VKShader.cpp | guimeixen/VulkanRenderer | 45cfd55320ee9a9b9b9a1a275e3805e79426f7bd | [
"MIT"
] | null | null | null | #include "VKShader.h"
#include "Log.h"
#include <fstream>
#include <iostream>
#include <vector>
#include <filesystem>
VKShader::VKShader()
{
shaderModule = VK_NULL_HANDLE;
stageInfo = {};
compiled = false;
compiledShaderFileExists = false;
shaderNeedsCompile = false;
}
bool VKShader::LoadShader(VkDevice device, const std::string& shaderName, VkShaderStageFlagBits shaderStage)
{
std::string baseShaderPath = "Data/Shaders/" + shaderName;
std::string compiledShaderPath = "Data/Shaders/spirv/" + shaderName;
if (shaderStage == VK_SHADER_STAGE_VERTEX_BIT)
{
baseShaderPath += ".vert";
compiledShaderPath += "_vert.spv";
}
else if (shaderStage == VK_SHADER_STAGE_FRAGMENT_BIT)
{
baseShaderPath += ".frag";
compiledShaderPath += "_frag.spv";
}
else if (shaderStage == VK_SHADER_STAGE_COMPUTE_BIT)
{
baseShaderPath += ".comp";
compiledShaderPath += "_comp.spv";
}
compiledShaderFileExists = std::filesystem::exists(compiledShaderPath);
if (compiledShaderFileExists)
{
auto compiledTime = std::filesystem::last_write_time(compiledShaderPath);
auto baseShaderWriteTime = std::filesystem::last_write_time(baseShaderPath);
// If the compiled time is older than when the base shader was modified the we need to compile it again
if (compiledTime < baseShaderWriteTime)
shaderNeedsCompile = true;
}
if (compiledShaderFileExists == false || shaderNeedsCompile)
{
// Compile the shader
std::string command = "glslc.exe ";
command += baseShaderPath;
command += " -o " + compiledShaderPath;
if (std::system(command.c_str()) != 0)
{
Log::Print(LogLevel::LEVEL_ERROR, "Failed to compile shader\n");
return false;
}
else
{
Log::Print(LogLevel::LEVEL_INFO, "Compiled shader %s\n", baseShaderPath.c_str());
}
}
std::ifstream file(compiledShaderPath, std::ios::ate | std::ios::binary);
if (!file.is_open())
{
std::cout << "Failed to open compiled shader file: " << compiledShaderPath << '\n';
return false;
}
size_t fileSize = (size_t)file.tellg();
std::vector<char> shaderData(fileSize);
file.seekg(0);
file.read(shaderData.data(), fileSize);
file.close();
VkShaderModuleCreateInfo createInfo = {};
createInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
createInfo.codeSize = shaderData.size();
createInfo.pCode = reinterpret_cast<const uint32_t*>(shaderData.data());
if (vkCreateShaderModule(device, &createInfo, nullptr, &shaderModule) != VK_SUCCESS)
{
std::cout << "Failed to create vertex shader module\n";
return false;
}
stageInfo = {};
stageInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
stageInfo.stage = shaderStage;
stageInfo.module = shaderModule;
stageInfo.pName = "main";
std::cout << "Loaded shader: " << baseShaderPath << '\n';
return true;
}
void VKShader::Dispose(VkDevice device)
{
if (shaderModule != VK_NULL_HANDLE)
{
vkDestroyShaderModule(device, shaderModule, nullptr);
}
}
bool VKShader::Compile(const std::string &baseShaderPath, const std::string& compiledShaderPath, VkShaderStageFlagBits stage)
{
return true;
}
| 28.508333 | 125 | 0.654487 | [
"vector"
] |
99bafb836e9edadae3292bf48b9179fe0125cca1 | 23,707 | cpp | C++ | winml/lib/Api.Ort/OnnxruntimeDescriptorConverter.cpp | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 6,036 | 2019-05-07T06:03:57.000Z | 2022-03-31T17:59:54.000Z | winml/lib/Api.Ort/OnnxruntimeDescriptorConverter.cpp | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 5,730 | 2019-05-06T23:04:55.000Z | 2022-03-31T23:55:56.000Z | winml/lib/Api.Ort/OnnxruntimeDescriptorConverter.cpp | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 1,566 | 2019-05-07T01:30:07.000Z | 2022-03-31T17:06:50.000Z | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "lib/Api.Ort/pch.h"
#include <evntrace.h>
#include "OnnxruntimeDescriptorConverter.h"
#include "ImageFeatureDescriptor.h"
#include "MapFeatureDescriptor.h"
#include "SequenceFeatureDescriptor.h"
#include "TensorFeatureDescriptor.h"
#include "winrt/windows.foundation.collections.h"
#include "winrt/windows.graphics.imaging.h"
#include "OnnxruntimeEngine.h"
#include "OnnxruntimeErrors.h"
// BitmapPixelFormat constants
static const char* c_bitmap_pixel_format_key = "Image.BitmapPixelFormat";
static const char* c_supported_pixel_formats[] =
{
"Gray8",
"Rgb8",
"Bgr8"};
// ColorSpaceGamma constants
// Unlike the other supported value arrays, this is an UNSUPPORTED list.
// Unfortunately, the original RS5 implementation blocked unsupported
// color_space_gamma values (Linear), and did not allow the actual supported
// values (SRGB).
static const char* c_color_space_key = "Image.ColorSpaceGamma";
static const char* c_unsupported_color_spaces[] =
{
"Linear"};
// NominalPixelRange constants
static const char* c_nominal_range_key = "Image.NominalPixelRange";
static const char* c_supported_nominal_ranges[] =
{
"NominalRange_0_255",
"Normalized_0_1",
"Normalized_1_1"};
namespace _winml {
// Forward declare CreateFeatureDescriptor
static winml::ILearningModelFeatureDescriptor
CreateFeatureDescriptor(
OnnxruntimeEngineFactory* engine_factory,
const OnnxruntimeValueInfoWrapper* feature_descriptor,
const std::unordered_map<std::string, std::string>& metadata);
static winml::TensorKind
TensorKindFromONNXTensorElementDataType(ONNXTensorElementDataType dataType) {
switch (dataType) {
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL: {
return winml::TensorKind::Boolean;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING: {
return winml::TensorKind::String;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16: {
return winml::TensorKind::Float16;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT: {
return winml::TensorKind::Float;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE: {
return winml::TensorKind::Double;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8: {
return winml::TensorKind::Int8;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16: {
return winml::TensorKind::Int16;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32: {
return winml::TensorKind::Int32;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64: {
return winml::TensorKind::Int64;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8: {
return winml::TensorKind::UInt8;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16: {
return winml::TensorKind::UInt16;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32: {
return winml::TensorKind::UInt32;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64: {
return winml::TensorKind::UInt64;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64: {
return winml::TensorKind::Complex64;
}
case ONNXTensorElementDataType::ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128: {
return winml::TensorKind::Complex128;
}
default: {
return winml::TensorKind::Undefined;
}
}
}
static std::string
TensorKindToString(winml::TensorKind tensorKind) {
switch (tensorKind) {
case winml::TensorKind::Float: {
return "float";
}
case winml::TensorKind::UInt8: {
return "uint8";
}
case winml::TensorKind::Int8: {
return "int8";
}
case winml::TensorKind::UInt16: {
return "uint16";
}
case winml::TensorKind::Int16: {
return "int16";
}
case winml::TensorKind::Int32: {
return "int32";
}
case winml::TensorKind::Int64: {
return "int64";
}
case winml::TensorKind::String: {
return "string";
}
case winml::TensorKind::Boolean: {
return "boolean";
}
case winml::TensorKind::Float16: {
return "float16";
}
case winml::TensorKind::Double: {
return "double";
}
case winml::TensorKind::UInt32: {
return "uint32";
}
case winml::TensorKind::UInt64: {
return "uint64";
}
case winml::TensorKind::Complex64: {
return "complex64";
}
case winml::TensorKind::Complex128: {
return "complex128";
}
case winml::TensorKind::Undefined:
default: {
return "undefined";
}
}
}
static const char*
FetchMetadataValueOrNull(
const std::unordered_map<std::string, std::string>& metadata,
const char* metadata_key) {
auto metadata_pair = metadata.find(metadata_key);
auto metadata_exists = metadata_pair != metadata.end();
return metadata_exists
? metadata_pair->second.c_str()
: nullptr;
}
template <unsigned TNumSupportedValues>
static bool
IsValueInRange(
const char* value,
const char* (&range)[TNumSupportedValues]) {
if (value) {
auto range_end = range + TNumSupportedValues;
auto found = std::find_if(
range,
range_end,
[&](auto& supported_value) {
return std::strcmp(supported_value, value) == 0;
}) != range_end;
return found;
}
return false;
}
enum class RangeType { AllowedList,
BlockedList };
template <unsigned TNumSupportedValues>
static bool
CheckImageMetadataIsUnsupported(
const std::unordered_map<std::string, std::string>& metadata,
const char* metadata_key,
const char* (&range)[TNumSupportedValues],
std::ostringstream& log_stream,
RangeType range_type = RangeType::AllowedList) {
// Check is the model has pixel format metadata.
// This is retrieved from the metadata (which is global to the model).
// We only consider formats that are supported in the image converter.
// If not supported you MUST bind as a tensor.
auto value = FetchMetadataValueOrNull(metadata, metadata_key);
auto metadata_exists = value != nullptr;
if (metadata_exists) {
auto found = IsValueInRange(value, range);
// if list of allowed values
auto is_allowed_list = range_type == RangeType::AllowedList;
auto is_not_in_allowed_list = is_allowed_list && !found;
// if list of blocked values
auto is_blocked_list = range_type == RangeType::BlockedList;
auto is_in_blocked_list = is_blocked_list && found;
auto is_unsupported = is_not_in_allowed_list || is_in_blocked_list;
// log
if (is_unsupported) {
log_stream << "Unsupported "
<< metadata_key
<< ": "
<< value
<< " found."
<< std::endl;
}
return is_unsupported;
}
// No metadata, so it cannot be unsupported
return false;
}
static std::pair<wgi::BitmapPixelFormat, wgi::BitmapAlphaMode>
CreateBitmapPixelFormatAndAlphaModeInfo(
const char* pixel_format) {
if (pixel_format) {
auto comparator =
std::bind(std::strcmp, pixel_format, std::placeholders::_1);
if (0 == comparator("Gray8")) {
return {wgi::BitmapPixelFormat::Gray8, wgi::BitmapAlphaMode::Premultiplied};
} else if (0 == comparator("Rgb8")) {
return {wgi::BitmapPixelFormat::Rgba8, wgi::BitmapAlphaMode::Premultiplied};
} else if (0 == comparator("Bgr8")) {
return {wgi::BitmapPixelFormat::Bgra8, wgi::BitmapAlphaMode::Premultiplied};
} else if (0 == comparator("Rgba8")) {
return {wgi::BitmapPixelFormat::Rgba8, wgi::BitmapAlphaMode::Straight};
} else if (0 == comparator("Bgra8")) {
return {wgi::BitmapPixelFormat::Bgra8, wgi::BitmapAlphaMode::Straight};
}
}
// default value, non conforming values are overridden to Bgra8, Premultiplied
return {wgi::BitmapPixelFormat::Bgra8, wgi::BitmapAlphaMode::Premultiplied};
}
static winmlp::ImageColorSpaceGamma
CreateImageColorSpaceGamma(const char* color_space_gamma) {
if (color_space_gamma) {
auto comparator =
std::bind(std::strcmp, color_space_gamma, std::placeholders::_1);
if (0 == comparator("Linear")) {
return winmlp::ImageColorSpaceGamma::ImageColorSpaceGamma_Linear;
} else if (0 == comparator("SRGB")) {
return winmlp::ImageColorSpaceGamma::ImageColorSpaceGamma_SRGB;
}
}
// default value, non conforming values are overridden to SRGB
return winmlp::ImageColorSpaceGamma::ImageColorSpaceGamma_SRGB;
}
static winml::LearningModelPixelRange
CreateImageNominalPixelRange(const char* nominal_range) {
if (nominal_range) {
auto comparator =
std::bind(std::strcmp, nominal_range, std::placeholders::_1);
if (0 == comparator("NominalRange_0_255")) {
return winml::LearningModelPixelRange::ZeroTo255;
} else if (0 == comparator("Normalized_0_1")) {
return winml::LearningModelPixelRange::ZeroToOne;
} else if (0 == comparator("Normalized_1_1")) {
return winml::LearningModelPixelRange::MinusOneToOne;
}
}
// default value, non conforming values are overridden to NominalRange_0_255
return winml::LearningModelPixelRange::ZeroTo255;
}
enum class TensorType { Tensor_Data,
Tensor_Image,
Tensor_Data_UnsupportedImageMetadata };
static TensorType
GetTensorType(
OnnxruntimeEngineFactory* engine_factory,
OrtTypeInfo* type_info,
const std::unordered_map<std::string, std::string>& metadata) {
const char* denotation;
size_t len;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetDenotationFromTypeInfo(type_info, &denotation, &len),
engine_factory->UseOrtApi());
constexpr char c_image[] = "IMAGE";
auto has_image_denotation = strncmp(denotation, c_image, _countof(c_image)) == 0;
if (!has_image_denotation) {
return TensorType::Tensor_Data;
}
// Create log_stream to capture any warning messages
// for improperly annotated image tensor
std::ostringstream log_stream;
// Check if the tensor value_info_proto is of type float.
// IMAGE tensors MUST be of type float
const OrtTensorTypeAndShapeInfo* tensor_info;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->CastTypeInfoToTensorInfo(type_info, &tensor_info),
engine_factory->UseOrtApi());
ONNXTensorElementDataType tensor_element_data_type;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetTensorElementType(tensor_info, &tensor_element_data_type),
engine_factory->UseOrtApi());
auto tensor_kind = _winml::TensorKindFromONNXTensorElementDataType(tensor_element_data_type);
auto is_float_tensor = tensor_kind == winml::TensorKind::Float;
if (!is_float_tensor) {
log_stream << "Unsupported image with " << TensorKindToString(tensor_kind)
<< " found." << std::endl;
}
// Check if the model has pixel format and color space metadata.
// This is retrieved from the metadata (which is global to the model).
// We only consider formats that are supported in the image converter.
// If not supported you MUST bind as a tensor.
auto has_unsupported_pixel_format =
CheckImageMetadataIsUnsupported(metadata, c_bitmap_pixel_format_key,
c_supported_pixel_formats, log_stream);
auto has_unsupported_nominal_range =
CheckImageMetadataIsUnsupported(metadata, c_nominal_range_key,
c_supported_nominal_ranges, log_stream);
// Unfortunately, the original RS5 implementation blocked unsupported
// color_space_gamma values (Linear), and did not allow the actual supported
// values (SRGB) like the other image metadata.
//
// So to keep parity with RS5, we continue to check against a list of
// unsupported color spaces.
auto has_unsupported_color_space_gamma =
CheckImageMetadataIsUnsupported(metadata, c_color_space_key,
c_unsupported_color_spaces, log_stream, RangeType::BlockedList);
bool has_unsupported_image_metadata =
has_unsupported_pixel_format ||
has_unsupported_color_space_gamma ||
has_unsupported_nominal_range;
auto is_tensor_improperly_annotated_as_image =
has_image_denotation &&
(!is_float_tensor ||
has_unsupported_image_metadata);
if (is_tensor_improperly_annotated_as_image) {
TraceLoggingWrite(winml_trace_logging_provider,
"WinMLInputValidation",
TraceLoggingKeyword(WINML_PROVIDER_KEYWORD_DEFAULT),
TraceLoggingLevel(WINEVENT_LEVEL_WARNING),
TraceLoggingOpcode(EVENT_TRACE_TYPE_INFO),
TraceLoggingString(log_stream.str().c_str()));
}
auto is_valid_image_tensor =
has_image_denotation && is_float_tensor && !has_unsupported_image_metadata;
return is_valid_image_tensor
? TensorType::Tensor_Image
: has_unsupported_image_metadata
? TensorType::Tensor_Data_UnsupportedImageMetadata
: TensorType::Tensor_Data;
}
static winml::ILearningModelFeatureDescriptor
CreateTensorFeatureDescriptor(
OnnxruntimeEngineFactory* engine_factory,
const OnnxruntimeValueInfoWrapper* feature_descriptor,
const std::unordered_map<std::string, std::string>& metadata,
bool has_unsupported_image_metadata) {
auto type_info = feature_descriptor->type_info_.get();
const OrtTensorTypeAndShapeInfo* tensor_info;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->CastTypeInfoToTensorInfo(type_info, &tensor_info),
engine_factory->UseOrtApi());
size_t num_dims;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetDimensionsCount(tensor_info, &num_dims),
engine_factory->UseOrtApi());
auto shape = std::vector<int64_t>(num_dims);
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetDimensions(tensor_info, shape.data(), shape.size()),
engine_factory->UseOrtApi());
ONNXTensorElementDataType tensor_element_data_type;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetTensorElementType(tensor_info, &tensor_element_data_type),
engine_factory->UseOrtApi());
auto kind = _winml::TensorKindFromONNXTensorElementDataType(tensor_element_data_type);
auto descriptor = winrt::make<winmlp::TensorFeatureDescriptor>(
feature_descriptor->name_,
feature_descriptor->description_, // description
kind,
shape,
feature_descriptor->name_length_ > 0, // is_required
has_unsupported_image_metadata);
return descriptor.as<winml::ILearningModelFeatureDescriptor>();
}
static winml::ILearningModelFeatureDescriptor
CreateImageFeatureDescriptor(
OnnxruntimeEngineFactory* engine_factory,
const OnnxruntimeValueInfoWrapper* feature_descriptor,
const std::unordered_map<std::string, std::string>& metadata) {
auto type_info = feature_descriptor->type_info_.get();
const OrtTensorTypeAndShapeInfo* tensor_info;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->CastTypeInfoToTensorInfo(type_info, &tensor_info),
engine_factory->UseOrtApi());
size_t num_dims;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetDimensionsCount(tensor_info, &num_dims),
engine_factory->UseOrtApi());
auto shape = std::vector<int64_t>(num_dims);
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetDimensions(tensor_info, shape.data(), shape.size()),
engine_factory->UseOrtApi());
ONNXTensorElementDataType tensor_element_data_type;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetTensorElementType(tensor_info, &tensor_element_data_type),
engine_factory->UseOrtApi());
auto kind = _winml::TensorKindFromONNXTensorElementDataType(tensor_element_data_type);
// pixel format and alpha
auto pixel_format_value = FetchMetadataValueOrNull(metadata, c_bitmap_pixel_format_key);
auto format_info = CreateBitmapPixelFormatAndAlphaModeInfo(pixel_format_value);
auto pixel_format = format_info.first;
auto alpha_mode = format_info.second;
// color space gamma value
auto color_space_gamma_value = FetchMetadataValueOrNull(metadata, c_color_space_key);
auto color_space_gamma = CreateImageColorSpaceGamma(color_space_gamma_value);
// nominal range
auto nominal_range_value = FetchMetadataValueOrNull(metadata, c_nominal_range_key);
auto nominal_range = CreateImageNominalPixelRange(nominal_range_value);
// The current code assumes that the shape will be in NCHW.
// Should the model metadata be read instead???
const int c_height_dimension = 2;
const int c_width_dimension = 3;
auto height = static_cast<uint32_t>(shape[c_height_dimension]);
auto width = static_cast<uint32_t>(shape[c_width_dimension]);
auto descriptor = winrt::make<winmlp::ImageFeatureDescriptor>(
feature_descriptor->name_,
feature_descriptor->description_,
kind,
shape,
feature_descriptor->name_length_ > 0, // is_required
pixel_format,
alpha_mode,
width,
height,
nominal_range,
color_space_gamma);
return descriptor.as<winml::ILearningModelFeatureDescriptor>();
}
static winml::ILearningModelFeatureDescriptor
CreateMapFeatureDescriptor(
OnnxruntimeEngineFactory* engine_factory,
const OnnxruntimeValueInfoWrapper* feature_descriptor,
const std::unordered_map<std::string, std::string>& metadata) {
auto type_info = feature_descriptor->type_info_.get();
const OrtMapTypeInfo* map_info;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->CastTypeInfoToMapTypeInfo(type_info, &map_info),
engine_factory->UseOrtApi());
ONNXTensorElementDataType map_key_data_type;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetMapKeyType(map_info, &map_key_data_type),
engine_factory->UseOrtApi());
auto key_kind = _winml::TensorKindFromONNXTensorElementDataType(map_key_data_type);
OrtTypeInfo* map_value_type_info;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetMapValueType(map_info, &map_value_type_info),
engine_factory->UseOrtApi());
UniqueOrtTypeInfo unique_map_value_type_info(map_value_type_info, engine_factory->UseOrtApi()->ReleaseTypeInfo);
OnnxruntimeValueInfoWrapper dummy_ort_value_info_wrapper;
dummy_ort_value_info_wrapper.description_ = feature_descriptor->description_;
dummy_ort_value_info_wrapper.description_length_ = feature_descriptor->description_length_;
dummy_ort_value_info_wrapper.name_ = feature_descriptor->name_;
dummy_ort_value_info_wrapper.name_length_ = feature_descriptor->name_length_;
dummy_ort_value_info_wrapper.type_info_ = std::move(unique_map_value_type_info);
auto value_descriptor =
CreateFeatureDescriptor(engine_factory, &dummy_ort_value_info_wrapper, metadata);
auto descriptor = winrt::make<winmlp::MapFeatureDescriptor>(
feature_descriptor->name_,
feature_descriptor->description_,
feature_descriptor->name_length_ > 0, // is_required
key_kind,
value_descriptor);
return descriptor.as<winml::ILearningModelFeatureDescriptor>();
}
static winml::ILearningModelFeatureDescriptor
CreateSequenceFeatureDescriptor(
OnnxruntimeEngineFactory* engine_factory,
const OnnxruntimeValueInfoWrapper* feature_descriptor,
const std::unordered_map<std::string, std::string>& metadata) {
auto type_info = feature_descriptor->type_info_.get();
const OrtSequenceTypeInfo* sequence_info;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->CastTypeInfoToSequenceTypeInfo(type_info, &sequence_info),
engine_factory->UseOrtApi());
OrtTypeInfo* sequence_element_type_info;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetSequenceElementType(sequence_info, &sequence_element_type_info),
engine_factory->UseOrtApi());
UniqueOrtTypeInfo unique_sequence_element_type_info(sequence_element_type_info, engine_factory->UseOrtApi()->ReleaseTypeInfo);
OnnxruntimeValueInfoWrapper dummy_ort_value_info_wrapper;
dummy_ort_value_info_wrapper.description_ = feature_descriptor->description_;
dummy_ort_value_info_wrapper.description_length_ = feature_descriptor->description_length_;
dummy_ort_value_info_wrapper.name_ = feature_descriptor->name_;
dummy_ort_value_info_wrapper.name_length_ = feature_descriptor->name_length_;
dummy_ort_value_info_wrapper.type_info_ = std::move(unique_sequence_element_type_info);
auto element_descriptor =
CreateFeatureDescriptor(engine_factory, &dummy_ort_value_info_wrapper, metadata);
auto descriptor = winrt::make<winmlp::SequenceFeatureDescriptor>(
feature_descriptor->name_,
feature_descriptor->description_,
feature_descriptor->name_length_ > 0, // is_required
element_descriptor);
return descriptor.as<winml::ILearningModelFeatureDescriptor>();
}
static winml::ILearningModelFeatureDescriptor
CreateFeatureDescriptor(
OnnxruntimeEngineFactory* engine_factory,
const OnnxruntimeValueInfoWrapper* feature_descriptor,
const std::unordered_map<std::string, std::string>& metadata) {
auto type_info = feature_descriptor->type_info_.get();
ONNXType onnx_type;
THROW_IF_NOT_OK_MSG(engine_factory->UseOrtApi()->GetOnnxTypeFromTypeInfo(type_info, &onnx_type),
engine_factory->UseOrtApi());
switch (onnx_type) {
case ONNXType::ONNX_TYPE_TENSOR: {
auto tensor_type = GetTensorType(engine_factory, type_info, metadata);
if (tensor_type == TensorType::Tensor_Image) {
return CreateImageFeatureDescriptor(
engine_factory,
feature_descriptor,
metadata);
} else {
auto has_unsupported_image_metadata =
tensor_type == TensorType::Tensor_Data_UnsupportedImageMetadata;
return CreateTensorFeatureDescriptor(
engine_factory,
feature_descriptor,
metadata,
has_unsupported_image_metadata);
}
}
case ONNXType::ONNX_TYPE_MAP: {
return CreateMapFeatureDescriptor(
engine_factory,
feature_descriptor,
metadata);
}
case ONNXType::ONNX_TYPE_SEQUENCE: {
return CreateSequenceFeatureDescriptor(
engine_factory,
feature_descriptor,
metadata);
}
default:
throw winrt::hresult_not_implemented();
}
}
OnnxruntimeDescriptorConverter::OnnxruntimeDescriptorConverter(
OnnxruntimeEngineFactory* engine_factory,
const std::unordered_map<std::string, std::string>& metadata) : engine_factory_(engine_factory), metadata_(metadata) {}
wfc::IVector<winml::ILearningModelFeatureDescriptor>
OnnxruntimeDescriptorConverter::ConvertToLearningModelDescriptors(const OnnxruntimeValueInfoWrapper* descriptors, size_t num_descriptors) {
auto features = winrt::single_threaded_vector<winml::ILearningModelFeatureDescriptor>();
for (size_t i = 0; i < num_descriptors; i++) {
const auto& descriptor = descriptors[i];
auto learning_model_descriptor = _winml::CreateFeatureDescriptor(engine_factory_.Get(), &descriptor, metadata_);
features.Append(learning_model_descriptor);
}
return features;
}
} // namespace _winml
| 37.689984 | 139 | 0.725862 | [
"shape",
"vector",
"model"
] |
99c0abfff758a915e799f15ff6e63f8ad087e799 | 2,714 | cpp | C++ | Love-Babbar-450-In-CPPTest/06_binary_trees/34_find_all_duplicate_subtree_in_BT.cpp | harshanu11/Love-Babbar-450-In-CSharp | 0dc3bef3e66e30abbc04f7bbf21c7319b41803e1 | [
"MIT"
] | null | null | null | Love-Babbar-450-In-CPPTest/06_binary_trees/34_find_all_duplicate_subtree_in_BT.cpp | harshanu11/Love-Babbar-450-In-CSharp | 0dc3bef3e66e30abbc04f7bbf21c7319b41803e1 | [
"MIT"
] | null | null | null | Love-Babbar-450-In-CPPTest/06_binary_trees/34_find_all_duplicate_subtree_in_BT.cpp | harshanu11/Love-Babbar-450-In-CSharp | 0dc3bef3e66e30abbc04f7bbf21c7319b41803e1 | [
"MIT"
] | null | null | null | /*
link: https://practice.geeksforgeeks.org/problems/duplicate-subtrees/1
sol: https://www.geeksforgeeks.org/find-duplicate-subtrees/
*/
#include "01_level_order_traversal.cpp"
#include "CppUnitTest.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include <queue>
#include <stack>
using namespace std;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace LoveBabbar450InCPPTest
{
//TEST_CLASS(BTSort)
//{
//public:
// TEST_METHOD(Test)
// {
// std::string charM = "harhs";
// int age = 14;
// age = 55;
// std::string lastName = "<<charM <<singh";
// }
//};
}
class find_all_duplicate_subtree_in_BT
{
// ----------------------------------------------------------------------------------------------------------------------- //
/*
using hashing
TC: O(N)
SC: O(N)
*/
// C++ program to find averages of all levels
// in a binary tree.
/* A binary tree node has data, pointer to
left child and a pointer to right child */
struct Node {
int data;
struct Node* left, * right;
};
string inorder(Node* node, unordered_map<string, int>& m)
{
if (!node)
return "";
string str = "(";
str += inorder(node->left, m);
str += to_string(node->data);
str += inorder(node->right, m);
str += ")";
// Subtree already present (Note that we use
// unordered_map instead of unordered_set
// because we want to print multiple duplicates
// only once, consider example of 4 in above
// subtree, it should be printed only once.
if (m[str] == 1)
cout << node->data << " ";
m[str]++;
return str;
}
// Wrapper over inorder()
void printAllDups(Node* root)
{
unordered_map<string, int> m;
inorder(root, m);
}
/* Helper function that allocates a
new node with the given data and
NULL left and right pointers. */
Node* newNode(int data)
{
Node* temp = new Node;
temp->data = data;
temp->left = temp->right = NULL;
return temp;
}
// Driver code
int main29()
{
Node* root = NULL;
root = newNode(1);
root->left = newNode(2);
root->right = newNode(3);
root->left->left = newNode(4);
root->right->left = newNode(2);
root->right->left->left = newNode(4);
root->right->right = newNode(4);
printAllDups(root);
return 0;
}
};
| 23.196581 | 129 | 0.529845 | [
"vector"
] |
99cdf17c8287ecc868645412bb9d44f2332c1c9f | 13,285 | cpp | C++ | algorithms/visappfeats.cpp | JohnStranzl/GRIME2 | 087a67055890b884ed701cc3d57c78978ad20ff2 | [
"Apache-2.0"
] | 3 | 2021-02-16T05:46:20.000Z | 2021-03-08T08:38:21.000Z | algorithms/visappfeats.cpp | JohnStranzl/GRIME2 | 087a67055890b884ed701cc3d57c78978ad20ff2 | [
"Apache-2.0"
] | 6 | 2021-04-10T14:55:24.000Z | 2021-08-28T17:54:24.000Z | algorithms/visappfeats.cpp | JohnStranzl/GRIME2 | 087a67055890b884ed701cc3d57c78978ad20ff2 | [
"Apache-2.0"
] | 1 | 2021-04-15T02:20:19.000Z | 2021-04-15T02:20:19.000Z | /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright 2021 Kenneth W. Chapman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#include "log.h"
#include "visappfeats.h"
#include <limits>
#include <iostream>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include "timestampconvert.h"
#include "metadata.h"
#include "csvreader.h"
using namespace cv;
using namespace std;
using namespace boost;
namespace fs = filesystem;
#ifndef DEBUG_VISAPP_FEATURES
#define DEBUG_VISAPP_FEATURES
#ifdef WIN32
static string DEBUG_FOLDER = "c:/gaugecam/debug/visappfeats/";
#else
static string DEBUG_FOLDER = "/var/tmp/gaugecam/visappfeats/";
#endif
#endif
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// static helper functions
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static bool is_number( const string& s )
{
return !s.empty() && find_if( s.begin(), s.end(), [](char c) { return !( isdigit( c ) || c == '.' || c== '-' ); } ) == s.end();
}
static double DISTANCE( const Point2d a, const Point2d b )
{
return static_cast< double >( sqrt( ( b.x - a.x ) * ( b.x - a.x ) + ( b.y - a.y ) * ( b.y - a.y ) ) );
}
namespace gc
{
VisAppFeats::VisAppFeats()
{
#ifdef DEBUG_VISAPP_FEATURES
if ( !boost::filesystem::exists( DEBUG_FOLDER ) )
{
bool bOk = boost::filesystem::create_directories( DEBUG_FOLDER );
if ( bOk )
{
FILE_LOG( logINFO ) << "Create find visappfeat debug folder: " << DEBUG_FOLDER;
}
else
{
FILE_LOG( logWARNING ) << "Could NOT create find visappfeat debug folder: " << DEBUG_FOLDER;
}
}
#endif
}
GC_STATUS VisAppFeats::CreateCSVFileAndHeader( const string filepath, const FeatureSet &featSet )
{
GC_STATUS retVal = GC_OK;
try
{
ofstream outFile;
if ( !fs::exists( filepath ) )
{
if ( !fs::exists( fs::path( filepath ).parent_path() ) )
{
bool bRet = fs::create_directories( fs::path( filepath ).parent_path() );
if ( !bRet )
{
FILE_LOG( logERROR ) << "[VisAppFeats::CreateCSVFileAndHeader] Could not create folder for CSV file: " << filepath;
retVal = GC_ERR;
}
}
if ( GC_OK == retVal )
{
outFile.open( filepath, ios_base::out );
if ( !outFile.is_open() )
{
FILE_LOG( logERROR ) << "[VisAppFeats::CreateCSVFileAndHeader] Could not create CSV: " << filepath;
retVal = GC_ERR;
}
else
{
outFile << "SensorTime, CaptureTime, Filename, Agency, SiteNumber, TimeZone, Stage, Discharge, ";
outFile << "CalcTimestamp, width, height, exposure, fNumber, isoSpeed, shutterSpeed, areaFeatCount";
if ( 0 < featSet.areaFeats.size() )
{
outFile << ", ";
for ( size_t i = 0; i < featSet.areaFeats.size(); ++i )
{
outFile << "grayMean " << i << ", graySigma " << i << ", ";
outFile << "entropyMean " << i << ", entropySigma " << i << ", ";
outFile << "hMean " << i << ", hSigma " << i << ", ";
outFile << "sMean " << i << ", sSigma " << i << ", ";
outFile << "vMean " << i << ", vSigma " << i;
if ( featSet.areaFeats.size() - 1 > i )
outFile << ", ";
}
}
outFile << endl;
}
outFile.close();
}
}
}
catch( const boost::exception &e )
{
FILE_LOG( logERROR ) << "[VisAppFeats::CreateCSVFileAndHeader] " << diagnostic_information( e );
retVal = GC_EXCEPT;
}
return retVal;
}
GC_STATUS VisAppFeats::ParseRow( const vector< string > data, FeatureSet &feat )
{
GC_STATUS retVal = GC_OK;
try
{
int j = 0;
PixelStats pixStats;
feat.clear();
feat.exif.captureTime = data[ j++ ];
feat.imageFilename = data[ j++ ];
feat.calcTimestamp = data[ j++ ];
feat.imageSize.width = is_number( data[ j ] ) ? stoi( data[ j ] ) : -9999999; ++j;
feat.imageSize.height = is_number( data[ j ] ) ? stoi( data[ j ] ) : -9999999; ++j;
feat.exif.exposureTime = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
feat.exif.fNumber = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
feat.exif.isoSpeedRating = is_number( data[ j ] ) ? stoi( data[ j ] ) : -9999999; ++j;
feat.exif.shutterSpeed = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
ImageAreaFeatures areaFeat;
int areaFeatCount = is_number( data[ j ] ) ? stoi( data[ j ] ) : 0; ++j;
for ( size_t i = 0; i < static_cast< size_t >( areaFeatCount ); ++i )
{
areaFeat.clear();
areaFeat.grayStats.average = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
areaFeat.grayStats.sigma = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
areaFeat.entropyStats.average = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
areaFeat.entropyStats.sigma = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
pixStats.average = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
pixStats.sigma = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
areaFeat.hsvStats.push_back( pixStats );
pixStats.average = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
pixStats.sigma = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
areaFeat.hsvStats.push_back( pixStats );
pixStats.average = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
pixStats.sigma = is_number( data[ j ] ) ? stod( data[ j ] ) : -9999999; ++j;
areaFeat.hsvStats.push_back( pixStats );
feat.areaFeats.push_back( areaFeat );
}
}
catch( const boost::exception &e )
{
FILE_LOG( logERROR ) << "[VisAppFeats::ReadCSV] " << diagnostic_information( e );
retVal = GC_EXCEPT;
}
return retVal;
}
GC_STATUS VisAppFeats::ReadCSV( const string filepath, vector< FeatureSet > &featSets )
{
GC_STATUS retVal = GC_OK;
try
{
CSVReader reader( filepath );
vector< vector< string > > data = reader.getData();
if ( data.empty() )
{
FILE_LOG( logERROR ) << "[VisAppFeats::ReadCSV] No data in file " << filepath;
retVal = GC_ERR;
}
else
{
FeatureSet feat;
size_t count = data[ 0 ].size();
for ( size_t i = 1; i < data.size(); ++i )
{
// cout << "Parse features: " << i << " of " << data.size() << "\r";
if ( count <= data[ i ].size() )
{
retVal = ParseRow( data[ i ], feat );
if ( GC_OK == retVal )
{
featSets.push_back( feat );
}
}
}
}
}
catch( const boost::exception &e )
{
FILE_LOG( logERROR ) << "[VisAppFeats::ReadCSV] " << diagnostic_information( e );
retVal = GC_EXCEPT;
}
return retVal;
}
GC_STATUS VisAppFeats::CalcMovement( const cv::Mat img, cv::Point &ptOrig, cv::Point &ptMove, double &angle )
{
GC_STATUS retVal = anchor.CalcMoveModel( img, ptOrig, ptMove, angle );
return retVal;
}
GC_STATUS VisAppFeats::SetAnchorRef( const string imgRefFilepath, const cv::Rect rect )
{
GC_STATUS retVal = anchor.SetRef( imgRefFilepath, rect );
return retVal;
}
GC_STATUS VisAppFeats::ReadSettings( const std::string jsonFilepath )
{
GC_STATUS retVal = GC_OK;
try
{
}
catch( const boost::exception &e )
{
FILE_LOG( logERROR ) << "[VisAppFeats::ReadSettings] " << diagnostic_information( e );
retVal = GC_EXCEPT;
}
return retVal;
}
GC_STATUS VisAppFeats::WriteSettings( const std::string jsonFilepath )
{
GC_STATUS retVal = GC_OK;
try
{
ofstream settings( jsonFilepath );
if ( !settings.is_open() )
{
FILE_LOG( logERROR ) << "[VisAppFeats::WriteSettings] Could not open file for writing -- " << jsonFilepath;
retVal = GC_ERR;
}
else
{
Rect anchorRect = anchor.ModelRect();
settings << "{" << endl;
settings << " \"anchor_model_roi_x\": " << anchorRect.x << "," << endl;
settings << " \"anchor_model_roi_y\": " << anchorRect.y << "," << endl;
settings << " \"anchor_model_roi_width\": " << anchorRect.width << "," << endl;
settings << " \"anchor_model_roi_height\": " << anchorRect.height << "," << endl;
settings << " \"anchor_model_ref_image\": " << anchor.ModelRefImagePath() << "," << endl;
settings << " \"feature_params\": " << endl;
settings << " {" << endl;
settings << " \"timestamp_format\": \"" << featCalcParams.timeStampFormat << "\"," << endl;
settings << " \"timestamp_length\": " << featCalcParams.timeStampLength << "," << endl;
settings << " \"timestamp_start_pos\": " << featCalcParams.timeStampStartPos << "," << endl;
settings << " \"timestamp_type\": " << featCalcParams.timeStampType << "," << endl;
settings << " \"area_rois\": " << endl;
settings << " [" << endl;
for ( size_t i = 0; i < featCalcParams.areaROIs.size(); ++i )
{
settings << " {" << endl;
settings << " \"color_blue\":" << static_cast< int >( featCalcParams.areaROIs[ i ].color.val[ 0 ] ) << "," << endl;
settings << " \"color_green\":" << static_cast< int >( featCalcParams.areaROIs[ i ].color.val[ 1 ] ) << "," << endl;
settings << " \"color_red\":" << static_cast< int >( featCalcParams.areaROIs[ i ].color.val[ 2 ] ) << "," << endl;
settings << " \"name\": \"" << featCalcParams.areaROIs[ i ].name << "\"," << endl;
settings << " \"roi_type\": \"" << featCalcParams.areaROIs[ i ].roi_type << "\"," << endl;
settings << " \"ellipse_center_x\":" << featCalcParams.areaROIs[ i ].rotRect.center.x << "," << endl;
settings << " \"ellipse_center_y\":" << featCalcParams.areaROIs[ i ].rotRect.center.y << "," << endl;
settings << " \"ellipse_width\":" << featCalcParams.areaROIs[ i ].rotRect.size.width << "," << endl;
settings << " \"ellipse_height\":" << featCalcParams.areaROIs[ i ].rotRect.size.height << "," << endl;
settings << " \"ellipse_angle\":" << featCalcParams.areaROIs[ i ].rotRect.angle << "," << endl;
settings << " \"contour_pts\": " << endl;
settings << " [";
for ( size_t j = 0; j < featCalcParams.areaROIs[ i ].contour.size(); ++j )
{
settings << featCalcParams.areaROIs[ i ].contour[ j ];
if ( featCalcParams.areaROIs[ i ].contour.size() - 1 > i )
{
settings << ",";
}
}
settings << "]" << endl;
settings << " }" << endl;
if ( featCalcParams.areaROIs.size() - 1 > i )
{
settings << ",";
}
settings << endl;
}
settings << " ]" << endl;
settings << " }" << endl;
settings << "}" << endl;
}
settings.close();
}
catch( const boost::exception &e )
{
FILE_LOG( logERROR ) << "[VisAppFeats::WriteSettings] " << diagnostic_information( e );
retVal = GC_EXCEPT;
}
return retVal;
}
} // namespace gc
| 40.626911 | 139 | 0.503425 | [
"vector"
] |
99d769938b65ddd3b5bd29e9e0ad27916549916a | 3,475 | cpp | C++ | archives/codelibraries/CompetitiveProgramming-master/code/graph/blossom.cpp | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | archives/codelibraries/CompetitiveProgramming-master/code/graph/blossom.cpp | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | archives/codelibraries/CompetitiveProgramming-master/code/graph/blossom.cpp | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 1 | 2021-05-29T14:21:33.000Z | 2021-05-29T14:21:33.000Z | #define MAXV 300
bool marked[MAXV], emarked[MAXV][MAXV];
int S[MAXV];
vi find_augmenting_path(const vector<vi> &adj,const vi &m){
int n = size(adj), s = 0;
vi par(n,-1), height(n), root(n,-1), q, a, b;
memset(marked,0,sizeof(marked));
memset(emarked,0,sizeof(emarked));
rep(i,0,n) if (m[i] >= 0) emarked[i][m[i]] = true;
else root[i] = i, S[s++] = i;
while (s) {
int v = S[--s];
iter(wt,adj[v]) {
int w = *wt;
if (emarked[v][w]) continue;
if (root[w] == -1) {
int x = S[s++] = m[w];
par[w]=v, root[w]=root[v], height[w]=height[v]+1;
par[x]=w, root[x]=root[w], height[x]=height[w]+1;
} else if (height[w] % 2 == 0) {
if (root[v] != root[w]) {
while (v != -1) q.push_back(v), v = par[v];
reverse(q.begin(), q.end());
while (w != -1) q.push_back(w), w = par[w];
return q;
} else {
int c = v;
while (c != -1) a.push_back(c), c = par[c];
c = w;
while (c != -1) b.push_back(c), c = par[c];
while (!a.empty()&&!b.empty()&&a.back()==b.back())
c = a.back(), a.pop_back(), b.pop_back();
memset(marked,0,sizeof(marked));
fill(par.begin(), par.end(), 0);
iter(it,a) par[*it] = 1; iter(it,b) par[*it] = 1;
par[c] = s = 1;
rep(i,0,n) root[par[i] = par[i] ? 0 : s++] = i;
vector<vi> adj2(s);
rep(i,0,n) iter(it,adj[i]) {
if (par[*it] == 0) continue;
if (par[i] == 0) {
if (!marked[par[*it]]) {
adj2[par[i]].push_back(par[*it]);
adj2[par[*it]].push_back(par[i]);
marked[par[*it]] = true; }
} else adj2[par[i]].push_back(par[*it]); }
vi m2(s, -1);
if (m[c] != -1) m2[m2[par[m[c]]] = 0] = par[m[c]];
rep(i,0,n) if(par[i]!=0&&m[i]!=-1&&par[m[i]]!=0)
m2[par[i]] = par[m[i]];
vi p = find_augmenting_path(adj2, m2);
int t = 0;
while (t < size(p) && p[t]) t++;
if (t == size(p)) {
rep(i,0,size(p)) p[i] = root[p[i]];
return p; }
if (!p[0] || (m[c] != -1 && p[t+1] != par[m[c]]))
reverse(p.begin(), p.end()), t = size(p)-t-1;
rep(i,0,t) q.push_back(root[p[i]]);
iter(it,adj[root[p[t-1]]]) {
if (par[*it] != (s = 0)) continue;
a.push_back(c), reverse(a.begin(), a.end());
iter(jt,b) a.push_back(*jt);
while (a[s] != *it) s++;
if ((height[*it] & 1) ^ (s < size(a) - size(b)))
reverse(a.begin(), a.end()), s = size(a)-s-1;
while(a[s]!=c)q.push_back(a[s]),s=(s+1)%size(a);
q.push_back(c);
rep(i,t+1,size(p)) q.push_back(root[p[i]]);
return q; } } }
emarked[v][w] = emarked[w][v] = true; }
marked[v] = true; } return q; }
vii max_matching(const vector<vi> &adj) {
vi m(size(adj), -1), ap; vii res, es;
rep(i,0,size(adj)) iter(it,adj[i]) es.emplace_back(i,*it);
random_shuffle(es.begin(), es.end());
iter(it,es) if (m[it->first] == -1 && m[it->second] == -1)
m[it->first] = it->second, m[it->second] = it->first;
do { ap = find_augmenting_path(adj, m);
rep(i,0,size(ap)) m[m[ap[i^1]] = ap[i]] = ap[i^1];
} while (!ap.empty());
rep(i,0,size(m)) if (i < m[i]) res.emplace_back(i, m[i]);
return res; }
// vim: cc=60 ts=2 sts=2 sw=2:
| 40.882353 | 60 | 0.446043 | [
"vector"
] |
99d7d3ec7537ab99e2942ef78ae1c3d577445ee4 | 2,439 | cpp | C++ | Engine/Graphics/GameObject3D.cpp | GCourtney27/Retina-Engine | 5358b9c499f4163a209024dc303c3efe6c520c01 | [
"MIT"
] | null | null | null | Engine/Graphics/GameObject3D.cpp | GCourtney27/Retina-Engine | 5358b9c499f4163a209024dc303c3efe6c520c01 | [
"MIT"
] | null | null | null | Engine/Graphics/GameObject3D.cpp | GCourtney27/Retina-Engine | 5358b9c499f4163a209024dc303c3efe6c520c01 | [
"MIT"
] | null | null | null | #include "GameObject3D.h"
void GameObject3D::SetLookAtPos(DirectX::XMFLOAT3 lookAtPos)
{
// Verify that look at pos is not the same as Model pos. They cannot be the same as that wouldn't make sense and would result in undefined behavior
if (lookAtPos.x == pos.x && lookAtPos.y == pos.y && lookAtPos.z == pos.z)
{
return;
}
lookAtPos.x = pos.x - lookAtPos.x;
lookAtPos.y = pos.y - lookAtPos.y;
lookAtPos.z = pos.z - lookAtPos.z;
float pitch = 0.0f;
if (lookAtPos.y != 0.0f)
{
const float distance = sqrt(lookAtPos.x * lookAtPos.x + lookAtPos.z * lookAtPos.z);
pitch = atan(lookAtPos.y / distance);
}
float yaw = 0.0f;
if (lookAtPos.x != 0.0f)
{
yaw = atan(lookAtPos.x / lookAtPos.z);
}
if (lookAtPos.z > 0)
{
yaw += XM_PI;
}
SetRotation(pitch, yaw, 0.0f);
}
const XMVECTOR & GameObject3D::GetForwardVector(bool omitY)
{
if (omitY)
return vec_forward_noY;
else
return vec_forward;
}
const XMVECTOR & GameObject3D::GetRightVector(bool omitY)
{
if (omitY)
return vec_right_noY;
else
return vec_right;
}
const XMVECTOR & GameObject3D::GetUpVector()
{
return DEFAULT_UP_VECTOR;
}
const XMVECTOR & GameObject3D::GetDownVector()
{
return DEFAULT_DOWN_VECTOR;
}
const XMVECTOR & GameObject3D::GetBackwardVector(bool omitY)
{
if (omitY)
return vec_backward_noY;
else
return vec_backward;
}
const XMVECTOR & GameObject3D::GetLeftVector(bool omitY)
{
if (omitY)
return vec_left_noY;
else
return vec_left;
}
void GameObject3D::UpdateMatrix()
{
assert("UpdataMatrix must be overriden" && 0);
}
void GameObject3D::UpdateDirectionVectors()
{
XMMATRIX vecRotationMatrix = XMMatrixRotationRollPitchYaw(rot.x, rot.y, 0.0f);
vec_forward = XMVector3TransformCoord(DEFAULT_FOREWARD_VECTOR, vecRotationMatrix);
vec_backward = XMVector3TransformCoord(DEFAULT_BACKWARD_VECTOR, vecRotationMatrix);
vec_left = XMVector3TransformCoord(DEFAULT_LEFT_VECTOR, vecRotationMatrix);
vec_right = XMVector3TransformCoord(DEFAULT_RIGHT_VECTOR, vecRotationMatrix);
XMMATRIX vecRotationMatrixNoY = XMMatrixRotationRollPitchYaw(0.0f, rot.y, 0.0f);
vec_forward_noY = XMVector3TransformCoord(DEFAULT_FOREWARD_VECTOR, vecRotationMatrixNoY);
vec_backward_noY = XMVector3TransformCoord(DEFAULT_BACKWARD_VECTOR, vecRotationMatrixNoY);
vec_left_noY = XMVector3TransformCoord(DEFAULT_LEFT_VECTOR, vecRotationMatrixNoY);
vec_right_noY = XMVector3TransformCoord(DEFAULT_RIGHT_VECTOR, vecRotationMatrixNoY);
}
| 25.14433 | 148 | 0.760968 | [
"model"
] |
99dbec73fab7913f51275864b20edfbf856811d5 | 5,297 | cpp | C++ | EBUCoreProcessor/src/EBUCore_1_4/metadata/base/ebucoreSubjectBase.cpp | Limecraft/ebu-mxfsdk | d2461c778f7980c4e116a53123c2ba744b1362a0 | [
"Apache-2.0"
] | 20 | 2015-02-24T23:54:23.000Z | 2022-03-29T12:42:32.000Z | EBUCoreProcessor/src/EBUCore_1_4/metadata/base/ebucoreSubjectBase.cpp | ebu/ebu-mxfsdk | d66e4b05354ec2b80365f1956f14678c6f7f6514 | [
"Apache-2.0"
] | 1 | 2018-10-26T00:44:05.000Z | 2018-10-26T00:44:05.000Z | EBUCoreProcessor/src/EBUCore_1_4/metadata/base/ebucoreSubjectBase.cpp | ebu/ebu-mxfsdk | d66e4b05354ec2b80365f1956f14678c6f7f6514 | [
"Apache-2.0"
] | 6 | 2015-02-05T09:54:14.000Z | 2022-02-26T20:56:32.000Z | /*
* Copyright 2012-2013 European Broadcasting Union and Limecraft, NV.
*
* 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.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <memory>
#include <libMXF++/MXF.h>
#include <EBUCore_1_4/metadata/EBUCoreDMS++.h>
using namespace std;
using namespace mxfpp;
using namespace EBUSDK::EBUCore::EBUCore_1_4::KLV;
const mxfKey ebucoreSubjectBase::setKey = MXF_SET_K(ebucoreSubject);
ebucoreSubjectBase::ebucoreSubjectBase(HeaderMetadata *headerMetadata)
: InterchangeObject(headerMetadata, headerMetadata->createCSet(&setKey))
{
headerMetadata->add(this);
}
ebucoreSubjectBase::ebucoreSubjectBase(HeaderMetadata *headerMetadata, ::MXFMetadataSet *cMetadataSet)
: InterchangeObject(headerMetadata, cMetadataSet)
{}
ebucoreSubjectBase::~ebucoreSubjectBase()
{}
bool ebucoreSubjectBase::havesubjectCode() const
{
return haveItem(&MXF_ITEM_K(ebucoreSubject, subjectCode));
}
std::string ebucoreSubjectBase::getsubjectCode() const
{
return getStringItem(&MXF_ITEM_K(ebucoreSubject, subjectCode));
}
bool ebucoreSubjectBase::havesubjectNote() const
{
return haveItem(&MXF_ITEM_K(ebucoreSubject, subjectNote));
}
std::string ebucoreSubjectBase::getsubjectNote() const
{
return getStringItem(&MXF_ITEM_K(ebucoreSubject, subjectNote));
}
bool ebucoreSubjectBase::havesubjectValue() const
{
return haveItem(&MXF_ITEM_K(ebucoreSubject, subjectValue));
}
std::vector<ebucoreTextualAnnotation*> ebucoreSubjectBase::getsubjectValue() const
{
vector<ebucoreTextualAnnotation*> result;
auto_ptr<ObjectIterator> iter(getStrongRefArrayItem(&MXF_ITEM_K(ebucoreSubject, subjectValue)));
while (iter->next())
{
MXFPP_CHECK(dynamic_cast<ebucoreTextualAnnotation*>(iter->get()) != 0);
result.push_back(dynamic_cast<ebucoreTextualAnnotation*>(iter->get()));
}
return result;
}
bool ebucoreSubjectBase::havesubjectDefinition() const
{
return haveItem(&MXF_ITEM_K(ebucoreSubject, subjectDefinition));
}
std::vector<ebucoreTextualAnnotation*> ebucoreSubjectBase::getsubjectDefinition() const
{
vector<ebucoreTextualAnnotation*> result;
auto_ptr<ObjectIterator> iter(getStrongRefArrayItem(&MXF_ITEM_K(ebucoreSubject, subjectDefinition)));
while (iter->next())
{
MXFPP_CHECK(dynamic_cast<ebucoreTextualAnnotation*>(iter->get()) != 0);
result.push_back(dynamic_cast<ebucoreTextualAnnotation*>(iter->get()));
}
return result;
}
bool ebucoreSubjectBase::havesubjectTypeGroup() const
{
return haveItem(&MXF_ITEM_K(ebucoreSubject, subjectTypeGroup));
}
ebucoreTypeGroup* ebucoreSubjectBase::getsubjectTypeGroup() const
{
auto_ptr<MetadataSet> obj(getStrongRefItem(&MXF_ITEM_K(ebucoreSubject, subjectTypeGroup)));
MXFPP_CHECK(dynamic_cast<ebucoreTypeGroup*>(obj.get()) != 0);
return dynamic_cast<ebucoreTypeGroup*>(obj.release());
}
bool ebucoreSubjectBase::havesubjectAttributorEntity() const
{
return haveItem(&MXF_ITEM_K(ebucoreSubject, subjectAttributorEntity));
}
ebucoreEntity* ebucoreSubjectBase::getsubjectAttributorEntity() const
{
auto_ptr<MetadataSet> obj(getStrongRefItem(&MXF_ITEM_K(ebucoreSubject, subjectAttributorEntity)));
MXFPP_CHECK(dynamic_cast<ebucoreEntity*>(obj.get()) != 0);
return dynamic_cast<ebucoreEntity*>(obj.release());
}
void ebucoreSubjectBase::setsubjectCode(std::string value)
{
setStringItem(&MXF_ITEM_K(ebucoreSubject, subjectCode), value);
}
void ebucoreSubjectBase::setsubjectNote(std::string value)
{
setStringItem(&MXF_ITEM_K(ebucoreSubject, subjectNote), value);
}
void ebucoreSubjectBase::setsubjectValue(const std::vector<ebucoreTextualAnnotation*>& value)
{
WrapObjectVectorIterator<ebucoreTextualAnnotation> iter(value);
setStrongRefArrayItem(&MXF_ITEM_K(ebucoreSubject, subjectValue), &iter);
}
void ebucoreSubjectBase::appendsubjectValue(ebucoreTextualAnnotation* value)
{
appendStrongRefArrayItem(&MXF_ITEM_K(ebucoreSubject, subjectValue), value);
}
void ebucoreSubjectBase::setsubjectDefinition(const std::vector<ebucoreTextualAnnotation*>& value)
{
WrapObjectVectorIterator<ebucoreTextualAnnotation> iter(value);
setStrongRefArrayItem(&MXF_ITEM_K(ebucoreSubject, subjectDefinition), &iter);
}
void ebucoreSubjectBase::appendsubjectDefinition(ebucoreTextualAnnotation* value)
{
appendStrongRefArrayItem(&MXF_ITEM_K(ebucoreSubject, subjectDefinition), value);
}
void ebucoreSubjectBase::setsubjectTypeGroup(ebucoreTypeGroup* value)
{
setStrongRefItem(&MXF_ITEM_K(ebucoreSubject, subjectTypeGroup), value);
}
void ebucoreSubjectBase::setsubjectAttributorEntity(ebucoreEntity* value)
{
setStrongRefItem(&MXF_ITEM_K(ebucoreSubject, subjectAttributorEntity), value);
}
| 31.158824 | 105 | 0.772135 | [
"vector"
] |
99e0739f9d00ef41812b06a07e15b50a400e957d | 4,673 | hh | C++ | src/summertest/AnalyticElasticityBase.hh | sebnaran/3DVEMforMHD | 83578463d3c9a31a77c209adb583eafe46f08b81 | [
"MIT"
] | null | null | null | src/summertest/AnalyticElasticityBase.hh | sebnaran/3DVEMforMHD | 83578463d3c9a31a77c209adb583eafe46f08b81 | [
"MIT"
] | null | null | null | src/summertest/AnalyticElasticityBase.hh | sebnaran/3DVEMforMHD | 83578463d3c9a31a77c209adb583eafe46f08b81 | [
"MIT"
] | null | null | null | /*
Operators
Copyright 2010-201x held jointly by LANS/LANL, LBNL, and PNNL.
Amanzi is released under the three-clause BSD License.
The terms of use and "as is" disclaimer for this license are
provided in the top-level COPYRIGHT file.
Author: Konstantin Lipnikov (lipnikov@lanl.gov)
Base class for testing elasticity and Stokes-type problems.
*/
#ifndef AMANZI_OPERATOR_ANALYTIC_ELASTICITY_BASE_HH_
#define AMANZI_OPERATOR_ANALYTIC_ELASTICITY_BASE_HH_
#include "CompositeVector.hh"
#include "CompositeVectorSpace.hh"
#include "Mesh.hh"
class AnalyticElasticityBase {
public:
AnalyticElasticityBase(Teuchos::RCP<const Amanzi::AmanziMesh::Mesh> mesh) : mesh_(mesh) {
nnodes_owned = mesh_->num_entities(Amanzi::AmanziMesh::NODE, Amanzi::AmanziMesh::Parallel_type::OWNED);
ncells_owned = mesh_->num_entities(Amanzi::AmanziMesh::CELL, Amanzi::AmanziMesh::Parallel_type::OWNED);
nnodes_wghost = mesh_->num_entities(Amanzi::AmanziMesh::NODE, Amanzi::AmanziMesh::Parallel_type::ALL);
ncells_wghost = mesh_->num_entities(Amanzi::AmanziMesh::NODE, Amanzi::AmanziMesh::Parallel_type::ALL);
};
~AnalyticElasticityBase() {};
// analytic solution for elasticity-type problem
// -- stiffness/elasticity tensor T
virtual Amanzi::WhetStone::Tensor Tensor(const Amanzi::AmanziGeometry::Point& p, double t) = 0;
// -- analytic solution
virtual Amanzi::AmanziGeometry::Point velocity_exact(const Amanzi::AmanziGeometry::Point& p, double t) = 0;
virtual double pressure_exact(const Amanzi::AmanziGeometry::Point& p, double t) = 0;
// -- source term
virtual Amanzi::AmanziGeometry::Point source_exact(const Amanzi::AmanziGeometry::Point& p, double t) = 0;
// error calculation
// -- velocity
void ComputeNodeError(Amanzi::CompositeVector& u, double t, double& unorm, double& l2_err, double& inf_err) {
unorm = 0.0;
l2_err = 0.0;
inf_err = 0.0;
// calculate nodal volumes
Amanzi::AmanziMesh::Entity_ID_List nodes;
Teuchos::RCP<Amanzi::CompositeVectorSpace> cvs = Teuchos::rcp(new Amanzi::CompositeVectorSpace());
cvs->SetMesh(mesh_)->SetGhosted(true)
->AddComponent("node", Amanzi::AmanziMesh::NODE, 1);
Amanzi::CompositeVector vol(*cvs);
Epetra_MultiVector& vol_node = *vol.ViewComponent("node", true);
vol.PutScalar(0.0);
for (int c = 0; c != ncells_owned; ++c) {
mesh_->cell_get_nodes(c, &nodes);
int nnodes = nodes.size();
for (int i = 0; i < nnodes; i++) {
vol_node[0][nodes[i]] += mesh_->cell_volume(c) / nnodes;
}
}
vol.GatherGhostedToMaster("node");
// calculate errors
int d = mesh_->space_dimension();
Amanzi::AmanziGeometry::Point p(d), ucalc(d);
Epetra_MultiVector& u_node = *u.ViewComponent("node");
for (int v = 0; v < nnodes_owned; ++v) {
mesh_->node_get_coordinates(v, &p);
const Amanzi::AmanziGeometry::Point& uexact = velocity_exact(p, t);
for (int i = 0; i < d; ++i) ucalc[i] = u_node[i][v];
double tmp = L22(ucalc - uexact);
l2_err += tmp * vol_node[0][v];
inf_err = std::max(inf_err, sqrt(tmp));
unorm += L22(uexact) * vol_node[0][v];
// std::cout << v << " uh=" << ucalc << " ex=" << uexact << std::endl;
}
#ifdef HAVE_MPI
double tmp = unorm;
mesh_->get_comm()->SumAll(&tmp, &unorm, 1);
tmp = l2_err;
mesh_->get_comm()->SumAll(&tmp, &l2_err, 1);
tmp = inf_err;
mesh_->get_comm()->MaxAll(&tmp, &inf_err, 1);
#endif
unorm = sqrt(unorm);
l2_err = sqrt(l2_err);
}
// -- pressure
void ComputeCellError(Amanzi::CompositeVector& p, double t, double& pnorm, double& l2_err, double& inf_err) {
pnorm = 0.0;
l2_err = 0.0;
inf_err = 0.0;
Epetra_MultiVector& p_cell = *p.ViewComponent("cell");
for (int c = 0; c < ncells_owned; ++c) {
const Amanzi::AmanziGeometry::Point& xm = mesh_->cell_centroid(c);
double area = mesh_->cell_volume(c);
double pexact = pressure_exact(xm, t);
double tmp = fabs(p_cell[0][c] - pexact);
l2_err += tmp * tmp * area;
inf_err = std::max(inf_err, tmp);
pnorm += pexact * pexact * area;
// std::cout << c << " ph=" << p_cell[0][c] << " ex=" << pexact << std::endl;
}
#ifdef HAVE_MPI
double tmp = pnorm;
mesh_->get_comm()->SumAll(&tmp, &pnorm, 1);
tmp = l2_err;
mesh_->get_comm()->SumAll(&tmp, &l2_err, 1);
tmp = inf_err;
mesh_->get_comm()->MaxAll(&tmp, &inf_err, 1);
#endif
pnorm = sqrt(pnorm);
l2_err = sqrt(l2_err);
}
protected:
Teuchos::RCP<const Amanzi::AmanziMesh::Mesh> mesh_;
int nnodes_owned, ncells_owned, nnodes_wghost, ncells_wghost;
};
#endif
| 33.862319 | 111 | 0.658678 | [
"mesh"
] |
99e923a2308ffa9a089c02bdb49b43363ceb21b8 | 11,024 | cpp | C++ | rinex3.cpp | mauriciodev/gnssLearn | 5b3fe2e0146651f16ac37f734f37e135f06b5dc8 | [
"MIT"
] | null | null | null | rinex3.cpp | mauriciodev/gnssLearn | 5b3fe2e0146651f16ac37f734f37e135f06b5dc8 | [
"MIT"
] | null | null | null | rinex3.cpp | mauriciodev/gnssLearn | 5b3fe2e0146651f16ac37f734f37e135f06b5dc8 | [
"MIT"
] | null | null | null | #include "rinex3.h"
rinex3::rinex3()
{
this->fillSystemDelay();
}
QVector<double> rinex3::readNavDoubles(QString in) {
//returns
QVector<double> res;
while (in.length() > 0) {
res.append(in.left(19).toDouble());
in=in.mid(19);
}
return res;
}
QVector<double> rinex3::readObsDoubles(QString in) {
//returns
QVector<double> res;
while (in.length() > 0) {
res.append(in.left(14).toDouble());
in=in.mid(16); //skipping loss of lock and signal strength digits
}
return res;
}
/*! Newton Raphson's solve for the elevation angle .
* x(i+1) = x(i) - f(x) / f'(x) */
double rinex3::solveEk(double e, double Mk)
{
double EPSILON=0.0001;
double x=0;
double h = 10;
while (abs(h) >= EPSILON)
{
double fx=Mk+e*sin(x)-x;
double dfx=e*cos(x)-1;
h = fx/dfx;
x = x - h;
}
return x;
}
/*! Reads a Rinex 3 navigation file and saves the data on the navDataEpochs map.
* A pair of PRN (Ex.: E31) and qdatetime is used as index for each satellite epoch.*/
bool rinex3::readNavFile(QString filePath)
{
QFile file(filePath);
if(!file.open(QIODevice::ReadOnly)) {
qDebug() << "Error: " << file.errorString();
return false;
}
QTextStream in(&file);
//skip header
QString line="";
this->navHeader.clear();
while(!in.atEnd() and !line.contains("END OF HEADER")) {
line = in.readLine();
this->navHeader.append(line);
}
QDateTime epoch;
QString satName;
//reading epochs
this->navDataEpochs.clear();
while(!in.atEnd()) {
QVector<double> dvalues;
line = in.readLine();
if (line[0].isLetter()) {
//This is a new satellite epoch "M1d1y9800:01:02",
satName=line.mid(0,4).trimmed();
//epoch.addSecs(this->getSystemDelay(satName));
if (!this->ignoreSystems.contains(satName[0])) {
QString ds=line.mid(4, 19);
epoch=QDateTime::fromString(ds, this->rinexDateFormatString());
QString values=line.mid(23);
dvalues.append(this->readNavDoubles(values));
this->setNavData(satName,epoch,dvalues);
//qDebug() << satName << epoch << this->navDataEpochs[satName].size();
}
} else {
//these is more data for the epoch
QString values=line.mid(4);
if (!this->ignoreSystems.contains(satName[0])) {
this->setNavData(satName,epoch,this->readNavDoubles(values));
}
}
}
file.close();
return true;
}
/*! Reads a Rinex 3 observation file and saves the data on the navDataEpochs map.
* A pair of PRN (Ex.: E31) and qdatetime is used as index for each satellite epoch.*/
bool rinex3::readObsFile(QString filePath)
{
QFile file(filePath);
if(!file.open(QIODevice::ReadOnly)) {
qDebug() << "Error: " << file.errorString();
return false;
}
QTextStream in(&file);
//skip header
QString line="";
QString currSystem="";
this->obsHeader.clear();
while(!in.atEnd() and !line.contains("END OF HEADER")) {
line = in.readLine();
this->obsHeader.append(line);
if (line.contains("SYS / # / OBS TYPES")) {
//Filling what kind of codes each system describes.
QString t=line.mid(7,line.indexOf("SYS")-8).trimmed();
if (line[0]!=" ") { //new system
currSystem=line[0];
obsTypes[currSystem]=t.split(" ");
} else { //line continuing the current system
obsTypes[currSystem].append(t.split(" "));
}
//qDebug()<<currSystem << ": "<< obsTypes[currSystem];
}
}
QDateTime epoch;
QString satName;
//reading epochs
obsDataEpochs.clear();
while(!in.atEnd()) {
QVector<double> dvalues;
line = in.readLine();
if (line[0]=='>') {
//This is a new satellite epoch
epoch=QDateTime::fromString( line.mid(2, 19), this->rinexDateFormatString());
int msec=line.mid(22,7).toInt();
epoch=epoch.addMSecs(msec);
} else {
//these are more data for the epoch
QString values=line.mid(3);
satName=line.left(3); //prn
dvalues.append(this->readObsDoubles(values));
obsDataEpochs[epoch][satName]=dvalues;
}
}
file.close();
return true;
}
bool rinex3::isPhase(QString obsType)
{
return (obsType[0]=='L');
}
bool rinex3::isCode(QString obsType)
{
return (obsType[0]=='C');
}
/*! Returns a string that can be used to transforms RINEX's date as text to QDateTime.*/
QString rinex3::rinexDateFormatString()
{
return "yyyy MM dd hh mm ss";
}
/*! This method should work for all systems.*/
double rinex3::getClockBias(QString sat, QDateTime epoch)
{
auto it=this->getLatestEpochIter(sat,epoch);
return (*it)[0];
}
VectorXd rinex3::getClockBiasVector(QStringList sats, QDateTime epoch) {
VectorXd v;
v.resize(sats.length());
for (int i=0; i<sats.length(); i++){
v[i]=this->getClockBias(sats[i],epoch);
}
return v;
}
/*! Returns a vector of doubles with the satellite coordinates at a given time. If computations fail, returns an empty vector.*/
Vector4d rinex3::getSatPosition(QString sat, QDateTime ttDate)
{
Vector4d coords=Vector4d::Zero();
if (! this->ignoreSystems.contains(this->getSatType(sat))) {
//I should be searching for the latest epoch here. Not sure what to do.
auto latestEpochIter=this->getLatestEpochIter(sat,ttDate);
if (latestEpochIter.key()>ttDate) {
qDebug()<<"Could not find satellite data for "<<sat<<" at "<<ttDate;
return coords; // empty vector
}
QVector<double> nav=(*latestEpochIter);
QDateTime tocDate=latestEpochIter.key();
double toc=gnsstime::getGPSTimeOfWeek(tocDate);
double toe=nav[11];
double tt=gnsstime::getGPSTimeOfWeek(ttDate);
//from Monico (2008) chapter 4
double dtSat=nav[0]+nav[1]*(tt-toc)+nav[2]* pow(tt-toc ,2);
double t_gps=tt-dtSat;
double dtk=t_gps-toe;
if (dtk>302400) dtk-=604800;
if (dtk<-302400) dtk+=604800;
double crs=nav[4];
double dn=nav[5];
double M0=nav[6];
double cuc=nav[7];
double e=nav[8];
double cus=nav[9];
double srqt_a=nav[10];
double cic=nav[12];
double OMEGA=nav[13];
double cis=nav[14];
double i0=nav[15];
double crc=nav[16];
double w=nav[17];
double OMEGA_DOT=nav[18];
double IDOT=nav[19];
double Mk=M0+(sqrt(GM)/pow(srqt_a,3)+dn)*dtk;
double Ek=this->solveEk(e,Mk); //newton raphson, really?
double cosv=(cos(Ek)-e)/(1-e*cos(Ek));
double sinv=sqrt(1-e*e)*sin(Ek)/(1-e*cos(Ek));
double v=acos(cosv);
if (sinv<0) v=v*-1.;
if (v<0) v+=2*PI;
double phi=w+v;
double uk=phi+cuc*cos(2*phi)+cus*sin(2*phi);
double r=srqt_a*srqt_a*(1-e*cos(Ek))+crc*cos(2*phi)+crs*sin(2*phi);
double i=i0+IDOT*dtk+cic*cos(2*phi)+cis*sin(2*phi);
double xk=r*cos(uk);
double yk=r*sin(uk);
double om=OMEGA+(OMEGA_DOT)*dtk-omega_e*t_gps;
double X=xk*cos(om)-yk*sin(om)*cos(i);
double Y=xk*sin(om)+yk*cos(om)*cos(i);
double Z=yk*sin(i);
//qDebug()<<fixed << sat<< X << Y << Z;
coords={X,Y,Z,dtSat};
}
return coords;
}
QString rinex3::getSatType(QString sat)
{
return sat.at(0);
}
QVector<double> rinex3::getLatestNavData(QString sat, QDateTime epoch)
{
auto latestEpoch= this->navDataEpochs[sat].lowerBound(epoch); //this is an iterator
return (*latestEpoch);
}
/*! This method sets up the leap seconds to be used later when syncronizing observations and ephemeris. This could be changed for a QSettings or a json file later.*/
void rinex3::fillSystemDelay(int leapSeconds)
{
//TODO: Check these values
this->GNSSToUTCDelay["G"]=leapSeconds-19;
this->GNSSToUTCDelay["E"]=leapSeconds-13;
this->GNSSToUTCDelay["R"]=0;
this->GNSSToUTCDelay["C"]=leapSeconds;
}
double rinex3::getSystemDelay(QString systemChar)
{
return this->GNSSToUTCDelay[systemChar.at(0)];
}
MatrixXd rinex3::getSatPositionMatrix(QStringList sats, QDateTime epoch)
{
MatrixXd m;
m.resize(sats.length(),4);
for (int i=0;i<sats.length(); i++){
auto v = this->getSatPosition(sats[i],epoch);
if (v==Vector4d::Zero()) { //sorry, couldn't find a sattelite position. This should be aborted.
return m;
} else {
//qDebug() << sats[i] << v ;
m(i,0)=v[0];
m(i,1)=v[1];
m(i,2)=v[2];
m(i,3)=v[3];
}
}
return m;
}
QStringList rinex3::getObsSatellitesOnEpoch(QDateTime epoch)
{
QStringList sats=this->obsDataEpochs[epoch].keys();
for (int i=sats.length()-1; i>-1;i--) {
if ( this->ignoreSystems.contains(sats[i][0])) {
sats.removeAt(i);
}
}
return sats;
}
QVector<double> rinex3::getObs(QString sat, QDateTime epoch)
{
if (this->obsDataEpochs[epoch].contains(sat)) {
QVector<double> values=this->obsDataEpochs[epoch][sat];
return values;
} else {
QVector<double> res;
return res;
}
}
/*! Returns a map with observable names to observable. */
QMap<QString, double> rinex3::getObsMap(QString sat, QDateTime epoch)
{
QMap<QString, double> res;
if (this->obsDataEpochs[epoch].contains(sat)) {
QVector<double> values=this->obsDataEpochs[epoch][sat];
for (int i=0;i<values.length();i++) {
QString obsName=this->obsTypes[sat.left(1)][i];
res.insert(obsName,values[i]);
}
}
return res;
}
/*! Returns the value of a single observable. */
double rinex3::getObs(QString sat, QDateTime epoch, QString observable)
{
if (this->obsDataEpochs[epoch].contains(sat)) {
int obsIndex=this->obsTypes[sat.left(1)].indexOf(observable);
return this->obsDataEpochs[epoch][sat][obsIndex];
}
return 0;
}
Vector3d rinex3::getX0()
{
Vector3d X0; X0<<0,0,0;
foreach (QString line, this->obsHeader) {
if (line.contains("APPROX POSITION XYZ")){
auto parts=line.split(" ",QString::SkipEmptyParts);
X0[0]=parts[0].toDouble();
X0[1]=parts[1].toDouble();
X0[2]=parts[2].toDouble();
return X0;
}
}
return X0;
}
/*! Returns a 1xN vector containing only the P1 observable for each satellite on the list.*/
VectorXd rinex3::getC1Vector(QStringList sats, QDateTime epoch) {
VectorXd v;
v.resize(sats.length());
for (int i=0;i<sats.length(); i++){
v[i]=this->obsDataEpochs[epoch][sats[i]][0];
}
return v;
}
| 28.708333 | 165 | 0.588353 | [
"vector"
] |
99ec664b4e91f3e92debc46a093ed08e92cca477 | 38,796 | cpp | C++ | source/Lib/CommonLib/TrQuant_EMT.cpp | kaixinzuochuxi/VTM-2.2-initial-QP | 0d12b27db20ab6ee77c3704b63b1ddf1abe43d34 | [
"BSD-3-Clause"
] | null | null | null | source/Lib/CommonLib/TrQuant_EMT.cpp | kaixinzuochuxi/VTM-2.2-initial-QP | 0d12b27db20ab6ee77c3704b63b1ddf1abe43d34 | [
"BSD-3-Clause"
] | null | null | null | source/Lib/CommonLib/TrQuant_EMT.cpp | kaixinzuochuxi/VTM-2.2-initial-QP | 0d12b27db20ab6ee77c3704b63b1ddf1abe43d34 | [
"BSD-3-Clause"
] | null | null | null | /* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2018, ITU/ISO/IEC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the ITU/ISO/IEC 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.
*/
/** \file TrQuant_EMT.cpp
\brief transform and quantization class
*/
#include "TrQuant_EMT.h"
#include "Rom.h"
#include <stdlib.h>
#include <math.h>
#include <limits>
#include <memory.h>
// ********************************** DCT-II **********************************
//Fast DCT-II transforms
void fastForwardDCT2_B2(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
int j;
int E, O;
TCoeff add = (shift > 0) ? (1 << (shift - 1)) : 0;
const TMatrixCoeff *iT = g_aiTr2[DCT2][0];
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
for (j = 0; j<reducedLine; j++)
{
/* E and O */
E = src[0] + src[1];
O = src[0] - src[1];
dst[0] = (iT[0] * E + add) >> shift;
dst[line] = (iT[2] * O + add) >> shift;
src += 2;
dst++;
}
if (iSkipLine)
{
dst = pCoef + reducedLine;
for (j = 0; j<2; j++)
{
memset(dst, 0, sizeof(TCoeff)*iSkipLine);
dst += line;
}
}
}
void fastInverseDCT2_B2(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
int j;
int E, O;
int add = 1 << (shift - 1);
const TMatrixCoeff *iT = g_aiTr2[DCT2][0];
const int reducedLine = line - iSkipLine;
for (j = 0; j<reducedLine; j++)
{
/* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
E = iT[0] * (src[0] + src[line]);
O = iT[2] * (src[0] - src[line]);
/* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */
dst[0] = Clip3(outputMinimum, outputMaximum, (E + add) >> shift);
dst[1] = Clip3(outputMinimum, outputMaximum, (O + add) >> shift);
src++;
dst += 2;
}
if (iSkipLine)
{
memset(dst, 0, (iSkipLine << 1) * sizeof(TCoeff));
}
/*TCoeff add = (shift > 0) ? (1 << (shift - 1)) : 0;
#define T(a,b) ( (TCoeff)( g_aiT2[ TRANSFORM_INVERSE ][ a ][ b ] ) * src[ a * line ] )
for (int j = 0; j < line; j++, src++, dst += 2)
{
dst[0] = Clip3(outputMinimum, outputMaximum, (T(0, 0) + T(1, 0) + add) >> shift);
dst[1] = Clip3(outputMinimum, outputMaximum, (T(0, 1) + T(1, 1) + add) >> shift);
}
#undef T*/
}
/** 4x4 forward transform implemented using partial butterfly structure (1D)
* \param src input data (residual)
* \param dst output data (transform coefficients)
* \param shift specifies right shift after 1D transform
* \param line
*/
void fastForwardDCT2_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
int j;
TCoeff E[2], O[2];
TCoeff add = (shift > 0) ? (1 << (shift - 1)) : 0;
const TMatrixCoeff *iT = g_aiTr4[DCT2][0];
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
for (j = 0; j<reducedLine; j++)
{
/* E and O */
E[0] = src[0] + src[3];
O[0] = src[0] - src[3];
E[1] = src[1] + src[2];
O[1] = src[1] - src[2];
dst[0] = (iT[0] * E[0] + iT[1] * E[1] + add) >> shift;
dst[2 * line] = (iT[8] * E[0] + iT[9] * E[1] + add) >> shift;
dst[line] = (iT[4] * O[0] + iT[5] * O[1] + add) >> shift;
dst[3 * line] = (iT[12] * O[0] + iT[13] * O[1] + add) >> shift;
src += 4;
dst++;
}
if (iSkipLine)
{
dst = pCoef + reducedLine;
for (j = 0; j<4; j++)
{
memset(dst, 0, sizeof(TCoeff)*iSkipLine);
dst += line;
}
}
}
/** 4x4 inverse transform implemented using partial butterfly structure (1D)
* \param src input data (transform coefficients)
* \param dst output data (residual)
* \param shift specifies right shift after 1D transform
* \param line
* \param outputMinimum minimum for clipping
* \param outputMaximum maximum for clipping
*/
void fastInverseDCT2_B4( const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum )
{
int j;
int E[2], O[2];
int add = 1 << ( shift - 1 );
const TMatrixCoeff *iT = g_aiTr4[DCT2][0];
const int reducedLine = line - iSkipLine;
for( j = 0; j < reducedLine; j++ )
{
/* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
O[0] = iT[1 * 4 + 0] * src[line] + iT[3 * 4 + 0] * src[3 * line];
O[1] = iT[1 * 4 + 1] * src[line] + iT[3 * 4 + 1] * src[3 * line];
E[0] = iT[0 * 4 + 0] * src[ 0] + iT[2 * 4 + 0] * src[2 * line];
E[1] = iT[0 * 4 + 1] * src[ 0] + iT[2 * 4 + 1] * src[2 * line];
/* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */
dst[0] = Clip3( outputMinimum, outputMaximum, ( E[0] + O[0] + add ) >> shift );
dst[1] = Clip3( outputMinimum, outputMaximum, ( E[1] + O[1] + add ) >> shift );
dst[2] = Clip3( outputMinimum, outputMaximum, ( E[1] - O[1] + add ) >> shift );
dst[3] = Clip3( outputMinimum, outputMaximum, ( E[0] - O[0] + add ) >> shift );
src++;
dst += 4;
}
if( iSkipLine )
{
memset( dst, 0, ( iSkipLine << 2 ) * sizeof( TCoeff ) );
}
}
template< int uiTrSize >
inline void _fastInverseMM( const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum, const TMatrixCoeff* iT )
{
const int rnd_factor = 1 << (shift - 1);
const int reducedLine = line - iSkipLine;
const int cutoff = uiTrSize - iSkipLine2;
for( int i = 0; i<reducedLine; i++ )
{
for( int j = 0; j<uiTrSize; j++ )
{
int iSum = 0;
for( int k = 0; k<cutoff; k++)
{
iSum += src[k*line + i] * iT[k*uiTrSize + j];
}
dst[i*uiTrSize + j] = Clip3(outputMinimum, outputMaximum, (int)(iSum + rnd_factor) >> shift);
}
}
if (iSkipLine)
{
memset(dst + (reducedLine*uiTrSize), 0, (iSkipLine*uiTrSize) * sizeof(TCoeff));
}
}
template< int uiTrSize >
inline void _fastForwardMM( const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TMatrixCoeff* tc )
{
const int rnd_factor = 1 << (shift - 1);
const int reducedLine = line - iSkipLine;
const int cutoff = uiTrSize - iSkipLine2;
TCoeff *pCoef;
for( int i = 0; i<reducedLine; i++ )
{
pCoef = dst;
const TMatrixCoeff* iT = tc;
for( int j = 0; j<cutoff; j++ )
{
int iSum = 0;
for( int k = 0; k<uiTrSize; k++ )
{
iSum += src[k] * iT[k];
}
pCoef[i] = (iSum + rnd_factor) >> shift;
pCoef += line;
iT += uiTrSize;
}
src += uiTrSize;
}
if( iSkipLine )
{
pCoef = dst + reducedLine;
for( int j = 0; j<cutoff; j++ )
{
memset(pCoef, 0, sizeof(TCoeff) * iSkipLine);
pCoef += line;
}
}
if( iSkipLine2 )
{
pCoef = dst + line*cutoff;
memset(pCoef, 0, sizeof(TCoeff) * line * iSkipLine2);
}
}
/** 8x8 forward transform implemented using partial butterfly structure (1D)
* \param src input data (residual)
* \param dst output data (transform coefficients)
* \param shift specifies right shift after 1D transform
* \param line
*/
void fastForwardDCT2_B8( const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2 )
{
int j, k;
TCoeff E[4], O[4];
TCoeff EE[2], EO[2];
TCoeff add = ( shift > 0 ) ? ( 1 << ( shift - 1 ) ) : 0;
const TMatrixCoeff *iT = g_aiTr8[DCT2][0];
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
for( j = 0; j < reducedLine; j++ )
{
/* E and O*/
for( k = 0; k < 4; k++ )
{
E[k] = src[k] + src[7 - k];
O[k] = src[k] - src[7 - k];
}
/* EE and EO */
EE[0] = E[0] + E[3];
EO[0] = E[0] - E[3];
EE[1] = E[1] + E[2];
EO[1] = E[1] - E[2];
dst[0 ] = (iT[ 0] * EE[0] + iT[ 1] * EE[1] + add) >> shift;
dst[4 * line] = (iT[32] * EE[0] + iT[33] * EE[1] + add) >> shift;
dst[2 * line] = (iT[16] * EO[0] + iT[17] * EO[1] + add) >> shift;
dst[6 * line] = (iT[48] * EO[0] + iT[49] * EO[1] + add) >> shift;
dst[ line] = (iT[ 8] * O[0] + iT[ 9] * O[1] + iT[10] * O[2] + iT[11] * O[3] + add) >> shift;
dst[3 * line] = (iT[24] * O[0] + iT[25] * O[1] + iT[26] * O[2] + iT[27] * O[3] + add) >> shift;
dst[5 * line] = (iT[40] * O[0] + iT[41] * O[1] + iT[42] * O[2] + iT[43] * O[3] + add) >> shift;
dst[7 * line] = (iT[56] * O[0] + iT[57] * O[1] + iT[58] * O[2] + iT[59] * O[3] + add) >> shift;
src += 8;
dst++;
}
if( iSkipLine )
{
dst = pCoef + reducedLine;
for( j = 0; j < 8; j++ )
{
memset( dst, 0, sizeof( TCoeff )*iSkipLine );
dst += line;
}
}
}
/** 8x8 inverse transform implemented using partial butterfly structure (1D)
* \param src input data (transform coefficients)
* \param dst output data (residual)
* \param shift specifies right shift after 1D transform
* \param line
* \param outputMinimum minimum for clipping
* \param outputMaximum maximum for clipping
*/
void fastInverseDCT2_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
int j, k;
int E[4], O[4];
int EE[2], EO[2];
int add = 1 << (shift - 1);
const TMatrixCoeff *iT = g_aiTr8[DCT2][0];
const int reducedLine = line - iSkipLine;
for( j = 0; j < reducedLine; j++ )
{
/* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
for( k = 0; k < 4; k++ )
{
O[k] = iT[1 * 8 + k] * src[line] + iT[3 * 8 + k] * src[3 * line] + iT[5 * 8 + k] * src[5 * line] + iT[7 * 8 + k] * src[7 * line];
}
EO[0] = iT[2 * 8 + 0] * src[2 * line] + iT[6 * 8 + 0] * src[6 * line];
EO[1] = iT[2 * 8 + 1] * src[2 * line] + iT[6 * 8 + 1] * src[6 * line];
EE[0] = iT[0 * 8 + 0] * src[0 ] + iT[4 * 8 + 0] * src[4 * line];
EE[1] = iT[0 * 8 + 1] * src[0 ] + iT[4 * 8 + 1] * src[4 * line];
/* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */
E[0] = EE[0] + EO[0];
E[3] = EE[0] - EO[0];
E[1] = EE[1] + EO[1];
E[2] = EE[1] - EO[1];
for( k = 0; k < 4; k++ )
{
dst[k ] = Clip3( outputMinimum, outputMaximum, ( E[ k] + O[ k] + add ) >> shift );
dst[k + 4] = Clip3( outputMinimum, outputMaximum, ( E[3 - k] - O[3 - k] + add ) >> shift );
}
src++;
dst += 8;
}
if( iSkipLine )
{
memset( dst, 0, ( iSkipLine << 3 ) * sizeof( TCoeff ) );
}
}
/** 16x16 forward transform implemented using partial butterfly structure (1D)
* \param src input data (residual)
* \param dst output data (transform coefficients)
* \param shift specifies right shift after 1D transform
* \param line
*/
void fastForwardDCT2_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
int j, k;
TCoeff E [8], O [8];
TCoeff EE [4], EO [4];
TCoeff EEE[2], EEO[2];
TCoeff add = ( shift > 0 ) ? ( 1 << ( shift - 1 ) ) : 0;
const TMatrixCoeff *iT = g_aiTr16[DCT2][0];
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
for( j = 0; j < reducedLine; j++ )
{
/* E and O*/
for( k = 0; k < 8; k++ )
{
E[k] = src[k] + src[15 - k];
O[k] = src[k] - src[15 - k];
}
/* EE and EO */
for( k = 0; k < 4; k++ )
{
EE[k] = E[k] + E[7 - k];
EO[k] = E[k] - E[7 - k];
}
/* EEE and EEO */
EEE[0] = EE[0] + EE[3];
EEO[0] = EE[0] - EE[3];
EEE[1] = EE[1] + EE[2];
EEO[1] = EE[1] - EE[2];
dst[ 0 ] = ( iT[ 0 ] * EEE[0] + iT[ 1] * EEE[1] + add ) >> shift;
dst[ 8 * line] = ( iT[ 8 * 16] * EEE[0] + iT[ 8 * 16 + 1] * EEE[1] + add ) >> shift;
dst[ 4 * line] = ( iT[ 4 * 16] * EEO[0] + iT[ 4 * 16 + 1] * EEO[1] + add ) >> shift;
dst[12 * line] = ( iT[12 * 16] * EEO[0] + iT[12 * 16 + 1] * EEO[1] + add ) >> shift;
for( k = 2; k < 16; k += 4 )
{
dst[k*line] = ( iT[k * 16] * EO[0] + iT[k * 16 + 1] * EO[1] + iT[k * 16 + 2] * EO[2] + iT[k * 16 + 3] * EO[3] + add ) >> shift;
}
for( k = 1; k < 16; k += 2 )
{
dst[k*line] = ( iT[k * 16 ] * O[0] + iT[k * 16 + 1] * O[1] + iT[k * 16 + 2] * O[2] + iT[k * 16 + 3] * O[3] +
iT[k * 16 + 4] * O[4] + iT[k * 16 + 5] * O[5] + iT[k * 16 + 6] * O[6] + iT[k * 16 + 7] * O[7] + add ) >> shift;
}
src += 16;
dst++;
}
if( iSkipLine )
{
dst = pCoef + reducedLine;
for( j = 0; j < 16; j++ )
{
memset( dst, 0, sizeof( TCoeff )*iSkipLine );
dst += line;
}
}
}
/** 16x16 inverse transform implemented using partial butterfly structure (1D)
* \param src input data (transform coefficients)
* \param dst output data (residual)
* \param shift specifies right shift after 1D transform
* \param line
* \param outputMinimum minimum for clipping
* \param outputMaximum maximum for clipping
*/
void fastInverseDCT2_B16( const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum )
{
int j, k;
int E [8], O [8];
int EE [4], EO [4];
int EEE[2], EEO[2];
int add = 1 << ( shift - 1 );
const TMatrixCoeff *iT = g_aiTr16[DCT2][0];
const int reducedLine = line - iSkipLine;
for( j = 0; j < reducedLine; j++ )
{
/* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
for( k = 0; k < 8; k++ )
{
O[k] = iT[1 * 16 + k] * src[ line] + iT[ 3 * 16 + k] * src[ 3 * line] + iT[ 5 * 16 + k] * src[ 5 * line] + iT[ 7 * 16 + k] * src[ 7 * line] +
iT[9 * 16 + k] * src[9 * line] + iT[11 * 16 + k] * src[11 * line] + iT[13 * 16 + k] * src[13 * line] + iT[15 * 16 + k] * src[15 * line];
}
for( k = 0; k < 4; k++ )
{
EO[k] = iT[2 * 16 + k] * src[2 * line] + iT[6 * 16 + k] * src[6 * line] + iT[10 * 16 + k] * src[10 * line] + iT[14 * 16 + k] * src[14 * line];
}
EEO[0] = iT[4 * 16 ] * src[4 * line] + iT[12 * 16 ] * src[12 * line];
EEE[0] = iT[0 ] * src[0 ] + iT[ 8 * 16 ] * src[ 8 * line];
EEO[1] = iT[4 * 16 + 1] * src[4 * line] + iT[12 * 16 + 1] * src[12 * line];
EEE[1] = iT[0 * 16 + 1] * src[0 ] + iT[ 8 * 16 + 1] * src[ 8 * line];
/* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */
for( k = 0; k < 2; k++ )
{
EE[k ] = EEE[ k] + EEO[ k];
EE[k + 2] = EEE[1 - k] - EEO[1 - k];
}
for( k = 0; k < 4; k++ )
{
E[k ] = EE[ k] + EO[ k];
E[k + 4] = EE[3 - k] - EO[3 - k];
}
for( k = 0; k < 8; k++ )
{
dst[k ] = Clip3( outputMinimum, outputMaximum, ( E[ k] + O[ k] + add ) >> shift );
dst[k + 8] = Clip3( outputMinimum, outputMaximum, ( E[7 - k] - O[7 - k] + add ) >> shift );
}
src++;
dst += 16;
}
if( iSkipLine )
{
memset( dst, 0, ( iSkipLine << 4 ) * sizeof( TCoeff ) );
}
}
/** 32x32 forward transform implemented using partial butterfly structure (1D)
* \param src input data (residual)
* \param dst output data (transform coefficients)
* \param shift specifies right shift after 1D transform
* \param line
*/
void fastForwardDCT2_B32( const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2 )
{
int j, k;
TCoeff E [16], O [16];
TCoeff EE [ 8], EO [ 8];
TCoeff EEE [ 4], EEO [ 4];
TCoeff EEEE[ 2], EEEO[ 2];
TCoeff add = ( shift > 0 ) ? ( 1 << ( shift - 1 ) ) : 0;
const TMatrixCoeff *iT = g_aiTr32[DCT2][0];
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
for (j = 0; j<reducedLine; j++)
{
/* E and O*/
for (k = 0;k<16;k++)
{
E[k] = src[k] + src[31 - k];
O[k] = src[k] - src[31 - k];
}
/* EE and EO */
for (k = 0;k<8;k++)
{
EE[k] = E[k] + E[15 - k];
EO[k] = E[k] - E[15 - k];
}
/* EEE and EEO */
for (k = 0;k<4;k++)
{
EEE[k] = EE[k] + EE[7 - k];
EEO[k] = EE[k] - EE[7 - k];
}
/* EEEE and EEEO */
EEEE[0] = EEE[0] + EEE[3];
EEEO[0] = EEE[0] - EEE[3];
EEEE[1] = EEE[1] + EEE[2];
EEEO[1] = EEE[1] - EEE[2];
dst[0] = (iT[0 * 32 + 0] * EEEE[0] + iT[0 * 32 + 1] * EEEE[1] + add) >> shift;
dst[16 * line] = (iT[16 * 32 + 0] * EEEE[0] + iT[16 * 32 + 1] * EEEE[1] + add) >> shift;
dst[8 * line] = (iT[8 * 32 + 0] * EEEO[0] + iT[8 * 32 + 1] * EEEO[1] + add) >> shift;
dst[24 * line] = (iT[24 * 32 + 0] * EEEO[0] + iT[24 * 32 + 1] * EEEO[1] + add) >> shift;
for (k = 4;k<32;k += 8)
{
dst[k*line] = (iT[k * 32 + 0] * EEO[0] + iT[k * 32 + 1] * EEO[1] + iT[k * 32 + 2] * EEO[2] + iT[k * 32 + 3] * EEO[3] + add) >> shift;
}
for (k = 2;k<32;k += 4)
{
dst[k*line] = (iT[k * 32 + 0] * EO[0] + iT[k * 32 + 1] * EO[1] + iT[k * 32 + 2] * EO[2] + iT[k * 32 + 3] * EO[3] +
iT[k * 32 + 4] * EO[4] + iT[k * 32 + 5] * EO[5] + iT[k * 32 + 6] * EO[6] + iT[k * 32 + 7] * EO[7] + add) >> shift;
}
for (k = 1;k<32;k += 2)
{
dst[k*line] = (iT[k * 32 + 0] * O[0] + iT[k * 32 + 1] * O[1] + iT[k * 32 + 2] * O[2] + iT[k * 32 + 3] * O[3] +
iT[k * 32 + 4] * O[4] + iT[k * 32 + 5] * O[5] + iT[k * 32 + 6] * O[6] + iT[k * 32 + 7] * O[7] +
iT[k * 32 + 8] * O[8] + iT[k * 32 + 9] * O[9] + iT[k * 32 + 10] * O[10] + iT[k * 32 + 11] * O[11] +
iT[k * 32 + 12] * O[12] + iT[k * 32 + 13] * O[13] + iT[k * 32 + 14] * O[14] + iT[k * 32 + 15] * O[15] + add) >> shift;
}
src += 32;
dst++;
}
if (iSkipLine)
{
dst = pCoef + reducedLine;
for (j = 0; j<32; j++)
{
memset(dst, 0, sizeof(TCoeff)*iSkipLine);
dst += line;
}
}
}
/** 32x32 inverse transform implemented using partial butterfly structure (1D)
* \param src input data (transform coefficients)
* \param dst output data (residual)
* \param shift specifies right shift after 1D transform
* \param line
* \param outputMinimum minimum for clipping
* \param outputMaximum maximum for clipping
*/
void fastInverseDCT2_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
int j, k;
int E[16], O[16];
int EE[8], EO[8];
int EEE[4], EEO[4];
int EEEE[2], EEEO[2];
int add = 1 << (shift - 1);
const TMatrixCoeff *iT = g_aiTr32[DCT2][0];
const int reducedLine = line - iSkipLine;
for (j = 0; j<reducedLine; j++)
{
/* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
for (k = 0;k<16;k++)
{
O[k] = iT[1 * 32 + k] * src[line] + iT[3 * 32 + k] * src[3 * line] + iT[5 * 32 + k] * src[5 * line] + iT[7 * 32 + k] * src[7 * line] +
iT[9 * 32 + k] * src[9 * line] + iT[11 * 32 + k] * src[11 * line] + iT[13 * 32 + k] * src[13 * line] + iT[15 * 32 + k] * src[15 * line] +
iT[17 * 32 + k] * src[17 * line] + iT[19 * 32 + k] * src[19 * line] + iT[21 * 32 + k] * src[21 * line] + iT[23 * 32 + k] * src[23 * line] +
iT[25 * 32 + k] * src[25 * line] + iT[27 * 32 + k] * src[27 * line] + iT[29 * 32 + k] * src[29 * line] + iT[31 * 32 + k] * src[31 * line];
}
for (k = 0;k<8;k++)
{
EO[k] = iT[2 * 32 + k] * src[2 * line] + iT[6 * 32 + k] * src[6 * line] + iT[10 * 32 + k] * src[10 * line] + iT[14 * 32 + k] * src[14 * line] +
iT[18 * 32 + k] * src[18 * line] + iT[22 * 32 + k] * src[22 * line] + iT[26 * 32 + k] * src[26 * line] + iT[30 * 32 + k] * src[30 * line];
}
for (k = 0;k<4;k++)
{
EEO[k] = iT[4 * 32 + k] * src[4 * line] + iT[12 * 32 + k] * src[12 * line] + iT[20 * 32 + k] * src[20 * line] + iT[28 * 32 + k] * src[28 * line];
}
EEEO[0] = iT[8 * 32 + 0] * src[8 * line] + iT[24 * 32 + 0] * src[24 * line];
EEEO[1] = iT[8 * 32 + 1] * src[8 * line] + iT[24 * 32 + 1] * src[24 * line];
EEEE[0] = iT[0 * 32 + 0] * src[0] + iT[16 * 32 + 0] * src[16 * line];
EEEE[1] = iT[0 * 32 + 1] * src[0] + iT[16 * 32 + 1] * src[16 * line];
/* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */
EEE[0] = EEEE[0] + EEEO[0];
EEE[3] = EEEE[0] - EEEO[0];
EEE[1] = EEEE[1] + EEEO[1];
EEE[2] = EEEE[1] - EEEO[1];
for (k = 0;k<4;k++)
{
EE[k] = EEE[k] + EEO[k];
EE[k + 4] = EEE[3 - k] - EEO[3 - k];
}
for (k = 0;k<8;k++)
{
E[k] = EE[k] + EO[k];
E[k + 8] = EE[7 - k] - EO[7 - k];
}
for (k = 0;k<16;k++)
{
dst[k] = Clip3(outputMinimum, outputMaximum, (E[k] + O[k] + add) >> shift);
dst[k + 16] = Clip3(outputMinimum, outputMaximum, (E[15 - k] - O[15 - k] + add) >> shift);
}
src++;
dst += 32;
}
if (iSkipLine)
{
memset(dst, 0, (iSkipLine << 5) * sizeof(TCoeff));
}
}
void fastForwardDCT2_B64(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
int rnd_factor = 1 << (shift - 1);
const int uiTrSize = 64;
const TMatrixCoeff *iT = g_aiTr64[DCT2][0];
int j, k;
TCoeff E[32], O[32];
TCoeff EE[16], EO[16];
TCoeff EEE[8], EEO[8];
TCoeff EEEE[4], EEEO[4];
TCoeff EEEEE[2], EEEEO[2];
TCoeff *tmp = dst;
//bool zo = iSkipLine2 >= 32;
bool zo = iSkipLine2 != 0;
for (j = 0; j<line - iSkipLine; j++)
{
/* E and O*/
for (k = 0;k<32;k++)
{
E[k] = src[k] + src[63 - k];
O[k] = src[k] - src[63 - k];
}
/* EE and EO */
for (k = 0;k<16;k++)
{
EE[k] = E[k] + E[31 - k];
EO[k] = E[k] - E[31 - k];
}
/* EEE and EEO */
for (k = 0;k<8;k++)
{
EEE[k] = EE[k] + EE[15 - k];
EEO[k] = EE[k] - EE[15 - k];
}
/* EEEE and EEEO */
for (k = 0;k<4;k++)
{
EEEE[k] = EEE[k] + EEE[7 - k];
EEEO[k] = EEE[k] - EEE[7 - k];
}
/* EEEEE and EEEEO */
EEEEE[0] = EEEE[0] + EEEE[3];
EEEEO[0] = EEEE[0] - EEEE[3];
EEEEE[1] = EEEE[1] + EEEE[2];
EEEEO[1] = EEEE[1] - EEEE[2];
dst[0] = (iT[0 * 64 + 0] * EEEEE[0] + iT[0 * 64 + 1] * EEEEE[1] + rnd_factor) >> shift;
dst[16 * line] = (iT[16 * 64 + 0] * EEEEO[0] + iT[16 * 64 + 1] * EEEEO[1] + rnd_factor) >> shift;
if (!zo)
{
dst[32 * line] = (iT[32 * 64 + 0] * EEEEE[0] + iT[32 * 64 + 1] * EEEEE[1] + rnd_factor) >> shift;
dst[48 * line] = (iT[48 * 64 + 0] * EEEEO[0] + iT[48 * 64 + 1] * EEEEO[1] + rnd_factor) >> shift;
}
for (k = 8;k<(zo ? 32 : 64);k += 16)
{
dst[k*line] = (iT[k * 64 + 0] * EEEO[0] + iT[k * 64 + 1] * EEEO[1] + iT[k * 64 + 2] * EEEO[2] + iT[k * 64 + 3] * EEEO[3] + rnd_factor) >> shift;
}
for (k = 4;k<(zo ? 32 : 64);k += 8)
{
dst[k*line] = (iT[k * 64 + 0] * EEO[0] + iT[k * 64 + 1] * EEO[1] + iT[k * 64 + 2] * EEO[2] + iT[k * 64 + 3] * EEO[3] +
iT[k * 64 + 4] * EEO[4] + iT[k * 64 + 5] * EEO[5] + iT[k * 64 + 6] * EEO[6] + iT[k * 64 + 7] * EEO[7] + rnd_factor) >> shift;
}
for (k = 2;k<(zo ? 32 : 64);k += 4)
{
dst[k*line] = (iT[k * 64 + 0] * EO[0] + iT[k * 64 + 1] * EO[1] + iT[k * 64 + 2] * EO[2] + iT[k * 64 + 3] * EO[3] +
iT[k * 64 + 4] * EO[4] + iT[k * 64 + 5] * EO[5] + iT[k * 64 + 6] * EO[6] + iT[k * 64 + 7] * EO[7] +
iT[k * 64 + 8] * EO[8] + iT[k * 64 + 9] * EO[9] + iT[k * 64 + 10] * EO[10] + iT[k * 64 + 11] * EO[11] +
iT[k * 64 + 12] * EO[12] + iT[k * 64 + 13] * EO[13] + iT[k * 64 + 14] * EO[14] + iT[k * 64 + 15] * EO[15] + rnd_factor) >> shift;
}
for (k = 1;k<(zo ? 32 : 64);k += 2)
{
dst[k*line] = (iT[k * 64 + 0] * O[0] + iT[k * 64 + 1] * O[1] + iT[k * 64 + 2] * O[2] + iT[k * 64 + 3] * O[3] +
iT[k * 64 + 4] * O[4] + iT[k * 64 + 5] * O[5] + iT[k * 64 + 6] * O[6] + iT[k * 64 + 7] * O[7] +
iT[k * 64 + 8] * O[8] + iT[k * 64 + 9] * O[9] + iT[k * 64 + 10] * O[10] + iT[k * 64 + 11] * O[11] +
iT[k * 64 + 12] * O[12] + iT[k * 64 + 13] * O[13] + iT[k * 64 + 14] * O[14] + iT[k * 64 + 15] * O[15] +
iT[k * 64 + 16] * O[16] + iT[k * 64 + 17] * O[17] + iT[k * 64 + 18] * O[18] + iT[k * 64 + 19] * O[19] +
iT[k * 64 + 20] * O[20] + iT[k * 64 + 21] * O[21] + iT[k * 64 + 22] * O[22] + iT[k * 64 + 23] * O[23] +
iT[k * 64 + 24] * O[24] + iT[k * 64 + 25] * O[25] + iT[k * 64 + 26] * O[26] + iT[k * 64 + 27] * O[27] +
iT[k * 64 + 28] * O[28] + iT[k * 64 + 29] * O[29] + iT[k * 64 + 30] * O[30] + iT[k * 64 + 31] * O[31] + rnd_factor) >> shift;
}
src += uiTrSize;
dst++;
}
const int reducedLine = line - iSkipLine;
const int cutoff = uiTrSize - iSkipLine2;
if (iSkipLine)
{
dst = tmp + reducedLine;
for (j = 0; j<cutoff; j++)
{
memset(dst, 0, sizeof(TCoeff)*iSkipLine);
dst += line;
}
}
if (iSkipLine2)
{
dst = tmp + line*cutoff;
memset(dst, 0, sizeof(TCoeff)*line*iSkipLine2);
}
}
void fastInverseDCT2_B64(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
int rnd_factor = 1 << (shift - 1);
const int uiTrSize = 64;
const TMatrixCoeff *iT = g_aiTr64[DCT2][0];
int j, k;
TCoeff E[32], O[32];
TCoeff EE[16], EO[16];
TCoeff EEE[8], EEO[8];
TCoeff EEEE[4], EEEO[4];
TCoeff EEEEE[2], EEEEO[2];
bool zo = iSkipLine2 >= 32;
for (j = 0; j<line - iSkipLine; j++)
{
/* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
for (k = 0;k<32;k++)
{
O[k] = iT[1 * 64 + k] * src[line] + iT[3 * 64 + k] * src[3 * line] + iT[5 * 64 + k] * src[5 * line] + iT[7 * 64 + k] * src[7 * line] +
iT[9 * 64 + k] * src[9 * line] + iT[11 * 64 + k] * src[11 * line] + iT[13 * 64 + k] * src[13 * line] + iT[15 * 64 + k] * src[15 * line] +
iT[17 * 64 + k] * src[17 * line] + iT[19 * 64 + k] * src[19 * line] + iT[21 * 64 + k] * src[21 * line] + iT[23 * 64 + k] * src[23 * line] +
iT[25 * 64 + k] * src[25 * line] + iT[27 * 64 + k] * src[27 * line] + iT[29 * 64 + k] * src[29 * line] + iT[31 * 64 + k] * src[31 * line] +
(zo ? 0 : (
iT[33 * 64 + k] * src[33 * line] + iT[35 * 64 + k] * src[35 * line] + iT[37 * 64 + k] * src[37 * line] + iT[39 * 64 + k] * src[39 * line] +
iT[41 * 64 + k] * src[41 * line] + iT[43 * 64 + k] * src[43 * line] + iT[45 * 64 + k] * src[45 * line] + iT[47 * 64 + k] * src[47 * line] +
iT[49 * 64 + k] * src[49 * line] + iT[51 * 64 + k] * src[51 * line] + iT[53 * 64 + k] * src[53 * line] + iT[55 * 64 + k] * src[55 * line] +
iT[57 * 64 + k] * src[57 * line] + iT[59 * 64 + k] * src[59 * line] + iT[61 * 64 + k] * src[61 * line] + iT[63 * 64 + k] * src[63 * line]));
}
for (k = 0;k<16;k++)
{
EO[k] = iT[2 * 64 + k] * src[2 * line] + iT[6 * 64 + k] * src[6 * line] + iT[10 * 64 + k] * src[10 * line] + iT[14 * 64 + k] * src[14 * line] +
iT[18 * 64 + k] * src[18 * line] + iT[22 * 64 + k] * src[22 * line] + iT[26 * 64 + k] * src[26 * line] + iT[30 * 64 + k] * src[30 * line] +
(zo ? 0 : (
iT[34 * 64 + k] * src[34 * line] + iT[38 * 64 + k] * src[38 * line] + iT[42 * 64 + k] * src[42 * line] + iT[46 * 64 + k] * src[46 * line] +
iT[50 * 64 + k] * src[50 * line] + iT[54 * 64 + k] * src[54 * line] + iT[58 * 64 + k] * src[58 * line] + iT[62 * 64 + k] * src[62 * line]));
}
for (k = 0;k<8;k++)
{
EEO[k] = iT[4 * 64 + k] * src[4 * line] + iT[12 * 64 + k] * src[12 * line] + iT[20 * 64 + k] * src[20 * line] + iT[28 * 64 + k] * src[28 * line] +
(zo ? 0 : (
iT[36 * 64 + k] * src[36 * line] + iT[44 * 64 + k] * src[44 * line] + iT[52 * 64 + k] * src[52 * line] + iT[60 * 64 + k] * src[60 * line]));
}
for (k = 0;k<4;k++)
{
EEEO[k] = iT[8 * 64 + k] * src[8 * line] + iT[24 * 64 + k] * src[24 * line] + (zo ? 0 : (iT[40 * 64 + k] * src[40 * line] + iT[56 * 64 + k] * src[56 * line]));
}
EEEEO[0] = iT[16 * 64 + 0] * src[16 * line] + (zo ? 0 : iT[48 * 64 + 0] * src[48 * line]);
EEEEO[1] = iT[16 * 64 + 1] * src[16 * line] + (zo ? 0 : iT[48 * 64 + 1] * src[48 * line]);
EEEEE[0] = iT[0 * 64 + 0] * src[0] + (zo ? 0 : iT[32 * 64 + 0] * src[32 * line]);
EEEEE[1] = iT[0 * 64 + 1] * src[0] + (zo ? 0 : iT[32 * 64 + 1] * src[32 * line]);
/* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */
for (k = 0;k<2;k++)
{
EEEE[k] = EEEEE[k] + EEEEO[k];
EEEE[k + 2] = EEEEE[1 - k] - EEEEO[1 - k];
}
for (k = 0;k<4;k++)
{
EEE[k] = EEEE[k] + EEEO[k];
EEE[k + 4] = EEEE[3 - k] - EEEO[3 - k];
}
for (k = 0;k<8;k++)
{
EE[k] = EEE[k] + EEO[k];
EE[k + 8] = EEE[7 - k] - EEO[7 - k];
}
for (k = 0;k<16;k++)
{
E[k] = EE[k] + EO[k];
E[k + 16] = EE[15 - k] - EO[15 - k];
}
for (k = 0;k<32;k++)
{
dst[k] = Clip3(outputMinimum, outputMaximum, (E[k] + O[k] + rnd_factor) >> shift);
dst[k + 32] = Clip3(outputMinimum, outputMaximum, (E[31 - k] - O[31 - k] + rnd_factor) >> shift);
}
src++;
dst += uiTrSize;
}
memset(dst, 0, uiTrSize*iSkipLine * sizeof(TCoeff));
}
// ********************************** DST-VII **********************************
void fastForwardDST7_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
int i;
TCoeff rnd_factor = (shift > 0) ? (1 << (shift - 1)) : 0;
#if HEVC_USE_4x4_DSTVII
const TMatrixCoeff *iT = use ? g_aiTr4[DST7][0] : g_as_DST_MAT_4[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DST7][0];
#endif
int c[4];
TCoeff *pCoeff = dst;
const int reducedLine = line - iSkipLine;
for (i = 0; i<reducedLine; i++)
{
// Intermediate Variables
c[0] = src[0] + src[3];
c[1] = src[1] + src[3];
c[2] = src[0] - src[1];
c[3] = iT[2] * src[2];
dst[0 * line] = (iT[0] * c[0] + iT[1] * c[1] + c[3] + rnd_factor) >> shift;
dst[1 * line] = (iT[2] * (src[0] + src[1] - src[3]) + rnd_factor) >> shift;
dst[2 * line] = (iT[0] * c[2] + iT[1] * c[0] - c[3] + rnd_factor) >> shift;
dst[3 * line] = (iT[1] * c[2] - iT[0] * c[1] + c[3] + rnd_factor) >> shift;
src += 4;
dst++;
}
if (iSkipLine)
{
dst = pCoeff + reducedLine;
for (i = 0; i<4; i++)
{
memset(dst, 0, sizeof(TCoeff)*iSkipLine);
dst += line;
}
}
}
void fastInverseDST7_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
int i;
TCoeff c[4];
TCoeff rnd_factor = (shift > 0) ? (1 << (shift - 1)) : 0;
#if HEVC_USE_4x4_DSTVII
const TMatrixCoeff *iT = use ? g_aiTr4[DST7][0] : g_as_DST_MAT_4[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DST7][0];
#endif
const int reducedLine = line - iSkipLine;
for (i = 0; i<reducedLine; i++)
{
// Intermediate Variables
c[0] = src[0 * line] + src[2 * line];
c[1] = src[2 * line] + src[3 * line];
c[2] = src[0 * line] - src[3 * line];
c[3] = iT[2] * src[1 * line];
dst[0] = Clip3(outputMinimum, outputMaximum, (iT[0] * c[0] + iT[1] * c[1] + c[3] + rnd_factor) >> shift);
dst[1] = Clip3(outputMinimum, outputMaximum, (iT[1] * c[2] - iT[0] * c[1] + c[3] + rnd_factor) >> shift);
dst[2] = Clip3(outputMinimum, outputMaximum, (iT[2] * (src[0 * line] - src[2 * line] + src[3 * line]) + rnd_factor) >> shift);
dst[3] = Clip3(outputMinimum, outputMaximum, (iT[1] * c[0] + iT[0] * c[2] - c[3] + rnd_factor) >> shift);
dst += 4;
src++;
}
if (iSkipLine)
{
memset(dst, 0, (iSkipLine << 2) * sizeof(TCoeff));
}
}
void fastForwardDST7_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
_fastForwardMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr8[DST7][0] );
}
void fastInverseDST7_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
_fastInverseMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr8[DST7][0] );
}
void fastForwardDST7_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
_fastForwardMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr16[DST7][0] );
}
void fastInverseDST7_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
_fastInverseMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr16[DST7][0] );
}
void fastForwardDST7_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
_fastForwardMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr32[DST7][0] );
}
void fastInverseDST7_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
_fastInverseMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr32[DST7][0] );
}
// ********************************** DCT-VIII **********************************
void fastForwardDCT8_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
int i;
int rnd_factor = 1 << (shift - 1);
const TMatrixCoeff *iT = g_aiTr4[DCT8][0];
int c[4];
TCoeff *pCoeff = dst;
const int reducedLine = line - iSkipLine;
for (i = 0; i<reducedLine; i++)
{
// Intermediate Variables
c[0] = src[0] + src[3];
c[1] = src[2] + src[0];
c[2] = src[3] - src[2];
c[3] = iT[1] * src[1];
dst[0 * line] = (iT[3] * c[0] + iT[2] * c[1] + c[3] + rnd_factor) >> shift;
dst[1 * line] = (iT[1] * (src[0] - src[2] - src[3]) + rnd_factor) >> shift;
dst[2 * line] = (iT[3] * c[2] + iT[2] * c[0] - c[3] + rnd_factor) >> shift;
dst[3 * line] = (iT[3] * c[1] - iT[2] * c[2] - c[3] + rnd_factor) >> shift;
src += 4;
dst++;
}
if (iSkipLine)
{
dst = pCoeff + reducedLine;
for (i = 0; i<4; i++)
{
memset(dst, 0, sizeof(TCoeff)*iSkipLine);
dst += line;
}
}
}
void fastInverseDCT8_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
int i;
int rnd_factor = 1 << (shift - 1);
const TMatrixCoeff *iT = g_aiTr4[DCT8][0];
int c[4];
const int reducedLine = line - iSkipLine;
for (i = 0; i<reducedLine; i++)
{
// Intermediate Variables
c[0] = src[0 * line] + src[3 * line];
c[1] = src[2 * line] + src[0 * line];
c[2] = src[3 * line] - src[2 * line];
c[3] = iT[1] * src[1 * line];
dst[0] = Clip3(outputMinimum, outputMaximum, (iT[3] * c[0] + iT[2] * c[1] + c[3] + rnd_factor) >> shift);
dst[1] = Clip3(outputMinimum, outputMaximum, (iT[1] * (src[0 * line] - src[2 * line] - src[3 * line]) + rnd_factor) >> shift);
dst[2] = Clip3(outputMinimum, outputMaximum, (iT[3] * c[2] + iT[2] * c[0] - c[3] + rnd_factor) >> shift);
dst[3] = Clip3(outputMinimum, outputMaximum, (iT[3] * c[1] - iT[2] * c[2] - c[3] + rnd_factor) >> shift);
dst += 4;
src++;
}
if (iSkipLine)
{
memset(dst, 0, (iSkipLine << 2) * sizeof(TCoeff));
}
}
void fastForwardDCT8_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
_fastForwardMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr8[DCT8][0] );
}
void fastInverseDCT8_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
_fastInverseMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr8[DCT8][0] );
}
void fastForwardDCT8_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
_fastForwardMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr16[DCT8][0] );
}
void fastInverseDCT8_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
_fastInverseMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr16[DCT8][0] );
}
void fastForwardDCT8_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
_fastForwardMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr32[DCT8][0] );
}
void fastInverseDCT8_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
_fastInverseMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr32[DCT8][0] );
}
| 35.955514 | 192 | 0.525853 | [
"vector",
"transform"
] |
99f45ce3b67c73f2e42088ef8a5c358f775781e3 | 26,941 | cpp | C++ | Engine/Source/Editor/PropertyEditor/Private/Presentation/PropertyEditor/PropertyEditor.cpp | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | 1 | 2022-01-29T18:36:12.000Z | 2022-01-29T18:36:12.000Z | Engine/Source/Editor/PropertyEditor/Private/Presentation/PropertyEditor/PropertyEditor.cpp | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | null | null | null | Engine/Source/Editor/PropertyEditor/Private/Presentation/PropertyEditor/PropertyEditor.cpp | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | null | null | null | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "Presentation/PropertyEditor/PropertyEditor.h"
#include "Modules/ModuleManager.h"
#include "UnrealEdGlobals.h"
#include "CategoryPropertyNode.h"
#include "ItemPropertyNode.h"
#include "ObjectPropertyNode.h"
#include "Toolkits/AssetEditorManager.h"
#include "Editor/SceneOutliner/Public/SceneOutlinerFilters.h"
#include "IDetailPropertyRow.h"
#include "PropertyCustomizationHelpers.h"
#include "PropertyEditorHelpers.h"
#include "Editor.h"
#include "EditorClassUtils.h"
#include "Kismet2/KismetEditorUtilities.h"
#include "IConfigEditorModule.h"
#include "PropertyNode.h"
#define LOCTEXT_NAMESPACE "PropertyEditor"
const FString FPropertyEditor::MultipleValuesDisplayName = NSLOCTEXT("PropertyEditor", "MultipleValues", "Multiple Values").ToString();
TSharedRef< FPropertyEditor > FPropertyEditor::Create( const TSharedRef< class FPropertyNode >& InPropertyNode, const TSharedRef<class IPropertyUtilities >& InPropertyUtilities )
{
return MakeShareable( new FPropertyEditor( InPropertyNode, InPropertyUtilities ) );
}
FPropertyEditor::FPropertyEditor( const TSharedRef<FPropertyNode>& InPropertyNode, const TSharedRef<IPropertyUtilities>& InPropertyUtilities )
: PropertyEditConditions()
, PropertyHandle( NULL )
, PropertyNode( InPropertyNode )
, PropertyUtilities( InPropertyUtilities )
, EditConditionProperty( NULL )
{
// FPropertyEditor isn't built to handle CategoryNodes
check( InPropertyNode->AsCategoryNode() == NULL );
UProperty* Property = InPropertyNode->GetProperty();
if( Property )
{
//see if the property supports some kind of edit condition and this isn't the "parent" property of a static array
const bool bStaticArray = Property->ArrayDim > 1 && InPropertyNode->GetArrayIndex() == INDEX_NONE;
if ( Property->HasMetaData( TEXT( "EditCondition" ) ) && !bStaticArray )
{
if ( !GetEditConditionPropertyAddress( /*OUT*/EditConditionProperty, *InPropertyNode, PropertyEditConditions ) )
{
EditConditionProperty = NULL;
}
}
}
PropertyHandle = PropertyEditorHelpers::GetPropertyHandle( InPropertyNode, PropertyUtilities->GetNotifyHook(), PropertyUtilities );
check( PropertyHandle.IsValid() && PropertyHandle->IsValidHandle() );
}
FText FPropertyEditor::GetDisplayName() const
{
FCategoryPropertyNode* CategoryNode = PropertyNode->AsCategoryNode();
FItemPropertyNode* ItemPropertyNode = PropertyNode->AsItemPropertyNode();
if ( CategoryNode != NULL )
{
return CategoryNode->GetDisplayName();
}
else if ( ItemPropertyNode != NULL )
{
return ItemPropertyNode->GetDisplayName();
}
else
{
FString DisplayName;
PropertyNode->GetQualifiedName( DisplayName, true );
return FText::FromString(DisplayName);
}
return FText::GetEmpty();
}
FText FPropertyEditor::GetToolTipText() const
{
return PropertyNode->GetToolTipText();
}
FString FPropertyEditor::GetDocumentationLink() const
{
FString DocumentationLink;
if( PropertyNode->AsItemPropertyNode() )
{
UProperty* Property = PropertyNode->GetProperty();
DocumentationLink = PropertyEditorHelpers::GetDocumentationLink( Property );
}
return DocumentationLink;
}
FString FPropertyEditor::GetDocumentationExcerptName() const
{
FString ExcerptName;
if( PropertyNode->AsItemPropertyNode() )
{
UProperty* Property = PropertyNode->GetProperty();
ExcerptName = PropertyEditorHelpers::GetDocumentationExcerptName( Property );
}
return ExcerptName;
}
FString FPropertyEditor::GetValueAsString() const
{
FString Str;
if( PropertyHandle->GetValueAsFormattedString( Str ) == FPropertyAccess::MultipleValues )
{
Str = MultipleValuesDisplayName;
}
return Str;
}
FString FPropertyEditor::GetValueAsDisplayString() const
{
FString Str;
if( PropertyHandle->GetValueAsDisplayString( Str ) == FPropertyAccess::MultipleValues )
{
Str = MultipleValuesDisplayName;
}
return Str;
}
FText FPropertyEditor::GetValueAsText() const
{
FText Text;
if( PropertyHandle->GetValueAsFormattedText( Text ) == FPropertyAccess::MultipleValues )
{
Text = NSLOCTEXT("PropertyEditor", "MultipleValues", "Multiple Values");
}
return Text;
}
FText FPropertyEditor::GetValueAsDisplayText() const
{
FText Text;
if( PropertyHandle->GetValueAsDisplayText( Text ) == FPropertyAccess::MultipleValues )
{
Text = NSLOCTEXT("PropertyEditor", "MultipleValues", "Multiple Values");
}
return Text;
}
bool FPropertyEditor::PropertyIsA(const UClass* Class) const
{
return PropertyNode->GetProperty() != NULL ? PropertyNode->GetProperty()->IsA( Class ) : false;
}
bool FPropertyEditor::IsFavorite() const
{
return PropertyNode->HasNodeFlags( EPropertyNodeFlags::IsFavorite ) != 0;
}
bool FPropertyEditor::IsChildOfFavorite() const
{
return PropertyNode->IsChildOfFavorite();
}
void FPropertyEditor::ToggleFavorite()
{
PropertyUtilities->ToggleFavorite( SharedThis( this ) );
}
void FPropertyEditor::UseSelected()
{
OnUseSelected();
}
void FPropertyEditor::OnUseSelected()
{
PropertyHandle->SetObjectValueFromSelection();
}
void FPropertyEditor::AddItem()
{
// This action must be deferred until next tick so that we avoid accessing invalid data before we have a chance to tick
PropertyUtilities->EnqueueDeferredAction( FSimpleDelegate::CreateSP( this, &FPropertyEditor::OnAddItem ) );
}
void FPropertyEditor::OnAddItem()
{
// Check to make sure that the property is a valid container
TSharedPtr<IPropertyHandleArray> ArrayHandle = PropertyHandle->AsArray();
TSharedPtr<IPropertyHandleSet> SetHandle = PropertyHandle->AsSet();
TSharedPtr<IPropertyHandleMap> MapHandle = PropertyHandle->AsMap();
check(ArrayHandle.IsValid() || SetHandle.IsValid() || MapHandle.IsValid());
if (ArrayHandle.IsValid())
{
ArrayHandle->AddItem();
}
else if (SetHandle.IsValid())
{
SetHandle->AddItem();
}
else if (MapHandle.IsValid())
{
MapHandle->AddItem();
}
// Expand containers when an item is added to them
PropertyNode->SetNodeFlags(EPropertyNodeFlags::Expanded, true);
//In case the property is show in the favorite category refresh the whole tree
if (PropertyNode->IsFavorite())
{
ForceRefresh();
}
}
void FPropertyEditor::ClearItem()
{
OnClearItem();
}
void FPropertyEditor::OnClearItem()
{
static const FString None("None");
PropertyHandle->SetValueFromFormattedString( None );
}
void FPropertyEditor::MakeNewBlueprint()
{
UProperty* NodeProperty = PropertyNode->GetProperty();
UClassProperty* ClassProp = Cast<UClassProperty>(NodeProperty);
UClass* Class = (ClassProp ? ClassProp->MetaClass : FEditorClassUtils::GetClassFromString(NodeProperty->GetMetaData("MetaClass")));
if (Class)
{
UBlueprint* Blueprint = FKismetEditorUtilities::CreateBlueprintFromClass(LOCTEXT("CreateNewBlueprint", "Create New Blueprint"), Class, FString::Printf(TEXT("New%s"),*Class->GetName()));
if(Blueprint != NULL && Blueprint->GeneratedClass)
{
PropertyHandle->SetValueFromFormattedString(Blueprint->GeneratedClass->GetPathName());
FAssetEditorManager::Get().OpenEditorForAsset(Blueprint);
}
}
}
void FPropertyEditor::EditConfigHierarchy()
{
UProperty* NodeProperty = PropertyNode->GetProperty();
IConfigEditorModule& ConfigEditorModule = FModuleManager::LoadModuleChecked<IConfigEditorModule>("ConfigEditor");
ConfigEditorModule.CreateHierarchyEditor(NodeProperty);
FGlobalTabmanager::Get()->InvokeTab(FName(TEXT("ConfigEditor")));
}
void FPropertyEditor::InsertItem()
{
// This action must be deferred until next tick so that we avoid accessing invalid data before we have a chance to tick
PropertyUtilities->EnqueueDeferredAction( FSimpleDelegate::CreateSP( this, &FPropertyEditor::OnInsertItem ) );
}
void FPropertyEditor::OnInsertItem()
{
TSharedPtr<IPropertyHandleArray> ArrayHandle = PropertyHandle->GetParentHandle()->AsArray();
check(ArrayHandle.IsValid());
int32 Index = PropertyNode->GetArrayIndex();
// Insert is only supported on arrays, not maps or sets
ArrayHandle->Insert(Index);
//In case the property is show in the favorite category refresh the whole tree
if (PropertyNode->IsFavorite() || (PropertyNode->GetParentNode() != nullptr && PropertyNode->GetParentNode()->IsFavorite()))
{
ForceRefresh();
}
}
void FPropertyEditor::DeleteItem()
{
// This action must be deferred until next tick so that we avoid accessing invalid data before we have a chance to tick
PropertyUtilities->EnqueueDeferredAction( FSimpleDelegate::CreateSP( this, &FPropertyEditor::OnDeleteItem ) );
}
void FPropertyEditor::OnDeleteItem()
{
TSharedPtr<IPropertyHandleArray> ArrayHandle = PropertyHandle->GetParentHandle()->AsArray();
TSharedPtr<IPropertyHandleSet> SetHandle = PropertyHandle->GetParentHandle()->AsSet();
TSharedPtr<IPropertyHandleMap> MapHandle = PropertyHandle->GetParentHandle()->AsMap();
check(ArrayHandle.IsValid() || SetHandle.IsValid() || MapHandle.IsValid());
int32 Index = PropertyNode->GetArrayIndex();
if (ArrayHandle.IsValid())
{
ArrayHandle->DeleteItem(Index);
}
else if (SetHandle.IsValid())
{
SetHandle->DeleteItem(Index);
}
else if (MapHandle.IsValid())
{
MapHandle->DeleteItem(Index);
}
//In case the property is show in the favorite category refresh the whole tree
if (PropertyNode->IsFavorite() || (PropertyNode->GetParentNode() != nullptr && PropertyNode->GetParentNode()->IsFavorite()))
{
ForceRefresh();
}
}
void FPropertyEditor::DuplicateItem()
{
// This action must be deferred until next tick so that we avoid accessing invalid data before we have a chance to tick
PropertyUtilities->EnqueueDeferredAction( FSimpleDelegate::CreateSP( this, &FPropertyEditor::OnDuplicateItem ) );
}
void FPropertyEditor::OnDuplicateItem()
{
TSharedPtr<IPropertyHandleArray> ArrayHandle = PropertyHandle->GetParentHandle()->AsArray();
check(ArrayHandle.IsValid());
int32 Index = PropertyNode->GetArrayIndex();
ArrayHandle->DuplicateItem(Index);
//In case the property is show in the favorite category refresh the whole tree
if (PropertyNode->IsFavorite() || (PropertyNode->GetParentNode() != nullptr && PropertyNode->GetParentNode()->IsFavorite()))
{
ForceRefresh();
}
}
void FPropertyEditor::BrowseTo()
{
OnBrowseTo();
}
void FPropertyEditor::OnBrowseTo()
{
// Sync the content browser or level editor viewport to the object(s) specified by the given property.
SyncToObjectsInNode( PropertyNode );
}
void FPropertyEditor::EmptyArray()
{
// This action must be deferred until next tick so that we avoid accessing invalid data before we have a chance to tick
PropertyUtilities->EnqueueDeferredAction( FSimpleDelegate::CreateSP( this, &FPropertyEditor::OnEmptyArray ) );
}
void FPropertyEditor::OnEmptyArray()
{
TSharedPtr<IPropertyHandleArray> ArrayHandle = PropertyHandle->AsArray();
TSharedPtr<IPropertyHandleSet> SetHandle = PropertyHandle->AsSet();
TSharedPtr<IPropertyHandleMap> MapHandle = PropertyHandle->AsMap();
check(ArrayHandle.IsValid() || SetHandle.IsValid() || MapHandle.IsValid());
if (ArrayHandle.IsValid())
{
ArrayHandle->EmptyArray();
}
else if (SetHandle.IsValid())
{
SetHandle->Empty();
}
else if (MapHandle.IsValid())
{
MapHandle->Empty();
}
//In case the property is show in the favorite category refresh the whole tree
if (PropertyNode->IsFavorite())
{
ForceRefresh();
}
}
bool FPropertyEditor::DoesPassFilterRestrictions() const
{
return PropertyNode->HasNodeFlags( EPropertyNodeFlags::IsSeenDueToFiltering ) != 0;
}
bool FPropertyEditor::IsEditConst() const
{
return PropertyNode->IsEditConst();
}
void FPropertyEditor::SetEditConditionState( bool bShouldEnable )
{
// Propagate the value change to any instances if we're editing a template object.
FObjectPropertyNode* ObjectNode = PropertyNode->FindObjectItemParent();
FPropertyNode* ParentNode = PropertyNode->GetParentNode();
check(ParentNode != nullptr);
PropertyNode->NotifyPreChange( PropertyNode->GetProperty(), PropertyUtilities->GetNotifyHook() );
for ( int32 ValueIdx = 0; ValueIdx < PropertyEditConditions.Num(); ValueIdx++ )
{
// Get the address corresponding to the base of this property (i.e. if a struct property, set BaseOffset to the address of value for the whole struct)
uint8* BaseOffset = ParentNode->GetValueAddress(PropertyEditConditions[ValueIdx].BaseAddress);
check(BaseOffset != NULL);
uint8* ValueAddr = EditConditionProperty->ContainerPtrToValuePtr<uint8>(BaseOffset);
const bool OldValue = EditConditionProperty->GetPropertyValue( ValueAddr );
const bool NewValue = XOR(bShouldEnable, PropertyEditConditions[ValueIdx].bNegateValue);
EditConditionProperty->SetPropertyValue( ValueAddr, NewValue );
if (ObjectNode != nullptr)
{
for (int32 ObjIndex = 0; ObjIndex < ObjectNode->GetNumObjects(); ++ObjIndex)
{
TWeakObjectPtr<UObject> ObjectWeakPtr = ObjectNode->GetUObject(ObjIndex);
UObject* Object = ObjectWeakPtr.Get();
if (Object != nullptr && Object->IsTemplate())
{
TArray<UObject*> ArchetypeInstances;
Object->GetArchetypeInstances(ArchetypeInstances);
for (int32 InstanceIndex = 0; InstanceIndex < ArchetypeInstances.Num(); ++InstanceIndex)
{
// Only propagate if the current value on the instance matches the previous value on the template.
uint8* ArchetypeBaseOffset = ParentNode->GetValueAddress((uint8*)ArchetypeInstances[InstanceIndex]);
if(ArchetypeBaseOffset)
{
uint8* ArchetypeValueAddr = EditConditionProperty->ContainerPtrToValuePtr<uint8>(ArchetypeBaseOffset);
const bool CurValue = EditConditionProperty->GetPropertyValue(ArchetypeValueAddr);
if(OldValue == CurValue)
{
EditConditionProperty->SetPropertyValue(ArchetypeValueAddr, NewValue);
}
}
}
}
}
}
}
FPropertyChangedEvent ChangeEvent(PropertyNode->GetProperty());
PropertyNode->NotifyPostChange( ChangeEvent, PropertyUtilities->GetNotifyHook() );
}
void FPropertyEditor::ResetToDefault()
{
// This action must be deferred until next tick so that we avoid accessing invalid data before we have a chance to tick
PropertyUtilities->EnqueueDeferredAction( FSimpleDelegate::CreateSP( this, &FPropertyEditor::OnResetToDefault ) );
}
void FPropertyEditor::CustomResetToDefault(const FResetToDefaultOverride& OnCustomResetToDefault)
{
// This action must be deferred until next tick so that we avoid accessing invalid data before we have a chance to tick
PropertyUtilities->EnqueueDeferredAction(FSimpleDelegate::CreateLambda([this, OnCustomResetToDefault](){ this->OnCustomResetToDefault(OnCustomResetToDefault); }));
}
void FPropertyEditor::OnGetClassesForAssetPicker( TArray<const UClass*>& OutClasses )
{
UProperty* NodeProperty = GetPropertyNode()->GetProperty();
UObjectPropertyBase* ObjProp = Cast<UObjectPropertyBase>( NodeProperty );
// This class and its children are the classes that we can show objects for
UClass* AllowedClass = ObjProp ? ObjProp->PropertyClass : UObject::StaticClass();
OutClasses.Add( AllowedClass );
}
void FPropertyEditor::OnAssetSelected( const FAssetData& AssetData )
{
// Set the object found from the asset picker
GetPropertyHandle()->SetValueFromFormattedString( AssetData.IsValid() ? AssetData.GetAsset()->GetPathName() : TEXT("None") );
}
void FPropertyEditor::OnActorSelected( AActor* InActor )
{
// Update the name like we would a picked asset
OnAssetSelected(InActor);
}
void FPropertyEditor::OnGetActorFiltersForSceneOutliner( TSharedPtr<SceneOutliner::FOutlinerFilters>& OutFilters )
{
struct Local
{
static bool IsFilteredActor( const AActor* Actor, TSharedRef<FPropertyEditor> PropertyEditor )
{
const TSharedRef<FPropertyNode> PropertyNode = PropertyEditor->GetPropertyNode();
UProperty* NodeProperty = PropertyNode->GetProperty();
UObjectPropertyBase* ObjProp = Cast<UObjectPropertyBase>( NodeProperty );
// This class and its children are the classes that we can show objects for
UClass* AllowedClass = ObjProp ? ObjProp->PropertyClass : AActor::StaticClass();
return Actor->IsA( AllowedClass );
}
};
OutFilters->AddFilterPredicate( SceneOutliner::FActorFilterPredicate::CreateStatic( &Local::IsFilteredActor, AsShared() ) );
}
void FPropertyEditor::OnResetToDefault()
{
PropertyNode->ResetToDefault( PropertyUtilities->GetNotifyHook() );
}
void FPropertyEditor::OnCustomResetToDefault(const FResetToDefaultOverride& OnCustomResetToDefault)
{
if (OnCustomResetToDefault.OnResetToDefaultClicked().IsBound())
{
PropertyNode->NotifyPreChange( PropertyNode->GetProperty(), PropertyUtilities->GetNotifyHook() );
OnCustomResetToDefault.OnResetToDefaultClicked().Execute(GetPropertyHandle());
// Call PostEditchange on all the objects
FPropertyChangedEvent ChangeEvent( PropertyNode->GetProperty() );
PropertyNode->NotifyPostChange( ChangeEvent, PropertyUtilities->GetNotifyHook() );
}
}
bool FPropertyEditor::IsPropertyEditingEnabled() const
{
return ( PropertyUtilities->IsPropertyEditingEnabled() ) &&
(EditConditionProperty == NULL || IsEditConditionMet( EditConditionProperty, PropertyEditConditions ));
}
void FPropertyEditor::ForceRefresh()
{
PropertyUtilities->ForceRefresh();
}
void FPropertyEditor::RequestRefresh()
{
PropertyUtilities->RequestRefresh();
}
bool FPropertyEditor::HasEditCondition() const
{
return EditConditionProperty != NULL;
}
bool FPropertyEditor::IsEditConditionMet() const
{
return IsEditConditionMet( EditConditionProperty, PropertyEditConditions );
}
bool FPropertyEditor::SupportsEditConditionToggle() const
{
return SupportsEditConditionToggle( PropertyNode->GetProperty() );
}
bool FPropertyEditor::IsResetToDefaultAvailable() const
{
UProperty* Property = PropertyNode->GetProperty();
// Should not be able to reset fixed size arrays
const bool bFixedSized = Property && Property->PropertyFlags & CPF_EditFixedSize;
const bool bCanResetToDefault = !(Property && Property->PropertyFlags & CPF_Config);
return Property && bCanResetToDefault && !bFixedSized && PropertyHandle->DiffersFromDefault();
}
bool FPropertyEditor::ValueDiffersFromDefault() const
{
return PropertyHandle->DiffersFromDefault();
}
FText FPropertyEditor::GetResetToDefaultLabel() const
{
return PropertyNode->GetResetToDefaultLabel();
}
void FPropertyEditor::AddPropertyEditorChild( const TSharedRef<FPropertyEditor>& Child )
{
ChildPropertyEditors.Add( Child );
}
void FPropertyEditor::RemovePropertyEditorChild( const TSharedRef<FPropertyEditor>& Child )
{
ChildPropertyEditors.Remove( Child );
}
const TArray< TSharedRef< FPropertyEditor > >& FPropertyEditor::GetPropertyEditorChildren() const
{
return ChildPropertyEditors;
}
TSharedRef< FPropertyNode > FPropertyEditor::GetPropertyNode() const
{
return PropertyNode;
}
const UProperty* FPropertyEditor::GetProperty() const
{
return PropertyNode->GetProperty();
}
TSharedRef< IPropertyHandle > FPropertyEditor::GetPropertyHandle() const
{
return PropertyHandle.ToSharedRef();
}
bool FPropertyEditor::IsEditConditionMet( UBoolProperty* ConditionProperty, const TArray<FPropertyConditionInfo>& ConditionValues ) const
{
check( ConditionProperty );
bool bResult = false;
FPropertyNode* ParentNode = PropertyNode->GetParentNode();
if(ParentNode)
{
bool bAllConditionsMet = true;
for (int32 ValueIdx = 0; bAllConditionsMet && ValueIdx < ConditionValues.Num(); ValueIdx++)
{
uint8* BaseOffset = ParentNode->GetValueAddress(ConditionValues[ValueIdx].BaseAddress);
if (!BaseOffset)
{
bAllConditionsMet = false;
break;
}
uint8* ValueAddr = EditConditionProperty->ContainerPtrToValuePtr<uint8>(BaseOffset);
if (ConditionValues[ValueIdx].bNegateValue)
{
bAllConditionsMet = !ConditionProperty->GetPropertyValue(ValueAddr);
}
else
{
bAllConditionsMet = ConditionProperty->GetPropertyValue(ValueAddr);
}
}
bResult = bAllConditionsMet;
}
return bResult;
}
bool FPropertyEditor::GetEditConditionPropertyAddress( UBoolProperty*& ConditionProperty, FPropertyNode& InPropertyNode, TArray<FPropertyConditionInfo>& ConditionPropertyAddresses )
{
bool bResult = false;
bool bNegate = false;
UBoolProperty* EditConditionProperty = PropertyCustomizationHelpers::GetEditConditionProperty(InPropertyNode.GetProperty(), bNegate);
if ( EditConditionProperty != NULL )
{
FPropertyNode* ParentNode = InPropertyNode.GetParentNode();
check(ParentNode);
UProperty* Property = InPropertyNode.GetProperty();
if (Property)
{
bool bStaticArray = (Property->ArrayDim > 1) && (InPropertyNode.GetArrayIndex() != INDEX_NONE);
if (bStaticArray)
{
//in the case of conditional static arrays, we have to go up one more level to get the proper parent struct.
ParentNode = ParentNode->GetParentNode();
check(ParentNode);
}
}
auto ComplexParentNode = ParentNode->FindComplexParent();
if (ComplexParentNode)
{
for (int32 Index = 0; Index < ComplexParentNode->GetInstancesNum(); ++Index)
{
uint8* BaseAddress = ComplexParentNode->GetMemoryOfInstance(Index);
if (BaseAddress)
{
// Get the address corresponding to the base of this property (i.e. if a struct property, set BaseOffset to the address of value for the whole struct)
uint8* BaseOffset = ParentNode->GetValueAddress(BaseAddress);
check(BaseOffset != NULL);
FPropertyConditionInfo NewCondition;
// now calculate the address of the property value being used as the condition and add it to the array.
NewCondition.BaseAddress = BaseAddress;
NewCondition.bNegateValue = bNegate;
ConditionPropertyAddresses.Add(NewCondition);
bResult = true;
}
}
}
}
if ( bResult )
{
// set the output variable
ConditionProperty = EditConditionProperty;
}
return bResult;
}
bool FPropertyEditor::SupportsEditConditionToggle( UProperty* InProperty )
{
bool bShowEditConditionToggle = false;
static const FName Name_HideEditConditionToggle("HideEditConditionToggle");
if (!InProperty->HasMetaData(Name_HideEditConditionToggle))
{
bool bNegateValue = false;
UBoolProperty* ConditionalProperty = PropertyCustomizationHelpers::GetEditConditionProperty( InProperty, bNegateValue );
if( ConditionalProperty != NULL )
{
if (!ConditionalProperty->HasAllPropertyFlags(CPF_Edit))
{
// Warn if the editcondition property is not marked as editable; this will break when the component is added to a Blueprint.
UObject* PropertyScope = InProperty->GetOwnerClass();
UObject* ConditionalPropertyScope = ConditionalProperty->GetOwnerClass();
if (!PropertyScope)
{
PropertyScope = InProperty->GetOwnerStruct();
ConditionalPropertyScope = ConditionalProperty->GetOwnerStruct();
}
const FString PropertyScopeName = PropertyScope ? PropertyScope->GetName() : FString();
const FString ConditionalPropertyScopeName = ConditionalPropertyScope ? ConditionalPropertyScope->GetName() : FString();
bShowEditConditionToggle = true;
}
else
{
// If it's editable, then only put an inline toggle box if the metadata specifies it
static const FName Name_InlineEditConditionToggle("InlineEditConditionToggle");
if (ConditionalProperty->HasMetaData(Name_InlineEditConditionToggle))
{
bShowEditConditionToggle = true;
}
}
}
}
return bShowEditConditionToggle;
}
void FPropertyEditor::SyncToObjectsInNode( const TWeakPtr< FPropertyNode >& WeakPropertyNode )
{
#if WITH_EDITOR
if ( !GUnrealEd )
{
return;
}
TSharedPtr< FPropertyNode > PropertyNode = WeakPropertyNode.Pin();
check(PropertyNode.IsValid());
UProperty* NodeProperty = PropertyNode->GetProperty();
UObjectPropertyBase* ObjectProperty = Cast<UObjectPropertyBase>( NodeProperty );
UInterfaceProperty* IntProp = Cast<UInterfaceProperty>( NodeProperty );
{
UClass* PropertyClass = UObject::StaticClass();
if( ObjectProperty )
{
PropertyClass = ObjectProperty->PropertyClass;
}
else if( IntProp )
{
PropertyClass = IntProp->InterfaceClass;
}
// Get a list of addresses for objects handled by the property window.
FReadAddressList ReadAddresses;
PropertyNode->GetReadAddress( !!PropertyNode->HasNodeFlags(EPropertyNodeFlags::SingleSelectOnly), ReadAddresses, false );
// GetReadAddresses will only provide a list of addresses if the property was properly formed, objects were selected, and only one object was selected if the node has the SingleSelectOnly flag.
// If a list of addresses is provided, GetReadAddress may still return false but we can operate on the property addresses even if they have different values.
check( ReadAddresses.Num() > 0 );
// Create a list of object names.
TArray<FString> ObjectNames;
ObjectNames.Empty( ReadAddresses.Num() );
// Copy each object's object property name off into the name list.
for ( int32 AddrIndex = 0 ; AddrIndex < ReadAddresses.Num() ; ++AddrIndex )
{
new( ObjectNames ) FString();
uint8* Address = ReadAddresses.GetAddress(AddrIndex);
if( Address )
{
NodeProperty->ExportText_Direct(ObjectNames[AddrIndex], Address, Address, NULL, PPF_None );
}
}
// Create a list of objects to sync the generic browser to.
TArray<UObject*> Objects;
for ( int32 ObjectIndex = 0 ; ObjectIndex < ObjectNames.Num() ; ++ObjectIndex )
{
UObject* Package = ANY_PACKAGE;
if( ObjectNames[ObjectIndex].Contains( TEXT(".")) )
{
// Formatted text string, use the exact path instead of any package
Package = NULL;
}
UObject* Object = StaticFindObject( PropertyClass, Package, *ObjectNames[ObjectIndex] );
if( !Object && Package != ANY_PACKAGE )
{
Object = StaticLoadObject(PropertyClass, Package, *ObjectNames[ObjectIndex]);
}
if ( Object )
{
// If the selected object is a blueprint generated class, then browsing to it in the content browser should instead point to the blueprint
// Note: This code needs to change once classes are the top level asset in the content browser and/or blueprint classes are displayed in the content browser
if (UClass* ObjectAsClass = Cast<UClass>(Object))
{
if (ObjectAsClass->ClassGeneratedBy != NULL)
{
Object = ObjectAsClass->ClassGeneratedBy;
}
}
Objects.Add( Object );
}
}
// If a single actor is selected, sync to its location in the level editor viewport instead of the content browser.
if( Objects.Num() == 1 && Objects[0]->IsA<AActor>() )
{
AActor* Actor = CastChecked<AActor>(Objects[0]);
if (Actor->GetLevel())
{
TArray<AActor*> Actors;
Actors.Add(Actor);
GEditor->SelectNone(/*bNoteSelectionChange=*/false, /*bDeselectBSPSurfs=*/true);
GEditor->SelectActor(Actor, /*InSelected=*/true, /*bNotify=*/true, /*bSelectEvenIfHidden=*/true);
// Jump to the location of the actor
GEditor->MoveViewportCamerasToActor(Actors, /*bActiveViewportOnly=*/false);
}
}
else if ( Objects.Num() > 0 )
{
GEditor->SyncBrowserToObjects(Objects);
}
}
#endif
}
#undef LOCTEXT_NAMESPACE
| 31.363213 | 195 | 0.756653 | [
"object"
] |
99f57f69fd0519e5e3dd3b3acc422fa38f17a0ba | 4,157 | cpp | C++ | EzAcc/DemoProject/Input Combos/Motor2D/ctAudio.cpp | Wilhelman/EzAcc-EasyAccessibilityFramework | d785c5f9c36367f6da7a89d10b1b80bd8b382173 | [
"MIT"
] | null | null | null | EzAcc/DemoProject/Input Combos/Motor2D/ctAudio.cpp | Wilhelman/EzAcc-EasyAccessibilityFramework | d785c5f9c36367f6da7a89d10b1b80bd8b382173 | [
"MIT"
] | null | null | null | EzAcc/DemoProject/Input Combos/Motor2D/ctAudio.cpp | Wilhelman/EzAcc-EasyAccessibilityFramework | d785c5f9c36367f6da7a89d10b1b80bd8b382173 | [
"MIT"
] | null | null | null | #include "ctDefs.h"
#include "ctLog.h"
#include "ctAudio.h"
#include "ctInput.h"
#include "ctApp.h"
#include "SDL/include/SDL.h"
#include "SDL_mixer\include\SDL_mixer.h"
#pragma comment( lib, "SDL_mixer/libx86/SDL2_mixer.lib" )
ctAudio::ctAudio() : ctModule()
{
music = NULL;
name = "audio";
}
// Destructor
ctAudio::~ctAudio()
{}
bool ctAudio::Load(pugi::xml_node& save) {
bool ret = true;
Mix_VolumeMusic(save.child("volume").attribute("music").as_int(50));
return ret;
}
bool ctAudio::Save(pugi::xml_node& save)const {
bool ret = true;
if (save.child("volume").empty()) {
save = save.append_child("volume");
save.append_attribute("music").set_value(Mix_VolumeMusic(-1));
}
else {
save.child("volume").attribute("music").set_value(Mix_VolumeMusic(-1));
}
return ret;
}
// Called before render is available
bool ctAudio::Awake(pugi::xml_node& config)
{
LOG("Loading Audio Mixer");
bool ret = true;
SDL_Init(0);
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
{
LOG("SDL_INIT_AUDIO could not initialize! SDL_Error: %s\n", SDL_GetError());
active = false;
ret = true;
}
// load support for the JPG and PNG image formats
int flags = MIX_INIT_OGG;
int init = Mix_Init(flags);
if ((init & flags) != flags)
{
LOG("Could not initialize Mixer lib. Mix_Init: %s", Mix_GetError());
active = false;
ret = true;
}
//Initialize SDL_mixer
if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 2048) < 0)
{
LOG("SDL_mixer could not initialize! SDL_mixer Error: %s\n", Mix_GetError());
active = false;
ret = true;
}
Mix_VolumeMusic(20);
return ret;
}
bool ctAudio::Update(float dt)
{
if (!active)
return true;
if (App->input->GetKey(SDL_SCANCODE_KP_PLUS) == KEY_DOWN) {
Mix_VolumeMusic(Mix_VolumeMusic(-1) + 10);
}
if (App->input->GetKey(SDL_SCANCODE_KP_MINUS) == KEY_DOWN) {
if (Mix_VolumeMusic(-1) < 10)
Mix_VolumeMusic(0);
else
Mix_VolumeMusic(Mix_VolumeMusic(-1) - 10);
}
return true;
}
// Called before quitting
bool ctAudio::CleanUp()
{
if (!active)
return true;
LOG("Freeing music, closing Mixer and Audio subsystem");
if (music != NULL)
{
//Mix_FreeMusic(music);
// Already implemented in EzAcc library, no need to free twice ...
}
Mix_CloseAudio();
Mix_Quit();
SDL_QuitSubSystem(SDL_INIT_AUDIO);
return true;
}
// Play a music file
bool ctAudio::PlayMusic(const char* path, float fade_time)
{
bool ret = true;
if (!active)
return false;
if (music != NULL)
{
if (fade_time > 0.0f)
{
Mix_FadeOutMusic(int(fade_time * 1000.0f));
}
else
{
Mix_HaltMusic();
}
// this call blocks until fade out is done
Mix_FreeMusic(music);
}
music = Mix_LoadMUS(path);
if (music == NULL)
{
LOG("Cannot load music %s. Mix_GetError(): %s\n", path, Mix_GetError());
ret = false;
}
else
{
if (fade_time > 0.0f)
{
if (Mix_FadeInMusic(music, -1, (int)(fade_time * 1000.0f)) < 0)
{
LOG("Cannot fade in music %s. Mix_GetError(): %s", path, Mix_GetError());
ret = false;
}
}
else
{
if (Mix_PlayMusic(music, -1) < 0)
{
LOG("Cannot play in music %s. Mix_GetError(): %s", path, Mix_GetError());
ret = false;
}
}
}
LOG("Successfully playing %s", path);
return ret;
}
bool ctAudio::StopMusic() {
Mix_FreeMusic(music);
music = nullptr;
Mix_HaltMusic();
return true;
}
// Load WAV
unsigned int ctAudio::LoadFx(const char* path)
{
if (!active)
return 0;
uint ret = 0;
Mix_Chunk* chunk = Mix_LoadWAV(path);
if (chunk == nullptr)
{
LOG("Cannot load wav %s. Mix_GetError(): %s", path, Mix_GetError());
}
else
{
fx[last_fx] = chunk;
ret = last_fx++;
if (last_fx == MAX_FX) {
last_fx = 0;
ret = last_fx;
}
}
return ret;
}
// Play WAV
bool ctAudio::PlayFx(unsigned int id, int repeat)
{
if (!active)
return false;
bool ret = false;
if (fx[id] != nullptr)
{
Mix_PlayChannel(-1, fx[id], repeat);
ret = true;
}
return ret;
}
// UnLoad WAV
bool ctAudio::UnLoadFx(uint id)
{
if (!active)
return true;
bool ret = false;
if (fx[id] != nullptr)
{
Mix_FreeChunk(fx[id]);
fx[id] = nullptr;
ret = true;
//last_fx--;
}
return ret;
} | 17.106996 | 79 | 0.647823 | [
"render"
] |
99f8ec7d37f1d904ecff478fed3a3431f927a94d | 8,206 | cpp | C++ | CarDetection/src/ImageAnalysis/ImageAnalysis.cpp | carlosmccosta/Car-Detection | 2c2c8e2172fb606f7e2b974a7e9f46de0e4199a2 | [
"MIT"
] | 41 | 2015-03-22T08:57:08.000Z | 2020-09-12T21:07:39.000Z | CarDetection/src/ImageAnalysis/ImageAnalysis.cpp | Ewenwan/Car-Detection | 2c2c8e2172fb606f7e2b974a7e9f46de0e4199a2 | [
"MIT"
] | 1 | 2016-07-21T07:07:25.000Z | 2016-07-21T08:49:40.000Z | CarDetection/src/ImageAnalysis/ImageAnalysis.cpp | carlosmccosta/Car-Detection | 2c2c8e2172fb606f7e2b974a7e9f46de0e4199a2 | [
"MIT"
] | 32 | 2015-03-23T06:14:37.000Z | 2021-01-23T00:00:12.000Z | #include "ImageAnalysis.h"
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <Image analysis> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
ImageAnalysis::ImageAnalysis(Ptr<ImagePreprocessor> imagePreprocessor, Ptr<ImageDetector> imageClassifierSVM) :
_useCVHiGUI(true), _windowsInitialized(false), _optionsOneWindow(false),
_frameRate(30), _screenWidth(1920), _screenHeight(1080),
_imagePreprocessorPtr(imagePreprocessor), _imageDetector(imageClassifierSVM) {};
ImageAnalysis::~ImageAnalysis() {
if (_useCVHiGUI) {
cv::destroyAllWindows();
}
}
bool ImageAnalysis::processImage(string path, bool useCVHighGUI) {
Mat imageToProcess;
bool loadSuccessful = true;
if (path != "") {
try {
imageToProcess = imread(path, CV_LOAD_IMAGE_COLOR);
} catch (...) {
loadSuccessful = false;
}
if (!imageToProcess.data) {
loadSuccessful = false;
}
} else {
loadSuccessful = false;
}
if (!loadSuccessful) {
if (useCVHighGUI) {
cv::destroyAllWindows();
}
return false;
}
_useCVHiGUI = useCVHighGUI;
_windowsInitialized = false;
bool status = processImage(imageToProcess, useCVHighGUI);
while(waitKey(10) != ESC_KEYCODE) {}
if (useCVHighGUI) {
cv::destroyAllWindows();
}
return status;
}
bool ImageAnalysis::processImage(Mat& image, bool useCVHighGUI) {
_originalImage = image.clone();
_useCVHiGUI = useCVHighGUI;
if (useCVHighGUI) {
if (!_windowsInitialized) {
setupMainWindow();
setupResultsWindows(_optionsOneWindow);
_windowsInitialized = true;
}
imshow(WINDOW_NAME_MAIN, _originalImage);
}
_preprocessedImage = image.clone();
_imagePreprocessorPtr->preprocessImage(_preprocessedImage, useCVHighGUI);
_processedImage = _preprocessedImage.clone();
// target detection
cout << "\n\n";
vector<Rect> targetsBoundingRectanglesOut;
Mat votingMask;
Mat votingMaskScaled;
_imageDetector->detectTargets(_processedImage, targetsBoundingRectanglesOut, votingMask, votingMaskScaled, true, true);
imshow(WINDOW_NAME_TARGET_DETECTION, _processedImage);
imshow(WINDOW_NAME_TARGET_DETECTION_VOTER_MASK, votingMaskScaled);
return true;
}
bool ImageAnalysis::updateImage() {
return processImage(_originalImage.clone(), _useCVHiGUI);
}
// ------------------------------------------------------------------------------------- <Video processing> -----------------------------------------------------------------------------------------
bool ImageAnalysis::processVideo(string path, bool useCVHighGUI) {
VideoCapture videoCapture;
try {
videoCapture = VideoCapture(path);
} catch (...) {
return false;
}
return processVideo(videoCapture, useCVHighGUI);
}
bool ImageAnalysis::processVideo(int cameraDeviceNumber, bool useCVHighGUI) {
VideoCapture videoCapture;
try {
videoCapture = VideoCapture(cameraDeviceNumber);
} catch (...) {
return false;
}
return processVideo(videoCapture, useCVHighGUI);
}
bool ImageAnalysis::processVideo(VideoCapture videoCapture, bool useCVHighGUI) {
if (!videoCapture.isOpened()) {
return false;
}
_useCVHiGUI = useCVHighGUI;
_windowsInitialized = false;
int millisecPollingInterval = 1000 / _frameRate;
if (millisecPollingInterval < 10)
millisecPollingInterval = 10;
Mat currentFrame;
while (videoCapture.read(currentFrame)) {
try {
processImage(currentFrame, useCVHighGUI);
} catch(...) {}
if (waitKey(millisecPollingInterval) == ESC_KEYCODE) {
break;
}
}
if (useCVHighGUI) {
cv::destroyAllWindows();
}
return true;
}
// ------------------------------------------------------------------------------------- </Video processing> ----------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------- <OpenCV HighGUI> ------------------------------------------------------------------------------------------
void updateImageAnalysis(int position, void* userData) {
ImageAnalysis* imgAnalysis = ((ImageAnalysis*)userData);
imgAnalysis->updateImage();
}
void ImageAnalysis::setupMainWindow() {
GUIUtils::addHighGUIWindow(0, 0, WINDOW_NAME_MAIN, _originalImage.size().width, _originalImage.size().height, _screenWidth, _screenHeight);
}
void ImageAnalysis::setupResultsWindows(bool optionsOneWindow) {
GUIUtils::addHighGUIWindow(1, 0, WINDOW_NAME_BILATERAL_FILTER, _originalImage.size().width, _originalImage.size().height, _screenWidth, _screenHeight);
//GUIUtils::addHighGUIWindow(2, 0, WINDOW_NAME_HISTOGRAM_EQUALIZATION, _originalImage.size().width, _originalImage.size().height, _screenWidth, _screenHeight);
GUIUtils::addHighGUIWindow(2, 0, WINDOW_NAME_HISTOGRAM_EQUALIZATION_CLAHE, _originalImage.size().width, _originalImage.size().height, _screenWidth, _screenHeight);
GUIUtils::addHighGUIWindow(0, 1, WINDOW_NAME_CONTRAST_AND_BRIGHTNESS, _originalImage.size().width, _originalImage.size().height, _screenWidth, _screenHeight);
GUIUtils::addHighGUIWindow(1, 1, WINDOW_NAME_TARGET_DETECTION_VOTER_MASK, _originalImage.size().width, _originalImage.size().height, _screenWidth, _screenHeight);
GUIUtils::addHighGUIWindow(2, 1, WINDOW_NAME_TARGET_DETECTION, _originalImage.size().width, _originalImage.size().height, _screenWidth, _screenHeight);
if (optionsOneWindow) {
namedWindow(WINDOW_NAME_OPTIONS, CV_WINDOW_NORMAL);
resizeWindow(WINDOW_NAME_OPTIONS, WINDOW_OPTIONS_WIDTH - WINDOW_FRAME_THICKNESS * 2, WINDOW_OPTIONS_HIGHT);
moveWindow(WINDOW_NAME_OPTIONS, _screenWidth - WINDOW_OPTIONS_WIDTH, 0);
} else {
GUIUtils::addHighGUITrackBarWindow(WINDOW_NAME_BILATERAL_FILTER_OPTIONS, 3, 0, 0, _screenWidth);
GUIUtils::addHighGUITrackBarWindow(WINDOW_NAME_HISTOGRAM_EQUALIZATION_CLAHE_OPTIONS, 3, 3, 1, _screenWidth);
GUIUtils::addHighGUITrackBarWindow(WINDOW_NAME_CONTRAST_AND_BRIGHTNESS_OPTIONS, 2, 6, 2, _screenWidth);
}
cv::createTrackbar(TRACK_BAR_NAME_BILATERAL_FILTER_DIST, (optionsOneWindow? WINDOW_NAME_OPTIONS : WINDOW_NAME_BILATERAL_FILTER_OPTIONS), _imagePreprocessorPtr->getBilateralFilterDistancePtr(), 100, updateImageAnalysis, (void*)this);
cv::createTrackbar(TRACK_BAR_NAME_BILATERAL_FILTER_COLOR_SIG, (optionsOneWindow ? WINDOW_NAME_OPTIONS : WINDOW_NAME_BILATERAL_FILTER_OPTIONS), _imagePreprocessorPtr->getBilateralFilterSigmaColorPtr(), 200, updateImageAnalysis, (void*)this);
cv::createTrackbar(TRACK_BAR_NAME_BILATERAL_FILTER_SPACE_SIG, (optionsOneWindow ? WINDOW_NAME_OPTIONS : WINDOW_NAME_BILATERAL_FILTER_OPTIONS), _imagePreprocessorPtr->getBilateralFilterSigmaSpacePtr(), 200, updateImageAnalysis, (void*)this);
cv::createTrackbar(TRACK_BAR_NAME_CLAHE_CLIP, (optionsOneWindow ? WINDOW_NAME_OPTIONS : WINDOW_NAME_HISTOGRAM_EQUALIZATION_CLAHE_OPTIONS), _imagePreprocessorPtr->getClaehClipLimitPtr(), 100, updateImageAnalysis, (void*)this);
cv::createTrackbar(TRACK_BAR_NAME_CLAHE_TILE_X, (optionsOneWindow ? WINDOW_NAME_OPTIONS : WINDOW_NAME_HISTOGRAM_EQUALIZATION_CLAHE_OPTIONS), _imagePreprocessorPtr->getClaehTileXSizePtr(), 20, updateImageAnalysis, (void*)this);
cv::createTrackbar(TRACK_BAR_NAME_CLAHE_TILE_Y, (optionsOneWindow ? WINDOW_NAME_OPTIONS : WINDOW_NAME_HISTOGRAM_EQUALIZATION_CLAHE_OPTIONS), _imagePreprocessorPtr->getClaehTileYSizePtr(), 20, updateImageAnalysis, (void*)this);
cv::createTrackbar(TRACK_BAR_NAME_CONTRAST, (optionsOneWindow ? WINDOW_NAME_OPTIONS : WINDOW_NAME_CONTRAST_AND_BRIGHTNESS_OPTIONS), _imagePreprocessorPtr->getContrastPtr(), 100, updateImageAnalysis, (void*)this);
cv::createTrackbar(TRACK_BAR_NAME_BRIGHTNESS, (optionsOneWindow ? WINDOW_NAME_OPTIONS : WINDOW_NAME_CONTRAST_AND_BRIGHTNESS_OPTIONS), _imagePreprocessorPtr->getBrightnessPtr(), 1000, updateImageAnalysis, (void*)this);
}
// -------------------------------------------------------------------------------------- </OpenCV HighGUI> -----------------------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> </Image analysis> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | 41.444444 | 241 | 0.685108 | [
"vector"
] |
820dbbaecb3734f8accdc5ea32119f2f9428a4b8 | 2,220 | cpp | C++ | implementations/ugene/src/corelibs/U2View/src/ov_msa/General/MSAGeneralTabFactory.cpp | r-barnes/sw_comparison | 1ac2c9cc10a32badd6b8fb1e96516c97f7800176 | [
"BSD-Source-Code"
] | null | null | null | implementations/ugene/src/corelibs/U2View/src/ov_msa/General/MSAGeneralTabFactory.cpp | r-barnes/sw_comparison | 1ac2c9cc10a32badd6b8fb1e96516c97f7800176 | [
"BSD-Source-Code"
] | null | null | null | implementations/ugene/src/corelibs/U2View/src/ov_msa/General/MSAGeneralTabFactory.cpp | r-barnes/sw_comparison | 1ac2c9cc10a32badd6b8fb1e96516c97f7800176 | [
"BSD-Source-Code"
] | null | null | null | /**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2020 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include "MSAGeneralTabFactory.h"
#include <QPixmap>
#include <U2Core/U2SafePoints.h>
#include <U2View/MSAEditor.h>
#include "MSAGeneralTab.h"
namespace U2 {
const QString MSAGeneralTabFactory::GROUP_ID = "OP_MSA_GENERAL";
const QString MSAGeneralTabFactory::GROUP_ICON_STR = ":core/images/settings2.png";
const QString MSAGeneralTabFactory::GROUP_DOC_PAGE = "46499988";
MSAGeneralTabFactory::MSAGeneralTabFactory() {
objectViewOfWidget = ObjViewType_AlignmentEditor;
}
QWidget *MSAGeneralTabFactory::createWidget(GObjectView *objView, const QVariantMap &options) {
SAFE_POINT(objView != nullptr,
QString("Internal error: unable to create widget for group '%1', object view is NULL.").arg(GROUP_ID),
nullptr);
MSAEditor *msa = qobject_cast<MSAEditor *>(objView);
SAFE_POINT(msa != nullptr,
QString("Internal error: unable to cast object view to MSAEditor for group '%1'.").arg(GROUP_ID),
nullptr);
MSAGeneralTab *widget = new MSAGeneralTab(msa);
widget->setObjectName("MsaGeneralTab");
return widget;
}
const QString &MSAGeneralTabFactory::getGroupId() {
return GROUP_ID;
}
OPGroupParameters MSAGeneralTabFactory::getOPGroupParameters() {
return OPGroupParameters(GROUP_ID, QPixmap(GROUP_ICON_STR), QObject::tr("General"), GROUP_DOC_PAGE);
}
} // namespace U2
| 33.636364 | 117 | 0.731982 | [
"object"
] |
8210a21f8c0289fb692fd8e8576b96245b4b5f35 | 9,453 | hpp | C++ | applications/physbam/physbam-lib/External_Libraries/Archives/boost/boost/numeric/ublas/operation_sparse.hpp | schinmayee/nimbus | 170cd15e24a7a88243a6ea80aabadc0fc0e6e177 | [
"BSD-3-Clause"
] | 20 | 2017-07-03T19:09:09.000Z | 2021-09-10T02:53:56.000Z | applications/physbam/physbam-lib/External_Libraries/Archives/boost/boost/numeric/ublas/operation_sparse.hpp | schinmayee/nimbus | 170cd15e24a7a88243a6ea80aabadc0fc0e6e177 | [
"BSD-3-Clause"
] | null | null | null | applications/physbam/physbam-lib/External_Libraries/Archives/boost/boost/numeric/ublas/operation_sparse.hpp | schinmayee/nimbus | 170cd15e24a7a88243a6ea80aabadc0fc0e6e177 | [
"BSD-3-Clause"
] | 9 | 2017-09-17T02:05:06.000Z | 2020-01-31T00:12:01.000Z | //
// Copyright (c) 2000-2002
// Joerg Walter, Mathias Koch
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. The authors make no representations
// about the suitability of this software for any purpose.
// It is provided "as is" without express or implied warranty.
//
// The authors gratefully acknowledge the support of
// GeNeSys mbH & Co. KG in producing this work.
//
#ifndef _BOOST_UBLAS_OPERATION_SPARSE_
#define _BOOST_UBLAS_OPERATION_SPARSE_
#include <boost/numeric/ublas/traits.hpp>
// These scaled additions were borrowed from MTL unashamedly.
// But Alexei Novakov had a lot of ideas to improve these. Thanks.
namespace boost { namespace numeric { namespace ublas {
template<class M, class E1, class E2, class TRI>
BOOST_UBLAS_INLINE
M &
sparse_prod (const matrix_expression<E1> &e1,
const matrix_expression<E2> &e2,
M &m, TRI,
row_major_tag) {
typedef M matrix_type;
typedef TRI triangular_restriction;
typedef const E1 expression1_type;
typedef const E2 expression2_type;
typedef typename M::size_type size_type;
typedef typename M::value_type value_type;
// ISSUE why is there a dense vector here?
vector<value_type> temporary (e2 ().size2 ());
temporary.clear ();
#if BOOST_UBLAS_TYPE_CHECK
matrix<value_type, row_major> cm (m.size1 (), m.size2 ());
typedef typename type_traits<value_type>::real_type real_type;
real_type merrorbound (norm_1 (m) + norm_1 (e1) * norm_1 (e2));
indexing_matrix_assign<scalar_assign> (cm, prod (e1, e2), row_major_tag ());
#endif
typename expression1_type::const_iterator1 it1 (e1 ().begin1 ());
typename expression1_type::const_iterator1 it1_end (e1 ().end1 ());
while (it1 != it1_end) {
size_type jb (temporary.size ());
size_type je (0);
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
typename expression1_type::const_iterator2 it2 (it1.begin ());
typename expression1_type::const_iterator2 it2_end (it1.end ());
#else
typename expression1_type::const_iterator2 it2 (boost::numeric::ublas::begin (it1, iterator1_tag ()));
typename expression1_type::const_iterator2 it2_end (boost::numeric::ublas::end (it1, iterator1_tag ()));
#endif
while (it2 != it2_end) {
// temporary.plus_assign (*it2 * row (e2 (), it2.index2 ()));
matrix_row<expression2_type> mr (e2 (), it2.index2 ());
typename matrix_row<expression2_type>::const_iterator itr (mr.begin ());
typename matrix_row<expression2_type>::const_iterator itr_end (mr.end ());
while (itr != itr_end) {
size_type j (itr.index ());
temporary (j) += *it2 * *itr;
jb = (std::min) (jb, j);
je = (std::max) (je, j);
++ itr;
}
++ it2;
}
for (size_type j = jb; j < je + 1; ++ j) {
if (temporary (j) != value_type/*zero*/()) {
// FIXME we'll need to extend the container interface!
// m.push_back (it1.index1 (), j, temporary (j));
// FIXME What to do with adaptors?
// m.insert (it1.index1 (), j, temporary (j));
if (triangular_restriction::other (it1.index1 (), j))
m (it1.index1 (), j) = temporary (j);
temporary (j) = value_type/*zero*/();
}
}
++ it1;
}
#if BOOST_UBLAS_TYPE_CHECK
BOOST_UBLAS_CHECK (norm_1 (m - cm) <= 2 * std::numeric_limits<real_type>::epsilon () * merrorbound, internal_logic ());
#endif
return m;
}
template<class M, class E1, class E2, class TRI>
BOOST_UBLAS_INLINE
M &
sparse_prod (const matrix_expression<E1> &e1,
const matrix_expression<E2> &e2,
M &m, TRI,
column_major_tag) {
typedef M matrix_type;
typedef TRI triangular_restriction;
typedef const E1 expression1_type;
typedef const E2 expression2_type;
typedef typename M::size_type size_type;
typedef typename M::value_type value_type;
// ISSUE why is there a dense vector here?
vector<value_type> temporary (e1 ().size1 ());
temporary.clear ();
#if BOOST_UBLAS_TYPE_CHECK
matrix<value_type, column_major> cm (m.size1 (), m.size2 ());
typedef typename type_traits<value_type>::real_type real_type;
real_type merrorbound (norm_1 (m) + norm_1 (e1) * norm_1 (e2));
indexing_matrix_assign<scalar_assign> (cm, prod (e1, e2), column_major_tag ());
#endif
typename expression2_type::const_iterator2 it2 (e2 ().begin2 ());
typename expression2_type::const_iterator2 it2_end (e2 ().end2 ());
while (it2 != it2_end) {
size_type ib (temporary.size ());
size_type ie (0);
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
typename expression2_type::const_iterator1 it1 (it2.begin ());
typename expression2_type::const_iterator1 it1_end (it2.end ());
#else
typename expression2_type::const_iterator1 it1 (boost::numeric::ublas::begin (it2, iterator2_tag ()));
typename expression2_type::const_iterator1 it1_end (boost::numeric::ublas::end (it2, iterator2_tag ()));
#endif
while (it1 != it1_end) {
// column (m, it2.index2 ()).plus_assign (*it1 * column (e1 (), it1.index1 ()));
matrix_column<expression1_type> mc (e1 (), it1.index1 ());
typename matrix_column<expression1_type>::const_iterator itc (mc.begin ());
typename matrix_column<expression1_type>::const_iterator itc_end (mc.end ());
while (itc != itc_end) {
size_type i (itc.index ());
temporary (i) += *it1 * *itc;
ib = (std::min) (ib, i);
ie = (std::max) (ie, i);
++ itc;
}
++ it1;
}
for (size_type i = ib; i < ie + 1; ++ i) {
if (temporary (i) != value_type/*zero*/()) {
// FIXME we'll need to extend the container interface!
// m.push_back (i, it2.index2 (), temporary (i));
// FIXME What to do with adaptors?
// m.insert (i, it2.index2 (), temporary (i));
if (triangular_restriction::other (i, it2.index2 ()))
m (i, it2.index2 ()) = temporary (i);
temporary (i) = value_type/*zero*/();
}
}
++ it2;
}
#if BOOST_UBLAS_TYPE_CHECK
BOOST_UBLAS_CHECK (norm_1 (m - cm) <= 2 * std::numeric_limits<real_type>::epsilon () * merrorbound, internal_logic ());
#endif
return m;
}
// Dispatcher
template<class M, class E1, class E2, class TRI>
BOOST_UBLAS_INLINE
M &
sparse_prod (const matrix_expression<E1> &e1,
const matrix_expression<E2> &e2,
M &m, TRI, bool init = true) {
typedef typename M::value_type value_type;
typedef TRI triangular_restriction;
typedef typename M::orientation_category orientation_category;
if (init)
m.assign (zero_matrix<value_type> (e1 ().size1 (), e2 ().size2 ()));
return sparse_prod (e1, e2, m, triangular_restriction (), orientation_category ());
}
template<class M, class E1, class E2, class TRI>
BOOST_UBLAS_INLINE
M
sparse_prod (const matrix_expression<E1> &e1,
const matrix_expression<E2> &e2,
TRI) {
typedef M matrix_type;
typedef TRI triangular_restriction;
matrix_type m (e1 ().size1 (), e2 ().size2 ());
// FIXME needed for c_matrix?!
// return sparse_prod (e1, e2, m, triangular_restriction (), false);
return sparse_prod (e1, e2, m, triangular_restriction (), true);
}
template<class M, class E1, class E2>
BOOST_UBLAS_INLINE
M &
sparse_prod (const matrix_expression<E1> &e1,
const matrix_expression<E2> &e2,
M &m, bool init = true) {
typedef typename M::value_type value_type;
typedef typename M::orientation_category orientation_category;
if (init)
m.assign (zero_matrix<value_type> (e1 ().size1 (), e2 ().size2 ()));
return sparse_prod (e1, e2, m, full (), orientation_category ());
}
template<class M, class E1, class E2>
BOOST_UBLAS_INLINE
M
sparse_prod (const matrix_expression<E1> &e1,
const matrix_expression<E2> &e2) {
typedef M matrix_type;
matrix_type m (e1 ().size1 (), e2 ().size2 ());
// FIXME needed for c_matrix?!
// return sparse_prod (e1, e2, m, full (), false);
return sparse_prod (e1, e2, m, full (), true);
}
}}}
#endif
| 42.773756 | 127 | 0.583201 | [
"vector"
] |
821150226242df053df7823665c322876d060f52 | 17,571 | cpp | C++ | src/qwt-6/examples/splineeditor/Plot.cpp | copasi/copasi-dependencies | c01dd455c843522375c32c2989aa8675f59bb810 | [
"Unlicense"
] | 5 | 2015-04-16T14:27:38.000Z | 2021-11-30T14:54:39.000Z | src/qwt-6/examples/splineeditor/Plot.cpp | copasi/copasi-dependencies | c01dd455c843522375c32c2989aa8675f59bb810 | [
"Unlicense"
] | 8 | 2017-05-30T16:58:39.000Z | 2022-02-22T16:51:34.000Z | src/qwt-6/examples/splineeditor/Plot.cpp | copasi/copasi-dependencies | c01dd455c843522375c32c2989aa8675f59bb810 | [
"Unlicense"
] | 7 | 2016-05-29T08:12:59.000Z | 2019-05-02T13:39:25.000Z | /*****************************************************************************
* Qwt Examples - Copyright (C) 2002 Uwe Rathmann
* This file may be used under the terms of the 3-clause BSD License
*****************************************************************************/
#include "Plot.h"
#include "ScalePicker.h"
#include "CanvasPicker.h"
#include <QwtPlotLayout>
#include <QwtPlotCurve>
#include <QwtPlotMarker>
#include <QwtPlotRenderer>
#include <QwtSymbol>
#include <QwtScaleWidget>
#include <QwtWheel>
#include <QwtSplineLocal>
#include <QwtSplineCubic>
#include <QwtSplinePleasing>
#include <QwtSplineBasis>
#include <QwtSplineParametrization>
#include <QwtCurveFitter>
#include <QwtLegend>
#include <QwtLegendLabel>
#include <QEvent>
#include <QPrinter>
#include <QPrintDialog>
#include <QPainterPath>
namespace
{
class Symbol : public QwtSymbol
{
public:
Symbol()
: QwtSymbol( QwtSymbol::Ellipse )
{
QColor c( Qt::gray );
c.setAlpha( 100 );
setBrush( c );
setPen( Qt::black );
setSize( 8 );
}
};
class SplineFitter : public QwtCurveFitter
{
public:
enum Mode
{
PChipSpline,
AkimaSpline,
CubicSpline,
CardinalSpline,
ParabolicBlendingSpline,
PleasingSpline,
BasisSpline
};
SplineFitter( Mode mode )
: QwtCurveFitter( QwtCurveFitter::Path )
, m_spline(NULL)
{
switch( mode )
{
case PleasingSpline:
{
m_spline = new QwtSplinePleasing();
break;
}
case PChipSpline:
{
m_spline = new QwtSplineLocal( QwtSplineLocal::PChip );
break;
}
case AkimaSpline:
{
m_spline = new QwtSplineLocal( QwtSplineLocal::Akima );
break;
}
case CubicSpline:
{
m_spline = new QwtSplineCubic();
break;
}
case CardinalSpline:
{
m_spline = new QwtSplineLocal( QwtSplineLocal::Cardinal );
break;
}
case ParabolicBlendingSpline:
{
m_spline = new QwtSplineLocal( QwtSplineLocal::ParabolicBlending );
break;
}
case BasisSpline:
{
m_spline = new QwtSplineBasis();
break;
}
}
if ( m_spline )
m_spline->setParametrization( QwtSplineParametrization::ParameterX );
}
~SplineFitter()
{
delete m_spline;
}
void setClosing( bool on )
{
if ( m_spline == NULL )
return;
m_spline->setBoundaryType(
on ? QwtSpline::ClosedPolygon : QwtSpline::ConditionalBoundaries );
}
void setBoundaryCondition( const QString& condition )
{
QwtSplineC2* splineC2 = dynamic_cast< QwtSplineC2* >( m_spline );
if ( splineC2 )
{
if ( condition == "Cubic Runout" )
{
setBoundaryConditions( QwtSplineC2::CubicRunout );
return;
}
if ( condition == "Not a Knot" )
{
setBoundaryConditions( QwtSplineC2::NotAKnot );
return;
}
}
QwtSplineC1* splineC1 = dynamic_cast< QwtSplineC1* >( m_spline );
if ( splineC1 )
{
if ( condition == "Linear Runout" )
{
setBoundaryConditions( QwtSpline::LinearRunout, 0.0 );
return;
}
if ( condition == "Parabolic Runout" )
{
// Parabolic Runout means clamping the 3rd derivative to 0.0
setBoundaryConditions( QwtSpline::Clamped3, 0.0 );
return;
}
}
// Natural
setBoundaryConditions( QwtSplineC1::Clamped2, 0.0 );
}
void setParametric( const QString& parameterType )
{
QwtSplineParametrization::Type type = QwtSplineParametrization::ParameterX;
if ( parameterType == "Uniform" )
{
type = QwtSplineParametrization::ParameterUniform;
}
else if ( parameterType == "Centripetral" )
{
type = QwtSplineParametrization::ParameterCentripetal;
}
else if ( parameterType == "Chordal" )
{
type = QwtSplineParametrization::ParameterChordal;
}
else if ( parameterType == "Manhattan" )
{
type = QwtSplineParametrization::ParameterManhattan;
}
m_spline->setParametrization( type );
}
virtual QPolygonF fitCurve( const QPolygonF& points ) const QWT_OVERRIDE
{
return m_spline->polygon( points, 0.5 );
}
virtual QPainterPath fitCurvePath( const QPolygonF& points ) const QWT_OVERRIDE
{
return m_spline->painterPath( points );
}
private:
void setBoundaryConditions( int condition, double value = 0.0 )
{
if ( m_spline == NULL )
return;
// always the same at both ends
m_spline->setBoundaryCondition( QwtSpline::AtBeginning, condition );
m_spline->setBoundaryValue( QwtSpline::AtBeginning, value );
m_spline->setBoundaryCondition( QwtSpline::AtEnd, condition );
m_spline->setBoundaryValue( QwtSpline::AtEnd, value );
}
QwtSpline* m_spline;
};
class Curve : public QwtPlotCurve
{
public:
Curve( const QString& title, const QColor& color )
: QwtPlotCurve( title )
{
setPaintAttribute( QwtPlotCurve::ClipPolygons, false );
setCurveAttribute( QwtPlotCurve::Fitted, true );
setRenderHint( QwtPlotItem::RenderAntialiased );
setPen( color );
setZ( 100 ); // on top of the marker
}
};
class LineMarker : public QwtPlotMarker
{
public:
LineMarker( const QString& title, const QColor& color )
: QwtPlotMarker( title )
{
setLineStyle( QwtPlotMarker::VLine );
setLinePen( QPen( color, 0, Qt::DotLine ) );
QwtText text( "click on the axes" );
text.setBackgroundBrush( Qt::white );
text.setColor( Qt::darkRed );
setLabel( text );
setLabelOrientation( Qt::Vertical );
setXValue( 5 );
}
};
}
Plot::Plot( bool parametric, QWidget* parent )
: QwtPlot( parent )
, m_boundaryCondition( QwtSplineC1::Clamped2 )
{
setTitle( "Points can be dragged using the mouse" );
setCanvasBackground( Qt::white );
#ifndef QT_NO_CURSOR
canvas()->setCursor( Qt::PointingHandCursor );
#endif
QwtLegend* legend = new QwtLegend;
legend->setDefaultItemMode( QwtLegendData::Checkable );
insertLegend( legend, QwtPlot::RightLegend );
connect( legend, SIGNAL(checked(const QVariant&,bool,int)),
SLOT(legendChecked(const QVariant&,bool)) );
// Avoid jumping when label with 3 digits
// appear/disappear when scrolling vertically
QwtScaleDraw* sd = axisScaleDraw( QwtAxis::YLeft );
sd->setMinimumExtent( sd->extent( axisWidget( QwtAxis::YLeft )->font() ) );
// pointless marker
m_marker = new LineMarker( "Marker", Qt::darkRed );
m_marker->attach( this );
// curves
m_curve = new Curve( "Lines", QColor() );
m_curve->setStyle( QwtPlotCurve::NoCurve );
m_curve->setSymbol( new Symbol() );
m_curve->setItemAttribute( QwtPlotItem::Legend, false );
m_curve->setZ( 1000 );
QPolygonF points;
if ( parametric )
{
setAxisScale( QwtAxis::XBottom, 20.0, 80.0 );
setAxisScale( QwtAxis::YLeft, -50.0, 100.0 );
const QSizeF size( 40, 50 );
const QPointF pos( 50, 70 );
const double cos30 = 0.866025;
const double dx = 0.5 * size.width() - cos30;
const double dy = 0.25 * size.height();
double x1 = pos.x() - dx;
double y1 = pos.y() - 2 * dy;
const double x2 = x1 + 1 * dx;
const double x3 = x1 + 2 * dx;
const double y2 = y1 + 1 * dy;
const double y3 = y1 + 3 * dy;
const double y4 = y1 + 4 * dy;
points += QPointF( x2, y1 );
points += QPointF( 0.5 * ( x2 + x3 ), y1 - 0.5 * ( y2 - y1 ) );
points += QPointF( x3, y2 );
points += QPointF( 0.5 * ( x2 + x3 ), 0.5 * ( y3 + y1 ) );
points += QPointF( x3, y3 );
points += QPointF( 0.5 * ( x2 + x3 ), y3 + 0.5 * ( y3 - y2 ) );
points += QPointF( x2, y4 );
points += QPointF( 0.5 * ( x1 + x2 ), y3 + 0.5 * ( y4 - y3 ) );
points += QPointF( x1, y3 );
points += QPointF( x1, y2 );
}
else
{
setAxisScale( QwtAxis::XBottom, 0.0, 100.0 );
setAxisScale( QwtAxis::YLeft, -50.0, 100.0 );
points << QPointF( 10, 30 ) << QPointF( 20, 90 ) << QPointF( 25, 60 )
<< QPointF( 35, 38 ) << QPointF( 42, 40 ) << QPointF( 55, 60 )
<< QPointF( 60, 50 ) << QPointF( 65, 80 ) << QPointF( 73, 30 )
<< QPointF( 82, 30 ) << QPointF( 87, 40 ) << QPointF( 95, 70 );
}
m_curve->setSamples( points );
m_curve->attach( this );
//
Curve* curve;
QVector< Curve* > curves;
curve = new Curve( "Pleasing", "DarkGoldenRod" );
curve->setCurveFitter( new SplineFitter( SplineFitter::PleasingSpline ) );
curves += curve;
curve = new Curve( "Cardinal", Qt::darkGreen);
curve->setCurveFitter( new SplineFitter( SplineFitter::CardinalSpline ) );
curves += curve;
curve = new Curve( "PChip", Qt::darkYellow);
curve->setCurveFitter( new SplineFitter( SplineFitter::PChipSpline ) );
curves += curve;
curve = new Curve( "Parabolic Blending", Qt::darkBlue);
curve->setCurveFitter( new SplineFitter( SplineFitter::ParabolicBlendingSpline ) );
curves += curve;
curve = new Curve( "Akima", Qt::darkCyan);
curve->setCurveFitter( new SplineFitter( SplineFitter::AkimaSpline ) );
curves += curve;
curve = new Curve( "Cubic", Qt::darkRed );
curve->setCurveFitter( new SplineFitter( SplineFitter::CubicSpline ) );
curves += curve;
curve = new Curve( "Basis", QColor("DarkOliveGreen" ) );
curve->setCurveFitter( new SplineFitter( SplineFitter::BasisSpline ) );
curves += curve;
for ( int i = 0; i < curves.size(); i++ )
{
curves[i]->attach( this );
showCurve( curves[i], true );
}
#if 0
for ( int i = 0; i < curves.size(); i++ )
showCurve( curves[i], false );
showCurve( curves[0], true );
#endif
setOverlaying( false );
// ------------------------------------
// The scale picker translates mouse clicks
// on the bottom axis into clicked() signals
// ------------------------------------
ScalePicker* scalePicker = new ScalePicker( this );
connect( scalePicker, SIGNAL(clicked(int,double)),
this, SLOT(updateMarker(int,double)) );
// ------------------------------------
// The canvas picker handles all mouse and key
// events on the plot canvas
// ------------------------------------
( void ) new CanvasPicker( !parametric, this );
// ------------------------------------
// We add a wheel to the canvas
// ------------------------------------
m_wheel = new QwtWheel( canvas() );
m_wheel->setOrientation( Qt::Vertical );
m_wheel->setRange( -100, 100 );
m_wheel->setValue( 0.0 );
m_wheel->setMass( 0.2 );
m_wheel->setTotalAngle( 4 * 360.0 );
m_wheel->resize( 16, 60 );
plotLayout()->setAlignCanvasToScale( QwtAxis::XTop, true );
plotLayout()->setAlignCanvasToScale( QwtAxis::XBottom, true );
plotLayout()->setAlignCanvasToScale( QwtAxis::YLeft, true );
plotLayout()->setCanvasMargin( m_wheel->width() + 4, QwtAxis::YRight );
connect( m_wheel, SIGNAL(valueChanged(double)),
SLOT(scrollLeftAxis(double)) );
// we need the resize events, to lay out the wheel
canvas()->installEventFilter( this );
m_wheel->setWhatsThis(
"With the wheel you can move the visible area." );
axisWidget( QwtAxis::XBottom )->setWhatsThis(
"Selecting a value at the scale will insert a new curve." );
}
void Plot::scrollLeftAxis( double value )
{
const double range = axisScaleDiv( QwtAxis::YLeft ).range();
setAxisScale( QwtAxis::YLeft, value, value + range );
replot();
}
bool Plot::eventFilter( QObject* object, QEvent* e )
{
if ( e->type() == QEvent::Resize )
{
if ( object == canvas() )
{
const int margin = 2;
const QRect cr = canvas()->contentsRect();
m_wheel->move( cr.right() - margin - m_wheel->width(),
cr.center().y() - ( m_wheel->height() ) / 2 );
}
}
return QwtPlot::eventFilter( object, e );
}
void Plot::updateMarker( int axis, double value )
{
if ( QwtAxis::isYAxis( axis ) )
{
m_marker->setLineStyle( QwtPlotMarker::HLine );
m_marker->setLabelOrientation( Qt::Horizontal );
m_marker->setYValue( value );
}
else
{
m_marker->setLineStyle( QwtPlotMarker::VLine );
m_marker->setLabelOrientation( Qt::Vertical );
m_marker->setXValue( value );
}
replot();
}
void Plot::legendChecked( const QVariant& itemInfo, bool on )
{
QwtPlotItem* plotItem = infoToItem( itemInfo );
if ( plotItem )
showCurve( plotItem, on );
}
void Plot::showCurve( QwtPlotItem* item, bool on )
{
item->setVisible( on );
QwtLegend* lgd = qobject_cast< QwtLegend* >( legend() );
QList< QWidget* > legendWidgets =
lgd->legendWidgets( itemToInfo( item ) );
if ( legendWidgets.size() == 1 )
{
QwtLegendLabel* legendLabel =
qobject_cast< QwtLegendLabel* >( legendWidgets[0] );
if ( legendLabel )
legendLabel->setChecked( on );
}
replot();
}
void Plot::setClosed( bool on )
{
QwtPlotItemList curves = itemList( QwtPlotItem::Rtti_PlotCurve );
for ( int i = 0; i < curves.size(); i++ )
{
QwtPlotCurve* curve = dynamic_cast< QwtPlotCurve* >( curves[i] );
SplineFitter* fitter = dynamic_cast< SplineFitter* >( curve->curveFitter() );
if ( fitter )
fitter->setClosing( on );
}
replot();
}
void Plot::setBoundaryCondition( const QString& condition )
{
QwtPlotItemList curves = itemList( QwtPlotItem::Rtti_PlotCurve );
for ( int i = 0; i < curves.size(); i++ )
{
QwtPlotCurve* curve = dynamic_cast< QwtPlotCurve* >( curves[i] );
SplineFitter* fitter = dynamic_cast< SplineFitter* >( curve->curveFitter() );
if ( fitter )
fitter->setBoundaryCondition( condition );
}
replot();
}
void Plot::setParametric( const QString& parameterType )
{
QwtPlotItemList curves = itemList( QwtPlotItem::Rtti_PlotCurve );
for ( int i = 0; i < curves.size(); i++ )
{
QwtPlotCurve* curve = ( QwtPlotCurve*)curves[i];
SplineFitter* fitter = dynamic_cast< SplineFitter* >( curve->curveFitter() );
if ( fitter )
fitter->setParametric( parameterType );
}
replot();
}
void Plot::setOverlaying( bool on )
{
QPolygonF points;
for ( size_t i = 0; i < m_curve->dataSize(); i++ )
points += m_curve->sample( i );
QwtPlotItemList curves = itemList( QwtPlotItem::Rtti_PlotCurve );
for ( int i = 0; i < curves.size(); i++ )
{
QwtPlotCurve* curve = static_cast< QwtPlotCurve* >( curves[i] );
if ( curve == m_curve )
continue;
QwtSymbol* symbol = NULL;
if ( !on )
{
points.translate( 0.0, -10 );
symbol = new Symbol();
}
curve->setSymbol( symbol );
curve->setSamples( points );
}
m_curve->setVisible( on );
replot();
}
#ifndef QT_NO_PRINTER
void Plot::printPlot()
{
QPrinter printer( QPrinter::HighResolution );
#if QT_VERSION >= 0x050300
printer.setPageOrientation( QPageLayout::Landscape );
#else
printer.setOrientation( QPrinter::Landscape );
#endif
printer.setOutputFileName( "spline.pdf" );
QPrintDialog dialog( &printer );
if ( dialog.exec() )
{
QwtPlotRenderer renderer;
if ( printer.colorMode() == QPrinter::GrayScale )
{
renderer.setDiscardFlag( QwtPlotRenderer::DiscardBackground );
renderer.setDiscardFlag( QwtPlotRenderer::DiscardCanvasBackground );
renderer.setDiscardFlag( QwtPlotRenderer::DiscardCanvasFrame );
renderer.setLayoutFlag( QwtPlotRenderer::FrameWithScales );
}
renderer.renderTo( this, printer );
}
}
#endif
#include "moc_Plot.cpp"
| 28.99505 | 87 | 0.543737 | [
"object"
] |
82184e751034b4631081db34a55db0eb7d0401c3 | 3,640 | cpp | C++ | lidar_data_processing/lidar_surface_detector/src/LidarSurfaceDetector.cpp | raiinboow/Lidar_Data_Processing_ROS | cef1f7b75fdc923e18e8b4f9ac194b1dfee68469 | [
"MIT"
] | 1 | 2022-02-28T12:04:31.000Z | 2022-02-28T12:04:31.000Z | lidar_data_processing/lidar_surface_detector/src/LidarSurfaceDetector.cpp | raiinboow/Lidar_Data_Processing_ROS | cef1f7b75fdc923e18e8b4f9ac194b1dfee68469 | [
"MIT"
] | null | null | null | lidar_data_processing/lidar_surface_detector/src/LidarSurfaceDetector.cpp | raiinboow/Lidar_Data_Processing_ROS | cef1f7b75fdc923e18e8b4f9ac194b1dfee68469 | [
"MIT"
] | 1 | 2021-03-30T00:41:58.000Z | 2021-03-30T00:41:58.000Z | /*****************************************************************
Author: J. Gong
Date: 2021-02-05
Description: LidarSurfaceDetector
*****************************************************************/
// Custom
#include "lidar_surface_detector/LidarSurfaceDetector.h"
#include "lidar_surface_detector/Utility.h"
#define PI 3.14159
// System
#include<cmath>
#include<iostream>
#include <iomanip>
// PCL conversion
#include<pcl_conversions/pcl_conversions.h>
/**************************************************************************
* Class Name: LidarSurfaceDetector
* Description: Road surface detection through asymmetrical grid
**************************************************************************/
/**
* Function Name: LidarSurfaceDetector
* Description: Constructor
* Input:
* - ros::NodeHandle nh: ROS NodeHandel
*
* ######################TODO##########################
* - read configuration from ROS parameter server
* #####################################################
*/
LidarSurfaceDetector::LidarSurfaceDetector(ros::NodeHandle nh){
MOUNT_HEIGHT = 0.3;
MOUNT_ANGLE = 0;
TARGET_WIDTH = 2;
TARGET_WIDTH_RESOLUTION = 0.1;
TARGET_LOOKAHEAD = 5;
// initialize
initialize_variable(nh);
}
/**
* Function Name: initialize_variable
* Description: initialize grid map and publisher
* Input:
* - ros::NodeHandle nh: ROS NodeHandel
* Output: void
*/
void LidarSurfaceDetector::initialize_variable(ros::NodeHandle nh){
// grid map
gm = new GridMap();
*gm = GridMap(MOUNT_HEIGHT, MOUNT_ANGLE, TARGET_LOOKAHEAD, TARGET_WIDTH, TARGET_WIDTH_RESOLUTION);
// publisher
for(int i=0; i<gm->map_rows(); i++){
vector<ros::Publisher*> publisher_row;
for(int j=0; j<gm->map_cols(); j++){
ros::Publisher *pub = new ros::Publisher;
std::string topic_str = "delta_" + std::to_string(i)+"_"+std::to_string(j);
const char* topic = topic_str.c_str();
*pub = nh.advertise<std_msgs::Float32>(topic, 1000);
publisher_row.push_back(pub);
}
publisher_matrix.push_back(publisher_row);
}
}
/**
* Function Name: detectionCallBack
* Description:
* - convert to PCL pointcloud Gen1
* - update grid map
* - publish delta of each cell
* - visualize grid map in the console
* Input:
* - const sensor_msgs::PointCloud2ConstPtr& input: ROS pointcloud message
* Output: void
*/
void LidarSurfaceDetector::detectionCallBack(const sensor_msgs::PointCloud2ConstPtr& input){
cout<<"########################################################"<<endl;
// time stamp
ros::Time ts = input->header.stamp;
double timestamp_ns = ts.toNSec();
// convert to PointCloud Gen2
pcl::PCLPointCloud2::Ptr inPtr(new pcl::PCLPointCloud2);
pcl_conversions::toPCL(*input, *inPtr);
// convert to PointCloud Gen1
pcl::PointCloud<PointT>::Ptr XYZPtr( new pcl::PointCloud<PointT>);
pcl::fromPCLPointCloud2(*inPtr, *XYZPtr);
// update grid
gm->Update(XYZPtr, timestamp_ns);
//publish
publish_delta(gm);
//visualize
gm->Plot();
}
/**
* Function Name: publish_delta
* Description: publish delta of each cell in grid map
* Input: void
* Output: void
*/
void LidarSurfaceDetector::publish_delta(){
for(int i=0; i<gm->map_rows(); i++){
for(int j=0; j<gm->map_cols(); j++){
publisher_matrix[i][j]->publish(gm->delta(i, j));
}
}
}
| 26.376812 | 102 | 0.557418 | [
"vector"
] |
8219fa5d4437215e9e16231d36d2bde994af8748 | 2,869 | cpp | C++ | source/Common/ModelViewMapper.cpp | play704611/dev_driver_tools | 312d40afb533b623e441139797410a33ecab3182 | [
"MIT"
] | null | null | null | source/Common/ModelViewMapper.cpp | play704611/dev_driver_tools | 312d40afb533b623e441139797410a33ecab3182 | [
"MIT"
] | null | null | null | source/Common/ModelViewMapper.cpp | play704611/dev_driver_tools | 312d40afb533b623e441139797410a33ecab3182 | [
"MIT"
] | 1 | 2018-10-02T08:47:03.000Z | 2018-10-02T08:47:03.000Z | //=============================================================================
/// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
/// \author AMD Developer Tools Team
/// \file
/// \brief ModelViewMapper class implementation.
//=============================================================================
// frontend headers
#include <QStandardItemModel>
#include <QDataWidgetMapper>
#include "ModelViewMapper.h"
//-----------------------------------------------------------------------------
/// Explicit constructor
/// \param modelCount the number of models required. Each model is referenced
/// by an ID
//-----------------------------------------------------------------------------
ModelViewMapper::ModelViewMapper(uint32_t modelCount)
: m_modelCount(modelCount)
{
m_ppControlModel = new QStandardItemModel*[modelCount];
m_ppControlMapper = new QDataWidgetMapper*[modelCount];
}
//-----------------------------------------------------------------------------
/// Destructor
//-----------------------------------------------------------------------------
ModelViewMapper::~ModelViewMapper()
{
for (uint32_t loop = 0; loop < m_modelCount; loop++)
{
delete m_ppControlModel[loop];
delete m_ppControlMapper[loop];
}
delete[] m_ppControlModel;
delete[] m_ppControlMapper;
}
//-----------------------------------------------------------------------------
/// Initialize a model corresponding to a IO control property. Allows model/view
/// to work on any UI component
/// \param pWidget the UI widget to use.
/// \param index the ID of the model so it can be referenced internally.
/// \param propertyName the name of the widget property that the model will
/// be mapped to.
//-----------------------------------------------------------------------------
void ModelViewMapper::InitializeModel(QWidget* pWidget, uint32_t id, const QString& propertyName)
{
m_ppControlModel[id] = new QStandardItemModel(1, 1);
QString defaultValue = "{0}";
if (propertyName.compare("styleSheet") == 0)
{
defaultValue = "";
}
QStandardItem* item1 = new QStandardItem(defaultValue);
m_ppControlModel[id]->setItem(0, 0, item1);
// Add a mapping between a QLabel and a section from the model by using QDataWidgetMapper.
m_ppControlMapper[id] = new QDataWidgetMapper();
m_ppControlMapper[id]->setModel(m_ppControlModel[id]);
m_ppControlMapper[id]->addMapping(pWidget, 0, propertyName.toUtf8());
m_ppControlMapper[id]->toFirst();
}
//-----------------------------------------------------------------------------
///
//-----------------------------------------------------------------------------
void ModelViewMapper::SetModelData(int id, const QVariant& data)
{
m_ppControlModel[id]->setData(m_ppControlModel[id]->index(0, 0), data);
}
| 38.77027 | 97 | 0.516208 | [
"model"
] |
821a69d0ee6090c9e9012fabc78de83c5e1b25cd | 33,651 | cpp | C++ | src/UIManager.cpp | pierotofy/glassomium | 27bbfc172501c9553e2ba769526399c166d2e992 | [
"Apache-2.0"
] | 8 | 2015-06-02T20:57:55.000Z | 2020-02-09T21:50:34.000Z | src/UIManager.cpp | pierotofy/glassomium | 27bbfc172501c9553e2ba769526399c166d2e992 | [
"Apache-2.0"
] | 2 | 2016-02-11T15:23:41.000Z | 2017-03-16T13:35:11.000Z | src/UIManager.cpp | pierotofy/glassomium | 27bbfc172501c9553e2ba769526399c166d2e992 | [
"Apache-2.0"
] | 5 | 2015-06-03T09:00:49.000Z | 2019-11-17T12:02:22.000Z | /*
Glassomium - web-based TUIO-enabled window manager
http://www.glassomium.org
Copyright 2012 The Glassomium Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "Application.h"
#include "UIManager.h"
#include "Utils.h"
#include "Globals.h"
//#include "KeyboardMap.h"
#include "TwoFingerGesture.h"
#include "DragGesture.h"
#include "TouchGesture.h"
#include "ColorChangeAnimation.h"
#include "TransformAnimation.h"
#include "UserWindow.h"
#include "SystemWindow.h"
#include "KeyboardWindow.h"
#include "BrowserWindow.h"
#include "ScreensaverWindow.h"
// Z order configuration
#define FOREGROUND_Z_ORDER_START 1000000000
#define KEYBOARD_Z_ORDER_START 2000000000
#define BACKGROUND_Z_ORDER_START -2140000000
#define NUM_APPLICATIONS 200000000
#define USER_Z_ORDER_START -(NUM_APPLICATIONS)
#define SCREENSAVER_Z_ORDER 2140000000
#define FULLSCREEN_Z_ORDER 1999999999
UIManager *UIManager::singleton = 0;
void UIManager::initialize(){
UIManager::singleton = new UIManager();
}
void UIManager::destroy(){
RELEASE_SAFELY(UIManager::singleton);
}
UIManager *UIManager::getSingleton(){
return singleton;
}
UIManager::UIManager(){
assert(UIManager::getSingleton() == 0); // Don't allow multiple instantiations
// Instantiate gesture manager
gestureManager = new GestureManager();
// Instantiate animation manager
animationManager = new AnimationManager();
overlaySprite = new OverlaySprite((unsigned int)Application::windowWidth, (unsigned int)Application::windowHeight);
screensaverShowing = false;
appConfigs = 0;
}
/** Requests from the UI server data that the UI manager will utilize to
* do its job. You need to call this method at startup and whenever the UI server
* has changed the data (UI reload?). The program will throw an excetion of it fails. */
void UIManager::updateServerResources(){
ServerManager::getSingleton()->retrieveJsResources();
appConfigs = ServerManager::getSingleton()->retrieveAppConfigurations();
themeConfig = ServerManager::getSingleton()->retrieveThemeConfiguration();
//themeConfig->dump();
screensaverWait = max(0, themeConfig->getInt("screensaver.wait"));
PhysicsManager::getSingleton()->setEnabled(themeConfig->getBool("physics.enabled"));
PhysicsManager::getSingleton()->setFriction(themeConfig->getFloat("physics.drag-friction"));
PhysicsManager::getSingleton()->setRestitution(themeConfig->getFloat("physics.drag-restitution"));
overlaySprite->setColor(intToColor(themeConfig->getInt("desktop.fade-transition-color")));
}
/** Setup the system windows, menus, keyboards and widgets of the theme received
* from the UI Server. There must be no windows in the windows list before calling this method */
void UIManager::setupSystemLayout(){
std::vector<std::string> components = themeConfig->getComponentsList();
for (unsigned int i = 0; i < components.size(); i++){
// What is each component?
WindowType windowType;
// What is the actual Z-order?
int zOrder;
string componentType = themeConfig->getString(components[i], "window.type");
if (componentType == "foreground"){
windowType = System;
// Z-order starts at 0 in the configuration, but we need to translate it to
// a value that is suitable for our UI manager
// for foreground system windows, they should never be on top of keyboards
// -2 (-1-1) to allow for full screen applications to run on top of system windows + 1 space
zOrder = FOREGROUND_Z_ORDER_START + max(0, min(KEYBOARD_Z_ORDER_START - FOREGROUND_Z_ORDER_START - 2, themeConfig->getInt(components[i], "window.z-order")));
}else if (componentType == "background"){
windowType = System;
// Make sure it's not more than the number of applications
zOrder = BACKGROUND_Z_ORDER_START + max(0, min(-(BACKGROUND_Z_ORDER_START) - NUM_APPLICATIONS, themeConfig->getInt(components[i], "window.z-order")));
}else if (componentType == "keyboard"){
windowType = Keyboard;
zOrder = KEYBOARD_Z_ORDER_START + max(0, themeConfig->getInt(components[i], "window.z-order"));
}else if (componentType == "user"){
windowType = User;
zOrder = USER_Z_ORDER_START + max(0, min(NUM_APPLICATIONS - 1, themeConfig->getInt(components[i], "window.z-order")));
}else{
cout << "FATAL! Invalid window type '" << componentType << "', check your theme configuration!" << endl;
exit(1);
}
Degrees rotation = themeConfig->getFloat(components[i], "window.rotation");
// Cap values between 0 and 1.0
float windowWidth = max(0.0f, min(1.0f, themeConfig->getFloat(components[i], "window.width")));
float windowHeight = max(0.0f, min(1.0f, themeConfig->getFloat(components[i], "window.height")));
float windowPosPercentageX = max(0.0f, min(1.0f, themeConfig->getFloat(components[i], "window.position.x")));
float windowPosPercentageY = max(0.0f, min(1.0f, themeConfig->getFloat(components[i], "window.position.y")));
// Convert position percentages to screen coordinates
float windowPosX = windowPosPercentageX * Application::windowWidth;
float windowPosY = windowPosPercentageY * Application::windowHeight;
// Find URL to load
string url = themeConfig->getString(components[i], "window.URL");
if (url == ""){
cout << "FATAL! Empty URL in window component [" << components[i] << "], check your theme configuration!" << endl;
exit(1);
}
// Add prefix if the URL starts with /
if (url[0] == '/'){
url = "http://localhost:5555" + url;
}
// Create window
Window *w = createWindow(windowWidth, windowHeight, windowType);
w->loadURL(url);
w->setPosition(windowPosX, windowPosY);
w->setZOrder(zOrder);
w->setRotation(rotation);
}
// Extract drag color components
int color = themeConfig->getInt("windows.drag-color");
dragColor = intToColor(color);
onSystemLayoutChanged();
}
/** Helper to converts a 4 bytes integer to a SFML color object */
sf::Color UIManager::intToColor(int color){
return sf::Color((sf::Uint8)(color >> 16),
(sf::Uint8)(color >> 8),
(sf::Uint8)(color));
}
/** This is called by the main loop, updates resources connected to the UI Manager */
void UIManager::update(){
for (unsigned int i = 0; i < windows.size(); i++){
windows[i]->update();
}
getGestureManager()->processQueue();
getAnimationManager()->processQueue();
PhysicsManager::getSingleton()->update();
// Check screensaver
if (screensaverWait > 0 && screensaverClock.getElapsedTime().asSeconds() > screensaverWait && !screensaverShowing){
showScreensaver();
}
// Check garbage bin
if (!garbageBin.empty() && garbageClock.getElapsedTime().asSeconds() > 10){
for (unsigned int i = 0; i < garbageBin.size(); i++){
if (g_debug){
cout << "Disposed window " << garbageBin[i]->getID() << endl;
}
RELEASE_SAFELY(garbageBin[i]);
}
garbageBin.clear();
}
}
/** Creates a screensaver window and displays it to the user, provided that a screensaver
* is not already displayed */
void UIManager::showScreensaver(){
if (!screensaverShowing){
Window *screensaverWindow = createWindow(1.0f, 1.0f, Screensaver);
screensaverWindow->setZOrder(SCREENSAVER_Z_ORDER); // On top of everything
sortWindowsByZOrder();
screensaverWindow->hide();
Animation *fadeIn = new FadeInAnimation(200, screensaverWindow);
fadeIn->start();
screensaverShowing = true;
putToSleepAllWindowsExcept(screensaverWindow);
}
}
/** Takes care of drawing our stuff in the rendering window. The order of drawing
* will decide the Z ordering of the elements */
void UIManager::draw(sf::RenderWindow *renderWindow){
// Windows are ordered by Z value (top most window = beginning of the list)
// so by iterating in reverse order we will get the correct rendering
unsigned int size = windows.size();
for (unsigned int i = 0; i < size; i++){
renderWindow->draw(*windows[size - 1 - i]->getSprite());
}
// Draw the overlay (when needed)
if (overlaySprite->isVisible()) renderWindow->draw(*overlaySprite->getSprite());
// Pointer sprites last
std::map<int, PointerSprite *>::iterator iter;
for (iter = visiblePointers.begin(); iter != visiblePointers.end(); iter++){
renderWindow->draw(*iter->second);
}
}
/** Display a keyboard window for the window that has made a request for it */
void UIManager::showKeyboard(Window *window){
// Are there any keyboards available?
if (keyboardsCount == 0) return;
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i]->getType() == Keyboard){
KeyboardWindow *kw = (KeyboardWindow *)windows[i];
// Available and rotation is close within certain degrees?
// The closest keyboard will be opened
if (kw->available() && kw->rotationSameAs(window, 180.0f / (float)keyboardsCount)){
// Yes, link and show!
kw->linkTo(window);
kw->show();
break;
}
}
}
}
/** Hide (remove) the keyboard from the window specified as an argument */
void UIManager::hideKeyboard(Window *window){
// Which keyboard is our window using?
for (unsigned int i = 0; i < windows.size(); i++){
if (dynamic_cast<KeyboardWindow*>(windows[i]) != NULL){
KeyboardWindow *kw = (KeyboardWindow *)windows[i];
if (kw->isLinkedTo(window)){
kw->unlink();
kw->hide();
kw->reload(); // So that the user starts with a "fresh" keyboard next time
break;
}
}
}
}
/** Based on the location of the parent's center, chooses a new center for the new child window */
void UIManager::setNewWindowCenter(Window *parent, Window *newWindow){
sf::Vector2f parentCenter = parent->getPosition();
// If the parent window crashed, simply set the new position to the same
if (parent->isCrashed()){
newWindow->setPosition(parentCenter);
return;
}
// In what corner of the screen is the parent?
float halfWidth = Application::windowWidth / 2.0f;
float halfHeight = Application::windowHeight / 2.0f;
float displacement = (parent->getHeight() / 2.0f) + (newWindow->getHeight() / 2.0f) + 10.0f;
// Upper left?
if (parentCenter.x < halfWidth && parentCenter.y < halfHeight){
newWindow->setPosition(parentCenter.x + displacement, parentCenter.y + displacement);
}
// Upper right?
else if (parentCenter.x >= halfWidth && parentCenter.y < halfHeight){
newWindow->setPosition(parentCenter.x - displacement, parentCenter.y + displacement);
}
// Lower left?
else if (parentCenter.x < halfWidth && parentCenter.y >= halfHeight){
newWindow->setPosition(parentCenter.x + displacement, parentCenter.y - displacement);
}
// Lower right?
else if (parentCenter.x >= halfWidth && parentCenter.y >= halfHeight){
newWindow->setPosition(parentCenter.x - displacement, parentCenter.y - displacement);
}
}
/** Creates a new window of the specified type and adds it to the list of available windows.
* @param width percentage between 0 and 1 that specifies the width of the window (relative to the screen)
* @param height percentage between 0 and 1 that specifies the height of the window (relative to the screen)
* @param type type of the window to create
* @return a pointer to the newly created window or NULL on error */
Window *UIManager::createWindow(float width, float height, WindowType type){
if (width > 1.0f) width = 1.0f;
if (height > 1.0f) height = 1.0f;
if (g_debug){
cout << "Creating window " << width << "x" << height << endl;
}
Window *w = NULL;
// What type of window are we creating?
if (type == User){
w = new UserWindow(width, height);
}else if (type == System){
w = new SystemWindow(width, height);
}else if (type == Keyboard){
w = new KeyboardWindow(width, height);
}else if (type == Browser){
w = new BrowserWindow(width, height);
}else if (type == Screensaver){
w = new ScreensaverWindow(width, height);
}
// Created?
if (w != NULL){
windows.push_back(w);
if (type == User || type == Browser){
// Modify Z-order of existing applications
setTopMostWindow(w);
}else{
// Simply sort
sortWindowsByZOrder();
}
}
return w;
}
/** To be called after the initial layout of the UI has been changed */
void UIManager::onSystemLayoutChanged(){
sortWindowsByZOrder();
updateKeyboardsCount();
}
/** Updates the count of the number of keyboards available */
void UIManager::updateKeyboardsCount(){
int count = 0;
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i]->getType() == Keyboard){
count++;
}
}
cout << "Found " << count << " keyboards" << endl;
keyboardsCount = count;
}
/** Windows with higher Z order will be first in the list */
void UIManager::sortWindowsByZOrder(){
sort (windows.begin(), windows.end(), UIManager::compareWindowsZOrder);
}
/** Dumps a list of the current windows along with some information
* Useful for debugging */
void UIManager::dumpWindows(){
cout << "Dumping windows: " << endl;
for (unsigned int i = 0; i < windows.size(); i++){
cout << " Window #" << windows[i]->getID() <<
" type " << windows[i]->getType() <<
" z-Order " << windows[i]->getZOrder() << endl;
}
}
/** Returns the window with the highest visible Z order that is being hit by the coordinates provided
* @return window pointer if one is found, NULL otherwise */
Window* UIManager::findFirstWindow(float screen_x, float screen_y){
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i]->isVisible()){
if (windows[i]->coordsInsideWindow(screen_x, screen_y)){
return windows[i];
}
}
}
return NULL;
}
/** Iterates through the list of windows searching for a window with the given ID.
* @return the window with the given ID, or NULL if none is found. */
Window* UIManager::findWindowById(int windowId){
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i]->getID() == windowId){
return windows[i];
}
}
return NULL;
}
/** Returns the window with the highest visible Z order that is also TUIO-enabled hit by the coordinates provided
* @return window pointer if one is found, NULL otherwise */
Window* UIManager::findFirstTuioEnabledWindow(float screen_x, float screen_y, sf::Vector2f &webviewCoords){
// Will need to scan our windows, find one (if any) and convert to webview coordinates
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i]->isVisible() && windows[i]->isTuioEnabled()){
if (windows[i]->coordsInsideWindow(screen_x, screen_y, webviewCoords)){
return windows[i];
}
}
}
return NULL;
}
/** Returns the window with the highest Z order that is being hit by all the coordinates provided
* @return window pointer if one is found, NULL otherwise */
Window* UIManager::findFirstWindow(sf::Vector2f screenCoords[], int numCoords){
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i]->isVisible()){
bool allInside = true;
for (int j = 0; j < numCoords; j++){
if (!windows[i]->coordsInsideWindow(screenCoords[j].x, screenCoords[j].y)){
allInside = false;
break;
}
}
if (allInside) return windows[i];
}
}
return NULL;
}
void UIManager::addPointer(int screen_x, int screen_y, int pointer_id, PointerSprite::Color color = PointerSprite::Red){
#define POINTER_RADIUS 30.0f
// Make sure we do not have already added the same pointer
if (visiblePointers.count(pointer_id) == 0){
PointerSprite *pointerSprite = new PointerSprite(POINTER_RADIUS/800.0f * Application::windowWidth, color);
pointerSprite->setPosition((float)screen_x, (float)screen_y);
visiblePointers[pointer_id] = pointerSprite;
}
}
void UIManager::movePointer(int screen_x, int screen_y, int pointer_id){
PointerSprite *pointerSprite = visiblePointers[pointer_id];
pointerSprite->setPosition((float)screen_x, (float)screen_y);
}
void UIManager::removePointer(int screen_x, int screen_y, int pointer_id){
PointerSprite *pointerSprite = visiblePointers[pointer_id];
RELEASE_SAFELY(pointerSprite);
visiblePointers.erase(pointer_id);
}
/** This is called by webviews whenever a new window is asked to be opened
* @param parent the Window where the request came from */
void UIManager::onNewWindowRequested(const string &url, Window *parent, WindowType type){
// Does this URL have a configuration? If not, generate a temporary one to get the default values
bool removeTemporaryConfiguration = false;
if (appConfigs->count(url) == 0){
(*appConfigs)[url] = new AppConfiguration();
removeTemporaryConfiguration = true;
}
Window *newWindow;
// Is the parent is a user window? (Was this window spawned as a popup from an existing user window?)
if (parent->getType() == User){
newWindow = UIManager::getSingleton()->createWindow(parent->getNormalizedWidth(), parent->getNormalizedHeight(), type);
parent->copyAttributesTo(newWindow);
}else{
// This was spawned by a system window (probably an application launch)
float width = (*appConfigs)[url]->getFloat("window.width");
float height = (*appConfigs)[url]->getFloat("window.height");
// Is there an aspect ratio to override the height?
float aspectRatio = (*appConfigs)[url]->getFloat("window.aspectratio");
if (aspectRatio != 0.0f){
float heightPixels = (width * Application::windowWidth) / aspectRatio;
height = heightPixels / Application::windowHeight;
}
newWindow = UIManager::getSingleton()->createWindow(width, height, type);
// User windows might need to change some application configs
if (type == User){
newWindow->setTransparent((*appConfigs)[url]->getBool("window.transparent"));
}
}
newWindow->hide();
// Start loading
newWindow->loadURL(url);
// Set center position
setNewWindowCenter(parent, newWindow);
// Rotation is inherited from parent
newWindow->setRotation(parent->getRotation());
setTopMostWindow(newWindow);
// Start full screen
if ((*appConfigs)[url]->getBool("window.fullscreen")){
UIManager::getSingleton()->setFullscreen(newWindow);
}
// Fade in
Animation *fadeIn = new FadeInAnimation(200, newWindow);
fadeIn->start();
// User windows will dispose this object
if (removeTemporaryConfiguration){
RELEASE_SAFELY((*appConfigs)[url]);
appConfigs->erase(url);
}
}
/** This is called when a webviews is asked to be closed */
void UIManager::onCloseWindowRequested(Window *sender){
//closeWindow(sender);
fadeAndCloseWindow(sender);
}
/** Called whenever a window has requested to be set to fullscreen */
void UIManager::onWindowEnterFullscreenRequested(Window *sender){
if (!sender->isFullscreen()){
// Save position/rotation/scale for exiting fullscreen later
sender->pushPosition();
// Normalize first
sender->normalizeRotation();
sender->pushRotation();
sender->pushScale();
animateFadeAndSetFullscreen(sender);
//animateScaleAndSetFullscreen(sender);
}
}
/** Sets a window in full screen mode */
void UIManager::setFullscreen(Window *window){
window->setFullscreen(true);
window->setZOrder(FULLSCREEN_Z_ORDER);
sortWindowsByZOrder();
// Put all other windows asleep
putToSleepAllWindowsExcept(window);
//dumpWindows();
}
void UIManager::animateFadeAndSetFullscreen(Window *window){
// Fade overlay in
overlaySprite->setData((void *)window);
Animation *a = new FadeInAnimation(250, overlaySprite, animateFadeAndSetFullscreenCallback);
a->start();
}
void UIManager::animateFadeAndSetFullscreenCallback(AnimatedObject *o){
// Set window to fullscreen, then fade overlay out
Window *w = (Window *)((OverlaySprite *)o)->getData();
UIManager::getSingleton()->setFullscreen(w);
Animation *a = new FadeOutAnimation(250, o);
a->start();
}
void UIManager::animateScaleAndSetFullscreen(Window *window){
sf::Vector2f targetPosition(Application::windowWidth / 2.0f, Application::windowHeight / 2.0f);
// Calculate rotation offset to reach fullscreen
window->normalizeRotation(); // We are now in a 0..360 range
Degrees currentRotation = window->getRotation();
Degrees targetRotation = 0.0f;
WindowOrientation orientation = window->getOrientation();
if (orientation == Bottom){
if (currentRotation >= 0.0f && currentRotation <= 45.0f){
targetRotation = 0.0f;
}else{
targetRotation = 360.0f;
}
}else{
switch(orientation){
case Left:
targetRotation = 90.0f;
break;
case Top:
targetRotation = 180.0f;
break;
case Right:
targetRotation = 270.0f;
break;
case Bottom: // Never executed, but compiler complains if it's not here
targetRotation = 0.0f;
break;
}
}
sf::Vector2f targetScale;
if (orientation == Bottom || orientation == Top){
targetScale = sf::Vector2f(Application::windowWidth / window->getTextureWidth(),
Application::windowHeight / window->getTextureHeight());
}else{
targetScale = sf::Vector2f(Application::windowHeight / window->getTextureWidth(),
Application::windowWidth / window->getTextureHeight());
}
Animation *a = new TransformAnimation(250, targetScale, targetPosition, targetRotation, TransformAnimation::Linear, window, animateScaleAndSetFullscreenCallback);
a->start();
}
void UIManager::animateScaleAndSetFullscreenCallback(AnimatedObject *w){
UIManager::getSingleton()->setFullscreen((Window *)w);
}
/** Called whenever a window has requested to exit out of fullscreen.
* No animation/scaling/rotating is performed. */
void UIManager::onWindowExitFullscreenRequested(Window *sender){
if (sender->isFullscreen()){
sender->setFullscreen(false);
sender->setZOrder(-1);
sortWindowsByZOrder();
wakeUpAllWindowsExcept(sender);
}
}
/** Called whenever a window wants to return to its previous rotation/dimension and scale
* before going to fullscreen. */
void UIManager::onWindowAnimatedExitFullscreenRequested(Window *sender){
if (sender->isFullscreen()){
onWindowExitFullscreenRequested(sender);
Degrees targetRotation = sender->popRotation();
sf::Vector2f targetScale = sender->popScale();
sf::Vector2f targetPosition = sender->popPosition();
// Clock-wise or counter clock-wise faster?
if (fabs(sender->getRotation() - targetRotation) <= 180.0f){
targetRotation = targetRotation;
}else{
targetRotation = targetRotation - 360.0f;
}
Animation *a = new TransformAnimation(250, targetScale, targetPosition, targetRotation, TransformAnimation::Linear, sender);
a->start();
}
}
/** Closes a window, frees up any resource that it might be using */
void UIManager::closeWindow(Window *window){
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i] == window){
// Unlink the keyboard
hideKeyboard(window);
// Remove from list
windows.erase(windows.begin() + i);
// Stop physics
PhysicsManager::getSingleton()->stopAllPhysics(window);
// If the window was in fullscreen, we need to remove the
// reference to the fullscreen window and do other stuff
if (window->isFullscreen()){
wakeUpAllWindowsExcept(window); // Others might be asleep
}
// Dispose later. This lets asynchronous events to be dispatched
// without making a mess with disposed memory areas
window->prepareForDisposal();
garbageBin.push_back(window);
garbageClock.restart();
break;
}
}
}
/** Fades and closes a window */
void UIManager::fadeAndCloseWindow(Window *window){
Animation *a = new FadeOutAnimation(100, window, fadeAndCloseWindowCallback);
a->start();
}
void UIManager::fadeAndCloseWindowCallback(AnimatedObject *w){
UIManager::getSingleton()->closeWindow((Window *)w);
}
/** Performs an animation on an existing screensaver window and closes it at the end */
void UIManager::onExitScreensaverRequested(Window *screensaver, ScreensaverAnimation animation, int animationMsTime){
Animation *a = 0;
switch(animation){
case FadeOut:
a = new FadeOutAnimation((float)animationMsTime, screensaver, exitScreensaverCallback);
break;
case SlideUp:
a = new MoveAnimation((float)animationMsTime, sf::Vector2f(Application::windowWidth / 2.0f, -(Application::windowHeight / 2.0f)), TransformAnimation::Linear, screensaver, exitScreensaverCallback);
break;
case SlideDown:
a = new MoveAnimation((float)animationMsTime, sf::Vector2f(Application::windowWidth / 2.0f, Application::windowHeight * 1.5f), TransformAnimation::Linear, screensaver, exitScreensaverCallback);
break;
case SlideLeft:
a = new MoveAnimation((float)animationMsTime, sf::Vector2f(-(Application::windowWidth / 2.0f), Application::windowHeight / 2.0f), TransformAnimation::Linear, screensaver, exitScreensaverCallback);
break;
case SlideRight:
a = new MoveAnimation((float)animationMsTime, sf::Vector2f(Application::windowWidth * 1.5f, Application::windowHeight / 2.0f), TransformAnimation::Linear, screensaver, exitScreensaverCallback);
break;
}
a->start();
screensaverClock.restart();
screensaverShowing = false;
}
void UIManager::exitScreensaverCallback(AnimatedObject *screensaver){
UIManager::getSingleton()->wakeUpAllWindowsExcept((Window *)screensaver); // Others might be asleep
UIManager::getSingleton()->closeWindow((Window *)screensaver);
if (g_debug){
cout << "Closed screensaver!" << endl;
}
}
void UIManager::onTouchGesture(const GestureEvent &gestureEvent){
// TODO: use gestureEvent.windowId instead of finding the window using the location of the touch!
TouchGesture *touch = static_cast<TouchGesture *>(gestureEvent.gesture);
TouchEvent touchEvent = touch->getTouchEvent();
if (touch->getPhase() == Gesture::BEGINNING){
onTouchDown(touchEvent);
}
else if (touch->getPhase() == Gesture::UPDATING){
onTouchMove(touchEvent);
}
else if (touch->getPhase() == Gesture::ENDING){
onTouchUp(touchEvent);
}
}
/** Handles a touch down event */
void UIManager::onTouchDown(const TouchEvent &touchEvent){
Window *window = findFirstWindow((float)touchEvent.screen_x, (float)touchEvent.screen_y);
if (window != NULL){
setTopMostWindow(window);
window->onMouseDown(touchEvent.touch_id, touchEvent.screen_x, touchEvent.screen_y);
}
}
/** Handles a touch move event */
void UIManager::onTouchMove(const TouchEvent &touchEvent){
Window *window = findFirstWindow((float)touchEvent.screen_x, (float)touchEvent.screen_y);
if (window != NULL){
window->onMouseMove(touchEvent.touch_id, touchEvent.screen_x, touchEvent.screen_y);
}
}
/** Handles a touch up event */
void UIManager::onTouchUp(const TouchEvent &touchEvent){
Window *window = findFirstWindow((float)touchEvent.screen_x, (float)touchEvent.screen_y);
if (window != NULL){
window->onMouseUp(touchEvent.touch_id, touchEvent.screen_x, touchEvent.screen_y);
}
}
void UIManager::onDragGesture(const GestureEvent &gestureEvent){
DragGesture *drag = static_cast<DragGesture *>(gestureEvent.gesture);
//Window *window = findFirstWindow(gestureEvent.location.x, gestureEvent.location.y);
Window *window = findWindowById(gestureEvent.windowId);
if (window != NULL){
if (drag->getPhase() == Gesture::BEGINNING){
window->startDragging(gestureEvent.location);
}
if (drag->getPhase() == Gesture::UPDATING){
window->updateDragging(gestureEvent.location);
}
if (drag->getPhase() == Gesture::ENDING){
window->stopDragging(gestureEvent.location, drag->getSpeedOnDragEnd());
}
}
}
/** Transform handles scale and rotate */
void UIManager::onTransformGesture(const GestureEvent &gestureEvent){
TwoFingerGesture *twoFingerGesture = static_cast<TwoFingerGesture *>(gestureEvent.gesture);
// Are the fingers inside the window?
sf::Vector2f touches[2];
touches[0] = twoFingerGesture->getFirstTouchLocation();
touches[1] = twoFingerGesture->getSecondTouchLocation();
touches[0].x *= Application::windowWidth;
touches[0].y *= Application::windowHeight;
touches[1].x *= Application::windowWidth;
touches[1].y *= Application::windowHeight;
//Window *window = findFirstWindow(touches, 2);
Window *window = findWindowById(gestureEvent.windowId);
if (window != NULL){
if (twoFingerGesture->getPhase() == Gesture::BEGINNING){
window->startTransforming(twoFingerGesture->getFirstTouchLocation(),
twoFingerGesture->getSecondTouchLocation());
}
if (twoFingerGesture->getPhase() == Gesture::UPDATING){
window->updateTransform(twoFingerGesture->getFirstTouchLocation(),
twoFingerGesture->getSecondTouchLocation());
}
if (twoFingerGesture->getPhase() == Gesture::ENDING){
window->stopTransforming();
}
}
}
/** Tracks the reception of a touch down event direcly from TUIO without being analyzed by the GestureManager
* Must be called from the rendering thread */
void UIManager::onTrackTouchDown(const TouchEvent &touchEvent){
// Reset screensaver timer
screensaverClock.restart();
if (g_debug){
// We color the pointer based on the touchgroup to which it belongs to
PointerSprite::Color pointerColor;
// Mouse events are never part of a touchgroup, so just color a default value
if (touchEvent.mouseSimulated){
pointerColor = PointerSprite::Red;
}else{
int touchGroup = getGestureManager()->findTouchGroup(touchEvent.blob);
pointerColor = (PointerSprite::Color)(touchGroup % 3); // Red (0), blue (1), green (2)
}
addPointer(touchEvent.screen_x, touchEvent.screen_y, touchEvent.touch_id, pointerColor);
}
// Handle TUIO enabled windows events
// TUIO-enabled windows are special in the sense that they receive events directly from TUIO events
// which are not filtered by the gesture manager (a two finger gesture will not be sent to the window
// as a scale gesture, but as two distinct "touchDown" events). These windows will also receive the other
// gesture messages, so it is responsability of the developer to disable certain gestures as not to create
// collisions when the user interacts with the window (for example, do not activate TUIO and allow transforms at the same time!)
sf::Vector2f webviewCoords;
Window *w = findFirstTuioEnabledWindow((float)touchEvent.screen_x, (float)touchEvent.screen_y, webviewCoords);
if (w != NULL){
w->fireJsTuioEvent("touchstart", touchEvent.group, touchEvent.touch_id, webviewCoords);
}
}
/** Tracks the reception of a touch up event direcly from TUIO without being analyzed by the GestureManager
* Must be called from the rendering thread */
void UIManager::onTrackTouchUp(const TouchEvent &touchEvent){
// Reset screensaver timer
screensaverClock.restart();
if (g_debug){
removePointer(touchEvent.screen_x, touchEvent.screen_y, touchEvent.touch_id);
}
// Handle TUIO enabled windows events
sf::Vector2f webviewCoords;
Window *w = findFirstTuioEnabledWindow((float)touchEvent.screen_x, (float)touchEvent.screen_y, webviewCoords);
if (w != NULL){
w->fireJsTuioEvent("touchend", touchEvent.group, touchEvent.touch_id, webviewCoords);
}
}
/** Tracks the reception of a touch move event direcly from TUIO without being analyzed by the GestureManager
* Must be called from the rendering thread */
void UIManager::onTrackTouchMove(const TouchEvent &touchEvent){
// Move the pointer sprite only when there's a down event
if (g_debug && visiblePointers.count(touchEvent.touch_id) != 0){
movePointer(touchEvent.screen_x, touchEvent.screen_y, touchEvent.touch_id);
}
// Handle TUIO enabled windows events
sf::Vector2f webviewCoords;
Window *w = findFirstTuioEnabledWindow((float)touchEvent.screen_x, (float)touchEvent.screen_y, webviewCoords);
if (w != NULL){
w->fireJsTuioEvent("touchmove", touchEvent.group, touchEvent.touch_id, webviewCoords);
}
}
/** Puts w as the topmost window and lowers the Z order of any other window
* windows that have a Z order greater than 0 are not affected */
void UIManager::setTopMostWindow(Window *w){
// Ignore static z-order windows (we never change their Z-order)
if (w->isZStatic()) return;
int previousZ = w->getZOrder();
w->setZOrder(-1); // -1 is the topmost window following our convention
// Avoid pushing down windows if w was already the topmost window
if (previousZ != -1){
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i] != w && !windows[i]->isZStatic()){
int currentZ = windows[i]->getZOrder();
if (currentZ <= 0) windows[i]->setZOrder(currentZ - 1);
}
}
}
sortWindowsByZOrder();
}
/** increases the Z order of any other user window (with z order less than 0)
* system windows are not affected */
void UIManager::pushUpZOrdering(Window *w){
for (unsigned int i = 0; i < windows.size(); i++){
int currentZ = windows[i]->getZOrder();
if (currentZ <= 0 && !windows[i]->isZStatic()) windows[i]->setZOrder(currentZ + 1);
}
}
/** Wakes up all windows */
void UIManager::wakeUpAllWindowsExcept(Window *w){
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i] != w) windows[i]->wakeUp();
}
}
/** Put asleep all windows exept the one passed as an argument */
void UIManager::putToSleepAllWindowsExcept(Window *w){
for (unsigned int i = 0; i < windows.size(); i++){
if (windows[i] != w) windows[i]->setToSleep();
}
}
UIManager::~UIManager(){
for (unsigned int i = 0; i<windows.size(); i++){
RELEASE_SAFELY(windows[i]);
}
windows.clear();
if (appConfigs != 0){
map<std::string, AppConfiguration *>::iterator it;
for (it = appConfigs->begin(); it != appConfigs->end(); it++){
RELEASE_SAFELY(it->second);
}
appConfigs->clear();
RELEASE_SAFELY(appConfigs);
}
RELEASE_SAFELY(overlaySprite);
RELEASE_SAFELY(gestureManager);
RELEASE_SAFELY(animationManager);
} | 33.651 | 198 | 0.722267 | [
"object",
"vector",
"transform"
] |
821ad9e117f55eb49e3fc28eb8f69fcc6f1dc401 | 42,349 | cpp | C++ | mechanics/src/Application.cpp | robindittmar/mechanics | ea62f750d3cd448cbd708dee972d5a5b9a1464a0 | [
"MIT"
] | null | null | null | mechanics/src/Application.cpp | robindittmar/mechanics | ea62f750d3cd448cbd708dee972d5a5b9a1464a0 | [
"MIT"
] | null | null | null | mechanics/src/Application.cpp | robindittmar/mechanics | ea62f750d3cd448cbd708dee972d5a5b9a1464a0 | [
"MIT"
] | null | null | null | #include "Application.h"
std::vector<BulletTracerEntry> CApplication::m_pBulletTracer;
std::vector<HitmarkerEntry> CApplication::m_pHitmarker;
CApplication::CApplication()
: m_pNetVarMgr(nullptr)
, m_pClientModeHook(nullptr)
, m_pModelRenderHook(nullptr)
, m_pClientHook(nullptr)
, m_pPanelHook(nullptr)
, m_pSurfaceHook(nullptr)
, m_pGameEventManagerHook(nullptr)
, m_pViewRenderHook(nullptr)
, m_pEngineSoundHook(nullptr)
, m_pMdlHook(nullptr)
, m_bGotSendPackets(false)
, m_bInitialHookDone(false)
, m_bIsHooked(false)
{
}
CApplication::~CApplication()
{
delete m_pMdlHook;
delete m_pEngineSoundHook;
delete m_pViewRenderHook;
delete m_pGameEventManagerHook;
delete m_pSurfaceHook;
delete m_pPanelHook;
delete m_pClientHook;
delete m_pModelRenderHook;
delete m_pClientModeHook;
delete m_pNetVarMgr;
}
CApplication* CApplication::Instance()
{
static CApplication inst;
return &inst;
}
void CApplication::Run(HMODULE hModule)
{
m_hModule = hModule;
this->Setup();
this->Hook();
}
void CApplication::Detach()
{
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "Detaching ...\n");
#endif
// Enable mouse again
this->m_pGui->SetEnableGameInput(true);
this->m_pGui->Cleanup();
// Unregister listener
this->m_pGameEventManager->RemoveListener(&this->m_gameEventListener);
// Unhook everything
this->Unhook();
// Free ResourceManager
delete g_pResourceManager;
g_pResourceManager = nullptr;
#ifdef _DEBUG
// Free console
delete g_pConsole;
g_pConsole = nullptr;
#endif
// TODO: Stimmt, das andere ist ja nicht von uns.. Cleanups *MÜSSEN* immer andersrum passieren als das initialisieren
// ----------- Our stuff -----------
// Thirdperson
if (m_pInput->m_fCameraInThirdPerson)
{
m_pInput->m_fCameraInThirdPerson = false;
}
// FovChanger
if (m_visuals.GetFovChangeScoped())
{
ConVar* pZoomSensitivity = m_pCVar->FindVar(/*zoom_sensitivity_ratio_mouse*/CXorString("\x6D\x64\xEA\xAF\x48\x78\xE0\xAC\x64\x62\xF1\xAB\x61\x62\xF1\xBB\x48\x79\xE4\xB6\x7E\x64\xDA\xAF\x78\x7E\xF6\xA7").ToCharArray());
pZoomSensitivity->SetValue(m_visuals.GetZoomSensitivity());
}
// NoSmoke
m_visuals.NoSmoke(false);
// SkinChanger Modeldelete
if (m_skinchanger.GetEnabled())
m_pClientState->ForceFullUpdate();
// ClanTag
if (m_misc.GetIsCustomClanTag())
{
m_misc.SetClanTag(nullptr);
m_misc.ApplyClanTag();
}
// MaterialVisuals
m_materialvisuals.Nightmode(100);
m_materialvisuals.Asuswalls(100);
m_materialvisuals.Skychanger(0);
// Free & Exit
CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)ThreadFreeLibrary, this->m_hModule, 0, nullptr);
}
bool CApplication::CreateFolder(const char* pName)
{
char pBuffer[MAX_PATH];
snprintf(pBuffer, MAX_PATH, "%s%s", this->GetWorkingDirectory(), pName);
if (!CreateDirectory(pBuffer, nullptr))
{
DWORD dwErr = GetLastError();
if (GetLastError() != ERROR_ALREADY_EXISTS)
{
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_ERROR, "Error when creating folder ('%s'): %d\n", pBuffer, dwErr);
#endif
return false;
}
}
return true;
}
void CApplication::Unhook()
{
// Proxy functions
m_pNetVarEyeAngles1->UnhookProxy();
m_pNetVarEyeAngles0->UnhookProxy();
m_pNetVarLowerBodyYaw->UnhookProxy();
m_pNetVarSequence->UnhookProxy();
// Reverse order, in case of any dependencies
this->m_pMdlHook->Restore();
this->m_pEngineSoundHook->Restore();
this->m_pViewRenderHook->Restore();
this->m_pGameEventManagerHook->Restore();
this->m_pSurfaceHook->Restore();
this->m_pPanelHook->Restore();
this->m_pClientHook->Restore();
this->m_pModelRenderHook->Restore();
this->m_pClientModeHook->Restore();
this->m_bIsHooked = false;
}
void CApplication::Rehook()
{
this->m_pClientModeHook->Replace();
this->m_pModelRenderHook->Replace();
this->m_pClientHook->Replace();
this->m_pPanelHook->Replace();
this->m_pSurfaceHook->Replace();
this->m_pGameEventManagerHook->Replace();
this->m_pViewRenderHook->Replace();
this->m_pEngineSoundHook->Replace();
this->m_pMdlHook->Replace();
g_pSequenceProxy = m_pNetVarSequence->HookProxy(hk_SetViewModelSequence);
g_pLowerBodyYawProxy = m_pNetVarLowerBodyYaw->HookProxy(hk_SetLowerBodyYawTarget);
g_pEyeAnglesProxy0 = m_pNetVarEyeAngles0->HookProxy(hk_SetEyeAnglesProxy0);
g_pEyeAnglesProxy1 = m_pNetVarEyeAngles1->HookProxy(hk_SetEyeAnglesProxy1);
this->m_bIsHooked = true;
}
IClientEntity* CApplication::GetLocalPlayer(bool bGetTargetIfLocalDead)
{
IClientEntity* pEntity = m_pEntityList->GetClientEntity(m_pEngineClient->GetLocalPlayer());
if (bGetTargetIfLocalDead && !pEntity->IsAlive())
pEntity = pEntity->GetObserverTarget();
return pEntity;
}
void CApplication::Setup()
{
#ifdef _DEBUG
// Setup console
g_pConsole = new CConsole();
g_pConsole->WritePlain(".mechanics\n > version %s\n > Build date: %s\n > Build time: %s\n\n", MECHANICS_VERSION_STRING, __DATE__, __TIME__);
#endif
// Grab info about our own dll path etc
this->GetModuleInfo();
// Create sub directories
this->CreateSubFolders();
// Load DLL addresses and interfaces + some sigs
this->GetLibrarys();
this->GetInterfaces();
// Load Netvars
this->GetNetVars();
// Resource manager
g_pResourceManager = new CResourceManager();
g_pResourceManager->Init(this);
m_pResourceManager = g_pResourceManager;
// Create Resources
m_pResourceManager->CreateTextures();
m_pResourceManager->CreateFonts();
// CGui initialization
m_pGui = CGui::Instance();
m_pGui->Setup();
// Setups
std::vector<IFeature*> features = { &m_ragebot, &m_gunAccuracy, &m_legitbot, &m_triggerbot, &m_resolver, &m_antiAim,
&m_bhop, &m_esp, &m_weaponesp, &m_soundEsp, &m_chams, &m_misc, &m_fakelag,
&m_fakewalk, &m_fakeduck, &m_skinchanger, &m_visuals, &m_materialvisuals,
&m_gunHud, &m_mirror, &m_radar, &m_lagcompensation };
for (auto& feature : features)
{
feature->Setup();
}
// Register Event Handlers
m_pGameEventManager->AddListener(&m_gameEventListener, /*game_newmap*/CXorString("\x70\x6A\xE8\xA7\x48\x65\xE0\xB5\x7A\x6A\xF5").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*cs_game_disconnected*/CXorString("\x74\x78\xDA\xA5\x76\x66\xE0\x9D\x73\x62\xF6\xA1\x78\x65\xEB\xA7\x74\x7F\xE0\xA6").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*switch_team*/CXorString("\x64\x7C\xEC\xB6\x74\x63\xDA\xB6\x72\x6A\xE8").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*player_spawned*/CXorString("\x67\x67\xE4\xBB\x72\x79\xDA\xB1\x67\x6A\xF2\xAC\x72\x6F").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*player_hurt*/CXorString("\x67\x67\xE4\xBB\x72\x79\xDA\xAA\x62\x79\xF1").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*player_death*/CXorString("\x67\x67\xE4\xBB\x72\x79\xDA\xA6\x72\x6A\xF1\xAA").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*round_start*/CXorString("\x65\x64\xF0\xAC\x73\x54\xF6\xB6\x76\x79\xF1").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*round_end*/CXorString("\x65\x64\xF0\xAC\x73\x54\xE0\xAC\x73").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*weapon_fire*/CXorString("\x60\x6E\xE4\xB2\x78\x65\xDA\xA4\x7E\x79\xE0").ToCharArray(), false);
m_pGameEventManager->AddListener(&m_gameEventListener, /*bullet_impact*/CXorString("\x75\x7E\xE9\xAE\x72\x7F\xDA\xAB\x7A\x7B\xE4\xA1\x63").ToCharArray(), false);
// Load config
CConfig config;
config.Init(this);
if (config.LoadFile("default.cfg"))
{
ConfigHelper::ConfigToFeatures(&config);
}
// <remove once implemented correctly>
this->m_skinchanger.SetEnabled(true);
// </remove once implemented correctly>
// Initialize menu
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "Creating menu... ");
#endif
m_pMenu = CMenu::Instance();
m_pMenu->Init(this);
m_pMenu->CreateMenu();
m_pMenu->ApplySettings();
#ifdef _DEBUG
g_pConsole->WritePlain("Done\n");
#endif
if (m_pEngineClient->IsInGame())
{
m_gunAccuracy.SetRecoilCompensation(atof(m_pCVar->FindVar(/*weapon_recoil_scale*/CXorString("\x60\x6E\xE4\xB2\x78\x65\xDA\xB0\x72\x68\xEA\xAB\x7B\x54\xF6\xA1\x76\x67\xE0"))->value));
}
}
void CApplication::Hook()
{
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "Hooking engine functions...\n");
#endif
m_pClientModeHook = new VMTHook((DWORD*)m_pClientMode);
g_pOverrideView = (OverrideView_t)m_pClientModeHook->Hook(18, (DWORD*)hk_OverrideView);
g_pCreateMove = (CreateMove_t)m_pClientModeHook->Hook(24, (DWORD*)hk_CreateMove);
g_pGetViewModelFov = (GetViewModelFov_t)m_pClientModeHook->Hook(35, (DWORD*)hk_GetViewModelFov);
m_pModelRenderHook = new VMTHook((DWORD*)this->m_pModelRender);
g_pDrawModelExecute = (DrawModelExecute_t)m_pModelRenderHook->Hook(21, (DWORD*)hk_DrawModelExecute);
m_pClientHook = new VMTHook((DWORD*)this->m_pClient);
g_pFrameStageNotify = (FrameStageNotify_t)m_pClientHook->Hook(37, (DWORD*)hk_FrameStageNotify);
m_pPanelHook = new VMTHook((DWORD*)this->m_pPanel);
g_pPaintTraverse = (PaintTraverse_t)m_pPanelHook->Hook(41, (DWORD*)hk_PaintTraverse);
m_pSurfaceHook = new VMTHook((DWORD*)this->m_pSurface);
g_pPlaySound = (PlaySound_t)m_pSurfaceHook->Hook(82, (DWORD*)hk_PlaySound);
g_pLockCursor = (LockCursor_t)m_pSurfaceHook->Hook(67, (DWORD*)hk_LockCursor);
m_pGameEventManagerHook = new VMTHook((DWORD*)this->m_pGameEventManager);
g_pFireEventClientSide = (FireEventClientSide_t)m_pGameEventManagerHook->Hook(9, (DWORD*)hk_FireEventClientSide);
m_pViewRenderHook = new VMTHook((DWORD*)m_pViewRender);
g_pRenderView = (RenderView_t)m_pViewRenderHook->Hook(6, (DWORD*)hk_RenderView);
g_pRenderSmokeOverlay = (RenderSmokeOverlay_t)m_pViewRenderHook->Hook(41 /*before 40*/, (DWORD*)hk_RenderSmokeOverlay);
m_pEngineSoundHook = new VMTHook((DWORD*)m_pEngineSound);
g_pEmitSound1 = (EmitSound1_t)m_pEngineSoundHook->Hook(5, (DWORD*)hk_EmitSound1);
//g_pEmitSound2 = (EmitSound2_t)m_pEngineSoundHook->Hook(6, (DWORD*)hk_EmitSound2);
m_pMdlHook = new VMTHook((DWORD*)m_pMdlCache);
g_pFindMdl = (FindMdl_t)m_pMdlHook->Hook(10, (DWORD*)hk_FindMDL);
// Proxy functions
g_pSequenceProxy = m_pNetVarSequence->HookProxy(hk_SetViewModelSequence);
g_pLowerBodyYawProxy = m_pNetVarLowerBodyYaw->HookProxy(hk_SetLowerBodyYawTarget);
g_pEyeAnglesProxy0 = m_pNetVarEyeAngles0->HookProxy(hk_SetEyeAnglesProxy0);
g_pEyeAnglesProxy1 = m_pNetVarEyeAngles1->HookProxy(hk_SetEyeAnglesProxy1);
//this->m_misc.SetClanTag(".mechanics"); //todo: dynamic!!
this->m_bIsHooked = true;
this->m_bInitialHookDone = true;
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "Done hooking\n");
#endif
}
void CApplication::CreateSubFolders()
{
this->CreateFolder(CONFIG_FOLDER);
this->CreateFolder(SKINCHANGER_CONFIG_FOLDER_FULL_RELATIVE);
}
void CApplication::GetModuleInfo()
{
int iLenFullpath;
char pFullpath[MAX_PATH];
iLenFullpath = GetModuleFileName(m_hModule, pFullpath, MAX_PATH);
for (int i = iLenFullpath - 1; i >= 0; i--)
{
if (pFullpath[i] == '\\')
{
m_iLenFilepath = i + 1;
m_pFilepath = new char[m_iLenFilepath + 1];
strncpy(m_pFilepath, pFullpath, m_iLenFilepath + 1);
m_pFilepath[m_iLenFilepath] = '\0';
m_iLenFilename = iLenFullpath - i - 1;
m_pFilename = new char[m_iLenFilename + 1];
strcpy(m_pFilename, pFullpath + i + 1);
break;
}
}
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "Module path: %s\n", m_pFilepath);
g_pConsole->Write(LOGLEVEL_INFO, "Module name: %s\n", m_pFilename);
g_pConsole->WritePlain("\n");
#endif
}
void CApplication::GetLibrarys()
{
// Grab engine addresses
this->m_dwTier0Dll = (DWORD)GetModuleHandle(/*tier0.dll*/CXorString("\x63\x62\xE0\xB0\x27\x25\xE1\xAE\x7B"));
//this->m_dwClientDll = (DWORD)GetModuleHandle(/*client.dll*/CXorString("tgì§y«¦{g"));
//todo: xorn
this->m_dwClientDll = (DWORD)GetModuleHandle(/*client_panorama.dll*/CXorString("\x74\x67\xEC\xA7\x79\x7F\xDA\xB2\x76\x65\xEA\xB0\x76\x66\xE4\xEC\x73\x67\xE9"));
this->m_dwEngineDll = (DWORD)GetModuleHandle(/*engine.dll*/CXorString("\x72\x65\xE2\xAB\x79\x6E\xAB\xA6\x7B\x67"));
this->m_dwMaterialSystemDll = (DWORD)GetModuleHandle(/*materialsystem.dll*/CXorString("\x7A\x6A\xF1\xA7\x65\x62\xE4\xAE\x64\x72\xF6\xB6\x72\x66\xAB\xA6\x7B\x67"));
this->m_dwVGui2Dll = (DWORD)GetModuleHandle(/*vgui2.dll*/CXorString("\x61\x6C\xF0\xAB\x25\x25\xE1\xAE\x7B"));
this->m_dwVGuiSurfaceDll = (DWORD)GetModuleHandle(/*vguimatsurface.dll*/CXorString("\x61\x6C\xF0\xAB\x7A\x6A\xF1\xB1\x62\x79\xE3\xA3\x74\x6E\xAB\xA6\x7B\x67"));
this->m_dwVPhysicsDll = (DWORD)GetModuleHandle(/*vphysics.dll*/CXorString("\x61\x7B\xED\xBB\x64\x62\xE6\xB1\x39\x6F\xE9\xAE"));
this->m_dwVStdLibDll = (DWORD)GetModuleHandle(/*vstdlib.dll*/CXorString("\x61\x78\xF1\xA6\x7B\x62\xE7\xEC\x73\x67\xE9"));
this->m_dwDatacacheDll = (DWORD)GetModuleHandle(/*datacache.dll*/CXorString("\x73\x6A\xF1\xA3\x74\x6A\xE6\xAA\x72\x25\xE1\xAE\x7B"));
this->m_dwLocalizeDll = (DWORD)GetModuleHandle(/*localize.dll*/CXorString("\x7B\x64\xE6\xA3\x7B\x62\xFF\xA7\x39\x6F\xE9\xAE"));
this->m_dwInputSystemDll = (DWORD)GetModuleHandle(/*inputsystem.dll*/CXorString("\x7E\x65\xF5\xB7\x63\x78\xFC\xB1\x63\x6E\xE8\xEC\x73\x67\xE9"));
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "tier0.dll\t\t=>\t0x%08X\n", m_dwTier0Dll);
g_pConsole->Write(LOGLEVEL_INFO, "client.dll\t\t=>\t0x%08X\n", m_dwClientDll);
g_pConsole->Write(LOGLEVEL_INFO, "engine.dll\t\t=>\t0x%08X\n", m_dwEngineDll);
g_pConsole->Write(LOGLEVEL_INFO, "materialsystem.dll\t=>\t0x%08X\n", m_dwMaterialSystemDll);
g_pConsole->Write(LOGLEVEL_INFO, "vgui2.dll\t\t=>\t0x%08X\n", m_dwVGui2Dll);
g_pConsole->Write(LOGLEVEL_INFO, "vguimatsurface.dll\t=>\t0x%08X\n", m_dwVGuiSurfaceDll);
g_pConsole->Write(LOGLEVEL_INFO, "vphysics.dll\t\t=>\t0x%08X\n", m_dwVPhysicsDll);
g_pConsole->Write(LOGLEVEL_INFO, "vstdlib.dll\t\t=>\t0x%08X\n", m_dwVStdLibDll);
g_pConsole->Write(LOGLEVEL_INFO, "datacache.dll\t\t=>\t0x%08X\n", m_dwDatacacheDll);
g_pConsole->Write(LOGLEVEL_INFO, "localize.dll\t\t=>\t0x%08X\n", m_dwLocalizeDll);
g_pConsole->Write(LOGLEVEL_INFO, "inputsystem.dll\t\t=>\t0x%08X\n", m_dwInputSystemDll);
g_pConsole->WritePlain("\n");
#endif // _DEBUG
}
void CApplication::GetInterfaces()
{
// Setup strings
CXorString xorCreateInterface(/*CreateInterface*/"\x54\x79\xE0\xA3\x63\x6E\xCC\xAC\x63\x6E\xF7\xA4\x76\x68\xE0");
CreateInterfaceFn ClientFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwClientDll, xorCreateInterface);
CreateInterfaceFn EngineFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwEngineDll, xorCreateInterface);
CreateInterfaceFn MaterialSystemFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwMaterialSystemDll, xorCreateInterface);
CreateInterfaceFn VGui2Factory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwVGui2Dll, xorCreateInterface);
CreateInterfaceFn VGuiSurfaceFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwVGuiSurfaceDll, xorCreateInterface);
CreateInterfaceFn VPhysicsFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwVPhysicsDll, xorCreateInterface);
CreateInterfaceFn VStdLibFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwVStdLibDll, xorCreateInterface);
CreateInterfaceFn DatacacheFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwDatacacheDll, xorCreateInterface);
CreateInterfaceFn LocalizeFacory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwLocalizeDll, xorCreateInterface);
CreateInterfaceFn InputSystemFactory = (CreateInterfaceFn)GetProcAddress((HMODULE)this->m_dwInputSystemDll, xorCreateInterface);
m_pConColorMsg = (ConColorMsg_t)GetProcAddress((HMODULE)this->m_dwTier0Dll, /*?ConColorMsg@@YAXABVColor@@PBDZZ*/CXorString("\x28\x48\xEA\xAC\x54\x64\xE9\xAD\x65\x46\xF6\xA5\x57\x4B\xDC\x83\x4F\x4A\xC7\x94\x54\x64\xE9\xAD\x65\x4B\xC5\x92\x55\x4F\xDF\x98"));
m_pRandomSeed = (RandomSeed_t)GetProcAddress((HMODULE)this->m_dwVStdLibDll, /*RandomSeed*/CXorString("\x45\x6A\xEB\xA6\x78\x66\xD6\xA7\x72\x6F"));
m_pRandomInt = (RandomInt_t)GetProcAddress((HMODULE)this->m_dwVStdLibDll, /*RandomInt*/CXorString("\x45\x6A\xEB\xA6\x78\x66\xCC\xAC\x63"));
m_pRandomFloat = (RandomFloat_t)GetProcAddress((HMODULE)this->m_dwVStdLibDll, /*RandomFloat*/CXorString("\x45\x6A\xEB\xA6\x78\x66\xC3\xAE\x78\x6A\xF1"));
m_pEngineClient = (IVEngineClient*)EngineFactory(/*VEngineClient014*/CXorString("\x41\x4E\xEB\xA5\x7E\x65\xE0\x81\x7B\x62\xE0\xAC\x63\x3B\xB4\xF6"), nullptr);
m_pClient = (IBaseClientDLL*)ClientFactory(/*VClient018*/CXorString("\x41\x48\xE9\xAB\x72\x65\xF1\xF2\x26\x33"), nullptr);
m_pEntityList = (IClientEntityList*)ClientFactory(/*VClientEntityList003*/CXorString("\x41\x48\xE9\xAB\x72\x65\xF1\x87\x79\x7F\xEC\xB6\x6E\x47\xEC\xB1\x63\x3B\xB5\xF1"), nullptr);
m_pModelInfo = (IVModelInfo*)EngineFactory(/*VModelInfoClient004*/CXorString("\x41\x46\xEA\xA6\x72\x67\xCC\xAC\x71\x64\xC6\xAE\x7E\x6E\xEB\xB6\x27\x3B\xB1"), nullptr);
m_pModelRender = (IVModelRender*)EngineFactory(/*VEngineModel016*/CXorString("\x41\x4E\xEB\xA5\x7E\x65\xE0\x8F\x78\x6F\xE0\xAE\x27\x3A\xB3"), nullptr);
m_pRenderView = (IVRenderView*)EngineFactory(/*VEngineRenderView014*/CXorString("\x41\x4E\xEB\xA5\x7E\x65\xE0\x90\x72\x65\xE1\xA7\x65\x5D\xEC\xA7\x60\x3B\xB4\xF6"), nullptr);
m_pEngineTrace = (IEngineTrace*)EngineFactory(/*EngineTraceClient004*/CXorString("\x52\x65\xE2\xAB\x79\x6E\xD1\xB0\x76\x68\xE0\x81\x7B\x62\xE0\xAC\x63\x3B\xB5\xF6"), nullptr);
m_pMaterialSystem = (IMaterialSystem*)MaterialSystemFactory(/*VMaterialSystem080*/CXorString("\x41\x46\xE4\xB6\x72\x79\xEC\xA3\x7B\x58\xFC\xB1\x63\x6E\xE8\xF2\x2F\x3B"), nullptr);
m_pCVar = (ICVar*)VStdLibFactory(/*VEngineCvar007*/CXorString("\x41\x4E\xEB\xA5\x7E\x65\xE0\x81\x61\x6A\xF7\xF2\x27\x3C"), nullptr);
m_pPanel = (IPanel*)VGui2Factory(/*VGUI_Panel009*/CXorString("\x41\x4C\xD0\x8B\x48\x5B\xE4\xAC\x72\x67\xB5\xF2\x2E"), nullptr);
m_pSurface = (ISurface*)VGuiSurfaceFactory(/*VGUI_Surface031*/CXorString("\x41\x4C\xD0\x8B\x48\x58\xF0\xB0\x71\x6A\xE6\xA7\x27\x38\xB4"), nullptr);
m_pGameEventManager = (IGameEventManager2*)EngineFactory(/*GAMEEVENTSMANAGER002*/CXorString("\x50\x4A\xC8\x87\x52\x5D\xC0\x8C\x43\x58\xC8\x83\x59\x4A\xC2\x87\x45\x3B\xB5\xF0"), nullptr);
m_pPhysicsSurfaceProps = (IPhysicsSurfaceProps*)VPhysicsFactory(/*VPhysicsSurfaceProps001*/CXorString("\x41\x5B\xED\xBB\x64\x62\xE6\xB1\x44\x7E\xF7\xA4\x76\x68\xE0\x92\x65\x64\xF5\xB1\x27\x3B\xB4"), nullptr);
m_pEngineSound = (IEngineSound*)EngineFactory(/*IEngineSoundClient003*/CXorString("\x5E\x4E\xEB\xA5\x7E\x65\xE0\x91\x78\x7E\xEB\xA6\x54\x67\xEC\xA7\x79\x7F\xB5\xF2\x24"), nullptr);
m_pMdlCache = (IMDLCache*)DatacacheFactory(/*MDLCache004*/CXorString("\x5A\x4F\xC9\x81\x76\x68\xED\xA7\x27\x3B\xB1"), nullptr);
m_pLocalize = (ILocalize*)LocalizeFacory(/*Localize_001*/CXorString("\x5B\x64\xE6\xA3\x7B\x62\xFF\xA7\x48\x3B\xB5\xF3"), nullptr);
m_pInputSystem = (IInputSystem*)InputSystemFactory(/*InputSystemVersion001*/CXorString("\x5E\x65\xF5\xB7\x63\x58\xFC\xB1\x63\x6E\xE8\x94\x72\x79\xF6\xAB\x78\x65\xB5\xF2\x26"), nullptr);
m_pGlobalVars = **(CGlobalVars***)((*(DWORD**)(m_pClient))[0] + OFFSET_GLOBALS); // GlobalVar
// CInput
this->m_pInput = *(CInput**)((*(DWORD**)(m_pClient))[18] + 0x01);
// IClientMode
m_pClientMode = (IClientMode*)(**(DWORD***)((*(DWORD**)(m_pClient))[10] + 0x05));
// IClientState
this->m_pClientState = **(IClientState***)(CPattern::FindPattern(
(BYTE*)this->EngineDll(),
ENGINEDLL_SIZE,
(BYTE*)"\xA1\x00\x00\x00\x00\x8B\x80\x00\x00\x00\x00\xC3",
"a----gh----e"
) + 0x01);
// IViewRender
m_pViewRender = **(IViewRender***)(CPattern::FindPattern(
(BYTE*)this->m_dwClientDll,
CLIENTDLL_SIZE,
(BYTE*)"\x55\x8B\xEC\xFF\x75\x10\x8B\x0D\x00\x00\x00\x00\xFF\x75\x0C",
"abcdefgh----ijk"
) + 0x08);
// KeyValues::Init
DWORD dwInitKeyValuesTemp = (CPattern::FindPattern(
(BYTE*)this->m_dwClientDll,
CLIENTDLL_SIZE,
(BYTE*)"\x68\x00\x00\x00\x00\x8B\xC8\xE8\x00\x00\x00\x00\x89\x45\xFC\xEB\x07\xC7\x45\x00\x00\x00\x00\x00\x8B\x03\x56",
"a----bbb----ccccccc-----ddd"
) + 0x07);
m_pInitKeyValues = (InitKeyValues_t)(dwInitKeyValuesTemp + (*(DWORD_PTR*)(dwInitKeyValuesTemp + 1)) + 0x05);
// KeyValues::LoadFromBuffer
DWORD dwLoadFromBufferTemp = CPattern::FindPattern(
(BYTE*)this->m_dwClientDll,
CLIENTDLL_SIZE,
(BYTE*)"\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x34\x53\x8B\x5D\x0C\x89\x4C\x24\x04",
"abcdefghijjjjjjjq"
);
m_pLoadFromBuffer = (LoadFromBuffer_t)dwLoadFromBufferTemp;
// IViewRenderBeams
m_pViewRenderBeams = *(IViewRenderBeams**)(CPattern::FindPattern(
(BYTE*)this->m_dwClientDll,
CLIENTDLL_SIZE,
(BYTE*)"\xB9\x00\x00\x00\x00\xA1\x00\x00\x00\x00\xFF\x10\xA1\x00\x00\x00\x00\xB9",
"a----l----htg----f"
) + 1);
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "ConColorMsg\t\t=>\t0x%08X\n", m_pConColorMsg);
g_pConsole->WritePlain("\n");
g_pConsole->Write(LOGLEVEL_INFO, "RandomSeed\t\t=>\t0x%08X\n", m_pRandomSeed);
g_pConsole->Write(LOGLEVEL_INFO, "RandomInt\t\t=>\t0x%08X\n", m_pRandomInt);
g_pConsole->Write(LOGLEVEL_INFO, "RandomFloat\t\t=>\t0x%08X\n", m_pRandomFloat);
g_pConsole->WritePlain("\n");
g_pConsole->Write(LOGLEVEL_INFO, "VEngineClient014\t\t=>\t0x%08X\n", m_pEngineClient);
g_pConsole->Write(LOGLEVEL_INFO, "VClient018\t\t=>\t0x%08X\n", m_pClient);
g_pConsole->Write(LOGLEVEL_INFO, "VClientEntityList003\t=>\t0x%08X\n", m_pEntityList);
g_pConsole->Write(LOGLEVEL_INFO, "VModelInfoClient004\t=>\t0x%08X\n", m_pModelInfo);
g_pConsole->Write(LOGLEVEL_INFO, "VEngineModel016\t\t=>\t0x%08X\n", m_pModelRender);
g_pConsole->Write(LOGLEVEL_INFO, "VEngineRenderView014\t=>\t0x%08X\n", m_pRenderView);
g_pConsole->Write(LOGLEVEL_INFO, "EngineTraceClient004\t=>\t0x%08X\n", m_pEngineTrace);
g_pConsole->Write(LOGLEVEL_INFO, "VMaterialSystem080\t=>\t0x%08X\n", m_pMaterialSystem);
g_pConsole->Write(LOGLEVEL_INFO, "VEngineCvar007\t\t=>\t0x%08X\n", m_pCVar);
g_pConsole->Write(LOGLEVEL_INFO, "VGUI_Panel009\t\t=>\t0x%08X\n", m_pPanel);
g_pConsole->Write(LOGLEVEL_INFO, "VGUI_Surface031\t\t=>\t0x%08X\n", m_pSurface);
g_pConsole->Write(LOGLEVEL_INFO, "GAMEEVENTSMANAGER002\t=>\t0x%08X\n", m_pGameEventManager);
g_pConsole->Write(LOGLEVEL_INFO, "VPhysicsSurfaceProps001\t=>\t0x%08X\n", m_pPhysicsSurfaceProps);
g_pConsole->Write(LOGLEVEL_INFO, "IEngineSoundClient003\t=>\t0x%08X\n", m_pEngineSound);
g_pConsole->Write(LOGLEVEL_INFO, "MDLCache004\t\t=>\t0x%08X\n", m_pMdlCache);
g_pConsole->Write(LOGLEVEL_INFO, "Localize_001\t\t=>\t0x%08X\n", m_pLocalize);
g_pConsole->Write(LOGLEVEL_INFO, "InputSystemVersion001\t=>\t0x%08X\n", m_pInputSystem);
g_pConsole->WritePlain("\n");
g_pConsole->Write(LOGLEVEL_INFO, "CGlobalVars\t\t=>\t0x%08X\n", m_pGlobalVars);
g_pConsole->WritePlain("\n");
g_pConsole->Write(LOGLEVEL_INFO, "CInput\t\t\t=>\t0x%08X\n", m_pInput);
g_pConsole->Write(LOGLEVEL_INFO, "IClientMode\t\t=>\t0x%08X\n", m_pClientMode);
g_pConsole->Write(LOGLEVEL_INFO, "IClientState\t\t=>\t0x%08X\n", m_pClientState);
g_pConsole->Write(LOGLEVEL_INFO, "IViewRender\t\t=>\t0x%08X\n", m_pViewRender);
g_pConsole->WritePlain("\n");
g_pConsole->Write(LOGLEVEL_INFO, "KeyValues::Init\t\t=>\t0x%08X\n", m_pInitKeyValues);
g_pConsole->Write(LOGLEVEL_INFO, "KeyValues::LoadFromBuffer=>\t0x%08X\n", m_pLoadFromBuffer);
g_pConsole->WritePlain("\n");
#endif // _DEBUG
}
void CApplication::GetNetVars()
{
CBenchmark benchmark(true);
CXorString xorBaseEntity(/*DT_BaseEntity*/"\x53\x5F\xDA\x80\x76\x78\xE0\x87\x79\x7F\xEC\xB6\x6E");
CXorString xorBasePlayer(/*DT_BasePlayer*/"\x53\x5F\xDA\x80\x76\x78\xE0\x92\x7B\x6A\xFC\xA7\x65");
CXorString xorCollisionProperty(/*DT_CollisionProperty*/"\x53\x5F\xDA\x81\x78\x67\xE9\xAB\x64\x62\xEA\xAC\x47\x79\xEA\xB2\x72\x79\xF1\xBB");
CXorString xorCSPlayer(/*DT_CSPlayer*/"\x53\x5F\xDA\x81\x44\x5B\xE9\xA3\x6E\x6E\xF7");
CXorString xorLocalPlayerExclusive(/*DT_LocalPlayerExclusive*/"\x53\x5F\xDA\x8E\x78\x68\xE4\xAE\x47\x67\xE4\xBB\x72\x79\xC0\xBA\x74\x67\xF0\xB1\x7E\x7D\xE0");
CXorString xorBaseCombatWeapon(/*DT_BaseCombatWeapon*/"\x53\x5F\xDA\x80\x76\x78\xE0\x81\x78\x66\xE7\xA3\x63\x5C\xE0\xA3\x67\x64\xEB");
CXorString xorWeaponCSBase(/*DT_WeaponCSBase*/"\x53\x5F\xDA\x95\x72\x6A\xF5\xAD\x79\x48\xD6\x80\x76\x78\xE0");
CXorString xorBaseCSGrenade(/*DT_BaseCSGrenade*/"\x53\x5F\xDA\x80\x76\x78\xE0\x81\x44\x4C\xF7\xA7\x79\x6A\xE1\xA7");
CXorString xorBaseCombatCharacter(/*DT_BaseCombatCharacter*/"\x53\x5F\xDA\x80\x76\x78\xE0\x81\x78\x66\xE7\xA3\x63\x48\xED\xA3\x65\x6A\xE6\xB6\x72\x79");
CXorString xorBaseViewModel(/*DT_BaseViewModel*/"\x53\x5F\xDA\x80\x76\x78\xE0\x94\x7E\x6E\xF2\x8F\x78\x6F\xE0\xAE");
CXorString xorPlantedC4(/*DT_PlantedC4*/"\x53\x5F\xDA\x92\x7B\x6A\xEB\xB6\x72\x6F\xC6\xF6");
CXorString xorBaseAttributableItem(/*DT_BaseAttributableItem*/"\x53\x5F\xDA\x80\x76\x78\xE0\x83\x63\x7F\xF7\xAB\x75\x7E\xF1\xA3\x75\x67\xE0\x8B\x63\x6E\xE8");
CXorString xorBaseAnimating(/*DT_BaseAnimating*/"\x53\x5F\xDA\x80\x76\x78\xE0\x83\x79\x62\xE8\xA3\x63\x62\xEB\xA5");
m_pNetVarMgr = new CNetVarManager();
m_pNetVarMgr->AddTable(xorBaseEntity);
m_pNetVarMgr->AddTable(xorBasePlayer);
m_pNetVarMgr->AddTable(xorCSPlayer);
m_pNetVarMgr->AddTable(xorBaseCombatWeapon);
m_pNetVarMgr->AddTable(xorWeaponCSBase);
m_pNetVarMgr->AddTable(xorBaseCSGrenade);
m_pNetVarMgr->AddTable(xorBaseCombatCharacter);
m_pNetVarMgr->AddTable(xorBaseViewModel);
m_pNetVarMgr->AddTable(xorPlantedC4);
m_pNetVarMgr->AddTable(xorBaseAttributableItem);
m_pNetVarMgr->AddTable(xorBaseAnimating);
#ifdef _DEBUG
g_pConsole->Write(LOGLEVEL_INFO, "Loading NetVars... ");
#endif
m_pNetVarMgr->LoadTables(m_pClient->GetAllClasses(), true);
#ifdef _DEBUG
g_pConsole->WritePlain("Done\n");
g_pConsole->Write(LOGLEVEL_INFO, "Loading Offsets... ");
#endif
Offsets::m_angRotation = m_pNetVarMgr->GetOffset(xorBaseEntity, /*m_angRotation*/CXorString("\x7A\x54\xE4\xAC\x70\x59\xEA\xB6\x76\x7F\xEC\xAD\x79"));
Offsets::m_nModelIndex = m_pNetVarMgr->GetOffset(xorBaseEntity, /*m_nModelIndex*/CXorString("\x7A\x54\xEB\x8F\x78\x6F\xE0\xAE\x5E\x65\xE1\xA7\x6F"));
Offsets::m_hMyWeapons = m_pNetVarMgr->GetOffset(xorBaseCombatCharacter, /*m_hMyWeapons*/CXorString("\x7A\x54\xED\x8F\x6E\x5C\xE0\xA3\x67\x64\xEB\xB1"));
Offsets::m_hViewModel = m_pNetVarMgr->GetOffset(xorBasePlayer, /*m_hViewModel[0]*/CXorString(""));
Offsets::m_flSimulationTime = m_pNetVarMgr->GetOffset(xorBaseEntity, /*m_flSimulationTime*/CXorString("\x7A\x54\xE3\xAE\x44\x62\xE8\xB7\x7B\x6A\xF1\xAB\x78\x65\xD1\xAB\x7A\x6E"));
m_pNetVarMgr->SetSummarizeOffsets(true);
Offsets::m_vecMins = m_pNetVarMgr->GetOffset(2, xorBaseEntity, xorCollisionProperty.ToCharArray(), /*m_vecMins*/CXorString("\x7A\x54\xF3\xA7\x74\x46\xEC\xAC\x64").ToCharArray());
Offsets::m_vecMaxs = m_pNetVarMgr->GetOffset(2, xorBaseEntity, xorCollisionProperty.ToCharArray(), /*m_vecMaxs*/CXorString("\x7A\x54\xF3\xA7\x74\x46\xE4\xBA\x64").ToCharArray());
m_pNetVarMgr->SetSummarizeOffsets(false);
Offsets::m_vecOrigin = m_pNetVarMgr->GetOffset(xorBaseEntity, /*m_vecOrigin*/CXorString("\x7A\x54\xF3\xA7\x74\x44\xF7\xAB\x70\x62\xEB"));
Offsets::m_vecViewOffset = m_pNetVarMgr->GetOffset(2, xorBasePlayer, xorLocalPlayerExclusive.ToCharArray(), /*m_vecViewOffset[0]*/CXorString("\x7A\x54\xF3\xA7\x74\x5D\xEC\xA7\x60\x44\xE3\xA4\x64\x6E\xF1\x99\x27\x56").ToCharArray());
Offsets::m_angEyeAngles = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_angEyeAngles*/CXorString("\x7A\x54\xE4\xAC\x70\x4E\xFC\xA7\x56\x65\xE2\xAE\x72\x78"));
m_pNetVarEyeAngles0 = m_pNetVarMgr->GetNetVar(xorCSPlayer, /*m_angEyeAngles[0]*/CXorString("\x7A\x54\xE4\xAC\x70\x4E\xFC\xA7\x56\x65\xE2\xAE\x72\x78\xDE\xF2\x4A"));
m_pNetVarEyeAngles1 = m_pNetVarMgr->GetNetVar(xorCSPlayer, /*m_angEyeAngles[1]*/CXorString("\x7A\x54\xE4\xAC\x70\x4E\xFC\xA7\x56\x65\xE2\xAE\x72\x78\xDE\xF3\x4A"));
Offsets::m_bHasHeavyArmor = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_bHasHeavyArmor*/CXorString("\x7A\x54\xE7\x8A\x76\x78\xCD\xA7\x76\x7D\xFC\x83\x65\x66\xEA\xB0"));
m_pNetVarLowerBodyYaw = m_pNetVarMgr->GetNetVar(xorCSPlayer, /*m_flLowerBodyYawTarget*/CXorString("\x7A\x54\xE3\xAE\x5B\x64\xF2\xA7\x65\x49\xEA\xA6\x6E\x52\xE4\xB5\x43\x6A\xF7\xA5\x72\x7F"));
Offsets::m_flLowerBodyYawTarget = m_pNetVarLowerBodyYaw->GetOffset();
Offsets::m_vecVelocity = m_pNetVarMgr->GetOffset(2, xorBasePlayer, xorLocalPlayerExclusive.ToCharArray(), /*m_vecVelocity[0]*/CXorString("\x7A\x54\xF3\xA7\x74\x5D\xE0\xAE\x78\x68\xEC\xB6\x6E\x50\xB5\x9F").ToCharArray());
Offsets::m_iTeamNum = m_pNetVarMgr->GetOffset(xorBaseEntity, /*m_iTeamNum*/CXorString("\x7A\x54\xEC\x96\x72\x6A\xE8\x8C\x62\x66"));
Offsets::m_lifeState = m_pNetVarMgr->GetOffset(xorBasePlayer, /*m_lifeState*/CXorString("\x7A\x54\xE9\xAB\x71\x6E\xD6\xB6\x76\x7F\xE0"));
Offsets::m_iHealth = m_pNetVarMgr->GetOffset(xorBasePlayer, /*m_iHealth*/CXorString("\x7A\x54\xEC\x8A\x72\x6A\xE9\xB6\x7F"));
Offsets::m_ArmorValue = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_ArmorValue*/CXorString("\x7A\x54\xC4\xB0\x7A\x64\xF7\x94\x76\x67\xF0\xA7"));
Offsets::m_bHasHelmet = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_bHasHelmet*/CXorString("\x7A\x54\xE7\x8A\x76\x78\xCD\xA7\x7B\x66\xE0\xB6"));
Offsets::m_fFlags = m_pNetVarMgr->GetOffset(xorBasePlayer, /*m_fFlags*/CXorString("\x7A\x54\xE3\x84\x7B\x6A\xE2\xB1"));
Offsets::m_bSpotted = m_pNetVarMgr->GetOffset(xorBaseEntity, /*m_bSpotted*/CXorString("\x7A\x54\xE7\x91\x67\x64\xF1\xB6\x72\x6F"));
Offsets::m_bGunGameImmunity = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_bGunGameImmunity*/CXorString("\x7A\x54\xE7\x85\x62\x65\xC2\xA3\x7A\x6E\xCC\xAF\x7A\x7E\xEB\xAB\x63\x72"));
Offsets::m_flFlashDuration = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_flFlashDuration*/CXorString("\x7A\x54\xE3\xAE\x51\x67\xE4\xB1\x7F\x4F\xF0\xB0\x76\x7F\xEC\xAD\x79"));
Offsets::m_flFlashMaxAlpha = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_flFlashMaxAlpha*/CXorString("\x7A\x54\xE3\xAE\x51\x67\xE4\xB1\x7F\x46\xE4\xBA\x56\x67\xF5\xAA\x76"));
//Offsets::m_bMoveType = m_pNetVarMgr->GetOffset("DT_BaseEntity", "m_bMoveType"); <= Not existant :/
Offsets::m_bIsScoped = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_bIsScoped*/CXorString("\x7A\x54\xE7\x8B\x64\x58\xE6\xAD\x67\x6E\xE1"));
Offsets::m_iShotsFired = m_pNetVarMgr->GetOffset(2, xorCSPlayer,
/*DT_CSLocalPlayerExclusive*/CXorString("\x53\x5F\xDA\x81\x44\x47\xEA\xA1\x76\x67\xD5\xAE\x76\x72\xE0\xB0\x52\x73\xE6\xAE\x62\x78\xEC\xB4\x72").ToCharArray(),
/*m_iShotsFired*/CXorString("\x7A\x54\xEC\x91\x7F\x64\xF1\xB1\x51\x62\xF7\xA7\x73").ToCharArray());
Offsets::m_hActiveWeapon = m_pNetVarMgr->GetOffset(xorBaseCombatCharacter, /*m_hActiveWeapon*/CXorString("\x7A\x54\xED\x83\x74\x7F\xEC\xB4\x72\x5C\xE0\xA3\x67\x64\xEB"));
Offsets::m_hObserverTarget = m_pNetVarMgr->GetOffset(xorBasePlayer, /*m_hObserverTarget*/CXorString("\x7A\x54\xED\x8D\x75\x78\xE0\xB0\x61\x6E\xF7\x96\x76\x79\xE2\xA7\x63"));
m_pNetVarMgr->SetSummarizeOffsets(true);
Offsets::deadflag = m_pNetVarMgr->GetOffset(2, xorBasePlayer,
/*DT_PlayerState*/CXorString("\x53\x5F\xDA\x92\x7B\x6A\xFC\xA7\x65\x58\xF1\xA3\x63\x6E").ToCharArray(),
/*deadflag*/CXorString("\x73\x6E\xE4\xA6\x71\x67\xE4\xA5").ToCharArray());
m_pNetVarMgr->SetSummarizeOffsets(false);
Offsets::m_nTickBase = m_pNetVarMgr->GetOffset(2, xorBasePlayer, xorLocalPlayerExclusive.ToCharArray(), /*m_nTickBase*/CXorString("\x7A\x54\xEB\x96\x7E\x68\xEE\x80\x76\x78\xE0").ToCharArray());
Offsets::m_bIsDefusing = m_pNetVarMgr->GetOffset(xorCSPlayer, /*m_bIsDefusing*/CXorString("\x7A\x54\xE7\x8B\x64\x4F\xE0\xA4\x62\x78\xEC\xAC\x70"));
Offsets::m_flC4Blow = m_pNetVarMgr->GetOffset(xorPlantedC4, /*m_flC4Blow*/CXorString("\x7A\x54\xE3\xAE\x54\x3F\xC7\xAE\x78\x7C"));
Offsets::m_flDefuseCountDown = m_pNetVarMgr->GetOffset(xorPlantedC4, /*m_flDefuseCountDown*/CXorString("\x7A\x54\xE3\xAE\x53\x6E\xE3\xB7\x64\x6E\xC6\xAD\x62\x65\xF1\x86\x78\x7C\xEB"));
Offsets::m_hBombDefuser = m_pNetVarMgr->GetOffset(xorPlantedC4, /*m_hBombDefuser*/CXorString("\x7A\x54\xED\x80\x78\x66\xE7\x86\x72\x6D\xF0\xB1\x72\x79"));
Offsets::m_flDuckSpeed = m_pNetVarMgr->GetOffset(xorBasePlayer, CXorString(/*m_flDuckSpeed*/"\x7A\x54\xE3\xAE\x53\x7E\xE6\xA9\x44\x7B\xE0\xA7\x73"));
Offsets::m_flDuckAmount = m_pNetVarMgr->GetOffset(xorBasePlayer, CXorString(/*m_flDuckAmount*/"\x7A\x54\xE3\xAE\x53\x7E\xE6\xA9\x56\x66\xEA\xB7\x79\x7F"));
CNetVar* pDtLocal = m_pNetVarMgr->GetNetVar(2, xorBasePlayer, xorLocalPlayerExclusive.ToCharArray(), /*DT_Local*/CXorString("\x53\x5F\xDA\x8E\x78\x68\xE4\xAE").ToCharArray());
Offsets::m_nJumpTimeMsecs = pDtLocal->GetOffset() + pDtLocal->GetChild(/*m_nJumpTimeMsecs*/CXorString("\x7A\x54\xEB\x88\x62\x66\xF5\x96\x7E\x66\xE0\x8F\x64\x6E\xE6\xB1"))->GetOffset();
Offsets::m_flFallVelocity = pDtLocal->GetOffset() + pDtLocal->GetChild(/*m_flFallVelocity*/CXorString("\x7A\x54\xE3\xAE\x51\x6A\xE9\xAE\x41\x6E\xE9\xAD\x74\x62\xF1\xBB"))->GetOffset();
Offsets::m_viewPunchAngle = pDtLocal->GetOffset() + pDtLocal->GetChild(/*m_viewPunchAngle*/CXorString("\x7A\x54\xF3\xAB\x72\x7C\xD5\xB7\x79\x68\xED\x83\x79\x6C\xE9\xA7"))->GetOffset();
Offsets::m_aimPunchAngle = pDtLocal->GetOffset() + pDtLocal->GetChild(/*m_aimPunchAngle*/CXorString("\x7A\x54\xE4\xAB\x7A\x5B\xF0\xAC\x74\x63\xC4\xAC\x70\x67\xE0"))->GetOffset();
Offsets::m_aimPunchAngleVel = pDtLocal->GetOffset() + pDtLocal->GetChild(/*m_aimPunchAngleVel*/CXorString("\x7A\x54\xE4\xAB\x7A\x5B\xF0\xAC\x74\x63\xC4\xAC\x70\x67\xE0\x94\x72\x67"))->GetOffset();
m_pNetVarMgr->SetSummarizeOffsets(true);
Offsets::m_iItemDefinitionIndex = m_pNetVarMgr->GetOffset(4, xorBaseCombatWeapon,
/*DT_EconEntity*/CXorString("\x53\x5F\xDA\x87\x74\x64\xEB\x87\x79\x7F\xEC\xB6\x6E").ToCharArray(),
/*DT_AttributeContainer*/CXorString("\x53\x5F\xDA\x83\x63\x7F\xF7\xAB\x75\x7E\xF1\xA7\x54\x64\xEB\xB6\x76\x62\xEB\xA7\x65").ToCharArray(),
/*DT_ScriptCreatedItem*/CXorString("\x53\x5F\xDA\x91\x74\x79\xEC\xB2\x63\x48\xF7\xA7\x76\x7F\xE0\xA6\x5E\x7F\xE0\xAF").ToCharArray(),
/*m_iItemDefinitionIndex*/CXorString("\x7A\x54\xEC\x8B\x63\x6E\xE8\x86\x72\x6D\xEC\xAC\x7E\x7F\xEC\xAD\x79\x42\xEB\xA6\x72\x73").ToCharArray());
m_pNetVarMgr->SetSummarizeOffsets(false);
Offsets::m_hOwner = m_pNetVarMgr->GetOffset(xorBaseCombatWeapon, /*m_hOwner*/CXorString("\x7A\x54\xED\x8D\x60\x65\xE0\xB0"));
Offsets::m_iClip1 = m_pNetVarMgr->GetOffset(xorBaseCombatWeapon, /*m_iClip1*/CXorString("\x7A\x54\xEC\x81\x7B\x62\xF5\xF3"));
Offsets::m_iClip2 = m_pNetVarMgr->GetOffset(xorBaseCombatWeapon, /*m_iClip2*/CXorString("\x7A\x54\xEC\x81\x7B\x62\xF5\xF0"));
Offsets::m_flNextPrimaryAttack = m_pNetVarMgr->GetOffset(2, xorBaseCombatWeapon,
/*DT_LocalActiveWeaponData*/CXorString("\x53\x5F\xDA\x8E\x78\x68\xE4\xAE\x56\x68\xF1\xAB\x61\x6E\xD2\xA7\x76\x7B\xEA\xAC\x53\x6A\xF1\xA3").ToCharArray(),
/*m_flNextPrimaryAttack*/CXorString("\x7A\x54\xE3\xAE\x59\x6E\xFD\xB6\x47\x79\xEC\xAF\x76\x79\xFC\x83\x63\x7F\xE4\xA1\x7C").ToCharArray());
Offsets::m_hWeaponWorldModel = m_pNetVarMgr->GetOffset(xorBaseCombatWeapon, /*m_hWeaponWorldModel*/CXorString("\x7A\x54\xED\x95\x72\x6A\xF5\xAD\x79\x5C\xEA\xB0\x7B\x6F\xC8\xAD\x73\x6E\xE9"));
Offsets::m_fAccuracyPenalty = m_pNetVarMgr->GetOffset(xorWeaponCSBase, /*m_fAccuracyPenalty*/CXorString("\x7A\x54\xE3\x83\x74\x68\xF0\xB0\x76\x68\xFC\x92\x72\x65\xE4\xAE\x63\x72"));
Offsets::m_flPostponeFireReadyTime = m_pNetVarMgr->GetOffset(xorWeaponCSBase, /*m_flPostponeFireReadyTime*/CXorString("\x7A\x54\xE3\xAE\x47\x64\xF6\xB6\x67\x64\xEB\xA7\x51\x62\xF7\xA7\x45\x6E\xE4\xA6\x6E\x5F\xEC\xAF\x72"));
Offsets::m_fThrowTime = m_pNetVarMgr->GetOffset(xorBaseCSGrenade, /*m_fThrowTime*/CXorString("\x7A\x54\xE3\x96\x7F\x79\xEA\xB5\x43\x62\xE8\xA7"));
CNetVar* pDtAttributeManager = m_pNetVarMgr->GetNetVar(xorBaseAttributableItem, /*DT_AttributeContainer*/CXorString("\x53\x5F\xDA\x83\x63\x7F\xF7\xAB\x75\x7E\xF1\xA7\x54\x64\xEB\xB6\x76\x62\xEB\xA7\x65"));
CNetVar* pDtItem = pDtAttributeManager->GetChild(/*DT_ScriptCreatedItem*/CXorString("\x53\x5F\xDA\x91\x74\x79\xEC\xB2\x63\x48\xF7\xA7\x76\x7F\xE0\xA6\x5E\x7F\xE0\xAF"));
int iOffset = pDtAttributeManager->GetOffset() + pDtItem->GetOffset();
Offsets::m_iItemIDHigh = iOffset + pDtItem->GetChild(/*m_iItemIDHigh*/CXorString("\x7A\x54\xEC\x8B\x63\x6E\xE8\x8B\x53\x43\xEC\xA5\x7F"))->GetOffset();
Offsets::m_iItemIDLow = iOffset + pDtItem->GetChild(/*m_iItemIDLow*/CXorString("\x7A\x54\xEC\x8B\x63\x6E\xE8\x8B\x53\x47\xEA\xB5"))->GetOffset();
Offsets::m_iAccountID = iOffset + pDtItem->GetChild(/*m_iAccountID*/CXorString("\x7A\x54\xEC\x83\x74\x68\xEA\xB7\x79\x7F\xCC\x86"))->GetOffset();
Offsets::m_iEntityQuality = iOffset + pDtItem->GetChild(/*m_iEntityQuality*/CXorString("\x7A\x54\xEC\x87\x79\x7F\xEC\xB6\x6E\x5A\xF0\xA3\x7B\x62\xF1\xBB"))->GetOffset();
Offsets::m_szCustomName = iOffset + pDtItem->GetChild(/*m_szCustomName*/CXorString("\x7A\x54\xF6\xB8\x54\x7E\xF6\xB6\x78\x66\xCB\xA3\x7A\x6E"))->GetOffset();
Offsets::m_OriginalOwnerXuidLow = m_pNetVarMgr->GetOffset(xorBaseAttributableItem, /*m_OriginalOwnerXuidLow*/CXorString("\x7A\x54\xCA\xB0\x7E\x6C\xEC\xAC\x76\x67\xCA\xB5\x79\x6E\xF7\x9A\x62\x62\xE1\x8E\x78\x7C"));
Offsets::m_OriginalOwnerXuidHigh = m_pNetVarMgr->GetOffset(xorBaseAttributableItem, /*m_OriginalOwnerXuidHigh*/CXorString("\x7A\x54\xCA\xB0\x7E\x6C\xEC\xAC\x76\x67\xCA\xB5\x79\x6E\xF7\x9A\x62\x62\xE1\x8A\x7E\x6C\xED"));
Offsets::m_nFallbackPaintKit = m_pNetVarMgr->GetOffset(xorBaseAttributableItem, /*m_nFallbackPaintKit*/CXorString("\x7A\x54\xEB\x84\x76\x67\xE9\xA0\x76\x68\xEE\x92\x76\x62\xEB\xB6\x5C\x62\xF1"));
Offsets::m_nFallbackSeed = m_pNetVarMgr->GetOffset(xorBaseAttributableItem, /*m_nFallbackSeed*/CXorString("\x7A\x54\xEB\x84\x76\x67\xE9\xA0\x76\x68\xEE\x91\x72\x6E\xE1"));
Offsets::m_flFallbackWear = m_pNetVarMgr->GetOffset(xorBaseAttributableItem, /*m_flFallbackWear*/CXorString("\x7A\x54\xE3\xAE\x51\x6A\xE9\xAE\x75\x6A\xE6\xA9\x40\x6E\xE4\xB0"));
Offsets::m_nFallbackStatTrak = m_pNetVarMgr->GetOffset(xorBaseAttributableItem, /*m_nFallbackStatTrak*/CXorString("\x7A\x54\xEB\x84\x76\x67\xE9\xA0\x76\x68\xEE\x91\x63\x6A\xF1\x96\x65\x6A\xEE"));
Offsets::DT_BaseViewModel::m_hWeapon = m_pNetVarMgr->GetOffset(xorBaseViewModel, /*m_hWeapon*/CXorString("\x7A\x54\xED\x95\x72\x6A\xF5\xAD\x79"));
Offsets::DT_BaseViewModel::m_hOwner = m_pNetVarMgr->GetOffset(xorBaseViewModel, /*m_hOwner*/CXorString("\x7A\x54\xED\x8D\x60\x65\xE0\xB0"));
Offsets::m_nSequence = m_pNetVarMgr->GetOffset(xorBaseAnimating, /*m_nSequence*/CXorString("\x7A\x54\xEB\x91\x72\x7A\xF0\xA7\x79\x68\xE0"));
Offsets::m_flPoseParameter = m_pNetVarMgr->GetOffset(xorBaseAnimating, /*m_flPoseParameter*/CXorString("\x7A\x54\xE3\xAE\x47\x64\xF6\xA7\x47\x6A\xF7\xA3\x7A\x6E\xF1\xA7\x65"));
Offsets::m_flCycle = m_pNetVarMgr->GetOffset(2, xorBaseAnimating,
/*DT_ServerAnimationData*/CXorString("\x53\x5F\xDA\x91\x72\x79\xF3\xA7\x65\x4A\xEB\xAB\x7A\x6A\xF1\xAB\x78\x65\xC1\xA3\x63\x6A").ToCharArray(),
/*m_flCycle*/CXorString("\x7A\x54\xE3\xAE\x54\x72\xE6\xAE\x72").ToCharArray());
#ifdef _DEBUG
g_pConsole->WritePlain("Done\n\n");
#endif
// Grab NetVars later required for hooking
m_pNetVarSequence = m_pNetVarMgr->GetNetVar(xorBaseViewModel, /*m_nSequence*/CXorString("\x7A\x54\xEB\x91\x72\x7A\xF0\xA7\x79\x68\xE0"));
m_misc.SetReadyCallback((IsReadyCallback_t)(CPattern::FindPattern(
(BYTE*)this->ClientDll(),
CLIENTDLL_SIZE,
(BYTE*)"\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x08\x56\x8B\x35\x00\x00\x00\x00\x57\x83\xBE",
"ghdrtzuigkog----trg"
)));
benchmark.FinishBenchmark();
benchmark.PrintBenchmark("Get Networked Variables");
}
void CorrectMovement(CUserCmd* pCmd, QAngle& qOrigAngles)
{
CApplication* pApp = CApplication::Instance();
Vector vecViewForward, vecViewRight, vecViewUp, vecAimForward, vecAimRight, vecAimUp;
QAngle qViewAngles, qAimAngles;
pApp->EngineClient()->GetViewAngles(qViewAngles);
float flForward = pCmd->forwardmove;
float flRight = pCmd->sidemove;
float flUp = pCmd->upmove;
qViewAngles = QAngle(0.0f, qViewAngles.y, 0.0f);
qAimAngles = QAngle(0.0f, pCmd->viewangles[1], 0.0f);
AngleVectors(qViewAngles, &vecViewForward, &vecViewRight, &vecViewUp);
AngleVectors(qAimAngles, &vecAimForward, &vecAimRight, &vecAimUp);
vecViewForward.NormalizeAngles();
vecViewRight.NormalizeAngles();
vecViewUp.NormalizeAngles();
Vector vecForwardNorm = vecViewForward * flForward;
Vector vecRightNorm = vecViewRight * flRight;
Vector vecUpNorm = vecViewUp * flUp;
pCmd->forwardmove = vecForwardNorm.Dot(vecAimForward) + vecRightNorm.Dot(vecAimForward) + vecUpNorm.Dot(vecAimForward);
pCmd->sidemove = vecForwardNorm.Dot(vecAimRight) + vecRightNorm.Dot(vecAimRight) + vecUpNorm.Dot(vecAimRight);
pCmd->upmove = vecForwardNorm.Dot(vecAimUp) + vecRightNorm.Dot(vecAimUp) + vecUpNorm.Dot(vecAimUp);
ClampMovement(pCmd);
}
void NormalizeAngles(CUserCmd* pUserCmd)
{
// Normalize pitch
while (pUserCmd->viewangles[0] > 89.0f)
{
pUserCmd->viewangles[0] -= 178.0f;
}
while (pUserCmd->viewangles[0] < -89.0f)
{
pUserCmd->viewangles[0] += 178.0f;
}
// Normalize yaw
while (pUserCmd->viewangles[1] > 179.9999f)
{
pUserCmd->viewangles[1] -= 360.0f;
}
while (pUserCmd->viewangles[1] < -179.9999f)
{
pUserCmd->viewangles[1] += 360.0f;
}
pUserCmd->viewangles[2] = 0.0f;
}
void ClampMovement(CUserCmd* pUserCmd)
{
constexpr float maxForwardMove = 450.0f;
constexpr float maxSideMove = 450.0f;
constexpr float maxUpMove = 320.0f;
// Clamp forward
if (pUserCmd->forwardmove > maxForwardMove)
{
pUserCmd->forwardmove = maxForwardMove;
}
else if (pUserCmd->forwardmove < -maxForwardMove)
{
pUserCmd->forwardmove = -maxForwardMove;
}
// Clamp sidemove
if (pUserCmd->sidemove > maxSideMove)
{
pUserCmd->sidemove = maxSideMove;
}
else if (pUserCmd->sidemove < -maxSideMove)
{
pUserCmd->sidemove = -maxSideMove;
}
// Clamp upmove
if (pUserCmd->upmove > maxUpMove)
{
pUserCmd->upmove = maxUpMove;
}
else if (pUserCmd->upmove < -maxUpMove)
{
pUserCmd->upmove = -maxUpMove;
}
}
DWORD __stdcall ThreadFreeLibrary(void* pParam)
{
// Wait 1 sec for hooks to finish running
Sleep(1000);
FreeLibraryAndExitThread((HMODULE)pParam, 0);
return 0;
} | 53.135508 | 257 | 0.755083 | [
"vector"
] |
821bfcd3e407ce92776d0f95b117bc4d2f3903c6 | 1,864 | cpp | C++ | src/core/nodes/node_collider_box.cpp | Ratstail91/zelda-framework | 54e94fe7d69271a514142406355199e8dbcccd38 | [
"Zlib"
] | 5 | 2021-04-26T19:55:40.000Z | 2021-07-20T08:34:57.000Z | src/core/nodes/node_collider_box.cpp | Ratstail91/zelda-framework | 54e94fe7d69271a514142406355199e8dbcccd38 | [
"Zlib"
] | null | null | null | src/core/nodes/node_collider_box.cpp | Ratstail91/zelda-framework | 54e94fe7d69271a514142406355199e8dbcccd38 | [
"Zlib"
] | null | null | null | #include "node_collider_box.hpp"
#include "node_transform.hpp"
#include "node_image.hpp"
void NodeColliderBox::SetBoundsToImageSibling() {
//check if there is an image on this node already
NodeImage* image = parent->GetFirstChildByType<NodeImage>();
if (image != nullptr) {
//automatically set up the bounds
halfSize.x = image->GetClipW() / 2.0;
halfSize.y = image->GetClipH() / 2.0;
center = halfSize;
}
}
ColliderBox NodeColliderBox::GetWorldColliderBox() {
NodeTransform* transform = parent->GetFirstChildByType<NodeTransform>();
if (transform != nullptr) {
//adjust self based on transform's position
return *this + transform->GetWorldPosition();
}
return *this;
}
void NodeColliderBox::SnapCollideWorldBox(ColliderBox const& otherWorldBox) {
ColliderBox thisWorldBox = GetWorldColliderBox();
//do nothing if no intersection
if (!Intersect(thisWorldBox, otherWorldBox)) {
return;
}
//snap to the closest position outside of other
double jumpX = thisWorldBox.halfSize.x + otherWorldBox.halfSize.x - fabs(thisWorldBox.center.x - otherWorldBox.center.x);
double jumpY = thisWorldBox.halfSize.y + otherWorldBox.halfSize.y - fabs(thisWorldBox.center.y - otherWorldBox.center.y);
Vector2 jump;
//floating ABS
if (fabs(jumpX) < fabs(jumpY)) {
//multiply by direction
jump = Vector2(jumpX, 0) * (thisWorldBox.center.x > otherWorldBox.center.x ? 1 : -1);
} else {
//multiply by direction
jump = Vector2(0, jumpY) * (thisWorldBox.center.y > otherWorldBox.center.y ? 1 : -1);
}
//get the transform and actually jump
NodeTransform* transform = parent->GetFirstChildByType<NodeTransform>();
if (transform != nullptr) {
transform->GetPosition() += jump;
//stop motion in that direction
if (jump.x != 0.0) {
transform->GetMotion().x = 0;
}
if (jump.y != 0.0) {
transform->GetMotion().y = 0;
}
}
}
| 27.820896 | 122 | 0.712446 | [
"transform"
] |
82222eda2d8c9c59cac44cacb0681e7b264da53e | 1,148 | cxx | C++ | examples/mergesort.cxx | lugt/algorithms-tester | 6fb0ae34584695486f98604790a5fc5b26e12eb7 | [
"Apache-2.0"
] | null | null | null | examples/mergesort.cxx | lugt/algorithms-tester | 6fb0ae34584695486f98604790a5fc5b26e12eb7 | [
"Apache-2.0"
] | null | null | null | examples/mergesort.cxx | lugt/algorithms-tester | 6fb0ae34584695486f98604790a5fc5b26e12eb7 | [
"Apache-2.0"
] | null | null | null | //
// Created by xc5 on 2019-03-16.
//
#include <vector>
#include <iostream>
#include "common_def.h"
ELETVEC merge(ELETVEC a, ELETVEC b) {
ELETVEC res;
ELET ba = 0;
ELET bb = 0;
while (ba < a.size() && bb < b.size()) {
if (a[ba] <= b[bb]) {
res.push_back(a[ba++]);
} else {
res.push_back(b[bb++]);
}
}
if (ba == a.size()) {
while (bb < b.size()) res.push_back(b[bb++]);
} else if (bb == b.size()) {
while (ba < a.size()) res.push_back(a[ba++]);
}
return res;
}
ELETVEC mergeSort(ELETVEC arr) {
auto s = (ELET) arr.size();
if (s < 2) return arr;
ELET mid = s / 2;
ELETVEC front(arr.begin(), arr.begin() + mid);
ELETVEC back(arr.begin() + mid, arr.end());
return merge(mergeSort(front), mergeSort(back));
}
void tracedMerge(ELET * values, ELET_OFST length, SPTR parent) {
AS_CHILD_SPAN(span, "tracedMergeSort", parent);
AS_CHILD_SPAN(merge_vector_span, "tracedMergeSortVectorize", span);
vector<ELET> temp(values, values + length);
SPAN_OK(merge_vector_span);
AS_CHILD_SPAN(merge_loop_span, "tracedMergeSortLoop", span);
mergeSort(temp);
SPAN_OK(merge_loop_span);
} | 22.96 | 69 | 0.622822 | [
"vector"
] |
8222692940b4ec20456773d73166986945ce44e5 | 951 | hpp | C++ | tests/LineFitting/LineFitting.hpp | argon24/robest | e91fe1f0ec94ae6fcf81a246ad4433b3371ddaa0 | [
"MIT"
] | 6 | 2018-01-14T23:51:02.000Z | 2021-12-02T08:42:20.000Z | tests/LineFitting/LineFitting.hpp | argon24/robest | e91fe1f0ec94ae6fcf81a246ad4433b3371ddaa0 | [
"MIT"
] | 1 | 2018-11-10T09:56:57.000Z | 2018-11-17T23:17:39.000Z | tests/LineFitting/LineFitting.hpp | argon24/robest | e91fe1f0ec94ae6fcf81a246ad4433b3371ddaa0 | [
"MIT"
] | 5 | 2018-11-09T20:12:35.000Z | 2021-09-24T09:41:47.000Z | /**
* @brief Line fitting to a set of 2D points
*
* @author Andrey Kudryavtsev (avkudr.github.io)
* @author Rahima Djahel (github:rahma24000)
* @date 13/03/2018
* @version 1.0
*/
#include <cmath>
#include <list>
#include <vector>
#include <iostream>
#include "robust_estim.hpp"
struct Point2d{
double x;
double y;
};
typedef std::vector<Point2d> Point2Dvector;
class LineFittingProblem : public robest::EstimationProblem{
public:
LineFittingProblem();
~LineFittingProblem();
void setData(std::vector<double> & x, std::vector<double> & y);
double estimErrorForSample(int i);
void estimModelFromSamples(const std::vector<int> & samplesIdx);
int getTotalNbSamples() const{
return (int) points.size();
}
void getResult(double & resa, double & resb){
resa = this->a;
resb = this->b;
}
private:
Point2Dvector points; // Data
double a;
double b;
};
| 19.02 | 68 | 0.648791 | [
"vector"
] |
822b23f5e6d8f6082610763603590b8334e8ef06 | 332,934 | cpp | C++ | third_party/pdfium/xfa/fxfa/parser/xfa_basic_data.cpp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 1 | 2020-09-15T08:43:34.000Z | 2020-09-15T08:43:34.000Z | third_party/pdfium/xfa/fxfa/parser/xfa_basic_data.cpp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | third_party/pdfium/xfa/fxfa/parser/xfa_basic_data.cpp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "xfa/fxfa/parser/xfa_basic_data.h"
#include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/fxfa/parser/xfa_basic_imp.h"
#include "xfa/fxfa/parser/xfa_doclayout.h"
#include "xfa/fxfa/parser/xfa_document.h"
#include "xfa/fxfa/parser/xfa_localemgr.h"
#include "xfa/fxfa/parser/xfa_object.h"
#include "xfa/fxfa/parser/xfa_parser.h"
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_script_datawindow.h"
#include "xfa/fxfa/parser/xfa_script_eventpseudomodel.h"
#include "xfa/fxfa/parser/xfa_script_hostpseudomodel.h"
#include "xfa/fxfa/parser/xfa_script_layoutpseudomodel.h"
#include "xfa/fxfa/parser/xfa_script_logpseudomodel.h"
#include "xfa/fxfa/parser/xfa_script_signaturepseudomodel.h"
#include "xfa/fxfa/parser/xfa_utils.h"
const XFA_ATTRIBUTEENUMINFO g_XFAEnumData[] = {
{0x2a, L"*", XFA_ATTRIBUTEENUM_Asterisk},
{0x2f, L"/", XFA_ATTRIBUTEENUM_Slash},
{0x5c, L"\\", XFA_ATTRIBUTEENUM_Backslash},
{0x239bd, L"on", XFA_ATTRIBUTEENUM_On},
{0x25356, L"tb", XFA_ATTRIBUTEENUM_Tb},
{0x25885, L"up", XFA_ATTRIBUTEENUM_Up},
{0x91b281, L"metaData", XFA_ATTRIBUTEENUM_MetaData},
{0x1f8dedb, L"delegate", XFA_ATTRIBUTEENUM_Delegate},
{0x2a6c55a, L"postSubmit", XFA_ATTRIBUTEENUM_PostSubmit},
{0x31b19c1, L"name", XFA_ATTRIBUTEENUM_Name},
{0x378a38a, L"cross", XFA_ATTRIBUTEENUM_Cross},
{0x3848b3f, L"next", XFA_ATTRIBUTEENUM_Next},
{0x48b6670, L"none", XFA_ATTRIBUTEENUM_None},
{0x51aafe5, L"shortEdge", XFA_ATTRIBUTEENUM_ShortEdge},
{0x55264c4, L"1mod10_1mod11", XFA_ATTRIBUTEENUM_1mod10_1mod11},
{0x5a5c519, L"height", XFA_ATTRIBUTEENUM_Height},
{0x89ce549, L"crossDiagonal", XFA_ATTRIBUTEENUM_CrossDiagonal},
{0x9f9d0f9, L"all", XFA_ATTRIBUTEENUM_All},
{0x9f9db48, L"any", XFA_ATTRIBUTEENUM_Any},
{0xa126261, L"toRight", XFA_ATTRIBUTEENUM_ToRight},
{0xa36de29, L"matchTemplate", XFA_ATTRIBUTEENUM_MatchTemplate},
{0xa48d040, L"dpl", XFA_ATTRIBUTEENUM_Dpl},
{0xa559c05, L"invisible", XFA_ATTRIBUTEENUM_Invisible},
{0xa7d48e3, L"fit", XFA_ATTRIBUTEENUM_Fit},
{0xa8a8f80, L"width", XFA_ATTRIBUTEENUM_Width},
{0xab466bb, L"preSubmit", XFA_ATTRIBUTEENUM_PreSubmit},
{0xacc5785, L"ipl", XFA_ATTRIBUTEENUM_Ipl},
{0xafab0f8, L"flateCompress", XFA_ATTRIBUTEENUM_FlateCompress},
{0xb355816, L"med", XFA_ATTRIBUTEENUM_Med},
{0xb69ef77, L"odd", XFA_ATTRIBUTEENUM_Odd},
{0xb69f9bb, L"off", XFA_ATTRIBUTEENUM_Off},
{0xb843dba, L"pdf", XFA_ATTRIBUTEENUM_Pdf},
{0xbb912b8, L"row", XFA_ATTRIBUTEENUM_Row},
{0xbedaf33, L"top", XFA_ATTRIBUTEENUM_Top},
{0xc56afcc, L"xdp", XFA_ATTRIBUTEENUM_Xdp},
{0xc56ba02, L"xfd", XFA_ATTRIBUTEENUM_Xfd},
{0xc56ddf1, L"xml", XFA_ATTRIBUTEENUM_Xml},
{0xc8b65f3, L"zip", XFA_ATTRIBUTEENUM_Zip},
{0xc8b89d6, L"zpl", XFA_ATTRIBUTEENUM_Zpl},
{0xf55d7ee, L"visible", XFA_ATTRIBUTEENUM_Visible},
{0xfe3596a, L"exclude", XFA_ATTRIBUTEENUM_Exclude},
{0x109d7ce7, L"mouseEnter", XFA_ATTRIBUTEENUM_MouseEnter},
{0x10f1bc0c, L"pair", XFA_ATTRIBUTEENUM_Pair},
{0x1154efe6, L"filter", XFA_ATTRIBUTEENUM_Filter},
{0x125bc94b, L"moveLast", XFA_ATTRIBUTEENUM_MoveLast},
{0x12e1f1f0, L"exportAndImport", XFA_ATTRIBUTEENUM_ExportAndImport},
{0x13000c60, L"push", XFA_ATTRIBUTEENUM_Push},
{0x138ee315, L"portrait", XFA_ATTRIBUTEENUM_Portrait},
{0x14da2125, L"default", XFA_ATTRIBUTEENUM_Default},
{0x157749a5, L"storedProc", XFA_ATTRIBUTEENUM_StoredProc},
{0x16641198, L"stayBOF", XFA_ATTRIBUTEENUM_StayBOF},
{0x16b2fc5b, L"stayEOF", XFA_ATTRIBUTEENUM_StayEOF},
{0x17fad373, L"postPrint", XFA_ATTRIBUTEENUM_PostPrint},
{0x193207d0, L"usCarrier", XFA_ATTRIBUTEENUM_UsCarrier},
{0x193ade3e, L"right", XFA_ATTRIBUTEENUM_Right},
{0x1bfc72d9, L"preOpen", XFA_ATTRIBUTEENUM_PreOpen},
{0x1cc9317a, L"actual", XFA_ATTRIBUTEENUM_Actual},
{0x1f31df1e, L"rest", XFA_ATTRIBUTEENUM_Rest},
{0x1fb1bf14, L"topCenter", XFA_ATTRIBUTEENUM_TopCenter},
{0x207de667, L"standardSymbol", XFA_ATTRIBUTEENUM_StandardSymbol},
{0x2196a452, L"initialize", XFA_ATTRIBUTEENUM_Initialize},
{0x23bd40c7, L"justifyAll", XFA_ATTRIBUTEENUM_JustifyAll},
{0x247cf3e9, L"normal", XFA_ATTRIBUTEENUM_Normal},
{0x25aa946b, L"landscape", XFA_ATTRIBUTEENUM_Landscape},
{0x2739b5c9, L"nonInteractive", XFA_ATTRIBUTEENUM_NonInteractive},
{0x27410f03, L"mouseExit", XFA_ATTRIBUTEENUM_MouseExit},
{0x2854e62c, L"minus", XFA_ATTRIBUTEENUM_Minus},
{0x287e936a, L"diagonalLeft", XFA_ATTRIBUTEENUM_DiagonalLeft},
{0x2972a98f, L"simplexPaginated", XFA_ATTRIBUTEENUM_SimplexPaginated},
{0x29d8225f, L"document", XFA_ATTRIBUTEENUM_Document},
{0x2a9d3016, L"warning", XFA_ATTRIBUTEENUM_Warning},
{0x2b35b6d9, L"auto", XFA_ATTRIBUTEENUM_Auto},
{0x2c1653d9, L"below", XFA_ATTRIBUTEENUM_Below},
{0x2c1f0540, L"bottomLeft", XFA_ATTRIBUTEENUM_BottomLeft},
{0x2c44e816, L"bottomCenter", XFA_ATTRIBUTEENUM_BottomCenter},
{0x2cd3e9f3, L"tcpl", XFA_ATTRIBUTEENUM_Tcpl},
{0x2d08af85, L"text", XFA_ATTRIBUTEENUM_Text},
{0x2dc478eb, L"grouping", XFA_ATTRIBUTEENUM_Grouping},
{0x2ef3afdd, L"secureSymbol", XFA_ATTRIBUTEENUM_SecureSymbol},
{0x2f2dd29a, L"preExecute", XFA_ATTRIBUTEENUM_PreExecute},
{0x33c43dec, L"docClose", XFA_ATTRIBUTEENUM_DocClose},
{0x33f25bb5, L"keyset", XFA_ATTRIBUTEENUM_Keyset},
{0x34e363da, L"vertical", XFA_ATTRIBUTEENUM_Vertical},
{0x361fa1b6, L"preSave", XFA_ATTRIBUTEENUM_PreSave},
{0x36f1c6d8, L"preSign", XFA_ATTRIBUTEENUM_PreSign},
{0x399f02b5, L"bottom", XFA_ATTRIBUTEENUM_Bottom},
{0x3b0ab096, L"toTop", XFA_ATTRIBUTEENUM_ToTop},
{0x3c752495, L"verify", XFA_ATTRIBUTEENUM_Verify},
{0x3ce05d68, L"first", XFA_ATTRIBUTEENUM_First},
{0x3ecead94, L"contentArea", XFA_ATTRIBUTEENUM_ContentArea},
{0x40623b5b, L"solid", XFA_ATTRIBUTEENUM_Solid},
{0x42c6cd8d, L"pessimistic", XFA_ATTRIBUTEENUM_Pessimistic},
{0x43ddc6bf, L"duplexPaginated", XFA_ATTRIBUTEENUM_DuplexPaginated},
{0x442f68c8, L"round", XFA_ATTRIBUTEENUM_Round},
{0x45efb847, L"remerge", XFA_ATTRIBUTEENUM_Remerge},
{0x46972265, L"ordered", XFA_ATTRIBUTEENUM_Ordered},
{0x46f95531, L"percent", XFA_ATTRIBUTEENUM_Percent},
{0x46fd25ae, L"even", XFA_ATTRIBUTEENUM_Even},
{0x4731d6ba, L"exit", XFA_ATTRIBUTEENUM_Exit},
{0x4977356b, L"toolTip", XFA_ATTRIBUTEENUM_ToolTip},
{0x49b980ee, L"orderedOccurrence", XFA_ATTRIBUTEENUM_OrderedOccurrence},
{0x4a7e2dfe, L"readOnly", XFA_ATTRIBUTEENUM_ReadOnly},
{0x4c4e8acb, L"currency", XFA_ATTRIBUTEENUM_Currency},
{0x4dcf25f8, L"concat", XFA_ATTRIBUTEENUM_Concat},
{0x4febb826, L"Thai", XFA_ATTRIBUTEENUM_Thai},
{0x50ef95b2, L"embossed", XFA_ATTRIBUTEENUM_Embossed},
{0x516e35ce, L"formdata", XFA_ATTRIBUTEENUM_Formdata},
{0x52fa6f0e, L"Greek", XFA_ATTRIBUTEENUM_Greek},
{0x54034c2f, L"decimal", XFA_ATTRIBUTEENUM_Decimal},
{0x542c7300, L"select", XFA_ATTRIBUTEENUM_Select},
{0x551f0ae5, L"longEdge", XFA_ATTRIBUTEENUM_LongEdge},
{0x55520a8a, L"protected", XFA_ATTRIBUTEENUM_Protected},
{0x559f76f3, L"bottomRight", XFA_ATTRIBUTEENUM_BottomRight},
{0x568cb500, L"zero", XFA_ATTRIBUTEENUM_Zero},
{0x56bcecb7, L"forwardOnly", XFA_ATTRIBUTEENUM_ForwardOnly},
{0x56bf456b, L"docReady", XFA_ATTRIBUTEENUM_DocReady},
{0x573cb40c, L"hidden", XFA_ATTRIBUTEENUM_Hidden},
{0x582e3424, L"include", XFA_ATTRIBUTEENUM_Include},
{0x58a3dd29, L"dashed", XFA_ATTRIBUTEENUM_Dashed},
{0x5955b22b, L"multiSelect", XFA_ATTRIBUTEENUM_MultiSelect},
{0x598d5c53, L"inactive", XFA_ATTRIBUTEENUM_Inactive},
{0x59c8f27d, L"embed", XFA_ATTRIBUTEENUM_Embed},
{0x5e7555e8, L"static", XFA_ATTRIBUTEENUM_Static},
{0x606d4def, L"onEntry", XFA_ATTRIBUTEENUM_OnEntry},
{0x6195eafb, L"Cyrillic", XFA_ATTRIBUTEENUM_Cyrillic},
{0x6491b0f3, L"nonBlank", XFA_ATTRIBUTEENUM_NonBlank},
{0x67bef031, L"topRight", XFA_ATTRIBUTEENUM_TopRight},
{0x67df5ebd, L"Hebrew", XFA_ATTRIBUTEENUM_Hebrew},
{0x6aea98be, L"topLeft", XFA_ATTRIBUTEENUM_TopLeft},
{0x6c51afc1, L"center", XFA_ATTRIBUTEENUM_Center},
{0x7145e6bf, L"moveFirst", XFA_ATTRIBUTEENUM_MoveFirst},
{0x7375465c, L"diamond", XFA_ATTRIBUTEENUM_Diamond},
{0x7461aef4, L"pageOdd", XFA_ATTRIBUTEENUM_PageOdd},
{0x75f8aeb2, L"1mod10", XFA_ATTRIBUTEENUM_1mod10},
{0x76d708e0, L"Korean", XFA_ATTRIBUTEENUM_Korean},
{0x789f14d7, L"aboveEmbedded", XFA_ATTRIBUTEENUM_AboveEmbedded},
{0x792ea39f, L"zipCompress", XFA_ATTRIBUTEENUM_ZipCompress},
{0x7a5b7193, L"numeric", XFA_ATTRIBUTEENUM_Numeric},
{0x7abec0d2, L"circle", XFA_ATTRIBUTEENUM_Circle},
{0x7afbba38, L"toBottom", XFA_ATTRIBUTEENUM_ToBottom},
{0x7b95e661, L"inverted", XFA_ATTRIBUTEENUM_Inverted},
{0x7baca2e3, L"update", XFA_ATTRIBUTEENUM_Update},
{0x7eb5da2c, L"isoname", XFA_ATTRIBUTEENUM_Isoname},
{0x7f6fd3d7, L"server", XFA_ATTRIBUTEENUM_Server},
{0x814f82b5, L"position", XFA_ATTRIBUTEENUM_Position},
{0x82deacf0, L"middleCenter", XFA_ATTRIBUTEENUM_MiddleCenter},
{0x83a49dc6, L"optional", XFA_ATTRIBUTEENUM_Optional},
{0x861a116f, L"usePrinterSetting", XFA_ATTRIBUTEENUM_UsePrinterSetting},
{0x86701ce0, L"outline", XFA_ATTRIBUTEENUM_Outline},
{0x8808385e, L"indexChange", XFA_ATTRIBUTEENUM_IndexChange},
{0x891f4606, L"change", XFA_ATTRIBUTEENUM_Change},
{0x89939f36, L"pageArea", XFA_ATTRIBUTEENUM_PageArea},
{0x8b5c3b25, L"once", XFA_ATTRIBUTEENUM_Once},
{0x8b5c6962, L"only", XFA_ATTRIBUTEENUM_Only},
{0x8b90e1f2, L"open", XFA_ATTRIBUTEENUM_Open},
{0x8bcfe96e, L"caption", XFA_ATTRIBUTEENUM_Caption},
{0x8ce83ef8, L"raised", XFA_ATTRIBUTEENUM_Raised},
{0x8d269cae, L"justify", XFA_ATTRIBUTEENUM_Justify},
{0x8fd520dc, L"refAndDescendants", XFA_ATTRIBUTEENUM_RefAndDescendants},
{0x9041d4b0, L"short", XFA_ATTRIBUTEENUM_Short},
{0x90c94426, L"pageFront", XFA_ATTRIBUTEENUM_PageFront},
{0x936beee5, L"monospace", XFA_ATTRIBUTEENUM_Monospace},
{0x947fa00f, L"middle", XFA_ATTRIBUTEENUM_Middle},
{0x9528a7b4, L"prePrint", XFA_ATTRIBUTEENUM_PrePrint},
{0x959ab231, L"always", XFA_ATTRIBUTEENUM_Always},
{0x96d61bf0, L"unknown", XFA_ATTRIBUTEENUM_Unknown},
{0x997194ee, L"toLeft", XFA_ATTRIBUTEENUM_ToLeft},
{0x9a83a3cd, L"above", XFA_ATTRIBUTEENUM_Above},
{0x9d0d71c7, L"dashDot", XFA_ATTRIBUTEENUM_DashDot},
{0x9df56f3e, L"gregorian", XFA_ATTRIBUTEENUM_Gregorian},
{0x9f6723fd, L"Roman", XFA_ATTRIBUTEENUM_Roman},
{0x9f693b21, L"mouseDown", XFA_ATTRIBUTEENUM_MouseDown},
{0xa1429b36, L"symbol", XFA_ATTRIBUTEENUM_Symbol},
{0xa5aa45cb, L"pageEven", XFA_ATTRIBUTEENUM_PageEven},
{0xa68635f1, L"sign", XFA_ATTRIBUTEENUM_Sign},
{0xa7315093, L"addNew", XFA_ATTRIBUTEENUM_AddNew},
{0xa7a773fa, L"star", XFA_ATTRIBUTEENUM_Star},
{0xa7d57b45, L"optimistic", XFA_ATTRIBUTEENUM_Optimistic},
{0xa8077321, L"rl-tb", XFA_ATTRIBUTEENUM_Rl_tb},
{0xa8f1468d, L"middleRight", XFA_ATTRIBUTEENUM_MiddleRight},
{0xaa84a1f1, L"maintain", XFA_ATTRIBUTEENUM_Maintain},
{0xab40b12c, L"package", XFA_ATTRIBUTEENUM_Package},
{0xac8b4d85, L"SimplifiedChinese", XFA_ATTRIBUTEENUM_SimplifiedChinese},
{0xadae6744, L"toCenter", XFA_ATTRIBUTEENUM_ToCenter},
{0xb0129df1, L"back", XFA_ATTRIBUTEENUM_Back},
{0xb0f088cf, L"unspecified", XFA_ATTRIBUTEENUM_Unspecified},
{0xb1271067, L"batchOptimistic", XFA_ATTRIBUTEENUM_BatchOptimistic},
{0xb18313a1, L"bold", XFA_ATTRIBUTEENUM_Bold},
{0xb1833cad, L"both", XFA_ATTRIBUTEENUM_Both},
{0xb221123f, L"butt", XFA_ATTRIBUTEENUM_Butt},
{0xb40c36bf, L"client", XFA_ATTRIBUTEENUM_Client},
{0xb56c7053, L"2mod10", XFA_ATTRIBUTEENUM_2mod10},
{0xb683a345, L"imageOnly", XFA_ATTRIBUTEENUM_ImageOnly},
{0xb7732dea, L"horizontal", XFA_ATTRIBUTEENUM_Horizontal},
{0xb88652a4, L"dotted", XFA_ATTRIBUTEENUM_Dotted},
{0xbb2f2880, L"userControl", XFA_ATTRIBUTEENUM_UserControl},
{0xbbb79c5d, L"diagonalRight", XFA_ATTRIBUTEENUM_DiagonalRight},
{0xbd077154, L"consumeData", XFA_ATTRIBUTEENUM_ConsumeData},
{0xbd3fb11e, L"check", XFA_ATTRIBUTEENUM_Check},
{0xbde9abda, L"data", XFA_ATTRIBUTEENUM_Data},
{0xbf5a02d8, L"down", XFA_ATTRIBUTEENUM_Down},
{0xbf7450ee, L"sansSerif", XFA_ATTRIBUTEENUM_SansSerif},
{0xc02d649f, L"inline", XFA_ATTRIBUTEENUM_Inline},
{0xc11a9e3a, L"TraditionalChinese", XFA_ATTRIBUTEENUM_TraditionalChinese},
{0xc16169d8, L"warn", XFA_ATTRIBUTEENUM_Warn},
{0xc16f071f, L"refOnly", XFA_ATTRIBUTEENUM_RefOnly},
{0xc27c8ba5, L"interactiveForms", XFA_ATTRIBUTEENUM_InteractiveForms},
{0xc2d1b15c, L"word", XFA_ATTRIBUTEENUM_Word},
{0xc3621288, L"unordered", XFA_ATTRIBUTEENUM_Unordered},
{0xc5251981, L"required", XFA_ATTRIBUTEENUM_Required},
{0xc7088e7d, L"importOnly", XFA_ATTRIBUTEENUM_ImportOnly},
{0xc72cf0e3, L"belowEmbedded", XFA_ATTRIBUTEENUM_BelowEmbedded},
{0xc819cf07, L"Japanese", XFA_ATTRIBUTEENUM_Japanese},
{0xcdce56b3, L"full", XFA_ATTRIBUTEENUM_Full},
{0xce0122e3, L"rl-row", XFA_ATTRIBUTEENUM_Rl_row},
{0xcf7d71f1, L"Vietnamese", XFA_ATTRIBUTEENUM_Vietnamese},
{0xcfde3e09, L"EastEuropeanRoman", XFA_ATTRIBUTEENUM_EastEuropeanRoman},
{0xd576d08e, L"mouseUp", XFA_ATTRIBUTEENUM_MouseUp},
{0xd7a92904, L"exportOnly", XFA_ATTRIBUTEENUM_ExportOnly},
{0xd8ed1467, L"clear", XFA_ATTRIBUTEENUM_Clear},
{0xd95657a6, L"click", XFA_ATTRIBUTEENUM_Click},
{0xd96c7de5, L"base64", XFA_ATTRIBUTEENUM_Base64},
{0xd9f47f36, L"close", XFA_ATTRIBUTEENUM_Close},
{0xdb075bde, L"host", XFA_ATTRIBUTEENUM_Host},
{0xdb103411, L"global", XFA_ATTRIBUTEENUM_Global},
{0xdb647188, L"blank", XFA_ATTRIBUTEENUM_Blank},
{0xdb9be968, L"table", XFA_ATTRIBUTEENUM_Table},
{0xdf590fbb, L"import", XFA_ATTRIBUTEENUM_Import},
{0xe0e573fb, L"custom", XFA_ATTRIBUTEENUM_Custom},
{0xe0ecc79a, L"middleLeft", XFA_ATTRIBUTEENUM_MiddleLeft},
{0xe1452019, L"postExecute", XFA_ATTRIBUTEENUM_PostExecute},
{0xe1911d98, L"radix", XFA_ATTRIBUTEENUM_Radix},
{0xe25fa7b8, L"postOpen", XFA_ATTRIBUTEENUM_PostOpen},
{0xe28dce7e, L"enter", XFA_ATTRIBUTEENUM_Enter},
{0xe2c44de4, L"ignore", XFA_ATTRIBUTEENUM_Ignore},
{0xe2cd8c61, L"lr-tb", XFA_ATTRIBUTEENUM_Lr_tb},
{0xe2da8336, L"fantasy", XFA_ATTRIBUTEENUM_Fantasy},
{0xe31d5396, L"italic", XFA_ATTRIBUTEENUM_Italic},
{0xe7ada113, L"author", XFA_ATTRIBUTEENUM_Author},
{0xe8e7cc18, L"toEdge", XFA_ATTRIBUTEENUM_ToEdge},
{0xe97aa98b, L"choice", XFA_ATTRIBUTEENUM_Choice},
{0xeafd2a38, L"disabled", XFA_ATTRIBUTEENUM_Disabled},
{0xeb2b7972, L"crossHatch", XFA_ATTRIBUTEENUM_CrossHatch},
{0xeb2db2d7, L"dataRef", XFA_ATTRIBUTEENUM_DataRef},
{0xec35dc6e, L"dashDotDot", XFA_ATTRIBUTEENUM_DashDotDot},
{0xef85d351, L"square", XFA_ATTRIBUTEENUM_Square},
{0xf2102445, L"dynamic", XFA_ATTRIBUTEENUM_Dynamic},
{0xf272c7be, L"manual", XFA_ATTRIBUTEENUM_Manual},
{0xf2bbb64d, L"etched", XFA_ATTRIBUTEENUM_Etched},
{0xf3b8fc6c, L"validationState", XFA_ATTRIBUTEENUM_ValidationState},
{0xf42f2b81, L"cursive", XFA_ATTRIBUTEENUM_Cursive},
{0xf54481d4, L"last", XFA_ATTRIBUTEENUM_Last},
{0xf5ad782b, L"left", XFA_ATTRIBUTEENUM_Left},
{0xf616da2e, L"link", XFA_ATTRIBUTEENUM_Link},
{0xf6b4afb0, L"long", XFA_ATTRIBUTEENUM_Long},
{0xf8636460, L"internationalCarrier",
XFA_ATTRIBUTEENUM_InternationalCarrier},
{0xf9fb37ac, L"PDF1.3", XFA_ATTRIBUTEENUM_PDF1_3},
{0xf9fb37af, L"PDF1.6", XFA_ATTRIBUTEENUM_PDF1_6},
{0xfbce7f19, L"serif", XFA_ATTRIBUTEENUM_Serif},
{0xfc82d695, L"postSave", XFA_ATTRIBUTEENUM_PostSave},
{0xfcef86b5, L"ready", XFA_ATTRIBUTEENUM_Ready},
{0xfd54fbb7, L"postSign", XFA_ATTRIBUTEENUM_PostSign},
{0xfdc0aae2, L"Arabic", XFA_ATTRIBUTEENUM_Arabic},
{0xfe06d2ca, L"error", XFA_ATTRIBUTEENUM_Error},
{0xfefc4885, L"urlencoded", XFA_ATTRIBUTEENUM_Urlencoded},
{0xff795ad2, L"lowered", XFA_ATTRIBUTEENUM_Lowered},
};
const int32_t g_iXFAEnumCount =
sizeof(g_XFAEnumData) / sizeof(XFA_ATTRIBUTEENUMINFO);
static const CXFA_Measurement g_XFAMeasurementData[] = {
CXFA_Measurement(0, XFA_UNIT_In),
CXFA_Measurement(0, XFA_UNIT_Pt),
CXFA_Measurement(5, XFA_UNIT_Mm),
CXFA_Measurement(0.25, XFA_UNIT_Mm),
CXFA_Measurement(-1, XFA_UNIT_Unknown),
CXFA_Measurement(0, XFA_UNIT_Angle),
CXFA_Measurement(10, XFA_UNIT_Pt),
CXFA_Measurement(360, XFA_UNIT_Angle),
CXFA_Measurement(0.5, XFA_UNIT_Pt),
};
const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = {
{0x68, L"h", XFA_ATTRIBUTE_H, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x77, L"w", XFA_ATTRIBUTE_W, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x78, L"x", XFA_ATTRIBUTE_X, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x79, L"y", XFA_ATTRIBUTE_Y, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x21aed, L"id", XFA_ATTRIBUTE_Id, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template |
XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form,
(void*)NULL},
{0x25363, L"to", XFA_ATTRIBUTE_To, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Config, (void*)NULL},
{0xcb0ac9, L"lineThrough", XFA_ATTRIBUTE_LineThrough,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x2282c73, L"hAlign", XFA_ATTRIBUTE_HAlign, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Left},
{0x2c1c7f1, L"typeface", XFA_ATTRIBUTE_Typeface, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)L"Courier"},
{0x3106c3a, L"beforeTarget", XFA_ATTRIBUTE_BeforeTarget,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x31b19c1, L"name", XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet |
XFA_XDPPACKET_Template | XFA_XDPPACKET_Datasets | XFA_XDPPACKET_Form |
XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form,
(void*)NULL},
{0x3848b3f, L"next", XFA_ATTRIBUTE_Next, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_None},
{0x43e349b, L"dataRowCount", XFA_ATTRIBUTE_DataRowCount,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x5518c25, L"break", XFA_ATTRIBUTE_Break, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Close},
{0x5ce6195, L"vScrollPolicy", XFA_ATTRIBUTE_VScrollPolicy,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Auto},
{0x8c74ae9, L"fontHorizontalScale", XFA_ATTRIBUTE_FontHorizontalScale,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)L"100%"},
{0x8d4f1c7, L"textIndent", XFA_ATTRIBUTE_TextIndent,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x97c1c65, L"context", XFA_ATTRIBUTE_Context, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_UNKNOWN, (void*)0},
{0x9876578, L"trayOut", XFA_ATTRIBUTE_TrayOut, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Auto},
{0xa2e3514, L"cap", XFA_ATTRIBUTE_Cap, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Square},
{0xb3543a6, L"max", XFA_ATTRIBUTE_Max, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xb356ca4, L"min", XFA_ATTRIBUTE_Min, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)1},
{0xbb8df5d, L"ref", XFA_ATTRIBUTE_Ref, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config | XFA_XDPPACKET_Template |
XFA_XDPPACKET_Form,
(void*)NULL},
{0xbb8f3df, L"rid", XFA_ATTRIBUTE_Rid, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xc080cd3, L"url", XFA_ATTRIBUTE_Url, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xc0811ed, L"use", XFA_ATTRIBUTE_Use, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template |
XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form,
(void*)NULL},
{0xcfea02e, L"leftInset", XFA_ATTRIBUTE_LeftInset,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x1026c59d, L"widows", XFA_ATTRIBUTE_Widows, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0x1059ec18, L"level", XFA_ATTRIBUTE_Level, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Config, (void*)0},
{0x1356caf8, L"bottomInset", XFA_ATTRIBUTE_BottomInset,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x13a08bdb, L"overflowTarget", XFA_ATTRIBUTE_OverflowTarget,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x1414d431, L"allowMacro", XFA_ATTRIBUTE_AllowMacro,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x14a32d52, L"pagePosition", XFA_ATTRIBUTE_PagePosition,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Any},
{0x1517dfa1, L"columnWidths", XFA_ATTRIBUTE_ColumnWidths,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x169134a1, L"overflowLeader", XFA_ATTRIBUTE_OverflowLeader,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x1b8dce3e, L"action", XFA_ATTRIBUTE_Action, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Include},
{0x1e459b8f, L"nonRepudiation", XFA_ATTRIBUTE_NonRepudiation,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x1ec8ab2c, L"rate", XFA_ATTRIBUTE_Rate, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)50},
{0x1ef3a64a, L"allowRichText", XFA_ATTRIBUTE_AllowRichText,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x2038c9b2, L"role", XFA_ATTRIBUTE_Role, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x20914367, L"overflowTrailer", XFA_ATTRIBUTE_OverflowTrailer,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x226ca8f1, L"operation", XFA_ATTRIBUTE_Operation,
XFA_ATTRIBUTETYPE_NOTSURE, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x24d85167, L"timeout", XFA_ATTRIBUTE_Timeout, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_SourceSet, (void*)NULL},
{0x25764436, L"topInset", XFA_ATTRIBUTE_TopInset, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x25839852, L"access", XFA_ATTRIBUTE_Access, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Open},
{0x268b7ec1, L"commandType", XFA_ATTRIBUTE_CommandType,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_SourceSet,
(void*)XFA_ATTRIBUTEENUM_Unknown},
{0x28dee6e9, L"format", XFA_ATTRIBUTE_Format, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x28e17e91, L"dataPrep", XFA_ATTRIBUTE_DataPrep, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_None},
{0x292b88fe, L"widgetData", XFA_ATTRIBUTE_WidgetData,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_UNKNOWN, (void*)0},
{0x29418bb7, L"abbr", XFA_ATTRIBUTE_Abbr, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_LocaleSet, (void*)0},
{0x2a82d99c, L"marginRight", XFA_ATTRIBUTE_MarginRight,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x2b5df51e, L"dataDescription", XFA_ATTRIBUTE_DataDescription,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_ConnectionSet, (void*)NULL},
{0x2bb3f470, L"encipherOnly", XFA_ATTRIBUTE_EncipherOnly,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x2cd79033, L"kerningMode", XFA_ATTRIBUTE_KerningMode,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_None},
{0x2ee7678f, L"rotate", XFA_ATTRIBUTE_Rotate, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 5)},
{0x2f105f72, L"wordCharacterCount", XFA_ATTRIBUTE_WordCharacterCount,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)7},
{0x2f16a382, L"type", XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x34ae103c, L"reserve", XFA_ATTRIBUTE_Reserve, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 4)},
{0x3650557e, L"textLocation", XFA_ATTRIBUTE_TextLocation,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Below},
{0x39cdb0a2, L"priority", XFA_ATTRIBUTE_Priority, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Custom},
{0x3a0273a6, L"underline", XFA_ATTRIBUTE_Underline,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x3b582286, L"moduleWidth", XFA_ATTRIBUTE_ModuleWidth,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 3)},
{0x3d123c26, L"hyphenate", XFA_ATTRIBUTE_Hyphenate,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x3e7af94f, L"listen", XFA_ATTRIBUTE_Listen, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_RefOnly},
{0x4156ee3f, L"delimiter", XFA_ATTRIBUTE_Delimiter, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x42fed1fd, L"contentType", XFA_ATTRIBUTE_ContentType,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template |
XFA_XDPPACKET_Datasets | XFA_XDPPACKET_Form,
(void*)NULL},
{0x453eaf38, L"startNew", XFA_ATTRIBUTE_StartNew, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0x45a6daf8, L"eofAction", XFA_ATTRIBUTE_EofAction, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_SourceSet, (void*)XFA_ATTRIBUTEENUM_MoveLast},
{0x47cfa43a, L"allowNeutral", XFA_ATTRIBUTE_AllowNeutral,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x47d03490, L"connection", XFA_ATTRIBUTE_Connection,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x4873c601, L"baselineShift", XFA_ATTRIBUTE_BaselineShift,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x4b319767, L"overlinePeriod", XFA_ATTRIBUTE_OverlinePeriod,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_All},
{0x4b8bc840, L"fracDigits", XFA_ATTRIBUTE_FracDigits,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)2},
{0x4ef3d02c, L"orientation", XFA_ATTRIBUTE_Orientation,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Portrait},
{0x4fdc3454, L"timeStamp", XFA_ATTRIBUTE_TimeStamp, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_XDP, (void*)NULL},
{0x52666f1c, L"printCheckDigit", XFA_ATTRIBUTE_PrintCheckDigit,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x534729c9, L"marginLeft", XFA_ATTRIBUTE_MarginLeft,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x5392ea58, L"stroke", XFA_ATTRIBUTE_Stroke, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Solid},
{0x5404d6df, L"moduleHeight", XFA_ATTRIBUTE_ModuleHeight,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 2)},
{0x54fa722c, L"transferEncoding", XFA_ATTRIBUTE_TransferEncoding,
XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x552d9ad5, L"usage", XFA_ATTRIBUTE_Usage, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_ExportAndImport},
{0x570ce835, L"presence", XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Visible},
{0x5739d1ff, L"radixOffset", XFA_ATTRIBUTE_RadixOffset,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x577682ac, L"preserve", XFA_ATTRIBUTE_Preserve, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x58be2870, L"aliasNode", XFA_ATTRIBUTE_AliasNode,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_UNKNOWN, (void*)0},
{0x5a32e493, L"multiLine", XFA_ATTRIBUTE_MultiLine,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x5a50e9e6, L"version", XFA_ATTRIBUTE_Version, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x5ab23b6c, L"startChar", XFA_ATTRIBUTE_StartChar, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x5b707a35, L"scriptTest", XFA_ATTRIBUTE_ScriptTest,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Error},
{0x5c054755, L"startAngle", XFA_ATTRIBUTE_StartAngle,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 5)},
{0x5ec958c0, L"cursorType", XFA_ATTRIBUTE_CursorType,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_SourceSet,
(void*)XFA_ATTRIBUTEENUM_ForwardOnly},
{0x5f760b50, L"digitalSignature", XFA_ATTRIBUTE_DigitalSignature,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x60a61edd, L"codeType", XFA_ATTRIBUTE_CodeType, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x60d4c8b1, L"output", XFA_ATTRIBUTE_Output, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_ConnectionSet, (void*)NULL},
{0x64110ab5, L"bookendTrailer", XFA_ATTRIBUTE_BookendTrailer,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x65e30c67, L"imagingBBox", XFA_ATTRIBUTE_ImagingBBox,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)L"none"},
{0x66539c48, L"excludeInitialCap", XFA_ATTRIBUTE_ExcludeInitialCap,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x66642f8f, L"force", XFA_ATTRIBUTE_Force, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Config, (void*)NULL},
{0x69aa2292, L"crlSign", XFA_ATTRIBUTE_CrlSign, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x6a3405dd, L"previous", XFA_ATTRIBUTE_Previous, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_None},
{0x6a95c976, L"pushCharacterCount", XFA_ATTRIBUTE_PushCharacterCount,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)3},
{0x6b6ddcfb, L"nullTest", XFA_ATTRIBUTE_NullTest, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Disabled},
{0x6cfa828a, L"runAt", XFA_ATTRIBUTE_RunAt, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Client},
{0x731e0665, L"spaceBelow", XFA_ATTRIBUTE_SpaceBelow,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x74788f8b, L"sweepAngle", XFA_ATTRIBUTE_SweepAngle,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 7)},
{0x78bff531, L"numberOfCells", XFA_ATTRIBUTE_NumberOfCells,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0x79543055, L"letterSpacing", XFA_ATTRIBUTE_LetterSpacing,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x79975f2b, L"lockType", XFA_ATTRIBUTE_LockType, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_SourceSet, (void*)XFA_ATTRIBUTEENUM_ReadOnly},
{0x7a0cc471, L"passwordChar", XFA_ATTRIBUTE_PasswordChar,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)L"*"},
{0x7a7cc341, L"vAlign", XFA_ATTRIBUTE_VAlign, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Top},
{0x7b29630a, L"sourceBelow", XFA_ATTRIBUTE_SourceBelow,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config,
(void*)XFA_ATTRIBUTEENUM_Update},
{0x7b95e661, L"inverted", XFA_ATTRIBUTE_Inverted, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0x7c2fd80b, L"mark", XFA_ATTRIBUTE_Mark, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Default},
{0x7c2ff6ae, L"maxH", XFA_ATTRIBUTE_MaxH, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x7c2ff6bd, L"maxW", XFA_ATTRIBUTE_MaxW, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x7c732a66, L"truncate", XFA_ATTRIBUTE_Truncate, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0x7d02356c, L"minH", XFA_ATTRIBUTE_MinH, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x7d02357b, L"minW", XFA_ATTRIBUTE_MinW, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x7d0b5fca, L"initial", XFA_ATTRIBUTE_Initial, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)1},
{0x7d9fd7c5, L"mode", XFA_ATTRIBUTE_Mode, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Config, (void*)XFA_ATTRIBUTEENUM_UsePrinterSetting},
{0x7e7e845e, L"layout", XFA_ATTRIBUTE_Layout, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Position},
{0x7f6fd3d7, L"server", XFA_ATTRIBUTE_Server, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x824f21b7, L"embedPDF", XFA_ATTRIBUTE_EmbedPDF, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0x8340ea66, L"oddOrEven", XFA_ATTRIBUTE_OddOrEven, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Any},
{0x836d4d7c, L"tabDefault", XFA_ATTRIBUTE_TabDefault,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x8855805f, L"contains", XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Datasets, (void*)XFA_ATTRIBUTEENUM_Data},
{0x8a692521, L"rightInset", XFA_ATTRIBUTE_RightInset,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x8af2e657, L"maxChars", XFA_ATTRIBUTE_MaxChars, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0x8b90e1f2, L"open", XFA_ATTRIBUTE_Open, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_UserControl},
{0x8c99377e, L"relation", XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x8d181d61, L"wideNarrowRatio", XFA_ATTRIBUTE_WideNarrowRatio,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)L"3:1"},
{0x8e1c2921, L"relevant", XFA_ATTRIBUTE_Relevant, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x8e29d794, L"signatureType", XFA_ATTRIBUTE_SignatureType,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Filter},
{0x8ec6204c, L"lineThroughPeriod", XFA_ATTRIBUTE_LineThroughPeriod,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_All},
{0x8ed182d1, L"shape", XFA_ATTRIBUTE_Shape, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Square},
{0x8fa01790, L"tabStops", XFA_ATTRIBUTE_TabStops, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0x8fc36c0a, L"outputBelow", XFA_ATTRIBUTE_OutputBelow,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config,
(void*)XFA_ATTRIBUTEENUM_Warn},
{0x9041d4b0, L"short", XFA_ATTRIBUTE_Short, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0x907c7719, L"fontVerticalScale", XFA_ATTRIBUTE_FontVerticalScale,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)L"100%"},
{0x94446dcc, L"thickness", XFA_ATTRIBUTE_Thickness,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 8)},
{0x957fa006, L"commitOn", XFA_ATTRIBUTE_CommitOn, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Select},
{0x982bd892, L"remainCharacterCount", XFA_ATTRIBUTE_RemainCharacterCount,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)3},
{0x98fd4d81, L"keyAgreement", XFA_ATTRIBUTE_KeyAgreement,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x99800d7a, L"errorCorrectionLevel", XFA_ATTRIBUTE_ErrorCorrectionLevel,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0x9a63da3d, L"upsMode", XFA_ATTRIBUTE_UpsMode, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_UsCarrier},
{0x9cc17d75, L"mergeMode", XFA_ATTRIBUTE_MergeMode, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_ConsumeData},
{0x9d833d75, L"circular", XFA_ATTRIBUTE_Circular, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0x9d8ee204, L"psName", XFA_ATTRIBUTE_PsName, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Config, (void*)NULL},
{0x9dcc3ab3, L"trailer", XFA_ATTRIBUTE_Trailer, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xa0933954, L"unicodeRange", XFA_ATTRIBUTE_UnicodeRange,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Config, (void*)NULL},
{0xa1b0d2f5, L"executeType", XFA_ATTRIBUTE_ExecuteType,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Import},
{0xa25a883d, L"duplexImposition", XFA_ATTRIBUTE_DuplexImposition,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_LongEdge},
{0xa42ca1b7, L"trayIn", XFA_ATTRIBUTE_TrayIn, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Auto},
{0xa433f001, L"bindingNode", XFA_ATTRIBUTE_BindingNode,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_UNKNOWN, (void*)0},
{0xa5340ff5, L"bofAction", XFA_ATTRIBUTE_BofAction, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_SourceSet, (void*)XFA_ATTRIBUTEENUM_MoveFirst},
{0xa5b410cf, L"save", XFA_ATTRIBUTE_Save, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0xa6118c89, L"targetType", XFA_ATTRIBUTE_TargetType,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Auto},
{0xa66404cb, L"keyEncipherment", XFA_ATTRIBUTE_KeyEncipherment,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xa6710262, L"credentialServerPolicy",
XFA_ATTRIBUTE_CredentialServerPolicy, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Optional},
{0xa686975b, L"size", XFA_ATTRIBUTE_Size, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 6)},
{0xa85e74f3, L"initialNumber", XFA_ATTRIBUTE_InitialNumber,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)1},
{0xabef37e3, L"slope", XFA_ATTRIBUTE_Slope, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Backslash},
{0xabfa6c4f, L"cSpace", XFA_ATTRIBUTE_CSpace, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)L"SRGB"},
{0xac06e2b0, L"colSpan", XFA_ATTRIBUTE_ColSpan, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)1},
{0xadc4c77b, L"binding", XFA_ATTRIBUTE_Binding, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xaf754613, L"checksum", XFA_ATTRIBUTE_Checksum, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form | XFA_XDPPACKET_Form,
(void*)NULL},
{0xb045fbc5, L"charEncoding", XFA_ATTRIBUTE_CharEncoding,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)L"UTF-8"},
{0xb0e5485d, L"bind", XFA_ATTRIBUTE_Bind, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_SourceSet, (void*)NULL},
{0xb12128b7, L"textEntry", XFA_ATTRIBUTE_TextEntry,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0xb373a862, L"archive", XFA_ATTRIBUTE_Archive, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xb598a1f7, L"uuid", XFA_ATTRIBUTE_Uuid, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_XDP, (void*)NULL},
{0xb5e49bf2, L"posture", XFA_ATTRIBUTE_Posture, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Normal},
{0xb6b44172, L"after", XFA_ATTRIBUTE_After, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Auto},
{0xb716467b, L"orphans", XFA_ATTRIBUTE_Orphans, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0xbc0c4695, L"qualifiedName", XFA_ATTRIBUTE_QualifiedName,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_UNKNOWN, (void*)NULL},
{0xbc254332, L"usehref", XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template |
XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form,
(void*)NULL},
{0xbc8fa350, L"locale", XFA_ATTRIBUTE_Locale, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xbd6e1d88, L"weight", XFA_ATTRIBUTE_Weight, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Normal},
{0xbd96a0e9, L"underlinePeriod", XFA_ATTRIBUTE_UnderlinePeriod,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_All},
{0xbde9abda, L"data", XFA_ATTRIBUTE_Data, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Link},
{0xbe52dfbf, L"desc", XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet, (void*)NULL},
{0xbe9ba472, L"numbered", XFA_ATTRIBUTE_Numbered, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)1},
{0xc035c6b1, L"dataColumnCount", XFA_ATTRIBUTE_DataColumnCount,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xc0ec9fa4, L"overline", XFA_ATTRIBUTE_Overline, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0xc2ba0923, L"urlPolicy", XFA_ATTRIBUTE_UrlPolicy, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xc2bd40fd, L"anchorType", XFA_ATTRIBUTE_AnchorType,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_TopLeft},
{0xc39a88bd, L"labelRef", XFA_ATTRIBUTE_LabelRef, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xc3c1442f, L"bookendLeader", XFA_ATTRIBUTE_BookendLeader,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xc4547a08, L"maxLength", XFA_ATTRIBUTE_MaxLength,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*) - 1},
{0xc4fed09b, L"accessKey", XFA_ATTRIBUTE_AccessKey, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xc5762157, L"cursorLocation", XFA_ATTRIBUTE_CursorLocation,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_SourceSet,
(void*)XFA_ATTRIBUTEENUM_Client},
{0xc860f30a, L"delayedOpen", XFA_ATTRIBUTE_DelayedOpen,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_SourceSet, (void*)NULL},
{0xc8da4da7, L"target", XFA_ATTRIBUTE_Target, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xca5dc27c, L"dataEncipherment", XFA_ATTRIBUTE_DataEncipherment,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xcb150479, L"afterTarget", XFA_ATTRIBUTE_AfterTarget,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xcbcaf66d, L"leader", XFA_ATTRIBUTE_Leader, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xcca7897e, L"picker", XFA_ATTRIBUTE_Picker, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Host},
{0xcd7f7b54, L"from", XFA_ATTRIBUTE_From, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config, (void*)NULL},
{0xcea5e62c, L"baseProfile", XFA_ATTRIBUTE_BaseProfile,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Full},
{0xd171b240, L"aspect", XFA_ATTRIBUTE_Aspect, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)XFA_ATTRIBUTEENUM_Fit},
{0xd3c84d25, L"rowColumnRatio", XFA_ATTRIBUTE_RowColumnRatio,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xd4b01921, L"lineHeight", XFA_ATTRIBUTE_LineHeight,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 1)},
{0xd4cc53f8, L"highlight", XFA_ATTRIBUTE_Highlight, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Inverted},
{0xd50f903a, L"valueRef", XFA_ATTRIBUTE_ValueRef, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xd52482e0, L"maxEntries", XFA_ATTRIBUTE_MaxEntries,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Config, (void*)5},
{0xd57c513c, L"dataLength", XFA_ATTRIBUTE_DataLength,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xd6128d8d, L"activity", XFA_ATTRIBUTE_Activity, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Click},
{0xd6a39990, L"input", XFA_ATTRIBUTE_Input, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_ConnectionSet, (void*)NULL},
{0xd6e27f1d, L"value", XFA_ATTRIBUTE_Value, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet |
XFA_XDPPACKET_Template | XFA_XDPPACKET_Datasets |
XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_Form,
(void*)NULL},
{0xd70798c2, L"blankOrNotBlank", XFA_ATTRIBUTE_BlankOrNotBlank,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Any},
{0xd861f8af, L"addRevocationInfo", XFA_ATTRIBUTE_AddRevocationInfo,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xd8f982bf, L"genericFamily", XFA_ATTRIBUTE_GenericFamily,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config,
(void*)XFA_ATTRIBUTEENUM_Serif},
{0xd996fa9b, L"hand", XFA_ATTRIBUTE_Hand, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Even},
{0xdb55fec5, L"href", XFA_ATTRIBUTE_Href, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xdc75676c, L"textEncoding", XFA_ATTRIBUTE_TextEncoding,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xde7f92ba, L"leadDigits", XFA_ATTRIBUTE_LeadDigits,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*) - 1},
{0xe11a2cbc, L"permissions", XFA_ATTRIBUTE_Permissions,
XFA_ATTRIBUTETYPE_Integer, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)2},
{0xe18b5659, L"spaceAbove", XFA_ATTRIBUTE_SpaceAbove,
XFA_ATTRIBUTETYPE_Measure, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0xe1a26b56, L"codeBase", XFA_ATTRIBUTE_CodeBase, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xe349d044, L"stock", XFA_ATTRIBUTE_Stock, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xe372ae97, L"isNull", XFA_ATTRIBUTE_IsNull, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Datasets, (void*)0},
{0xe4c3a5e5, L"restoreState", XFA_ATTRIBUTE_RestoreState,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Manual},
{0xe5c96d6a, L"excludeAllCaps", XFA_ATTRIBUTE_ExcludeAllCaps,
XFA_ATTRIBUTETYPE_Boolean, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)0},
{0xe64b1129, L"formatTest", XFA_ATTRIBUTE_FormatTest,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Warning},
{0xe6f99487, L"hScrollPolicy", XFA_ATTRIBUTE_HScrollPolicy,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Auto},
{0xe8dddf50, L"join", XFA_ATTRIBUTE_Join, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Square},
{0xe8f118a8, L"keyCertSign", XFA_ATTRIBUTE_KeyCertSign,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xe948b9a8, L"radius", XFA_ATTRIBUTE_Radius, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0xe996b2fe, L"sourceAbove", XFA_ATTRIBUTE_SourceAbove,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config,
(void*)XFA_ATTRIBUTEENUM_Warn},
{0xea7090a0, L"override", XFA_ATTRIBUTE_Override, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xeb091003, L"classId", XFA_ATTRIBUTE_ClassId, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xeb511b54, L"disable", XFA_ATTRIBUTE_Disable, XFA_ATTRIBUTETYPE_Boolean,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)0},
{0xeda9017a, L"scope", XFA_ATTRIBUTE_Scope, XFA_ATTRIBUTETYPE_NOTSURE,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xf197844d, L"match", XFA_ATTRIBUTE_Match, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Once},
{0xf2009339, L"placement", XFA_ATTRIBUTE_Placement, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Left},
{0xf4ffce73, L"before", XFA_ATTRIBUTE_Before, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_Auto},
{0xf531b059, L"writingScript", XFA_ATTRIBUTE_WritingScript,
XFA_ATTRIBUTETYPE_Enum, XFA_XDPPACKET_Config,
(void*)XFA_ATTRIBUTEENUM_Asterisk},
{0xf575ca75, L"endChar", XFA_ATTRIBUTE_EndChar, XFA_ATTRIBUTETYPE_Cdata,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (void*)NULL},
{0xf6b47749, L"lock", XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTETYPE_Integer,
XFA_XDPPACKET_Config, (void*)0},
{0xf6b4afb0, L"long", XFA_ATTRIBUTE_Long, XFA_ATTRIBUTETYPE_Measure,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)(g_XFAMeasurementData + 0)},
{0xf6b59543, L"intact", XFA_ATTRIBUTE_Intact, XFA_ATTRIBUTETYPE_Enum,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)XFA_ATTRIBUTEENUM_None},
{0xf889e747, L"xdpContent", XFA_ATTRIBUTE_XdpContent,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
{0xfea53ec6, L"decipherOnly", XFA_ATTRIBUTE_DecipherOnly,
XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
(void*)NULL},
};
const int32_t g_iXFAAttributeCount =
sizeof(g_XFAAttributeData) / sizeof(XFA_ATTRIBUTEINFO);
const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = {
{XFA_ELEMENT_SubformSet, XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Ordered},
{XFA_ELEMENT_NumberPattern, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Numeric},
{XFA_ELEMENT_KeyUsage, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_LabelPrinter, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Zpl},
{XFA_ELEMENT_CalendarSymbols, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Gregorian},
{XFA_ELEMENT_Barcode, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Cdata,
(void*)NULL},
{XFA_ELEMENT_Barcode, XFA_ATTRIBUTE_Checksum, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_None},
{XFA_ELEMENT_TimePattern, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Med},
{XFA_ELEMENT_BatchOutput, XFA_ATTRIBUTE_Format, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_None},
{XFA_ELEMENT_SubjectDNs, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Issuers, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_EncryptionMethods, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Pattern, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_CrossHatch},
{XFA_ELEMENT_Compress, XFA_ATTRIBUTE_Scope, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_ImageOnly},
{XFA_ELEMENT_Image, XFA_ATTRIBUTE_TransferEncoding, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Base64},
{XFA_ELEMENT_TimeStamp, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Subform, XFA_ATTRIBUTE_Scope, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Name},
{XFA_ELEMENT_Handler, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Record, XFA_ATTRIBUTE_Max, XFA_ATTRIBUTETYPE_Integer,
(void*)0},
{XFA_ELEMENT_Command, XFA_ATTRIBUTE_Timeout, XFA_ATTRIBUTETYPE_Integer,
(void*)30},
{XFA_ELEMENT_DigestMethods, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_PageSet, XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_OrderedOccurrence},
{XFA_ELEMENT_Equate, XFA_ATTRIBUTE_From, XFA_ATTRIBUTETYPE_Cdata,
(void*)NULL},
{XFA_ELEMENT_Equate, XFA_ATTRIBUTE_To, XFA_ATTRIBUTETYPE_Cdata,
(void*)NULL},
{XFA_ELEMENT_Traverse, XFA_ATTRIBUTE_Operation, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Next},
{XFA_ELEMENT_Encodings, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Signing, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Oids, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Signature, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_PDF1_3},
{XFA_ELEMENT_ExData, XFA_ATTRIBUTE_TransferEncoding, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_None},
{XFA_ELEMENT_Linear, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_ToRight},
{XFA_ELEMENT_CurrencySymbol, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Symbol},
{XFA_ELEMENT_EquateRange, XFA_ATTRIBUTE_From, XFA_ATTRIBUTETYPE_Cdata,
(void*)NULL},
{XFA_ELEMENT_EquateRange, XFA_ATTRIBUTE_To, XFA_ATTRIBUTETYPE_Cdata,
(void*)NULL},
{XFA_ELEMENT_SignData, XFA_ATTRIBUTE_Operation, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Sign},
{XFA_ELEMENT_DatePattern, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Med},
{XFA_ELEMENT_Bind, XFA_ATTRIBUTE_TransferEncoding, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_None},
{XFA_ELEMENT_Reasons, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_AppearanceFilter, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Form, XFA_ATTRIBUTE_Checksum, XFA_ATTRIBUTETYPE_Cdata,
(void*)NULL},
{XFA_ELEMENT_Value, XFA_ATTRIBUTE_Override, XFA_ATTRIBUTETYPE_Boolean,
(void*)0},
{XFA_ELEMENT_Calculate, XFA_ATTRIBUTE_Override, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Error},
{XFA_ELEMENT_Connect, XFA_ATTRIBUTE_Timeout, XFA_ATTRIBUTETYPE_Integer,
(void*)15},
{XFA_ELEMENT_Submit, XFA_ATTRIBUTE_Format, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Xdp},
{XFA_ELEMENT_Radial, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_ToEdge},
{XFA_ELEMENT_LockDocument, XFA_ATTRIBUTE_Type, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Optional},
{XFA_ELEMENT_Occur, XFA_ATTRIBUTE_Max, XFA_ATTRIBUTETYPE_Integer, (void*)1},
{XFA_ELEMENT_NumberSymbol, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum,
(void*)XFA_ATTRIBUTEENUM_Decimal},
};
const int32_t g_iXFANotsureCount =
sizeof(g_XFANotsureAttributes) / sizeof(XFA_NOTSUREATTRIBUTE);
const XFA_ELEMENTINFO g_XFAElementData[] = {
{0x23ee3, L"ps", XFA_ELEMENT_Ps, XFA_XDPPACKET_Config, XFA_OBJECTTYPE_Node},
{0x25363, L"to", XFA_ELEMENT_To, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x2587e, L"ui", XFA_ELEMENT_Ui,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x1c648b, L"recordSet", XFA_ELEMENT_RecordSet, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_Node},
{0x171428f, L"subsetBelow", XFA_ELEMENT_SubsetBelow, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x1a0776a, L"subformSet", XFA_ELEMENT_SubformSet,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0x2340d70, L"adobeExtensionLevel", XFA_ELEMENT_AdobeExtensionLevel,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x2c1c7f1, L"typeface", XFA_ELEMENT_Typeface, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_Node},
{0x5518c25, L"break", XFA_ELEMENT_Break,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x5fff523, L"fontInfo", XFA_ELEMENT_FontInfo, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x653a227, L"numberPattern", XFA_ELEMENT_NumberPattern,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_ContentNode},
{0x65b4a05, L"dynamicRender", XFA_ELEMENT_DynamicRender,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x7e4362e, L"printScaling", XFA_ELEMENT_PrintScaling, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x7fe6d3a, L"checkButton", XFA_ELEMENT_CheckButton,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x80cf58f, L"datePatterns", XFA_ELEMENT_DatePatterns,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0x811929d, L"sourceSet", XFA_ELEMENT_SourceSet, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_ModelNode},
{0x9f9d612, L"amd", XFA_ELEMENT_Amd, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x9f9efb6, L"arc", XFA_ELEMENT_Arc,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xa48835e, L"day", XFA_ELEMENT_Day, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_ContentNode},
{0xa6328b8, L"era", XFA_ELEMENT_Era, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_ContentNode},
{0xae6a0a0, L"jog", XFA_ELEMENT_Jog, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xb1b3d22, L"log", XFA_ELEMENT_Log, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xb35439e, L"map", XFA_ELEMENT_Map,
XFA_XDPPACKET_Config | XFA_XDPPACKET_SourceSet, XFA_OBJECTTYPE_Node},
{0xb355301, L"mdp", XFA_ELEMENT_Mdp,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xb420438, L"breakBefore", XFA_ELEMENT_BreakBefore,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xb6a091c, L"oid", XFA_ELEMENT_Oid,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_TextNode},
{0xb84389f, L"pcl", XFA_ELEMENT_Pcl, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xb843dba, L"pdf", XFA_ELEMENT_Pdf, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xbb8df5d, L"ref", XFA_ELEMENT_Ref,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_TextNode},
{0xc080cd0, L"uri", XFA_ELEMENT_Uri,
XFA_XDPPACKET_Config | XFA_XDPPACKET_ConnectionSet,
XFA_OBJECTTYPE_TextNode},
{0xc56afbf, L"xdc", XFA_ELEMENT_Xdc,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Xdc, XFA_OBJECTTYPE_ModelNode},
{0xc56afcc, L"xdp", XFA_ELEMENT_Xdp, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xc56b9ff, L"xfa", XFA_ELEMENT_Xfa, XFA_XDPPACKET_XDP,
XFA_OBJECTTYPE_ModelNode},
{0xc56fcb7, L"xsl", XFA_ELEMENT_Xsl, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xc8b89d6, L"zpl", XFA_ELEMENT_Zpl, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xc9bae94, L"cache", XFA_ELEMENT_Cache, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xcb016be, L"margin", XFA_ELEMENT_Margin,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xe1378fe, L"keyUsage", XFA_ELEMENT_KeyUsage,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xfe3596a, L"exclude", XFA_ELEMENT_Exclude, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x10395ac7, L"choiceList", XFA_ELEMENT_ChoiceList,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x1059ec18, L"level", XFA_ELEMENT_Level, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x10874804, L"labelPrinter", XFA_ELEMENT_LabelPrinter,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_Node},
{0x10c40e03, L"calendarSymbols", XFA_ELEMENT_CalendarSymbols,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0x10f1ea24, L"para", XFA_ELEMENT_Para,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x10f1ea37, L"part", XFA_ELEMENT_Part, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x1140975b, L"pdfa", XFA_ELEMENT_Pdfa, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x1154efe6, L"filter", XFA_ELEMENT_Filter,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x13f41de1, L"present", XFA_ELEMENT_Present, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x1827e6ea, L"pagination", XFA_ELEMENT_Pagination, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x18463707, L"encoding", XFA_ELEMENT_Encoding,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_NodeC},
{0x185e41e2, L"event", XFA_ELEMENT_Event,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x1adb142d, L"whitespace", XFA_ELEMENT_Whitespace, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x1f3f64c3, L"defaultUi", XFA_ELEMENT_DefaultUi,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x204e87cb, L"dataModel", XFA_ELEMENT_DataModel, XFA_XDPPACKET_Datasets,
XFA_OBJECTTYPE_ModelNode},
{0x2057b350, L"barcode", XFA_ELEMENT_Barcode,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x20596bad, L"timePattern", XFA_ELEMENT_TimePattern,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_ContentNode},
{0x210b74d3, L"batchOutput", XFA_ELEMENT_BatchOutput, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x212ff0e2, L"enforce", XFA_ELEMENT_Enforce, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x21d351b4, L"currencySymbols", XFA_ELEMENT_CurrencySymbols,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0x21db83c5, L"addSilentPrint", XFA_ELEMENT_AddSilentPrint,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x22266258, L"rename", XFA_ELEMENT_Rename, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x226ca8f1, L"operation", XFA_ELEMENT_Operation,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_TextNode},
{0x23e27b84, L"typefaces", XFA_ELEMENT_Typefaces, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_Node},
{0x23f4aa75, L"subjectDNs", XFA_ELEMENT_SubjectDNs,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x240d5e8e, L"issuers", XFA_ELEMENT_Issuers,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x2457a033, L"signaturePseudoModel", XFA_ELEMENT_SignaturePseudoModel,
XFA_XDPPACKET_XDP, XFA_OBJECTTYPE_OrdinaryObject},
{0x24a52f8a, L"wsdlConnection", XFA_ELEMENT_WsdlConnection,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_Node},
{0x254ebd07, L"debug", XFA_ELEMENT_Debug, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x2655c66a, L"delta", XFA_ELEMENT_Delta, XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_OrdinaryObject},
{0x26c0daec, L"eraNames", XFA_ELEMENT_EraNames, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_Node},
{0x273ab03b, L"modifyAnnots", XFA_ELEMENT_ModifyAnnots,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x27875bb4, L"startNode", XFA_ELEMENT_StartNode, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x285d0dbc, L"button", XFA_ELEMENT_Button,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x28dee6e9, L"format", XFA_ELEMENT_Format,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x2a23349e, L"border", XFA_ELEMENT_Border,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x2ae67f19, L"area", XFA_ELEMENT_Area,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContainerNode},
{0x2c3c4c67, L"hyphenation", XFA_ELEMENT_Hyphenation,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x2d08af85, L"text", XFA_ELEMENT_Text,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContentNode},
{0x2d71b00f, L"time", XFA_ELEMENT_Time,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0x2f16a382, L"type", XFA_ELEMENT_Type, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x2fe057e9, L"overprint", XFA_ELEMENT_Overprint, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x302aee16, L"certificates", XFA_ELEMENT_Certificates,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x30b227df, L"encryptionMethods", XFA_ELEMENT_EncryptionMethods,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x32b900d1, L"setProperty", XFA_ELEMENT_SetProperty,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x337d9e45, L"printerName", XFA_ELEMENT_PrinterName, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x33edda4b, L"startPage", XFA_ELEMENT_StartPage, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x381943e4, L"pageOffset", XFA_ELEMENT_PageOffset, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x382106cd, L"dateTime", XFA_ELEMENT_DateTime,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0x386e7421, L"comb", XFA_ELEMENT_Comb,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x390acd9e, L"pattern", XFA_ELEMENT_Pattern,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x3942163e, L"ifEmpty", XFA_ELEMENT_IfEmpty, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x39944a7b, L"suppressBanner", XFA_ELEMENT_SuppressBanner,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x3b3c3dca, L"outputBin", XFA_ELEMENT_OutputBin, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x3b8a4024, L"field", XFA_ELEMENT_Field,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0x3c15352f, L"agent", XFA_ELEMENT_Agent, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x3d7e8668, L"outputXSL", XFA_ELEMENT_OutputXSL, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x3e1c91c5, L"adjustData", XFA_ELEMENT_AdjustData, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x3e7a9408, L"autoSave", XFA_ELEMENT_AutoSave, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x3ecead94, L"contentArea", XFA_ELEMENT_ContentArea,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0x3ef334e3, L"eventPseudoModel", XFA_ELEMENT_EventPseudoModel,
XFA_XDPPACKET_XDP, XFA_OBJECTTYPE_OrdinaryObject},
{0x3fadaec0, L"wsdlAddress", XFA_ELEMENT_WsdlAddress,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_TextNode},
{0x40623b5b, L"solid", XFA_ELEMENT_Solid,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x41f0bd76, L"dateTimeSymbols", XFA_ELEMENT_DateTimeSymbols,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_ContentNode},
{0x444e7523, L"encryptionLevel", XFA_ELEMENT_EncryptionLevel,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x4523af55, L"edge", XFA_ELEMENT_Edge,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x45d5e3c1, L"stipple", XFA_ELEMENT_Stipple,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x475e4e87, L"attributes", XFA_ELEMENT_Attributes, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x487a8c87, L"versionControl", XFA_ELEMENT_VersionControl,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_Node},
{0x48e5248c, L"meridiem", XFA_ELEMENT_Meridiem, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_ContentNode},
{0x48f36719, L"exclGroup", XFA_ELEMENT_ExclGroup,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0x4977356b, L"toolTip", XFA_ELEMENT_ToolTip,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_TextNode},
{0x499afecc, L"compress", XFA_ELEMENT_Compress, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x4a0c4948, L"reason", XFA_ELEMENT_Reason,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_TextNode},
{0x4bdcce13, L"execute", XFA_ELEMENT_Execute,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x4c56b216, L"contentCopy", XFA_ELEMENT_ContentCopy, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x4cc176d3, L"dateTimeEdit", XFA_ELEMENT_DateTimeEdit,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x4e1e39b6, L"config", XFA_ELEMENT_Config, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ModelNode},
{0x4e2d6083, L"image", XFA_ELEMENT_Image,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0x4e814150, L"#xHTML", XFA_ELEMENT_SharpxHTML,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet |
XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_SourceSet |
XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_NodeV},
{0x4f2388c1, L"numberOfCopies", XFA_ELEMENT_NumberOfCopies,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x4f512e30, L"behaviorOverride", XFA_ELEMENT_BehaviorOverride,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x4fdc3454, L"timeStamp", XFA_ELEMENT_TimeStamp,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x51d90546, L"month", XFA_ELEMENT_Month, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_ContentNode},
{0x523437e4, L"viewerPreferences", XFA_ELEMENT_ViewerPreferences,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_Node},
{0x53abc1c6, L"scriptModel", XFA_ELEMENT_ScriptModel, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x54034c2f, L"decimal", XFA_ELEMENT_Decimal,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0x54202c9e, L"subform", XFA_ELEMENT_Subform,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0x542c7300, L"select", XFA_ELEMENT_Select, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_TextNode},
{0x5436d198, L"window", XFA_ELEMENT_Window, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x5473b6dc, L"localeSet", XFA_ELEMENT_LocaleSet,
XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_ModelNode},
{0x56ae179e, L"handler", XFA_ELEMENT_Handler,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_TextNode},
{0x5700bd5f, L"hostPseudoModel", XFA_ELEMENT_HostPseudoModel,
XFA_XDPPACKET_XDP, XFA_OBJECTTYPE_OrdinaryObject},
{0x570ce835, L"presence", XFA_ELEMENT_Presence, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x5779d65f, L"record", XFA_ELEMENT_Record, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x59c8f27d, L"embed", XFA_ELEMENT_Embed, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x5a50e9e6, L"version", XFA_ELEMENT_Version, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x5b8383df, L"command", XFA_ELEMENT_Command, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_Node},
{0x5c43c6c3, L"copies", XFA_ELEMENT_Copies, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x5e0c2c49, L"staple", XFA_ELEMENT_Staple, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x5e5083dd, L"submitFormat", XFA_ELEMENT_SubmitFormat,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x5e8c5d20, L"boolean", XFA_ELEMENT_Boolean,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContentNode},
{0x60490a85, L"message", XFA_ELEMENT_Message,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_Node},
{0x60d4c8b1, L"output", XFA_ELEMENT_Output, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x61810081, L"psMap", XFA_ELEMENT_PsMap, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x62bd904b, L"excludeNS", XFA_ELEMENT_ExcludeNS, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x669d4f77, L"assist", XFA_ELEMENT_Assist,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x67334a1c, L"picture", XFA_ELEMENT_Picture,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContentNode},
{0x67fe7334, L"traversal", XFA_ELEMENT_Traversal,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x6894589c, L"silentPrint", XFA_ELEMENT_SilentPrint, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x68a16bbd, L"webClient", XFA_ELEMENT_WebClient, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x69f115df, L"layoutPseudoModel", XFA_ELEMENT_LayoutPseudoModel,
XFA_XDPPACKET_XDP, XFA_OBJECTTYPE_OrdinaryObject},
{0x6a4bc084, L"producer", XFA_ELEMENT_Producer, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x6a9e04c9, L"corner", XFA_ELEMENT_Corner,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x6ccd7274, L"msgId", XFA_ELEMENT_MsgId, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x6e67921f, L"color", XFA_ELEMENT_Color,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x6ec217a5, L"keep", XFA_ELEMENT_Keep,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x6eef1116, L"query", XFA_ELEMENT_Query, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_Node},
{0x7033bfd5, L"insert", XFA_ELEMENT_Insert, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_TextNode},
{0x704af389, L"imageEdit", XFA_ELEMENT_ImageEdit,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x7233018a, L"validate", XFA_ELEMENT_Validate,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContentNode},
{0x72ba47b4, L"digestMethods", XFA_ELEMENT_DigestMethods,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x72f2aa7a, L"numberPatterns", XFA_ELEMENT_NumberPatterns,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0x74caed29, L"pageSet", XFA_ELEMENT_PageSet,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0x7568e6ae, L"integer", XFA_ELEMENT_Integer,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContentNode},
{0x76182db9, L"soapAddress", XFA_ELEMENT_SoapAddress,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_TextNode},
{0x773146c5, L"equate", XFA_ELEMENT_Equate, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x77d449dd, L"formFieldFilling", XFA_ELEMENT_FormFieldFilling,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x7889d68a, L"pageRange", XFA_ELEMENT_PageRange, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x7baca2e3, L"update", XFA_ELEMENT_Update, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_TextNode},
{0x7ce89001, L"connectString", XFA_ELEMENT_ConnectString,
XFA_XDPPACKET_SourceSet, XFA_OBJECTTYPE_TextNode},
{0x7d9fd7c5, L"mode", XFA_ELEMENT_Mode, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x7e7e845e, L"layout", XFA_ELEMENT_Layout, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x7e845c34, L"#xml", XFA_ELEMENT_Sharpxml,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_NodeV},
{0x7fb341df, L"xsdConnection", XFA_ELEMENT_XsdConnection,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_Node},
{0x7ffb51cc, L"traverse", XFA_ELEMENT_Traverse,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x80203b5a, L"encodings", XFA_ELEMENT_Encodings,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x803550fc, L"template", XFA_ELEMENT_Template,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ModelNode},
{0x803d5bbc, L"acrobat", XFA_ELEMENT_Acrobat, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0x821d6569, L"validationMessaging", XFA_ELEMENT_ValidationMessaging,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_NodeV},
{0x830e688f, L"signing", XFA_ELEMENT_Signing,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x83a550d2, L"dataWindow", XFA_ELEMENT_DataWindow, XFA_XDPPACKET_Datasets,
XFA_OBJECTTYPE_OrdinaryObject},
{0x83dab9f5, L"script", XFA_ELEMENT_Script,
XFA_XDPPACKET_Config | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContentNode},
{0x8411ebcd, L"addViewerPreferences", XFA_ELEMENT_AddViewerPreferences,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x8777642e, L"alwaysEmbed", XFA_ELEMENT_AlwaysEmbed, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x877a6b39, L"passwordEdit", XFA_ELEMENT_PasswordEdit,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x87e84c99, L"numericEdit", XFA_ELEMENT_NumericEdit,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x8852cdec, L"encryptionMethod", XFA_ELEMENT_EncryptionMethod,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_NodeC},
{0x891f4606, L"change", XFA_ELEMENT_Change, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x89939f36, L"pageArea", XFA_ELEMENT_PageArea,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0x8a9d6247, L"submitUrl", XFA_ELEMENT_SubmitUrl, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0x8ad8b90f, L"oids", XFA_ELEMENT_Oids,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x8b036f32, L"signature", XFA_ELEMENT_Signature,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x8b128efb, L"ADBE_JSConsole", XFA_ELEMENT_ADBE_JSConsole,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0x8bcfe96e, L"caption", XFA_ELEMENT_Caption,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x8e1c2921, L"relevant", XFA_ELEMENT_Relevant, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x8e3f0a4b, L"flipLabel", XFA_ELEMENT_FlipLabel, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0x900280b7, L"exData", XFA_ELEMENT_ExData,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0x91e80352, L"dayNames", XFA_ELEMENT_DayNames, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_Node},
{0x93113b11, L"soapAction", XFA_ELEMENT_SoapAction,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_TextNode},
{0x938b09f6, L"defaultTypeface", XFA_ELEMENT_DefaultTypeface,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_NodeV},
{0x95b37897, L"manifest", XFA_ELEMENT_Manifest,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x97b76b54, L"overflow", XFA_ELEMENT_Overflow,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x9a57861b, L"linear", XFA_ELEMENT_Linear,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0x9ad5a821, L"currencySymbol", XFA_ELEMENT_CurrencySymbol,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_ContentNode},
{0x9c6471b3, L"delete", XFA_ELEMENT_Delete, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_TextNode},
{0x9deea61d, L"deltas", XFA_ELEMENT_Deltas, XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_OrdinaryObject},
{0x9e67de21, L"digestMethod", XFA_ELEMENT_DigestMethod,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_NodeC},
{0x9f3e9510, L"instanceManager", XFA_ELEMENT_InstanceManager,
XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xa0799892, L"equateRange", XFA_ELEMENT_EquateRange, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xa084a381, L"medium", XFA_ELEMENT_Medium,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xa1211b8b, L"textEdit", XFA_ELEMENT_TextEdit,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xa17008f0, L"templateCache", XFA_ELEMENT_TemplateCache,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_Node},
{0xa4f7b88f, L"compressObjectStream", XFA_ELEMENT_CompressObjectStream,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xa65f5d17, L"dataValue", XFA_ELEMENT_DataValue, XFA_XDPPACKET_Datasets,
XFA_OBJECTTYPE_Node},
{0xa6caaa89, L"accessibleContent", XFA_ELEMENT_AccessibleContent,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xa8c7d5e2, L"nodeList", XFA_ELEMENT_NodeList, XFA_XDPPACKET_XDP,
XFA_OBJECTTYPE_NodeList},
{0xa94cc00b, L"includeXDPContent", XFA_ELEMENT_IncludeXDPContent,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xa9b081a1, L"xmlConnection", XFA_ELEMENT_XmlConnection,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_Node},
{0xab2a3b74, L"validateApprovalSignatures",
XFA_ELEMENT_ValidateApprovalSignatures, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xab8c5a2b, L"signData", XFA_ELEMENT_SignData,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xabaa2ceb, L"packets", XFA_ELEMENT_Packets, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xadba359c, L"datePattern", XFA_ELEMENT_DatePattern,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_ContentNode},
{0xae222b2b, L"duplexOption", XFA_ELEMENT_DuplexOption,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xb012effb, L"base", XFA_ELEMENT_Base, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xb0e5485d, L"bind", XFA_ELEMENT_Bind,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_Node},
{0xb45d61b2, L"compression", XFA_ELEMENT_Compression, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xb563f0ff, L"user", XFA_ELEMENT_User, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_TextNode},
{0xb5848ad5, L"rectangle", XFA_ELEMENT_Rectangle,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xb6dacb72, L"effectiveOutputPolicy", XFA_ELEMENT_EffectiveOutputPolicy,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_Node},
{0xb7d7654d, L"ADBE_JSDebugger", XFA_ELEMENT_ADBE_JSDebugger,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xbab37f73, L"acrobat7", XFA_ELEMENT_Acrobat7, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xbc70081e, L"interactive", XFA_ELEMENT_Interactive, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xbc8fa350, L"locale", XFA_ELEMENT_Locale,
XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0xbcd44940, L"currentPage", XFA_ELEMENT_CurrentPage, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xbde9abda, L"data", XFA_ELEMENT_Data, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xbde9abde, L"date", XFA_ELEMENT_Date,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0xbe52dfbf, L"desc", XFA_ELEMENT_Desc,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xbf4b6405, L"encrypt", XFA_ELEMENT_Encrypt,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Config | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ContentNode},
{0xbfa87cce, L"draw", XFA_ELEMENT_Draw,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0xc181ff4b, L"encryption", XFA_ELEMENT_Encryption, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xc1970f40, L"meridiemNames", XFA_ELEMENT_MeridiemNames,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0xc5ad9f5e, L"messaging", XFA_ELEMENT_Messaging, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xc69549f4, L"speak", XFA_ELEMENT_Speak,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_TextNode},
{0xc7743dc7, L"dataGroup", XFA_ELEMENT_DataGroup, XFA_XDPPACKET_Datasets,
XFA_OBJECTTYPE_Node},
{0xc7eb20e9, L"common", XFA_ELEMENT_Common, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xc85d4528, L"#text", XFA_ELEMENT_Sharptext,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Config | XFA_XDPPACKET_LocaleSet |
XFA_XDPPACKET_ConnectionSet | XFA_XDPPACKET_SourceSet |
XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_NodeV},
{0xc861556a, L"paginationOverride", XFA_ELEMENT_PaginationOverride,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xc903dabb, L"reasons", XFA_ELEMENT_Reasons,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xc9a8127f, L"signatureProperties", XFA_ELEMENT_SignatureProperties,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xca010c2d, L"threshold", XFA_ELEMENT_Threshold, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xcb4c5e96, L"appearanceFilter", XFA_ELEMENT_AppearanceFilter,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_NodeC},
{0xcc92aba7, L"fill", XFA_ELEMENT_Fill,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xcd308b77, L"font", XFA_ELEMENT_Font,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Config | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_Node},
{0xcd309ff4, L"form", XFA_ELEMENT_Form, XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_ModelNode},
{0xcebcca2d, L"mediumInfo", XFA_ELEMENT_MediumInfo, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xcfe0d643, L"certificate", XFA_ELEMENT_Certificate,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_TextNode},
{0xd012c033, L"password", XFA_ELEMENT_Password, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_TextNode},
{0xd01604bd, L"runScripts", XFA_ELEMENT_RunScripts, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xd1227e6f, L"trace", XFA_ELEMENT_Trace, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xd1532876, L"float", XFA_ELEMENT_Float,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0xd17a6c30, L"renderPolicy", XFA_ELEMENT_RenderPolicy,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xd4bf6823, L"logPseudoModel", XFA_ELEMENT_LogPseudoModel,
XFA_XDPPACKET_XDP, XFA_OBJECTTYPE_OrdinaryObject},
{0xd58aa962, L"destination", XFA_ELEMENT_Destination, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xd6e27f1d, L"value", XFA_ELEMENT_Value,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xd7a14462, L"bookend", XFA_ELEMENT_Bookend,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xd8c31254, L"exObject", XFA_ELEMENT_ExObject,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xda6a8590, L"openAction", XFA_ELEMENT_OpenAction, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xdab4fb7d, L"neverEmbed", XFA_ELEMENT_NeverEmbed, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xdb98475f, L"bindItems", XFA_ELEMENT_BindItems,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xdbfbe02e, L"calculate", XFA_ELEMENT_Calculate,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xdd7676ed, L"print", XFA_ELEMENT_Print, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xdde273d7, L"extras", XFA_ELEMENT_Extras,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_Node},
{0xde146b34, L"proto", XFA_ELEMENT_Proto,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xdf059321, L"dSigData", XFA_ELEMENT_DSigData,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xdfccf030, L"creator", XFA_ELEMENT_Creator, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xdff78c6a, L"connect", XFA_ELEMENT_Connect,
XFA_XDPPACKET_SourceSet | XFA_XDPPACKET_Template | XFA_XDPPACKET_Form,
XFA_OBJECTTYPE_Node},
{0xe11a2cbc, L"permissions", XFA_ELEMENT_Permissions, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xe14c801c, L"connectionSet", XFA_ELEMENT_ConnectionSet,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_ModelNode},
{0xe1c83a14, L"submit", XFA_ELEMENT_Submit,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xe29821cd, L"range", XFA_ELEMENT_Range, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xe38d83c7, L"linearized", XFA_ELEMENT_Linearized, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xe3aa2578, L"packet", XFA_ELEMENT_Packet, XFA_XDPPACKET_XDP,
XFA_OBJECTTYPE_NodeC},
{0xe3aa860e, L"rootElement", XFA_ELEMENT_RootElement,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_TextNode},
{0xe3e553fa, L"plaintextMetadata", XFA_ELEMENT_PlaintextMetadata,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xe3e6e4f2, L"numberSymbols", XFA_ELEMENT_NumberSymbols,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0xe3f067f6, L"printHighQuality", XFA_ELEMENT_PrintHighQuality,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xe3fd078c, L"driver", XFA_ELEMENT_Driver, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xe48b34f2, L"incrementalLoad", XFA_ELEMENT_IncrementalLoad,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_NodeV},
{0xe550e7c2, L"subjectDN", XFA_ELEMENT_SubjectDN,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_NodeC},
{0xe6669a78, L"compressLogicalStructure",
XFA_ELEMENT_CompressLogicalStructure, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xe7a7ea02, L"incrementalMerge", XFA_ELEMENT_IncrementalMerge,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xe948530d, L"radial", XFA_ELEMENT_Radial,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xea8d6999, L"variables", XFA_ELEMENT_Variables,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContainerNode},
{0xeaa142c0, L"timePatterns", XFA_ELEMENT_TimePatterns,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_Node},
{0xeb943a71, L"effectiveInputPolicy", XFA_ELEMENT_EffectiveInputPolicy,
XFA_XDPPACKET_ConnectionSet, XFA_OBJECTTYPE_Node},
{0xef04a2bc, L"nameAttr", XFA_ELEMENT_NameAttr, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xf07222ab, L"conformance", XFA_ELEMENT_Conformance, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xf0aaaadc, L"transform", XFA_ELEMENT_Transform, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_Node},
{0xf1433e88, L"lockDocument", XFA_ELEMENT_LockDocument,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_ContentNode},
{0xf54eb997, L"breakAfter", XFA_ELEMENT_BreakAfter,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xf616da28, L"line", XFA_ELEMENT_Line,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xf616f3dc, L"list", XFA_ELEMENT_List, XFA_XDPPACKET_XDP,
XFA_OBJECTTYPE_OrdinaryList},
{0xf7055fb1, L"source", XFA_ELEMENT_Source, XFA_XDPPACKET_SourceSet,
XFA_OBJECTTYPE_Node},
{0xf7eebe1c, L"occur", XFA_ELEMENT_Occur,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
{0xf8d10d97, L"pickTrayByPDFSize", XFA_ELEMENT_PickTrayByPDFSize,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xf8f19e3a, L"monthNames", XFA_ELEMENT_MonthNames, XFA_XDPPACKET_LocaleSet,
XFA_OBJECTTYPE_Node},
{0xf984149b, L"severity", XFA_ELEMENT_Severity, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xf9bcb037, L"groupParent", XFA_ELEMENT_GroupParent, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_NodeV},
{0xfbc42fff, L"documentAssembly", XFA_ELEMENT_DocumentAssembly,
XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode},
{0xfc78159f, L"numberSymbol", XFA_ELEMENT_NumberSymbol,
XFA_XDPPACKET_LocaleSet, XFA_OBJECTTYPE_ContentNode},
{0xfcbd606c, L"tagged", XFA_ELEMENT_Tagged, XFA_XDPPACKET_Config,
XFA_OBJECTTYPE_ContentNode},
{0xff063802, L"items", XFA_ELEMENT_Items,
XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node},
};
const int32_t g_iXFAElementCount =
sizeof(g_XFAElementData) / sizeof(XFA_ELEMENTINFO);
const XFA_ELEMENTHIERARCHY g_XFAElementPropertyIndex[] = {
{0, 8}, {8, 0}, {8, 14}, {22, 0}, {22, 0}, {22, 6}, {28, 0},
{28, 0}, {28, 1}, {29, 3}, {32, 0}, {32, 0}, {32, 0}, {32, 3},
{35, 1}, {36, 0}, {36, 0}, {36, 2}, {38, 0}, {38, 0}, {38, 0},
{38, 4}, {42, 0}, {42, 0}, {42, 1}, {43, 0}, {43, 8}, {51, 19},
{70, 0}, {70, 0}, {70, 2}, {72, 1}, {73, 0}, {73, 2}, {75, 4},
{79, 1}, {80, 1}, {81, 0}, {81, 0}, {81, 3}, {84, 0}, {84, 4},
{88, 4}, {92, 1}, {93, 0}, {93, 4}, {97, 9}, {106, 14}, {120, 0},
{120, 0}, {120, 5}, {125, 0}, {125, 1}, {126, 0}, {126, 0}, {126, 0},
{126, 0}, {126, 0}, {126, 1}, {127, 0}, {127, 0}, {127, 0}, {127, 0},
{127, 0}, {127, 0}, {127, 0}, {127, 6}, {133, 1}, {134, 0}, {134, 1},
{135, 0}, {135, 0}, {135, 1}, {136, 2}, {138, 5}, {143, 2}, {145, 0},
{145, 0}, {145, 0}, {145, 0}, {145, 0}, {145, 5}, {150, 0}, {150, 0},
{150, 0}, {150, 0}, {150, 0}, {150, 0}, {150, 0}, {150, 2}, {152, 0},
{152, 0}, {152, 0}, {152, 17}, {169, 0}, {169, 1}, {170, 0}, {170, 0},
{170, 2}, {172, 0}, {172, 0}, {172, 1}, {173, 0}, {173, 0}, {173, 2},
{175, 2}, {177, 0}, {177, 0}, {177, 0}, {177, 11}, {188, 0}, {188, 0},
{188, 0}, {188, 0}, {188, 0}, {188, 4}, {192, 3}, {195, 0}, {195, 0},
{195, 0}, {195, 0}, {195, 0}, {195, 0}, {195, 9}, {204, 0}, {204, 0},
{204, 17}, {221, 0}, {221, 0}, {221, 0}, {221, 0}, {221, 0}, {221, 0},
{221, 0}, {221, 0}, {221, 0}, {221, 4}, {225, 0}, {225, 0}, {225, 0},
{225, 0}, {225, 2}, {227, 3}, {230, 0}, {230, 0}, {230, 2}, {232, 0},
{232, 1}, {233, 2}, {235, 2}, {237, 0}, {237, 0}, {237, 2}, {239, 0},
{239, 1}, {240, 1}, {241, 2}, {243, 0}, {243, 3}, {246, 4}, {250, 0},
{250, 1}, {251, 2}, {253, 0}, {253, 0}, {253, 0}, {253, 0}, {253, 0},
{253, 0}, {253, 0}, {253, 0}, {253, 0}, {253, 0}, {253, 2}, {255, 2},
{257, 0}, {257, 6}, {263, 5}, {268, 0}, {268, 0}, {268, 0}, {268, 3},
{271, 0}, {271, 0}, {271, 3}, {274, 4}, {278, 0}, {278, 0}, {278, 4},
{282, 0}, {282, 0}, {282, 5}, {287, 0}, {287, 5}, {292, 0}, {292, 0},
{292, 0}, {292, 1}, {293, 0}, {293, 0}, {293, 1}, {294, 0}, {294, 2},
{296, 0}, {296, 0}, {296, 0}, {296, 0}, {296, 1}, {297, 0}, {297, 0},
{297, 4}, {301, 0}, {301, 0}, {301, 0}, {301, 0}, {301, 0}, {301, 0},
{301, 1}, {302, 0}, {302, 2}, {304, 0}, {304, 0}, {304, 0}, {304, 0},
{304, 1}, {305, 4}, {309, 0}, {309, 3}, {312, 0}, {312, 0}, {312, 1},
{313, 0}, {313, 8}, {321, 0}, {321, 10}, {331, 0}, {331, 10}, {341, 1},
{342, 12}, {354, 3}, {357, 1}, {358, 0}, {358, 0}, {358, 0}, {358, 8},
{366, 0}, {366, 0}, {366, 0}, {366, 0}, {366, 0}, {366, 0}, {366, 7},
{373, 2}, {375, 0}, {375, 1}, {376, 0}, {376, 0}, {376, 0}, {376, 0},
{376, 0}, {376, 0}, {376, 0}, {376, 0}, {376, 13}, {389, 0}, {389, 1},
{390, 1}, {391, 0}, {391, 0}, {391, 3}, {394, 0}, {394, 0}, {394, 0},
{394, 0}, {394, 0}, {394, 4}, {398, 9}, {407, 0}, {407, 1}, {408, 0},
{408, 0}, {408, 0}, {408, 0}, {408, 0}, {408, 1}, {409, 0}, {409, 2},
{411, 0}, {411, 0}, {411, 0}, {411, 0}, {411, 2}, {413, 0}, {413, 1},
{414, 0}, {414, 0}, {414, 0}, {414, 7}, {421, 0}, {421, 1}, {422, 1},
{423, 0}, {423, 1}, {424, 1}, {425, 0}, {425, 1}, {426, 0}, {426, 0},
{426, 0}, {426, 0}, {426, 0}, {426, 0},
};
const XFA_PROPERTY g_XFAElementPropertyData[] = {
{XFA_ELEMENT_FontInfo, 1, 0},
{XFA_ELEMENT_Jog, 1, 0},
{XFA_ELEMENT_Xdc, 1, 0},
{XFA_ELEMENT_BatchOutput, 1, 0},
{XFA_ELEMENT_OutputBin, 1, 0},
{XFA_ELEMENT_Compress, 1, 0},
{XFA_ELEMENT_Staple, 1, 0},
{XFA_ELEMENT_MediumInfo, 1, 0},
{XFA_ELEMENT_CheckButton, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_ChoiceList, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_DefaultUi, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Barcode, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Button, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_DateTimeEdit, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Picture, 1, 0},
{XFA_ELEMENT_ImageEdit, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_PasswordEdit, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_NumericEdit, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Signature, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_TextEdit, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_ExObject, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Break, 1, 0},
{XFA_ELEMENT_Overflow, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Bookend, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Occur, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_SubsetBelow, 1, 0},
{XFA_ELEMENT_Map, 1, 0},
{XFA_ELEMENT_Embed, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_DatePattern, 4, 0},
{XFA_ELEMENT_Edge, 1, 0},
{XFA_ELEMENT_Fill, 1, 0},
{XFA_ELEMENT_To, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Mode, 1, 0},
{XFA_ELEMENT_Threshold, 1, 0},
{XFA_ELEMENT_Script, 1, 0},
{XFA_ELEMENT_FontInfo, 1, 0},
{XFA_ELEMENT_Jog, 1, 0},
{XFA_ELEMENT_Xdc, 1, 0},
{XFA_ELEMENT_BatchOutput, 1, 0},
{XFA_ELEMENT_PageOffset, 1, 0},
{XFA_ELEMENT_OutputBin, 1, 0},
{XFA_ELEMENT_Staple, 1, 0},
{XFA_ELEMENT_MediumInfo, 1, 0},
{XFA_ELEMENT_AdobeExtensionLevel, 1, 0},
{XFA_ELEMENT_FontInfo, 1, 0},
{XFA_ELEMENT_Xdc, 1, 0},
{XFA_ELEMENT_Pdfa, 1, 0},
{XFA_ELEMENT_BatchOutput, 1, 0},
{XFA_ELEMENT_ViewerPreferences, 1, 0},
{XFA_ELEMENT_ScriptModel, 1, 0},
{XFA_ELEMENT_Version, 1, 0},
{XFA_ELEMENT_SubmitFormat, 1, 0},
{XFA_ELEMENT_SilentPrint, 1, 0},
{XFA_ELEMENT_Producer, 1, 0},
{XFA_ELEMENT_Compression, 1, 0},
{XFA_ELEMENT_Interactive, 1, 0},
{XFA_ELEMENT_Encryption, 1, 0},
{XFA_ELEMENT_RenderPolicy, 1, 0},
{XFA_ELEMENT_OpenAction, 1, 0},
{XFA_ELEMENT_Creator, 1, 0},
{XFA_ELEMENT_Linearized, 1, 0},
{XFA_ELEMENT_Tagged, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Xsl, 1, 0},
{XFA_ELEMENT_Packets, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Debug, 1, 0},
{XFA_ELEMENT_FontInfo, 1, 0},
{XFA_ELEMENT_Xdc, 1, 0},
{XFA_ELEMENT_BatchOutput, 1, 0},
{XFA_ELEMENT_FlipLabel, 1, 0},
{XFA_ELEMENT_TemplateCache, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_FontInfo, 1, 0},
{XFA_ELEMENT_Xdc, 1, 0},
{XFA_ELEMENT_BatchOutput, 1, 0},
{XFA_ELEMENT_FlipLabel, 1, 0},
{XFA_ELEMENT_EraNames, 1, 0},
{XFA_ELEMENT_DayNames, 2, 0},
{XFA_ELEMENT_MeridiemNames, 1, 0},
{XFA_ELEMENT_MonthNames, 2, 0},
{XFA_ELEMENT_Hyphenation, 1, 0},
{XFA_ELEMENT_Amd, 1, 0},
{XFA_ELEMENT_Part, 1, 0},
{XFA_ELEMENT_IncludeXDPContent, 1, 0},
{XFA_ELEMENT_Conformance, 1, 0},
{XFA_ELEMENT_Mdp, 1, 0},
{XFA_ELEMENT_Certificates, 1, 0},
{XFA_ELEMENT_TimeStamp, 1, 0},
{XFA_ELEMENT_Handler, 1, 0},
{XFA_ELEMENT_DigestMethods, 1, 0},
{XFA_ELEMENT_Encodings, 1, 0},
{XFA_ELEMENT_Reasons, 1, 0},
{XFA_ELEMENT_AppearanceFilter, 1, 0},
{XFA_ELEMENT_LockDocument, 1, 0},
{XFA_ELEMENT_Xdp, 1, 0},
{XFA_ELEMENT_Cache, 1, 0},
{XFA_ELEMENT_Pagination, 1, 0},
{XFA_ELEMENT_Overprint, 1, 0},
{XFA_ELEMENT_BehaviorOverride, 1, 0},
{XFA_ELEMENT_Copies, 1, 0},
{XFA_ELEMENT_Output, 1, 0},
{XFA_ELEMENT_Validate, 1, 0},
{XFA_ELEMENT_Layout, 1, 0},
{XFA_ELEMENT_Script, 1, 0},
{XFA_ELEMENT_Common, 1, 0},
{XFA_ELEMENT_PaginationOverride, 1, 0},
{XFA_ELEMENT_Destination, 1, 0},
{XFA_ELEMENT_IncrementalMerge, 1, 0},
{XFA_ELEMENT_Execute, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Script, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_SignData, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Submit, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_CurrencySymbol, 3, 0},
{XFA_ELEMENT_Operation, 1, 0},
{XFA_ELEMENT_WsdlAddress, 1, 0},
{XFA_ELEMENT_SoapAddress, 1, 0},
{XFA_ELEMENT_SoapAction, 1, 0},
{XFA_ELEMENT_EffectiveOutputPolicy, 1, 0},
{XFA_ELEMENT_EffectiveInputPolicy, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Era, 2, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Picture, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Edge, 4, 0},
{XFA_ELEMENT_Corner, 4, 0},
{XFA_ELEMENT_Fill, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_KeyUsage, 1, 0},
{XFA_ELEMENT_SubjectDNs, 1, 0},
{XFA_ELEMENT_Issuers, 1, 0},
{XFA_ELEMENT_Signing, 1, 0},
{XFA_ELEMENT_Oids, 1, 0},
{XFA_ELEMENT_Color, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Ui, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Para, 1, 0},
{XFA_ELEMENT_Format, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Assist, 1, 0},
{XFA_ELEMENT_Traversal, 1, 0},
{XFA_ELEMENT_Keep, 1, 0},
{XFA_ELEMENT_Validate, 1, 0},
{XFA_ELEMENT_Caption, 1, 0},
{XFA_ELEMENT_Bind, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Font, 1, 0},
{XFA_ELEMENT_Value, 1, 0},
{XFA_ELEMENT_Calculate, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Items, 2, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Color, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Color, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Para, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Assist, 1, 0},
{XFA_ELEMENT_Traversal, 1, 0},
{XFA_ELEMENT_Validate, 1, 0},
{XFA_ELEMENT_Caption, 1, 0},
{XFA_ELEMENT_Bind, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Calculate, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Comb, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Present, 1, 0},
{XFA_ELEMENT_Acrobat, 1, 0},
{XFA_ELEMENT_Trace, 1, 0},
{XFA_ELEMENT_PrintScaling, 1, 0},
{XFA_ELEMENT_Enforce, 1, 0},
{XFA_ELEMENT_NumberOfCopies, 1, 0},
{XFA_ELEMENT_PageRange, 1, 0},
{XFA_ELEMENT_AddViewerPreferences, 1, 0},
{XFA_ELEMENT_ADBE_JSConsole, 1, 0},
{XFA_ELEMENT_DuplexOption, 1, 0},
{XFA_ELEMENT_ADBE_JSDebugger, 1, 0},
{XFA_ELEMENT_PickTrayByPDFSize, 1, 0},
{XFA_ELEMENT_Break, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Para, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Assist, 1, 0},
{XFA_ELEMENT_Traversal, 1, 0},
{XFA_ELEMENT_Keep, 1, 0},
{XFA_ELEMENT_Validate, 1, 0},
{XFA_ELEMENT_PageSet, 1, 0},
{XFA_ELEMENT_Overflow, 1, 0},
{XFA_ELEMENT_Bind, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Bookend, 1, 0},
{XFA_ELEMENT_Calculate, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Variables, 1, 0},
{XFA_ELEMENT_Occur, 1, 0},
{XFA_ELEMENT_Query, 1, 0},
{XFA_ELEMENT_Insert, 1, 0},
{XFA_ELEMENT_Update, 1, 0},
{XFA_ELEMENT_Delete, 1, 0},
{XFA_ELEMENT_MsgId, 1, 0},
{XFA_ELEMENT_Severity, 1, 0},
{XFA_ELEMENT_To, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Type, 1, 0},
{XFA_ELEMENT_ToolTip, 1, 0},
{XFA_ELEMENT_Speak, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_AddSilentPrint, 1, 0},
{XFA_ELEMENT_PrinterName, 1, 0},
{XFA_ELEMENT_FontInfo, 1, 0},
{XFA_ELEMENT_Xdc, 1, 0},
{XFA_ELEMENT_Color, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_RecordSet, 1, 0},
{XFA_ELEMENT_Select, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Message, 1, 0},
{XFA_ELEMENT_Picture, 1, 0},
{XFA_ELEMENT_Script, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_NumberPattern, 4, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Occur, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_RootElement, 1, 0},
{XFA_ELEMENT_Script, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Xsl, 1, 0},
{XFA_ELEMENT_StartPage, 1, 0},
{XFA_ELEMENT_Relevant, 1, 0},
{XFA_ELEMENT_Base, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_AutoSave, 1, 0},
{XFA_ELEMENT_Validate, 1, 0},
{XFA_ELEMENT_ValidateApprovalSignatures, 1, 0},
{XFA_ELEMENT_Acrobat7, 1, 0},
{XFA_ELEMENT_Common, 1, 0},
{XFA_ELEMENT_Exclude, 1, 0},
{XFA_ELEMENT_CurrentPage, 1, 0},
{XFA_ELEMENT_RunScripts, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Comb, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Medium, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Occur, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Filter, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Manifest, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Para, 1, 0},
{XFA_ELEMENT_Font, 1, 0},
{XFA_ELEMENT_Value, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Day, 7, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Color, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Occur, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Comb, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Filter, 1, 0},
{XFA_ELEMENT_Manifest, 1, 0},
{XFA_ELEMENT_Picture, 1, 0},
{XFA_ELEMENT_Level, 1, 0},
{XFA_ELEMENT_Type, 1, 0},
{XFA_ELEMENT_CompressObjectStream, 1, 0},
{XFA_ELEMENT_CompressLogicalStructure, 1, 0},
{XFA_ELEMENT_Edge, 4, 0},
{XFA_ELEMENT_Corner, 4, 0},
{XFA_ELEMENT_Fill, 1, 0},
{XFA_ELEMENT_DynamicRender, 1, 0},
{XFA_ELEMENT_DatePatterns, 1, 0},
{XFA_ELEMENT_CalendarSymbols, 1, 0},
{XFA_ELEMENT_CurrencySymbols, 1, 0},
{XFA_ELEMENT_Typefaces, 1, 0},
{XFA_ELEMENT_DateTimeSymbols, 1, 0},
{XFA_ELEMENT_NumberPatterns, 1, 0},
{XFA_ELEMENT_NumberSymbols, 1, 0},
{XFA_ELEMENT_TimePatterns, 1, 0},
{XFA_ELEMENT_Uri, 1, 0},
{XFA_ELEMENT_Xsl, 1, 0},
{XFA_ELEMENT_StartNode, 1, 0},
{XFA_ELEMENT_OutputXSL, 1, 0},
{XFA_ELEMENT_AdjustData, 1, 0},
{XFA_ELEMENT_Attributes, 1, 0},
{XFA_ELEMENT_Window, 1, 0},
{XFA_ELEMENT_Record, 1, 0},
{XFA_ELEMENT_Range, 1, 0},
{XFA_ELEMENT_IncrementalLoad, 1, 0},
{XFA_ELEMENT_Text, 1, 0},
{XFA_ELEMENT_Time, 1, 0},
{XFA_ELEMENT_DateTime, 1, 0},
{XFA_ELEMENT_Image, 1, 0},
{XFA_ELEMENT_Decimal, 1, 0},
{XFA_ELEMENT_Boolean, 1, 0},
{XFA_ELEMENT_Integer, 1, 0},
{XFA_ELEMENT_ExData, 1, 0},
{XFA_ELEMENT_Date, 1, 0},
{XFA_ELEMENT_Float, 1, 0},
{XFA_ELEMENT_Certificate, 1, 0},
{XFA_ELEMENT_Ui, 1, 0},
{XFA_ELEMENT_Margin, 1, 0},
{XFA_ELEMENT_Para, 1, 0},
{XFA_ELEMENT_Border, 1, 0},
{XFA_ELEMENT_Assist, 1, 0},
{XFA_ELEMENT_Traversal, 1, 0},
{XFA_ELEMENT_Keep, 1, 0},
{XFA_ELEMENT_Caption, 1, 0},
{XFA_ELEMENT_Desc, 1, 0},
{XFA_ELEMENT_Font, 1, 0},
{XFA_ELEMENT_Value, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_EncryptionLevel, 1, 0},
{XFA_ELEMENT_Encrypt, 1, 0},
{XFA_ELEMENT_Permissions, 1, 0},
{XFA_ELEMENT_Meridiem, 2, 0},
{XFA_ELEMENT_SuppressBanner, 1, 0},
{XFA_ELEMENT_VersionControl, 1, 0},
{XFA_ELEMENT_LocaleSet, 1, 0},
{XFA_ELEMENT_Template, 1, 0},
{XFA_ELEMENT_ValidationMessaging, 1, 0},
{XFA_ELEMENT_Locale, 1, 0},
{XFA_ELEMENT_Data, 1, 0},
{XFA_ELEMENT_Messaging, 1, 0},
{XFA_ELEMENT_Pattern, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Solid, 1,
XFA_PROPERTYFLAG_OneOf | XFA_PROPERTYFLAG_DefaultOneOf},
{XFA_ELEMENT_Stipple, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Color, 1, 0},
{XFA_ELEMENT_Linear, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Radial, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Fill, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Map, 1, 0},
{XFA_ELEMENT_Arc, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Text, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Time, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_DateTime, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Image, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Decimal, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Boolean, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Integer, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_ExData, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Rectangle, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Date, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Float, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Line, 1, XFA_PROPERTYFLAG_OneOf},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Destination, 1, 0},
{XFA_ELEMENT_Message, 1, 0},
{XFA_ELEMENT_Script, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Picture, 1, 0},
{XFA_ELEMENT_ConnectString, 1, 0},
{XFA_ELEMENT_User, 1, 0},
{XFA_ELEMENT_Password, 1, 0},
{XFA_ELEMENT_ModifyAnnots, 1, 0},
{XFA_ELEMENT_ContentCopy, 1, 0},
{XFA_ELEMENT_FormFieldFilling, 1, 0},
{XFA_ELEMENT_Change, 1, 0},
{XFA_ELEMENT_AccessibleContent, 1, 0},
{XFA_ELEMENT_Print, 1, 0},
{XFA_ELEMENT_PlaintextMetadata, 1, 0},
{XFA_ELEMENT_PrintHighQuality, 1, 0},
{XFA_ELEMENT_DocumentAssembly, 1, 0},
{XFA_ELEMENT_Encrypt, 1, 0},
{XFA_ELEMENT_NumberSymbol, 5, 0},
{XFA_ELEMENT_FontInfo, 1, 0},
{XFA_ELEMENT_Xdc, 1, 0},
{XFA_ELEMENT_Color, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_TimePattern, 4, 0},
{XFA_ELEMENT_Whitespace, 1, 0},
{XFA_ELEMENT_Rename, 1, 0},
{XFA_ELEMENT_IfEmpty, 1, 0},
{XFA_ELEMENT_Presence, 1, 0},
{XFA_ELEMENT_Picture, 1, 0},
{XFA_ELEMENT_NameAttr, 1, 0},
{XFA_ELEMENT_GroupParent, 1, 0},
{XFA_ELEMENT_Script, 1, 0},
{XFA_ELEMENT_Edge, 1, 0},
{XFA_ELEMENT_Connect, 1, 0},
{XFA_ELEMENT_Extras, 1, 0},
{XFA_ELEMENT_Month, 12, 0},
};
const XFA_ELEMENTHIERARCHY g_XFAElementChildrenIndex[] = {
{0, 0}, {0, 0}, {0, 0}, {0, 1}, {1, 0}, {1, 4}, {5, 0},
{5, 0}, {5, 0}, {5, 3}, {8, 0}, {8, 0}, {8, 0}, {8, 0},
{8, 0}, {8, 1}, {9, 0}, {9, 0}, {9, 0}, {9, 0}, {9, 0},
{9, 0}, {9, 2}, {11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0},
{11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0},
{11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0},
{11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 0}, {11, 8}, {19, 0},
{19, 0}, {19, 0}, {19, 0}, {19, 0}, {19, 0}, {19, 0}, {19, 0},
{19, 0}, {19, 0}, {19, 0}, {19, 0}, {19, 0}, {19, 0}, {19, 1},
{20, 1}, {21, 1}, {22, 0}, {22, 0}, {22, 0}, {22, 0}, {22, 0},
{22, 0}, {22, 0}, {22, 0}, {22, 0}, {22, 0}, {22, 7}, {29, 0},
{29, 0}, {29, 0}, {29, 0}, {29, 0}, {29, 0}, {29, 1}, {30, 1},
{31, 0}, {31, 0}, {31, 0}, {31, 0}, {31, 0}, {31, 0}, {31, 0},
{31, 0}, {31, 0}, {31, 4}, {35, 2}, {37, 0}, {37, 0}, {37, 0},
{37, 0}, {37, 0}, {37, 0}, {37, 0}, {37, 0}, {37, 0}, {37, 0},
{37, 0}, {37, 0}, {37, 0}, {37, 0}, {37, 4}, {41, 0}, {41, 0},
{41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 2}, {43, 0}, {43, 0},
{43, 0}, {43, 0}, {43, 0}, {43, 0}, {43, 0}, {43, 0}, {43, 0},
{43, 13}, {56, 0}, {56, 0}, {56, 1}, {57, 0}, {57, 0}, {57, 0},
{57, 0}, {57, 0}, {57, 0}, {57, 0}, {57, 0}, {57, 0}, {57, 0},
{57, 0}, {57, 1}, {58, 0}, {58, 1}, {59, 0}, {59, 0}, {59, 0},
{59, 1}, {60, 0}, {60, 0}, {60, 0}, {60, 0}, {60, 0}, {60, 0},
{60, 0}, {60, 0}, {60, 1}, {61, 0}, {61, 0}, {61, 0}, {61, 1},
{62, 0}, {62, 2}, {64, 0}, {64, 0}, {64, 0}, {64, 0}, {64, 0},
{64, 0}, {64, 0}, {64, 0}, {64, 0}, {64, 0}, {64, 0}, {64, 0},
{64, 1}, {65, 1}, {66, 1}, {67, 0}, {67, 1}, {68, 0}, {68, 0},
{68, 0}, {68, 0}, {68, 0}, {68, 0}, {68, 0}, {68, 0}, {68, 6},
{74, 0}, {74, 1}, {75, 0}, {75, 0}, {75, 0}, {75, 0}, {75, 0},
{75, 0}, {75, 0}, {75, 0}, {75, 0}, {75, 1}, {76, 0}, {76, 0},
{76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0},
{76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0},
{76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0},
{76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0}, {76, 0},
{76, 0}, {76, 0}, {76, 0}, {76, 2}, {78, 0}, {78, 0}, {78, 0},
{78, 1}, {79, 0}, {79, 0}, {79, 1}, {80, 0}, {80, 0}, {80, 1},
{81, 0}, {81, 0}, {81, 1}, {82, 0}, {82, 0}, {82, 0}, {82, 0},
{82, 0}, {82, 0}, {82, 0}, {82, 0}, {82, 0}, {82, 0}, {82, 1},
{83, 0}, {83, 0}, {83, 0}, {83, 0}, {83, 0}, {83, 0}, {83, 11},
{94, 0}, {94, 0}, {94, 0}, {94, 0}, {94, 0}, {94, 11}, {105, 106},
{211, 0}, {211, 0}, {211, 1}, {212, 0}, {212, 3}, {215, 1}, {216, 0},
{216, 0}, {216, 0}, {216, 0}, {216, 0}, {216, 0}, {216, 0}, {216, 0},
{216, 0}, {216, 0}, {216, 0}, {216, 0}, {216, 0}, {216, 12}, {228, 0},
{228, 0}, {228, 0}, {228, 0}, {228, 0}, {228, 0}, {228, 0}, {228, 0},
{228, 0}, {228, 2}, {230, 0}, {230, 0}, {230, 0}, {230, 0}, {230, 0},
{230, 0}, {230, 0}, {230, 0}, {230, 10},
};
const uint16_t g_XFAElementChildrenData[] = {
XFA_ELEMENT_Extras,
XFA_ELEMENT_SubformSet,
XFA_ELEMENT_BreakBefore,
XFA_ELEMENT_Subform,
XFA_ELEMENT_BreakAfter,
XFA_ELEMENT_AlwaysEmbed,
XFA_ELEMENT_DefaultTypeface,
XFA_ELEMENT_NeverEmbed,
XFA_ELEMENT_Source,
XFA_ELEMENT_Equate,
XFA_ELEMENT_EquateRange,
XFA_ELEMENT_Ps,
XFA_ELEMENT_Pcl,
XFA_ELEMENT_Pdf,
XFA_ELEMENT_Zpl,
XFA_ELEMENT_LabelPrinter,
XFA_ELEMENT_WebClient,
XFA_ELEMENT_SubmitUrl,
XFA_ELEMENT_Driver,
XFA_ELEMENT_Typeface,
XFA_ELEMENT_SubjectDN,
XFA_ELEMENT_Certificate,
XFA_ELEMENT_SubformSet,
XFA_ELEMENT_Area,
XFA_ELEMENT_Field,
XFA_ELEMENT_ExclGroup,
XFA_ELEMENT_Subform,
XFA_ELEMENT_Draw,
XFA_ELEMENT_ExObject,
XFA_ELEMENT_EncryptionMethod,
XFA_ELEMENT_Ref,
XFA_ELEMENT_Event,
XFA_ELEMENT_SetProperty,
XFA_ELEMENT_BindItems,
XFA_ELEMENT_Connect,
XFA_ELEMENT_Pdf,
XFA_ELEMENT_Destination,
XFA_ELEMENT_Event,
XFA_ELEMENT_SetProperty,
XFA_ELEMENT_Field,
XFA_ELEMENT_Connect,
XFA_ELEMENT_Agent,
XFA_ELEMENT_PsMap,
XFA_ELEMENT_SubformSet,
XFA_ELEMENT_BreakBefore,
XFA_ELEMENT_Event,
XFA_ELEMENT_Area,
XFA_ELEMENT_SetProperty,
XFA_ELEMENT_Field,
XFA_ELEMENT_ExclGroup,
XFA_ELEMENT_Subform,
XFA_ELEMENT_Draw,
XFA_ELEMENT_ExObject,
XFA_ELEMENT_Proto,
XFA_ELEMENT_Connect,
XFA_ELEMENT_BreakAfter,
XFA_ELEMENT_Locale,
XFA_ELEMENT_Text,
XFA_ELEMENT_Font,
XFA_ELEMENT_Traverse,
XFA_ELEMENT_Map,
XFA_ELEMENT_DigestMethod,
XFA_ELEMENT_PageSet,
XFA_ELEMENT_PageArea,
XFA_ELEMENT_Encoding,
XFA_ELEMENT_Subform,
XFA_ELEMENT_SubmitUrl,
XFA_ELEMENT_Certificate,
XFA_ELEMENT_Area,
XFA_ELEMENT_Field,
XFA_ELEMENT_ContentArea,
XFA_ELEMENT_ExclGroup,
XFA_ELEMENT_Subform,
XFA_ELEMENT_Draw,
XFA_ELEMENT_Oid,
XFA_ELEMENT_Ref,
XFA_ELEMENT_ExcludeNS,
XFA_ELEMENT_Transform,
XFA_ELEMENT_SetProperty,
XFA_ELEMENT_Message,
XFA_ELEMENT_Log,
XFA_ELEMENT_Reason,
XFA_ELEMENT_Area,
XFA_ELEMENT_Text,
XFA_ELEMENT_Time,
XFA_ELEMENT_DateTime,
XFA_ELEMENT_Image,
XFA_ELEMENT_Decimal,
XFA_ELEMENT_Boolean,
XFA_ELEMENT_Integer,
XFA_ELEMENT_ExData,
XFA_ELEMENT_Date,
XFA_ELEMENT_Float,
XFA_ELEMENT_ExObject,
XFA_ELEMENT_Text,
XFA_ELEMENT_Time,
XFA_ELEMENT_DateTime,
XFA_ELEMENT_Image,
XFA_ELEMENT_Decimal,
XFA_ELEMENT_Boolean,
XFA_ELEMENT_Integer,
XFA_ELEMENT_ExData,
XFA_ELEMENT_Date,
XFA_ELEMENT_Float,
XFA_ELEMENT_Extras,
XFA_ELEMENT_Ui,
XFA_ELEMENT_SubformSet,
XFA_ELEMENT_Break,
XFA_ELEMENT_CheckButton,
XFA_ELEMENT_Arc,
XFA_ELEMENT_Mdp,
XFA_ELEMENT_BreakBefore,
XFA_ELEMENT_Oid,
XFA_ELEMENT_Ref,
XFA_ELEMENT_Margin,
XFA_ELEMENT_KeyUsage,
XFA_ELEMENT_ChoiceList,
XFA_ELEMENT_Para,
XFA_ELEMENT_Filter,
XFA_ELEMENT_Encoding,
XFA_ELEMENT_Event,
XFA_ELEMENT_DefaultUi,
XFA_ELEMENT_Barcode,
XFA_ELEMENT_SubjectDNs,
XFA_ELEMENT_Issuers,
XFA_ELEMENT_Button,
XFA_ELEMENT_Format,
XFA_ELEMENT_Border,
XFA_ELEMENT_Area,
XFA_ELEMENT_Hyphenation,
XFA_ELEMENT_Text,
XFA_ELEMENT_Time,
XFA_ELEMENT_Certificates,
XFA_ELEMENT_SetProperty,
XFA_ELEMENT_DateTime,
XFA_ELEMENT_Comb,
XFA_ELEMENT_Pattern,
XFA_ELEMENT_Field,
XFA_ELEMENT_ContentArea,
XFA_ELEMENT_Solid,
XFA_ELEMENT_Edge,
XFA_ELEMENT_Stipple,
XFA_ELEMENT_ExclGroup,
XFA_ELEMENT_ToolTip,
XFA_ELEMENT_Reason,
XFA_ELEMENT_Execute,
XFA_ELEMENT_DateTimeEdit,
XFA_ELEMENT_Image,
XFA_ELEMENT_TimeStamp,
XFA_ELEMENT_Decimal,
XFA_ELEMENT_Subform,
XFA_ELEMENT_Handler,
XFA_ELEMENT_Boolean,
XFA_ELEMENT_Message,
XFA_ELEMENT_Assist,
XFA_ELEMENT_Picture,
XFA_ELEMENT_Traversal,
XFA_ELEMENT_Corner,
XFA_ELEMENT_Color,
XFA_ELEMENT_Keep,
XFA_ELEMENT_ImageEdit,
XFA_ELEMENT_Validate,
XFA_ELEMENT_DigestMethods,
XFA_ELEMENT_PageSet,
XFA_ELEMENT_Integer,
XFA_ELEMENT_Traverse,
XFA_ELEMENT_Encodings,
XFA_ELEMENT_Signing,
XFA_ELEMENT_Script,
XFA_ELEMENT_PasswordEdit,
XFA_ELEMENT_NumericEdit,
XFA_ELEMENT_PageArea,
XFA_ELEMENT_Oids,
XFA_ELEMENT_Signature,
XFA_ELEMENT_Caption,
XFA_ELEMENT_ExData,
XFA_ELEMENT_Manifest,
XFA_ELEMENT_Overflow,
XFA_ELEMENT_Linear,
XFA_ELEMENT_DigestMethod,
XFA_ELEMENT_Medium,
XFA_ELEMENT_TextEdit,
XFA_ELEMENT_SignData,
XFA_ELEMENT_Rectangle,
XFA_ELEMENT_Date,
XFA_ELEMENT_Desc,
XFA_ELEMENT_Encrypt,
XFA_ELEMENT_Draw,
XFA_ELEMENT_Speak,
XFA_ELEMENT_Reasons,
XFA_ELEMENT_AppearanceFilter,
XFA_ELEMENT_Fill,
XFA_ELEMENT_Font,
XFA_ELEMENT_Certificate,
XFA_ELEMENT_Float,
XFA_ELEMENT_Value,
XFA_ELEMENT_Bookend,
XFA_ELEMENT_ExObject,
XFA_ELEMENT_BindItems,
XFA_ELEMENT_Calculate,
XFA_ELEMENT_Extras,
XFA_ELEMENT_Connect,
XFA_ELEMENT_Submit,
XFA_ELEMENT_SubjectDN,
XFA_ELEMENT_Radial,
XFA_ELEMENT_Variables,
XFA_ELEMENT_LockDocument,
XFA_ELEMENT_BreakAfter,
XFA_ELEMENT_Line,
XFA_ELEMENT_Occur,
XFA_ELEMENT_Items,
XFA_ELEMENT_Extras,
XFA_ELEMENT_WsdlConnection,
XFA_ELEMENT_XsdConnection,
XFA_ELEMENT_XmlConnection,
XFA_ELEMENT_SignData,
XFA_ELEMENT_Text,
XFA_ELEMENT_Time,
XFA_ELEMENT_DateTime,
XFA_ELEMENT_Image,
XFA_ELEMENT_Decimal,
XFA_ELEMENT_Boolean,
XFA_ELEMENT_Integer,
XFA_ELEMENT_Script,
XFA_ELEMENT_ExData,
XFA_ELEMENT_Manifest,
XFA_ELEMENT_Date,
XFA_ELEMENT_Float,
XFA_ELEMENT_Command,
XFA_ELEMENT_Bind,
XFA_ELEMENT_Text,
XFA_ELEMENT_Time,
XFA_ELEMENT_DateTime,
XFA_ELEMENT_Image,
XFA_ELEMENT_Decimal,
XFA_ELEMENT_Boolean,
XFA_ELEMENT_Integer,
XFA_ELEMENT_ExData,
XFA_ELEMENT_Date,
XFA_ELEMENT_Float,
};
const XFA_ELEMENTHIERARCHY g_XFAElementAttributeIndex[] = {
{0, 3}, {3, 2}, {5, 3}, {8, 10}, {18, 2}, {20, 6}, {26, 2},
{28, 1}, {29, 13}, {42, 2}, {44, 1}, {45, 2}, {47, 2}, {49, 7},
{56, 0}, {56, 4}, {60, 2}, {62, 7}, {69, 0}, {69, 0}, {69, 2},
{71, 2}, {73, 8}, {81, 5}, {86, 8}, {94, 4}, {98, 3}, {101, 3},
{104, 3}, {107, 6}, {113, 2}, {115, 2}, {117, 2}, {119, 2}, {121, 3},
{124, 2}, {126, 7}, {133, 13}, {146, 2}, {148, 6}, {154, 2}, {156, 3},
{159, 1}, {160, 17}, {177, 2}, {179, 2}, {181, 6}, {187, 2}, {189, 2},
{191, 3}, {194, 7}, {201, 2}, {203, 3}, {206, 0}, {206, 21}, {227, 1},
{228, 3}, {231, 2}, {233, 0}, {233, 2}, {235, 2}, {237, 6}, {243, 0},
{243, 4}, {247, 4}, {251, 0}, {251, 2}, {253, 2}, {255, 0}, {255, 0},
{255, 2}, {257, 2}, {259, 4}, {263, 3}, {266, 7}, {273, 10}, {283, 9},
{292, 6}, {298, 4}, {302, 2}, {304, 2}, {306, 6}, {312, 4}, {316, 3},
{319, 2}, {321, 2}, {323, 4}, {327, 4}, {331, 4}, {335, 4}, {339, 2},
{341, 2}, {343, 2}, {345, 22}, {367, 3}, {370, 2}, {372, 2}, {374, 2},
{376, 9}, {385, 0}, {385, 4}, {389, 3}, {392, 0}, {392, 2}, {394, 7},
{401, 4}, {405, 2}, {407, 4}, {411, 0}, {411, 21}, {432, 4}, {436, 3},
{439, 4}, {443, 6}, {449, 2}, {451, 5}, {456, 2}, {458, 8}, {466, 1},
{467, 2}, {469, 2}, {471, 5}, {476, 0}, {476, 2}, {478, 2}, {480, 6},
{486, 26}, {512, 4}, {516, 2}, {518, 2}, {520, 4}, {524, 0}, {524, 2},
{526, 2}, {528, 2}, {530, 2}, {532, 5}, {537, 2}, {539, 3}, {542, 2},
{544, 4}, {548, 5}, {553, 2}, {555, 0}, {555, 2}, {557, 4}, {561, 5},
{566, 3}, {569, 2}, {571, 3}, {574, 0}, {574, 2}, {576, 9}, {585, 2},
{587, 5}, {592, 6}, {598, 5}, {603, 4}, {607, 4}, {611, 8}, {619, 4},
{623, 0}, {623, 7}, {630, 4}, {634, 4}, {638, 5}, {643, 2}, {645, 2},
{647, 4}, {651, 4}, {655, 2}, {657, 2}, {659, 1}, {660, 2}, {662, 5},
{667, 4}, {671, 3}, {674, 2}, {676, 2}, {678, 4}, {682, 0}, {682, 9},
{691, 2}, {693, 2}, {695, 5}, {700, 4}, {704, 3}, {707, 2}, {709, 10},
{719, 2}, {721, 4}, {725, 4}, {729, 2}, {731, 6}, {737, 2}, {739, 2},
{741, 9}, {750, 1}, {751, 4}, {755, 3}, {758, 5}, {763, 6}, {769, 4},
{773, 1}, {774, 4}, {778, 0}, {778, 3}, {781, 1}, {782, 5}, {787, 10},
{797, 7}, {804, 3}, {807, 2}, {809, 5}, {814, 2}, {816, 0}, {816, 2},
{818, 2}, {820, 2}, {822, 6}, {828, 2}, {830, 1}, {831, 2}, {833, 2},
{835, 8}, {843, 2}, {845, 4}, {849, 4}, {853, 4}, {857, 2}, {859, 2},
{861, 2}, {863, 3}, {866, 2}, {868, 2}, {870, 4}, {874, 3}, {877, 5},
{882, 20}, {902, 2}, {904, 0}, {904, 2}, {906, 6}, {912, 1}, {913, 2},
{915, 1}, {916, 2}, {918, 4}, {922, 2}, {924, 2}, {926, 4}, {930, 4},
{934, 20}, {954, 1}, {955, 2}, {957, 4}, {961, 4}, {965, 2}, {967, 2},
{969, 4}, {973, 2}, {975, 0}, {975, 2}, {977, 5}, {982, 5}, {987, 8},
{995, 2}, {997, 2}, {999, 4}, {1003, 4}, {1007, 2}, {1009, 4}, {1013, 0},
{1013, 1}, {1014, 2}, {1016, 9}, {1025, 2}, {1027, 0}, {1027, 8}, {1035, 2},
{1037, 2}, {1039, 0}, {1039, 4}, {1043, 2}, {1045, 0}, {1045, 2}, {1047, 3},
{1050, 2}, {1052, 5}, {1057, 2}, {1059, 2}, {1061, 4}, {1065, 3}, {1068, 0},
{1068, 4}, {1072, 2}, {1074, 2}, {1076, 3}, {1079, 4}, {1083, 8}, {1091, 5},
{1096, 0}, {1096, 4}, {1100, 6}, {1106, 2}, {1108, 1}, {1109, 2}, {1111, 2},
{1113, 2}, {1115, 1}, {1116, 2}, {1118, 7},
};
const uint8_t g_XFAElementAttributeData[] = {
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Max,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_EofAction,
XFA_ATTRIBUTE_CursorType,
XFA_ATTRIBUTE_LockType,
XFA_ATTRIBUTE_BofAction,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_CursorLocation,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Relation,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_BeforeTarget,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_OverflowTarget,
XFA_ATTRIBUTE_OverflowLeader,
XFA_ATTRIBUTE_OverflowTrailer,
XFA_ATTRIBUTE_StartNew,
XFA_ATTRIBUTE_BookendTrailer,
XFA_ATTRIBUTE_After,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_BookendLeader,
XFA_ATTRIBUTE_AfterTarget,
XFA_ATTRIBUTE_Before,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_AllowNeutral,
XFA_ATTRIBUTE_Mark,
XFA_ATTRIBUTE_Shape,
XFA_ATTRIBUTE_Size,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_StartAngle,
XFA_ATTRIBUTE_SweepAngle,
XFA_ATTRIBUTE_Circular,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Hand,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Bind,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_From,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_SignatureType,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Permissions,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_StartNew,
XFA_ATTRIBUTE_Trailer,
XFA_ATTRIBUTE_TargetType,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Target,
XFA_ATTRIBUTE_Leader,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_TimeStamp,
XFA_ATTRIBUTE_Uuid,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_LeftInset,
XFA_ATTRIBUTE_BottomInset,
XFA_ATTRIBUTE_TopInset,
XFA_ATTRIBUTE_RightInset,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_NonRepudiation,
XFA_ATTRIBUTE_EncipherOnly,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_DigitalSignature,
XFA_ATTRIBUTE_CrlSign,
XFA_ATTRIBUTE_KeyAgreement,
XFA_ATTRIBUTE_KeyEncipherment,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_DataEncipherment,
XFA_ATTRIBUTE_KeyCertSign,
XFA_ATTRIBUTE_DecipherOnly,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Open,
XFA_ATTRIBUTE_CommitOn,
XFA_ATTRIBUTE_TextEntry,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_HAlign,
XFA_ATTRIBUTE_TextIndent,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Widows,
XFA_ATTRIBUTE_MarginRight,
XFA_ATTRIBUTE_MarginLeft,
XFA_ATTRIBUTE_RadixOffset,
XFA_ATTRIBUTE_Preserve,
XFA_ATTRIBUTE_SpaceBelow,
XFA_ATTRIBUTE_VAlign,
XFA_ATTRIBUTE_TabDefault,
XFA_ATTRIBUTE_TabStops,
XFA_ATTRIBUTE_Orphans,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_LineHeight,
XFA_ATTRIBUTE_SpaceAbove,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Version,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_AddRevocationInfo,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Listen,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Activity,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_DataRowCount,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_DataPrep,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_TextLocation,
XFA_ATTRIBUTE_ModuleWidth,
XFA_ATTRIBUTE_PrintCheckDigit,
XFA_ATTRIBUTE_ModuleHeight,
XFA_ATTRIBUTE_StartChar,
XFA_ATTRIBUTE_Truncate,
XFA_ATTRIBUTE_WideNarrowRatio,
XFA_ATTRIBUTE_ErrorCorrectionLevel,
XFA_ATTRIBUTE_UpsMode,
XFA_ATTRIBUTE_Checksum,
XFA_ATTRIBUTE_CharEncoding,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_DataColumnCount,
XFA_ATTRIBUTE_RowColumnRatio,
XFA_ATTRIBUTE_DataLength,
XFA_ATTRIBUTE_EndChar,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Format,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Output,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Input,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_DataDescription,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Highlight,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Break,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Hand,
XFA_ATTRIBUTE_X,
XFA_ATTRIBUTE_Y,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Level,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_ColSpan,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_WordCharacterCount,
XFA_ATTRIBUTE_Hyphenate,
XFA_ATTRIBUTE_ExcludeInitialCap,
XFA_ATTRIBUTE_PushCharacterCount,
XFA_ATTRIBUTE_RemainCharacterCount,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_ExcludeAllCaps,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Rid,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_MaxChars,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Url,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_CredentialServerPolicy,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_UrlPolicy,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Connection,
XFA_ATTRIBUTE_Target,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_X,
XFA_ATTRIBUTE_Y,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_NumberOfCells,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_H,
XFA_ATTRIBUTE_W,
XFA_ATTRIBUTE_X,
XFA_ATTRIBUTE_Y,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_HAlign,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Access,
XFA_ATTRIBUTE_Rotate,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_VAlign,
XFA_ATTRIBUTE_MaxH,
XFA_ATTRIBUTE_MaxW,
XFA_ATTRIBUTE_MinH,
XFA_ATTRIBUTE_MinW,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_ColSpan,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Locale,
XFA_ATTRIBUTE_AnchorType,
XFA_ATTRIBUTE_AccessKey,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_H,
XFA_ATTRIBUTE_W,
XFA_ATTRIBUTE_X,
XFA_ATTRIBUTE_Y,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Cap,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Stroke,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_Thickness,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Rate,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_SourceBelow,
XFA_ATTRIBUTE_OutputBelow,
XFA_ATTRIBUTE_SourceAbove,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_H,
XFA_ATTRIBUTE_W,
XFA_ATTRIBUTE_X,
XFA_ATTRIBUTE_Y,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_HAlign,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Access,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_VAlign,
XFA_ATTRIBUTE_MaxH,
XFA_ATTRIBUTE_MaxW,
XFA_ATTRIBUTE_MinH,
XFA_ATTRIBUTE_MinW,
XFA_ATTRIBUTE_Layout,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_ColSpan,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_AnchorType,
XFA_ATTRIBUTE_AccessKey,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Rid,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Scope,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Connection,
XFA_ATTRIBUTE_RunAt,
XFA_ATTRIBUTE_ExecuteType,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Picker,
XFA_ATTRIBUTE_HScrollPolicy,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_ContentType,
XFA_ATTRIBUTE_TransferEncoding,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Aspect,
XFA_ATTRIBUTE_Href,
XFA_ATTRIBUTE_Value,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Server,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_FracDigits,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_LeadDigits,
XFA_ATTRIBUTE_H,
XFA_ATTRIBUTE_W,
XFA_ATTRIBUTE_X,
XFA_ATTRIBUTE_Y,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_HAlign,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_AllowMacro,
XFA_ATTRIBUTE_ColumnWidths,
XFA_ATTRIBUTE_Access,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_VAlign,
XFA_ATTRIBUTE_MaxH,
XFA_ATTRIBUTE_MaxW,
XFA_ATTRIBUTE_MinH,
XFA_ATTRIBUTE_MinW,
XFA_ATTRIBUTE_Layout,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_MergeMode,
XFA_ATTRIBUTE_ColSpan,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Locale,
XFA_ATTRIBUTE_AnchorType,
XFA_ATTRIBUTE_RestoreState,
XFA_ATTRIBUTE_Scope,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Timeout,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Mode,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Role,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Stroke,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_Inverted,
XFA_ATTRIBUTE_Thickness,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Join,
XFA_ATTRIBUTE_Radius,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_CSpace,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Value,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Next,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Previous,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Intact,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_CommandType,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Data,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_ScriptTest,
XFA_ATTRIBUTE_NullTest,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_FormatTest,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Relation,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_DuplexImposition,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_To,
XFA_ATTRIBUTE_Force,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_From,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Value,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_DataDescription,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Operation,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_BaseProfile,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_ContentType,
XFA_ATTRIBUTE_RunAt,
XFA_ATTRIBUTE_Binding,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_PasswordChar,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_HScrollPolicy,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_HScrollPolicy,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_PagePosition,
XFA_ATTRIBUTE_OddOrEven,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_InitialNumber,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Numbered,
XFA_ATTRIBUTE_BlankOrNotBlank,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Reserve,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Placement,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Rid,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_ContentType,
XFA_ATTRIBUTE_TransferEncoding,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_MaxLength,
XFA_ATTRIBUTE_Href,
XFA_ATTRIBUTE_Abbr,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_WritingScript,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Action,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Trailer,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Target,
XFA_ATTRIBUTE_Leader,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_To,
XFA_ATTRIBUTE_UnicodeRange,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_From,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_TrayOut,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Orientation,
XFA_ATTRIBUTE_ImagingBBox,
XFA_ATTRIBUTE_Short,
XFA_ATTRIBUTE_TrayIn,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Stock,
XFA_ATTRIBUTE_Long,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_VScrollPolicy,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_AllowRichText,
XFA_ATTRIBUTE_MultiLine,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_HScrollPolicy,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_MaxEntries,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_ContentType,
XFA_ATTRIBUTE_Contains,
XFA_ATTRIBUTE_Value,
XFA_ATTRIBUTE_IsNull,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_DataDescription,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Operation,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Target,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_ContentType,
XFA_ATTRIBUTE_TransferEncoding,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Match,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Hand,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_H,
XFA_ATTRIBUTE_W,
XFA_ATTRIBUTE_X,
XFA_ATTRIBUTE_Y,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_HAlign,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Rotate,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_VAlign,
XFA_ATTRIBUTE_MaxH,
XFA_ATTRIBUTE_MaxW,
XFA_ATTRIBUTE_MinH,
XFA_ATTRIBUTE_MinW,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_ColSpan,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Locale,
XFA_ATTRIBUTE_AnchorType,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Rid,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Priority,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Disable,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Value,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_LineThrough,
XFA_ATTRIBUTE_Typeface,
XFA_ATTRIBUTE_FontHorizontalScale,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_KerningMode,
XFA_ATTRIBUTE_Underline,
XFA_ATTRIBUTE_BaselineShift,
XFA_ATTRIBUTE_OverlinePeriod,
XFA_ATTRIBUTE_LetterSpacing,
XFA_ATTRIBUTE_LineThroughPeriod,
XFA_ATTRIBUTE_FontVerticalScale,
XFA_ATTRIBUTE_PsName,
XFA_ATTRIBUTE_Size,
XFA_ATTRIBUTE_Posture,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Weight,
XFA_ATTRIBUTE_UnderlinePeriod,
XFA_ATTRIBUTE_Overline,
XFA_ATTRIBUTE_GenericFamily,
XFA_ATTRIBUTE_Checksum,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Relevant,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Override,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Trailer,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Leader,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_CodeType,
XFA_ATTRIBUTE_Archive,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_CodeBase,
XFA_ATTRIBUTE_ClassId,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Connection,
XFA_ATTRIBUTE_LabelRef,
XFA_ATTRIBUTE_ValueRef,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Override,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Value,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Timeout,
XFA_ATTRIBUTE_Connection,
XFA_ATTRIBUTE_Usage,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_DelayedOpen,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Format,
XFA_ATTRIBUTE_EmbedPDF,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Target,
XFA_ATTRIBUTE_TextEncoding,
XFA_ATTRIBUTE_XdpContent,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Delimiter,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Type,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_StartNew,
XFA_ATTRIBUTE_Trailer,
XFA_ATTRIBUTE_TargetType,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Target,
XFA_ATTRIBUTE_Leader,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Slope,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Hand,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Max,
XFA_ATTRIBUTE_Min,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Initial,
XFA_ATTRIBUTE_Usehref,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Abbr,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Desc,
XFA_ATTRIBUTE_Lock,
XFA_ATTRIBUTE_Id,
XFA_ATTRIBUTE_Name,
XFA_ATTRIBUTE_Ref,
XFA_ATTRIBUTE_Use,
XFA_ATTRIBUTE_Presence,
XFA_ATTRIBUTE_Save,
XFA_ATTRIBUTE_Usehref,
};
const XFA_PACKETINFO g_XFAPacketData[] = {
{0x0, NULL, XFA_XDPPACKET_USER, NULL,
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTMANY},
{0x811929d, L"sourceSet", XFA_XDPPACKET_SourceSet,
L"http://www.xfa.org/schema/xfa-source-set/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0xb843dba, L"pdf", XFA_XDPPACKET_Pdf, L"http://ns.adobe.com/xdp/pdf/",
XFA_XDPPACKET_FLAGS_COMPLETEMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0xc56afbf, L"xdc", XFA_XDPPACKET_Xdc, L"http://www.xfa.org/schema/xdc/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0xc56afcc, L"xdp", XFA_XDPPACKET_XDP, L"http://ns.adobe.com/xdp/",
XFA_XDPPACKET_FLAGS_COMPLETEMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0x132a8fbc, L"xmpmeta", XFA_XDPPACKET_Xmpmeta,
L"http://ns.adobe.com/xmpmeta/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTMANY},
{0x48d004a8, L"xfdf", XFA_XDPPACKET_Xfdf, L"http://ns.adobe.com/xfdf/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0x4e1e39b6, L"config", XFA_XDPPACKET_Config,
L"http://www.xfa.org/schema/xci/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0x5473b6dc, L"localeSet", XFA_XDPPACKET_LocaleSet,
L"http://www.xfa.org/schema/xfa-locale-set/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0x6038580a, L"stylesheet", XFA_XDPPACKET_Stylesheet,
L"http://www.w3.org/1999/XSL/Transform",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTMANY},
{0x803550fc, L"template", XFA_XDPPACKET_Template,
L"http://www.xfa.org/schema/xfa-template/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0x8b036f32, L"signature", XFA_XDPPACKET_Signature,
L"http://www.w3.org/2000/09/xmldsig#",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0x99b95079, L"datasets", XFA_XDPPACKET_Datasets,
L"http://www.xfa.org/schema/xfa-data/",
XFA_XDPPACKET_FLAGS_PREFIXMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0xcd309ff4, L"form", XFA_XDPPACKET_Form,
L"http://www.xfa.org/schema/xfa-form/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
{0xe14c801c, L"connectionSet", XFA_XDPPACKET_ConnectionSet,
L"http://www.xfa.org/schema/xfa-connection-set/",
XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE},
};
const int32_t g_iXFAPacketCount =
sizeof(g_XFAPacketData) / sizeof(XFA_PACKETINFO);
const XFA_SCRIPTHIERARCHY g_XFAScriptIndex[] = {
{0, 0, 0, 2, 316}, {0, 0, 2, 2, 316}, {0, 0, 4, 2, 316},
{0, 0, 6, 8, 316}, {0, 0, 14, 4, 316}, {0, 0, 18, 5, 317},
{0, 0, 23, 2, 316}, {0, 0, 25, 1, 316}, {0, 0, 26, 12, 316},
{0, 0, 38, 2, 316}, {0, 0, 40, 1, 316}, {0, 0, 41, 3, 316},
{0, 0, 44, 2, 316}, {0, 0, 46, 6, 316}, {0, 0, 52, 0, 316},
{0, 0, 52, 2, 319}, {0, 0, 54, 2, 316}, {0, 0, 56, 6, 316},
{0, 0, 62, 0, 316}, {0, 0, 62, 0, 316}, {0, 0, 62, 2, 316},
{0, 0, 64, 2, 316}, {0, 0, 66, 6, 316}, {0, 0, 72, 4, 316},
{0, 0, 76, 7, 316}, {0, 0, 83, 2, 320}, {0, 0, 85, 3, 316},
{0, 0, 88, 3, 316}, {0, 0, 91, 2, 320}, {0, 0, 93, 6, 320},
{0, 0, 99, 4, 316}, {0, 0, 103, 2, 316}, {0, 0, 105, 3, 319},
{0, 0, 108, 4, 316}, {0, 0, 112, 3, 316}, {0, 0, 115, 2, 316},
{0, 0, 117, 6, 316}, {0, 0, 123, 12, 316}, {0, 0, 135, 2, 316},
{0, 0, 137, 5, 316}, {0, 0, 142, 2, 316}, {0, 0, 144, 3, 316},
{0, 0, 147, 1, 316}, {0, 0, 148, 14, 316}, {0, 0, 162, 2, 316},
{0, 0, 164, 2, 316}, {0, 0, 166, 3, 316}, {0, 0, 169, 2, 316},
{0, 0, 171, 2, 316}, {0, 0, 173, 2, 316}, {0, 0, 175, 4, 316},
{0, 0, 179, 2, 316}, {0, 0, 181, 2, 316}, {0, 0, 183, 0, 319},
{0, 0, 183, 20, 316}, {0, 0, 203, 1, 316}, {0, 0, 204, 3, 316},
{0, 0, 207, 2, 316}, {0, 0, 209, 0, 316}, {0, 0, 209, 2, 316},
{0, 0, 211, 2, 316}, {0, 0, 213, 4, 320}, {0, 0, 217, 0, 316},
{0, 0, 217, 1, 316}, {0, 0, 218, 3, 316}, {0, 4, 221, 0, 312},
{4, 1, 221, 1, 316}, {5, 0, 222, 2, 316}, {5, 1, 224, 3, -1},
{6, 0, 227, 0, 316}, {6, 0, 227, 2, 316}, {6, 0, 229, 2, 316},
{6, 0, 231, 3, 316}, {6, 0, 234, 2, 316}, {6, 0, 236, 6, 316},
{6, 0, 242, 10, 317}, {6, 0, 252, 9, 316}, {6, 0, 261, 5, 318},
{6, 0, 266, 4, 318}, {6, 0, 270, 2, 316}, {6, 0, 272, 2, 316},
{6, 0, 274, 5, 316}, {6, 0, 279, 3, 316}, {6, 0, 282, 2, 316},
{6, 0, 284, 2, 316}, {6, 0, 286, 2, 316}, {6, 0, 288, 2, 316},
{6, 0, 290, 4, 316}, {6, 0, 294, 3, 316}, {6, 0, 297, 3, 316},
{6, 0, 300, 2, 316}, {6, 0, 302, 2, 316}, {6, 0, 304, 2, 316},
{6, 13, 306, 36, 317}, {19, 0, 342, 3, 316}, {19, 0, 345, 2, 316},
{19, 0, 347, 2, 316}, {19, 0, 349, 2, 316}, {19, 0, 351, 7, 317},
{19, 2, 358, 16, 312}, {21, 0, 374, 2, 320}, {21, 0, 376, 2, 316},
{21, 0, 378, 0, 316}, {21, 0, 378, 2, 316}, {21, 0, 380, 6, 316},
{21, 0, 386, 3, 316}, {21, 0, 389, 2, 316}, {21, 0, 391, 4, 316},
{21, 0, 395, 0, 316}, {21, 5, 395, 30, 316}, {26, 0, 425, 2, 320},
{26, 0, 427, 3, 316}, {26, 0, 430, 2, 320}, {26, 0, 432, 5, 316},
{26, 0, 437, 2, 316}, {26, 0, 439, 3, 316}, {26, 0, 442, 2, 316},
{26, 0, 444, 8, 316}, {26, 0, 452, 1, 316}, {26, 0, 453, 2, 316},
{26, 0, 455, 2, 316}, {26, 0, 457, 4, 316}, {26, 0, 461, 0, 316},
{26, 0, 461, 2, 316}, {26, 0, 463, 2, 316}, {26, 0, 465, 6, 318},
{26, 5, 471, 31, 317}, {31, 0, 502, 2, 320}, {31, 0, 504, 2, 316},
{31, 0, 506, 2, 316}, {31, 0, 508, 4, 320}, {31, 16, 512, 14, 312},
{47, 0, 526, 2, 316}, {47, 0, 528, 2, 316}, {47, 0, 530, 2, 316},
{47, 0, 532, 2, 316}, {47, 0, 534, 3, 316}, {47, 0, 537, 2, 316},
{47, 0, 539, 3, 316}, {47, 0, 542, 3, 316}, {47, 0, 545, 4, 318},
{47, 0, 549, 4, 316}, {47, 0, 553, 2, 316}, {47, 0, 555, 0, 316},
{47, 0, 555, 2, 316}, {47, 0, 557, 3, 316}, {47, 0, 560, 6, 316},
{47, 0, 566, 2, 316}, {47, 0, 568, 2, 316}, {47, 0, 570, 3, 316},
{47, 19, 573, 1, 312}, {66, 0, 574, 2, 316}, {66, 0, 576, 8, 316},
{66, 0, 584, 2, 316}, {66, 0, 586, 4, 316}, {66, 0, 590, 5, 316},
{66, 0, 595, 3, 316}, {66, 0, 598, 2, 320}, {66, 0, 600, 3, 316},
{66, 0, 603, 7, 316}, {66, 0, 610, 3, 316}, {66, 0, 613, 0, 316},
{66, 0, 613, 4, 317}, {66, 0, 617, 4, 318}, {66, 0, 621, 2, 320},
{66, 0, 623, 5, 316}, {66, 0, 628, 2, 316}, {66, 0, 630, 2, 316},
{66, 0, 632, 2, 320}, {66, 0, 634, 2, 320}, {66, 0, 636, 4, 316},
{66, 0, 640, 2, 316}, {66, 0, 642, 1, 316}, {66, 0, 643, 1, 316},
{66, 0, 644, 4, 316}, {66, 0, 648, 3, 316}, {66, 7, 651, 2, 319},
{73, 0, 653, 2, 316}, {73, 0, 655, 2, 316}, {73, 0, 657, 3, 316},
{73, 4, 660, 4, 312}, {77, 0, 664, 10, 316}, {77, 0, 674, 2, 316},
{77, 0, 676, 4, 316}, {77, 0, 680, 4, 316}, {77, 0, 684, 3, 316},
{77, 0, 687, 2, 316}, {77, 0, 689, 2, 316}, {77, 0, 691, 8, 317},
{77, 0, 699, 3, 316}, {77, 0, 702, 3, 316}, {77, 0, 705, 2, 316},
{77, 0, 707, 2, 316}, {77, 0, 709, 5, 316}, {77, 0, 714, 4, 316},
{77, 0, 718, 2, 316}, {77, 0, 720, 8, 318}, {77, 0, 728, 1, 316},
{77, 0, 729, 2, 320}, {77, 0, 731, 3, 316}, {77, 1, 734, 4, 316},
{78, 0, 738, 5, 316}, {78, 0, 743, 3, 316}, {78, 0, 746, 1, 316},
{78, 0, 747, 2, 320}, {78, 0, 749, 0, 313}, {78, 0, 749, 2, 316},
{78, 5, 751, 3, 316}, {83, 0, 754, 5, 316}, {83, 0, 759, 7, 316},
{83, 0, 766, 6, 316}, {83, 0, 772, 3, 316}, {83, 0, 775, 2, 316},
{83, 0, 777, 5, 316}, {83, 0, 782, 2, 316}, {83, 0, 784, 0, 314},
{83, 0, 784, 2, 316}, {83, 0, 786, 1, 316}, {83, 0, 787, 2, 316},
{83, 0, 789, 5, 316}, {83, 0, 794, 2, 316}, {83, 0, 796, 1, 316},
{83, 0, 797, 2, 316}, {83, 0, 799, 2, 316}, {83, 0, 801, 6, 316},
{83, 0, 807, 2, 316}, {83, 0, 809, 2, 320}, {83, 0, 811, 3, 316},
{83, 0, 814, 4, 316}, {83, 0, 818, 2, 316}, {83, 0, 820, 2, 316},
{83, 0, 822, 2, 316}, {83, 0, 824, 2, 316}, {83, 0, 826, 2, 316},
{83, 0, 828, 2, 316}, {83, 0, 830, 4, 318}, {83, 1, 834, 2, 316},
{84, 0, 836, 5, 316}, {84, 0, 841, 20, 317}, {84, 0, 861, 2, 316},
{84, 0, 863, 0, 316}, {84, 0, 863, 2, 316}, {84, 0, 865, 4, 320},
{84, 0, 869, 0, 316}, {84, 0, 869, 2, 316}, {84, 0, 871, 1, 316},
{84, 0, 872, 2, 316}, {84, 0, 874, 3, 316}, {84, 0, 877, 2, 316},
{84, 0, 879, 2, 316}, {84, 0, 881, 4, 316}, {84, 0, 885, 3, 316},
{84, 0, 888, 17, 316}, {84, 6, 905, 1, 319}, {90, 0, 906, 2, 316},
{90, 0, 908, 2, 320}, {90, 0, 910, 2, 320}, {90, 0, 912, 2, 316},
{90, 0, 914, 2, 316}, {90, 0, 916, 4, 318}, {90, 0, 920, 2, 316},
{90, 5, 922, 0, 312}, {95, 0, 922, 2, 316}, {95, 0, 924, 4, 316},
{95, 0, 928, 4, 316}, {95, 0, 932, 6, 316}, {95, 0, 938, 2, 316},
{95, 0, 940, 4, 316}, {95, 0, 944, 3, 316}, {95, 0, 947, 3, 316},
{95, 0, 950, 2, 316}, {95, 0, 952, 3, 316}, {95, 0, 955, 0, 316},
{95, 0, 955, 0, 316}, {95, 0, 955, 2, 316}, {95, 0, 957, 7, 316},
{95, 0, 964, 2, 316}, {95, 0, 966, 0, 319}, {95, 0, 966, 7, 316},
{95, 0, 973, 2, 316}, {95, 0, 975, 2, 316}, {95, 3, 977, 1, 316},
{98, 0, 978, 2, 320}, {98, 0, 980, 4, 316}, {98, 0, 984, 0, 316},
{98, 0, 984, 2, 316}, {98, 0, 986, 2, 316}, {98, 0, 988, 4, 316},
{98, 0, 992, 1, 316}, {98, 0, 993, 2, 316}, {98, 0, 995, 2, 316},
{98, 0, 997, 3, 316}, {98, 0, 1000, 2, 317}, {98, 0, 1002, 0, 316},
{98, 0, 1002, 4, 316}, {98, 0, 1006, 4, 316}, {98, 0, 1010, 2, 316},
{98, 0, 1012, 3, 316}, {98, 0, 1015, 4, 316}, {98, 0, 1019, 7, 316},
{98, 0, 1026, 4, 316}, {98, 0, 1030, 1, 313}, {98, 17, 1031, 3, 316},
{115, 0, 1034, 5, 316}, {115, 0, 1039, 2, 316}, {115, 0, 1041, 1, 316},
{115, 0, 1042, 4, 316}, {115, 0, 1046, 2, 316}, {115, 0, 1048, 2, 316},
{115, 0, 1050, 1, 316}, {115, 0, 1051, 2, 316}, {115, 0, 1053, 5, 316},
{115, 0, 1058, 1, -1}, {115, 4, 1059, 1, 312}, {119, 1, 1060, 0, 313},
{120, 2, 1060, 8, 312}, {122, 11, 1068, 6, 315}, {133, 2, 1074, 0, 316},
{135, 0, 1074, 0, 316}, {135, 3, 1074, 2, 316}, {138, 0, 1076, 2, 316},
};
const XFA_METHODINFO g_SomMethodData[] = {
{0x3c752495, L"verify", (XFA_METHOD_CALLBACK)&CScript_SignaturePseudoModel::
Script_SignaturePseudoModel_Verify},
{0xa68635f1, L"sign", (XFA_METHOD_CALLBACK)&CScript_SignaturePseudoModel::
Script_SignaturePseudoModel_Sign},
{0xa7f2c5e6, L"enumerate",
(XFA_METHOD_CALLBACK)&CScript_SignaturePseudoModel::
Script_SignaturePseudoModel_Enumerate},
{0xd8ed1467, L"clear", (XFA_METHOD_CALLBACK)&CScript_SignaturePseudoModel::
Script_SignaturePseudoModel_Clear},
{0x4bdcce13, L"execute",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_WsdlConnection_Execute},
{0x1c296ba4, L"restore",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Delta_Restore},
{0x7d123a9, L"clearItems",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_ClearItems},
{0xfb0b007, L"execEvent",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_ExecEvent},
{0x6716ce97, L"execInitialize",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_ExecInitialize},
{0x7bb919c2, L"deleteItem",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_DeleteItem},
{0x9f053d5e, L"getSaveItem",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_GetSaveItem},
{0xbbd32747, L"boundItem",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_BoundItem},
{0xc492d950, L"getItemState",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_GetItemState},
{0xc6013cd3, L"execCalculate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_ExecCalculate},
{0xd8930d0e, L"setItems",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_SetItems},
{0xe0f15045, L"getDisplayItem",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_GetDisplayItem},
{0xe23acddc, L"setItemState",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_SetItemState},
{0xe2dfb2f8, L"addItem",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_AddItem},
{0xef8ce48f, L"execValidate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Field_ExecValidate},
{0x461079ef, L"emit", (XFA_METHOD_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_Emit},
{0xfec90c63, L"reset", (XFA_METHOD_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_Reset},
{0xfb0b007, L"execEvent",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ExclGroup_ExecEvent},
{0x3d832221, L"selectedMember",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ExclGroup_SelectedMember},
{0x6716ce97, L"execInitialize",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ExclGroup_ExecInitialize},
{0xc6013cd3, L"execCalculate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ExclGroup_ExecCalculate},
{0xef8ce48f, L"execValidate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ExclGroup_ExecValidate},
{0xfb0b007, L"execEvent",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Subform_ExecEvent},
{0x6716ce97, L"execInitialize",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Subform_ExecInitialize},
{0xc6013cd3, L"execCalculate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Subform_ExecCalculate},
{0xd9b9b1f1, L"getInvalidObjects",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Subform_GetInvalidObjects},
{0xef8ce48f, L"execValidate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Subform_ExecValidate},
{0xa366b7c, L"exportData", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_ExportData},
{0x16cc226c, L"gotoURL", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_GotoURL},
{0x1e0722f5, L"pageDown", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_PageDown},
{0x3e66cb2c, L"setFocus", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_SetFocus},
{0x4ac9faae, L"openList", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_OpenList},
{0x7b89714f, L"response", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Response},
{0x7fd9fd58, L"documentInBatch",
(XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_DocumentInBatch},
{0xaf1d019d, L"resetData", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_ResetData},
{0xb07be13c, L"beep", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Beep},
{0xb1882ca0, L"getFocus", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_GetFocus},
{0xbf4ba9ee, L"messageBox", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_MessageBox},
{0xd6d4dbc1, L"documentCountInBatch",
(XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_DocumentCountInBatch},
{0xdd7676ed, L"print", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Print},
{0xe2f863d0, L"currentDateTime",
(XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_CurrentDateTime},
{0xf995d0f5, L"importData", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_ImportData},
{0xfeb96b62, L"pageUp", (XFA_METHOD_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_PageUp},
{0x68, L"h", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_H},
{0x77, L"w", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_W},
{0x78, L"x", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_X},
{0x79, L"y", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_Y},
{0x5460206, L"pageCount", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_PageCount},
{0x5eb5b0f, L"pageSpan", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_PageSpan},
{0x10f1b1bd, L"page", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_Page},
{0x1c1e6318, L"pageContent",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_PageContent},
{0x1c1f4a5c, L"absPageCount",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_AbsPageCount},
{0x1ec47db5, L"absPageCountInBatch",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_AbsPageCountInBatch},
{0x2e4ecbdb, L"sheetCountInBatch",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_SheetCountInBatch},
{0x2fcff4b5, L"relayout", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_Relayout},
{0x3bf1c2a5, L"absPageSpan",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_AbsPageSpan},
{0x5775c2cc, L"absPageInBatch",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_AbsPageInBatch},
{0x8c5feb32, L"sheetInBatch",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_SheetInBatch},
{0x8f3a8379, L"sheet", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_Sheet},
{0x96f3c4cb, L"relayoutPageArea",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_RelayoutPageArea},
{0xd2a4a542, L"sheetCount",
(XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_SheetCount},
{0xe74f0653, L"absPage", (XFA_METHOD_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_AbsPage},
{0x44c352ad, L"formNodes",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Template_FormNodes},
{0x45efb847, L"remerge",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Template_Remerge},
{0x6716ce97, L"execInitialize",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Template_ExecInitialize},
{0x712c6afa, L"createNode",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Template_CreateNode},
{0xa8a35e25, L"recalculate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Template_Recalculate},
{0xc6013cd3, L"execCalculate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Template_ExecCalculate},
{0xef8ce48f, L"execValidate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Template_ExecValidate},
{0x4cc1c0f9, L"moveCurrentRecord",
(XFA_METHOD_CALLBACK)&CScript_DataWindow::
Script_DataWindow_MoveCurrentRecord},
{0x5779d65f, L"record",
(XFA_METHOD_CALLBACK)&CScript_DataWindow::Script_DataWindow_Record},
{0x8a476498, L"gotoRecord",
(XFA_METHOD_CALLBACK)&CScript_DataWindow::Script_DataWindow_GotoRecord},
{0xaac241c8, L"isRecordGroup",
(XFA_METHOD_CALLBACK)&CScript_DataWindow::Script_DataWindow_IsRecordGroup},
{0x1c6f4277, L"evaluate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Manifest_Evaluate},
{0x2afec2cc, L"moveInstance",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_InstanceManager_MoveInstance},
{0x2bf94a63, L"removeInstance",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_InstanceManager_RemoveInstance},
{0x303adaf4, L"setInstances",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_InstanceManager_SetInstances},
{0x4d76b89e, L"addInstance",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_InstanceManager_AddInstance},
{0xc660dc8a, L"insertInstance",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_InstanceManager_InsertInstance},
{0xddfd1ea1, L"metadata",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Desc_Metadata},
{0x44c352ad, L"formNodes",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Form_FormNodes},
{0x45efb847, L"remerge",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Form_Remerge},
{0x6716ce97, L"execInitialize",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Form_ExecInitialize},
{0xa8a35e25, L"recalculate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Form_Recalculate},
{0xc6013cd3, L"execCalculate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Form_ExecCalculate},
{0xef8ce48f, L"execValidate",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Form_ExecValidate},
{0x60490a85, L"message", (XFA_METHOD_CALLBACK)&CScript_LogPseudoModel::
Script_LogPseudoModel_Message},
{0x60ecfcc9, L"traceDeactivate",
(XFA_METHOD_CALLBACK)&CScript_LogPseudoModel::
Script_LogPseudoModel_TraceDeactivate},
{0x86a0f4c0, L"traceActivate",
(XFA_METHOD_CALLBACK)&CScript_LogPseudoModel::
Script_LogPseudoModel_TraceActivate},
{0x93eac39a, L"traceEnabled", (XFA_METHOD_CALLBACK)&CScript_LogPseudoModel::
Script_LogPseudoModel_TraceEnabled},
{0xd1227e6f, L"trace",
(XFA_METHOD_CALLBACK)&CScript_LogPseudoModel::Script_LogPseudoModel_Trace},
{0x36c0ee14, L"getAttribute",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Packet_GetAttribute},
{0x5468e2a0, L"setAttribute",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Packet_SetAttribute},
{0xadc48de2, L"removeAttribute",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Packet_RemoveAttribute},
{0x3848b3f, L"next", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Next},
{0x14e25bc8, L"cancelBatch",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_CancelBatch},
{0x3ce05d68, L"first",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_First},
{0x649e1e65, L"updateBatch",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_UpdateBatch},
{0x6a3405dd, L"previous",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Previous},
{0x74818fb3, L"isBOF",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_IsBOF},
{0x74d07a76, L"isEOF",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_IsEOF},
{0x7613cb66, L"cancel",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Cancel},
{0x7baca2e3, L"update",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Update},
{0x8b90e1f2, L"open", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Open},
{0x9c6471b3, L"delete",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Delete},
{0xa7315093, L"addNew",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_AddNew},
{0xa7ce5f8d, L"requery",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Requery},
{0xc7368674, L"resync",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Resync},
{0xd9f47f36, L"close",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Close},
{0xf54481d4, L"last", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_Last},
{0xf7965460, L"hasDataChanged",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_Source_HasDataChanged},
{0x6275f6af, L"item",
(XFA_METHOD_CALLBACK)&CXFA_NodeList::Script_ListClass_Item},
{0x7033bfd5, L"insert",
(XFA_METHOD_CALLBACK)&CXFA_NodeList::Script_ListClass_Insert},
{0x9cab7cae, L"remove",
(XFA_METHOD_CALLBACK)&CXFA_NodeList::Script_ListClass_Remove},
{0xda12e518, L"append",
(XFA_METHOD_CALLBACK)&CXFA_NodeList::Script_ListClass_Append},
{0xd892a054, L"namedItem",
(XFA_METHOD_CALLBACK)&CXFA_NodeList::Script_TreelistClass_NamedItem},
{0xba2dd386, L"resolveNode",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_TreeClass_ResolveNode},
{0xe509e2b9, L"resolveNodes",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_TreeClass_ResolveNodes},
{0x1bca1ebd, L"applyXSL",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_ApplyXSL},
{0x36c0ee14, L"getAttribute",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_GetAttribute},
{0x5468e2a0, L"setAttribute",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_SetAttribute},
{0x5ee00996, L"setElement",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_SetElement},
{0x92dada4f, L"saveFilteredXML",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_SaveFilteredXML},
{0x9c456500, L"saveXML",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_SaveXML},
{0xabd3200a, L"getElement",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_GetElement},
{0xb269c60d, L"isPropertySpecified",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_IsPropertySpecified},
{0xb528be91, L"loadXML",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_LoadXML},
{0xd9f46591, L"clone",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_Clone},
{0xe006a76b, L"assignNode",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_AssignNode},
{0x7303fcea, L"getDelta",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ContainerClass_GetDelta},
{0xe7742c9d, L"getDeltas",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ContainerClass_GetDeltas},
{0x30ff6aad, L"clearErrorList",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_ClearErrorList},
{0x712c6afa, L"createNode",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_CreateNode},
{0x83a6411d, L"isCompatibleNS",
(XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_IsCompatibleNS},
};
const int32_t g_iSomMethodCount =
sizeof(g_SomMethodData) / sizeof(XFA_METHODINFO);
const XFA_SCRIPTATTRIBUTEINFO g_SomAttributeData[] = {
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xb3543a6, L"max",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Max, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x45a6daf8, L"eofAction",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_EofAction, XFA_SCRIPT_Basic},
{0x5ec958c0, L"cursorType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CursorType, XFA_SCRIPT_Basic},
{0x79975f2b, L"lockType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LockType, XFA_SCRIPT_Basic},
{0xa5340ff5, L"bofAction",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_BofAction, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc5762157, L"cursorLocation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CursorLocation, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1ee2d24d, L"instanceIndex",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_InstanceIndex, -1,
XFA_SCRIPT_Basic},
{0x8c99377e, L"relation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relation, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0x3106c3a, L"beforeTarget",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_BeforeTarget, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x13a08bdb, L"overflowTarget",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_OverflowTarget, XFA_SCRIPT_Basic},
{0x169134a1, L"overflowLeader",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_OverflowLeader, XFA_SCRIPT_Basic},
{0x20914367, L"overflowTrailer",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_OverflowTrailer, XFA_SCRIPT_Basic},
{0x453eaf38, L"startNew",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_StartNew, XFA_SCRIPT_Basic},
{0x64110ab5, L"bookendTrailer",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_BookendTrailer, XFA_SCRIPT_Basic},
{0xb6b44172, L"after",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_After, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc3c1442f, L"bookendLeader",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_BookendLeader, XFA_SCRIPT_Basic},
{0xcb150479, L"afterTarget",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AfterTarget, XFA_SCRIPT_Basic},
{0xf4ffce73, L"before",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Before, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue_Read, -1,
XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x47cfa43a, L"allowNeutral",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AllowNeutral, XFA_SCRIPT_Basic},
{0x7c2fd80b, L"mark",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Mark, XFA_SCRIPT_Basic},
{0x8ed182d1, L"shape",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Shape, XFA_SCRIPT_Basic},
{0xa686975b, L"size",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Size, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x5c054755, L"startAngle",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_StartAngle, XFA_SCRIPT_Basic},
{0x74788f8b, L"sweepAngle",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_SweepAngle, XFA_SCRIPT_Basic},
{0x9d833d75, L"circular",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Circular, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd996fa9b, L"hand",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Hand, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xb0e5485d, L"bind",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Bind, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xcd7f7b54, L"from",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_From, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x8e29d794, L"signatureType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_SignatureType, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe11a2cbc, L"permissions",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Permissions, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x453eaf38, L"startNew",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_StartNew, XFA_SCRIPT_Basic},
{0x9dcc3ab3, L"trailer",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Trailer, XFA_SCRIPT_Basic},
{0xa6118c89, L"targetType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TargetType, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc8da4da7, L"target",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Target, XFA_SCRIPT_Basic},
{0xcbcaf66d, L"leader",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Leader, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x2d574d58, L"this", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Xfa_This,
-1, XFA_SCRIPT_Object},
{0x4fdc3454, L"timeStamp",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TimeStamp, XFA_SCRIPT_Basic},
{0xb598a1f7, L"uuid",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Uuid, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xcfea02e, L"leftInset",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LeftInset, XFA_SCRIPT_Basic},
{0x1356caf8, L"bottomInset",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_BottomInset, XFA_SCRIPT_Basic},
{0x25764436, L"topInset",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TopInset, XFA_SCRIPT_Basic},
{0x8a692521, L"rightInset",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_RightInset, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1e459b8f, L"nonRepudiation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_NonRepudiation, XFA_SCRIPT_Basic},
{0x2bb3f470, L"encipherOnly",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_EncipherOnly, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0x5f760b50, L"digitalSignature",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DigitalSignature, XFA_SCRIPT_Basic},
{0x69aa2292, L"crlSign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CrlSign, XFA_SCRIPT_Basic},
{0x98fd4d81, L"keyAgreement",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_KeyAgreement, XFA_SCRIPT_Basic},
{0xa66404cb, L"keyEncipherment",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_KeyEncipherment, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xca5dc27c, L"dataEncipherment",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataEncipherment, XFA_SCRIPT_Basic},
{0xe8f118a8, L"keyCertSign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_KeyCertSign, XFA_SCRIPT_Basic},
{0xfea53ec6, L"decipherOnly",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DecipherOnly, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x8b90e1f2, L"open",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Open, XFA_SCRIPT_Basic},
{0x957fa006, L"commitOn",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CommitOn, XFA_SCRIPT_Basic},
{0xb12128b7, L"textEntry",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TextEntry, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0x2282c73, L"hAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HAlign, XFA_SCRIPT_Basic},
{0x8d4f1c7, L"textIndent",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TextIndent, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2a82d99c, L"marginRight",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MarginRight, XFA_SCRIPT_Basic},
{0x534729c9, L"marginLeft",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MarginLeft, XFA_SCRIPT_Basic},
{0x5739d1ff, L"radixOffset",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_RadixOffset, XFA_SCRIPT_Basic},
{0x577682ac, L"preserve",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Preserve, XFA_SCRIPT_Basic},
{0x731e0665, L"spaceBelow",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_SpaceBelow, XFA_SCRIPT_Basic},
{0x7a7cc341, L"vAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_VAlign, XFA_SCRIPT_Basic},
{0x836d4d7c, L"tabDefault",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TabDefault, XFA_SCRIPT_Basic},
{0x8fa01790, L"tabStops",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TabStops, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd4b01921, L"lineHeight",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LineHeight, XFA_SCRIPT_Basic},
{0xe18b5659, L"spaceAbove",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_SpaceAbove, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd861f8af, L"addRevocationInfo",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AddRevocationInfo, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbb8df5d, L"ref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Ref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6128d8d, L"activity",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Activity, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x43e349b, L"dataRowCount",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataRowCount, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x28e17e91, L"dataPrep",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataPrep, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0x3650557e, L"textLocation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TextLocation, XFA_SCRIPT_Basic},
{0x3b582286, L"moduleWidth",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ModuleWidth, XFA_SCRIPT_Basic},
{0x52666f1c, L"printCheckDigit",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_PrintCheckDigit, XFA_SCRIPT_Basic},
{0x5404d6df, L"moduleHeight",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ModuleHeight, XFA_SCRIPT_Basic},
{0x5ab23b6c, L"startChar",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_StartChar, XFA_SCRIPT_Basic},
{0x7c732a66, L"truncate",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Truncate, XFA_SCRIPT_Basic},
{0x8d181d61, L"wideNarrowRatio",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_WideNarrowRatio, XFA_SCRIPT_Basic},
{0x99800d7a, L"errorCorrectionLevel",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ErrorCorrectionLevel, XFA_SCRIPT_Basic},
{0x9a63da3d, L"upsMode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_UpsMode, XFA_SCRIPT_Basic},
{0xaf754613, L"checksum",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Checksum, XFA_SCRIPT_Basic},
{0xb045fbc5, L"charEncoding",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CharEncoding, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc035c6b1, L"dataColumnCount",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataColumnCount, XFA_SCRIPT_Basic},
{0xd3c84d25, L"rowColumnRatio",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_RowColumnRatio, XFA_SCRIPT_Basic},
{0xd57c513c, L"dataLength",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataLength, XFA_SCRIPT_Basic},
{0xf575ca75, L"endChar",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_EndChar, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0x28dee6e9, L"format",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Format, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x60d4c8b1, L"output",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Output, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6a39990, L"input",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Input, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x2b5df51e, L"dataDescription",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataDescription, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x6c0d9600, L"currentValue",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Delta_CurrentValue, -1,
XFA_SCRIPT_Basic},
{0x942643f0, L"savedValue",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Delta_SavedValue, -1,
XFA_SCRIPT_Basic},
{0xc8da4da7, L"target",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Delta_Target, -1,
XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd4cc53f8, L"highlight",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Highlight, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x5518c25, L"break",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Break, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd996fa9b, L"hand",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Hand, XFA_SCRIPT_Basic},
{0x78, L"x", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_X, XFA_SCRIPT_Basic},
{0x79, L"y", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Y, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1059ec18, L"level",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_Integer,
XFA_ATTRIBUTE_Level, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xac06e2b0, L"colSpan",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ColSpan, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x21aed, L"id",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Id, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f105f72, L"wordCharacterCount",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_WordCharacterCount, XFA_SCRIPT_Basic},
{0x3d123c26, L"hyphenate",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Hyphenate, XFA_SCRIPT_Basic},
{0x66539c48, L"excludeInitialCap",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ExcludeInitialCap, XFA_SCRIPT_Basic},
{0x6a95c976, L"pushCharacterCount",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_PushCharacterCount, XFA_SCRIPT_Basic},
{0x982bd892, L"remainCharacterCount",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_RemainCharacterCount, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe5c96d6a, L"excludeAllCaps",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ExcludeAllCaps, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x8af2e657, L"maxChars",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxChars, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc080cd3, L"url",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Url, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa6710262, L"credentialServerPolicy",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CredentialServerPolicy, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc2ba0923, L"urlPolicy",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_UrlPolicy, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x47d03490, L"connection",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Connection, XFA_SCRIPT_Basic},
{0xc8da4da7, L"target",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Target, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x78bff531, L"numberOfCells",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_Integer,
XFA_ATTRIBUTE_NumberOfCells, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x68, L"h", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_H, XFA_SCRIPT_Basic},
{0x77, L"w", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_W, XFA_SCRIPT_Basic},
{0x78, L"x", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_X, XFA_SCRIPT_Basic},
{0x79, L"y", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Y, XFA_SCRIPT_Basic},
{0x2282c73, L"hAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HAlign, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1abbd7e0, L"dataNode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DataNode, -1,
XFA_SCRIPT_Object},
{0x25839852, L"access",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Access, XFA_SCRIPT_Basic},
{0x2ee7678f, L"rotate",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Rotate, XFA_SCRIPT_Basic},
{0x3b1ddd06, L"fillColor",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_FillColor, -1,
XFA_SCRIPT_Basic},
{0x54c399e3, L"formattedValue",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Field_FormattedValue, -1,
XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0x5a3b375d, L"borderColor",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_BorderColor, -1,
XFA_SCRIPT_Basic},
{0x5e936ed6, L"fontColor",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_FontColor, -1,
XFA_SCRIPT_Basic},
{0x6826c408, L"parentSubform",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Field_ParentSubform, -1,
XFA_SCRIPT_Basic},
{0x79b67434, L"mandatoryMessage",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_MandatoryMessage, -1,
XFA_SCRIPT_Basic},
{0x7a7cc341, L"vAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_VAlign, XFA_SCRIPT_Basic},
{0x7c2ff6ae, L"maxH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxH, XFA_SCRIPT_Basic},
{0x7c2ff6bd, L"maxW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxW, XFA_SCRIPT_Basic},
{0x7d02356c, L"minH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinH, XFA_SCRIPT_Basic},
{0x7d02357b, L"minW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinW, XFA_SCRIPT_Basic},
{0x85fd6faf, L"mandatory",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_Mandatory, -1,
XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0x964fb42e, L"formatMessage",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Field_FormatMessage, -1,
XFA_SCRIPT_Basic},
{0xa03cf627, L"rawValue",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xa60dd202, L"length",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Field_Length, -1,
XFA_SCRIPT_Basic},
{0xac06e2b0, L"colSpan",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ColSpan, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbc8fa350, L"locale",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Locale, XFA_SCRIPT_Basic},
{0xc2bd40fd, L"anchorType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AnchorType, XFA_SCRIPT_Basic},
{0xc4fed09b, L"accessKey",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AccessKey, XFA_SCRIPT_Basic},
{0xcabfa3d0, L"validationMessage",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_ValidationMessage, -1,
XFA_SCRIPT_Basic},
{0xdcecd663, L"editValue",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Field_EditValue, -1,
XFA_SCRIPT_Basic},
{0xe07e5061, L"selectedIndex",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Field_SelectedIndex, -1,
XFA_SCRIPT_Basic},
{0xf65e34be, L"borderWidth",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_BorderWidth, -1,
XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x68, L"h", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_H, XFA_SCRIPT_Basic},
{0x77, L"w", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_W, XFA_SCRIPT_Basic},
{0x78, L"x", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_X, XFA_SCRIPT_Basic},
{0x79, L"y", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Y, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd843798, L"fullText", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_FullText,
-1, XFA_SCRIPT_Basic},
{0x1b6d1cf5, L"reenter", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_Reenter,
-1, XFA_SCRIPT_Basic},
{0x1e6ffa9a, L"prevContentType",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_PrevContentType,
-1, XFA_SCRIPT_Basic},
{0x25a3c206, L"soapFaultString",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_SoapFaultString,
-1, XFA_SCRIPT_Basic},
{0x2e00c007, L"newContentType",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_NewContentType,
-1, XFA_SCRIPT_Basic},
{0x4570500f, L"modifier",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_Modifier,
-1, XFA_SCRIPT_Basic},
{0x50e2e33b, L"selEnd", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_SelEnd,
-1, XFA_SCRIPT_Basic},
{0x57de87c2, L"prevText",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_PrevText,
-1, XFA_SCRIPT_Basic},
{0x6ea04e0a, L"soapFaultCode",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_SoapFaultCode,
-1, XFA_SCRIPT_Basic},
{0x6f6556cf, L"newText", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_NewText,
-1, XFA_SCRIPT_Basic},
{0x891f4606, L"change", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_Change,
-1, XFA_SCRIPT_Basic},
{0x8fa3c19e, L"shift", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_Shift,
-1, XFA_SCRIPT_Basic},
{0xa9d9b2e1, L"keyDown", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_KeyDown,
-1, XFA_SCRIPT_Basic},
{0xbfc89db2, L"selStart",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_SelStart,
-1, XFA_SCRIPT_Basic},
{0xc32a5812, L"commitKey",
(XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_CommitKey,
-1, XFA_SCRIPT_Basic},
{0xc8da4da7, L"target", (XFA_ATTRIBUTE_CALLBACK)&CScript_EventPseudoModel::
Script_EventPseudoModel_Target,
-1, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xa2e3514, L"cap",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Cap, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x5392ea58, L"stroke",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Stroke, XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0x94446dcc, L"thickness",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Thickness, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1ec8ab2c, L"rate",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Rate, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x7b29630a, L"sourceBelow",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_SourceBelow, XFA_SCRIPT_Basic},
{0x8fc36c0a, L"outputBelow",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_OutputBelow, XFA_SCRIPT_Basic},
{0xe996b2fe, L"sourceAbove",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_SourceAbove, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x68, L"h", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_H, XFA_SCRIPT_Basic},
{0x77, L"w", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_W, XFA_SCRIPT_Basic},
{0x78, L"x", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_X, XFA_SCRIPT_Basic},
{0x79, L"y", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Y, XFA_SCRIPT_Basic},
{0x2282c73, L"hAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HAlign, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xf23332f, L"errorText",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ExclGroup_ErrorText, -1,
XFA_SCRIPT_Basic},
{0x1abbd7e0, L"dataNode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DataNode, -1,
XFA_SCRIPT_Object},
{0x25839852, L"access",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Access, XFA_SCRIPT_Basic},
{0x3b1ddd06, L"fillColor",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_FillColor, -1,
XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0x5a3b375d, L"borderColor",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_BorderColor, -1,
XFA_SCRIPT_Basic},
{0x79b67434, L"mandatoryMessage",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_MandatoryMessage, -1,
XFA_SCRIPT_Basic},
{0x7a7cc341, L"vAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_VAlign, XFA_SCRIPT_Basic},
{0x7c2ff6ae, L"maxH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxH, XFA_SCRIPT_Basic},
{0x7c2ff6bd, L"maxW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxW, XFA_SCRIPT_Basic},
{0x7d02356c, L"minH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinH, XFA_SCRIPT_Basic},
{0x7d02357b, L"minW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinW, XFA_SCRIPT_Basic},
{0x7e7e845e, L"layout",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Layout, XFA_SCRIPT_Basic},
{0x846599f8, L"transient",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ExclGroup_Transient, -1,
XFA_SCRIPT_Basic},
{0x85fd6faf, L"mandatory",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_Mandatory, -1,
XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xa03cf627, L"rawValue",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ExclGroup_DefaultAndRawValue,
-1, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ExclGroup_DefaultAndRawValue,
-1, XFA_SCRIPT_Basic},
{0xac06e2b0, L"colSpan",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ColSpan, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc2bd40fd, L"anchorType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AnchorType, XFA_SCRIPT_Basic},
{0xc4fed09b, L"accessKey",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AccessKey, XFA_SCRIPT_Basic},
{0xcabfa3d0, L"validationMessage",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_ValidationMessage, -1,
XFA_SCRIPT_Basic},
{0xf65e34be, L"borderWidth",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_BorderWidth, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xeda9017a, L"scope",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Scope, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x47d03490, L"connection",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Connection, XFA_SCRIPT_Basic},
{0x6cfa828a, L"runAt",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_RunAt, XFA_SCRIPT_Basic},
{0xa1b0d2f5, L"executeType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ExecuteType, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe6f99487, L"hScrollPolicy",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HScrollPolicy, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x42fed1fd, L"contentType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ContentType, XFA_SCRIPT_Basic},
{0x54fa722c, L"transferEncoding",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TransferEncoding, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue_Read, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd171b240, L"aspect",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Aspect, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue_Read, -1,
XFA_SCRIPT_Basic},
{0xdb55fec5, L"href",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Href, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Value, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0x7f6fd3d7, L"server",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Server, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x4b8bc840, L"fracDigits",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_FracDigits, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xde7f92ba, L"leadDigits",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LeadDigits, XFA_SCRIPT_Basic},
{0x68, L"h", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_H, XFA_SCRIPT_Basic},
{0x77, L"w", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_W, XFA_SCRIPT_Basic},
{0x78, L"x", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_X, XFA_SCRIPT_Basic},
{0x79, L"y", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Y, XFA_SCRIPT_Basic},
{0x2282c73, L"hAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HAlign, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1414d431, L"allowMacro",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AllowMacro, XFA_SCRIPT_Basic},
{0x1517dfa1, L"columnWidths",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ColumnWidths, XFA_SCRIPT_Basic},
{0x1abbd7e0, L"dataNode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DataNode, -1,
XFA_SCRIPT_Object},
{0x1ee2d24d, L"instanceIndex",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_InstanceIndex, -1,
XFA_SCRIPT_Basic},
{0x25839852, L"access",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Access, XFA_SCRIPT_Basic},
{0x3b1ddd06, L"fillColor",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_FillColor, -1,
XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0x5a3b375d, L"borderColor",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_BorderColor, -1,
XFA_SCRIPT_Basic},
{0x7a7cc341, L"vAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_VAlign, XFA_SCRIPT_Basic},
{0x7c2ff6ae, L"maxH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxH, XFA_SCRIPT_Basic},
{0x7c2ff6bd, L"maxW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxW, XFA_SCRIPT_Basic},
{0x7d02356c, L"minH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinH, XFA_SCRIPT_Basic},
{0x7d02357b, L"minW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinW, XFA_SCRIPT_Basic},
{0x7e7e845e, L"layout",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Layout, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0x9cc17d75, L"mergeMode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MergeMode, XFA_SCRIPT_Basic},
{0x9f3e9510, L"instanceManager",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Subform_InstanceManager, -1,
XFA_SCRIPT_Object},
{0xac06e2b0, L"colSpan",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ColSpan, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbc8fa350, L"locale",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Subform_Locale, -1,
XFA_SCRIPT_Basic},
{0xc2bd40fd, L"anchorType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AnchorType, XFA_SCRIPT_Basic},
{0xcabfa3d0, L"validationMessage",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_ValidationMessage, -1,
XFA_SCRIPT_Basic},
{0xe4c3a5e5, L"restoreState",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_RestoreState, XFA_SCRIPT_Basic},
{0xeda9017a, L"scope",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Scope, XFA_SCRIPT_Basic},
{0xf65e34be, L"borderWidth",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_BorderWidth, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0x5a50e9e6, L"version",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Handler_Version, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x4107ed, L"foxitAppType",
(XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_FoxitAppType,
-1, XFA_SCRIPT_Basic},
{0x31b19c1, L"name", (XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Name,
-1, XFA_SCRIPT_Basic},
{0x66c1ae9, L"validationsEnabled",
(XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_ValidationsEnabled,
-1, XFA_SCRIPT_Basic},
{0x14d04502, L"title", (XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Title,
-1, XFA_SCRIPT_Basic},
{0x193afe8b, L"foxitName",
(XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_FoxitName,
-1, XFA_SCRIPT_Basic},
{0x392ae445, L"platform", (XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Platform,
-1, XFA_SCRIPT_Basic},
{0x5a50e9e6, L"version", (XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Version,
-1, XFA_SCRIPT_Basic},
{0x66cb1eed, L"variation",
(XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Variation,
-1, XFA_SCRIPT_Basic},
{0x7717cbc4, L"language", (XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_Language,
-1, XFA_SCRIPT_Basic},
{0x86698963, L"appType", (XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_AppType,
-1, XFA_SCRIPT_Basic},
{0x94ff9e8d, L"calculationsEnabled",
(XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_CalculationsEnabled,
-1, XFA_SCRIPT_Basic},
{0xbcd44940, L"currentPage",
(XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_CurrentPage,
-1, XFA_SCRIPT_Basic},
{0xd4286870, L"foxitVersion",
(XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_FoxitVersion,
-1, XFA_SCRIPT_Basic},
{0xd592b920, L"numPages", (XFA_ATTRIBUTE_CALLBACK)&CScript_HostPseudoModel::
Script_HostPseudoModel_NumPages,
-1, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x24d85167, L"timeout",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Timeout, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x7d9fd7c5, L"mode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Mode, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x7d9fd7c5, L"mode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_SubmitFormat_Mode, -1,
XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2038c9b2, L"role",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Role, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xfcef86b5, L"ready", (XFA_ATTRIBUTE_CALLBACK)&CScript_LayoutPseudoModel::
Script_LayoutPseudoModel_Ready,
-1, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x5392ea58, L"stroke",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Stroke, XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0x7b95e661, L"inverted",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Inverted, XFA_SCRIPT_Basic},
{0x94446dcc, L"thickness",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Thickness, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe8dddf50, L"join",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Join, XFA_SCRIPT_Basic},
{0xe948b9a8, L"radius",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Radius, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xabfa6c4f, L"cSpace",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CSpace, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Value, XFA_SCRIPT_Basic},
{0x3848b3f, L"next",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Next, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x6a3405dd, L"previous",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Previous, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xf6b59543, L"intact",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Intact, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x268b7ec1, L"commandType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CommandType, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbde9abda, L"data",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Data, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x5b707a35, L"scriptTest",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ScriptTest, XFA_SCRIPT_Basic},
{0x6b6ddcfb, L"nullTest",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_NullTest, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xe64b1129, L"formatTest",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_FormatTest, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x8c99377e, L"relation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relation, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x25363, L"to",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_To, XFA_SCRIPT_Basic},
{0x66642f8f, L"force",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Force, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xcd7f7b54, L"from",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_From, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Value, XFA_SCRIPT_Basic},
{0x2b5df51e, L"dataDescription",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataDescription, XFA_SCRIPT_Basic},
{0xbb8df5d, L"ref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Ref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x226ca8f1, L"operation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Operation, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xfb67185, L"recordsBefore", (XFA_ATTRIBUTE_CALLBACK)&CScript_DataWindow::
Script_DataWindow_RecordsBefore,
-1, XFA_SCRIPT_Basic},
{0x21d5dfcb, L"currentRecordNumber",
(XFA_ATTRIBUTE_CALLBACK)&CScript_DataWindow::
Script_DataWindow_CurrentRecordNumber,
-1, XFA_SCRIPT_Basic},
{0x312af044, L"recordsAfter", (XFA_ATTRIBUTE_CALLBACK)&CScript_DataWindow::
Script_DataWindow_RecordsAfter,
-1, XFA_SCRIPT_Basic},
{0x6aab37cb, L"isDefined",
(XFA_ATTRIBUTE_CALLBACK)&CScript_DataWindow::Script_DataWindow_IsDefined,
-1, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x42fed1fd, L"contentType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ContentType, XFA_SCRIPT_Basic},
{0x6cfa828a, L"runAt",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_RunAt, XFA_SCRIPT_Basic},
{0xa021b738, L"stateless",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Script_Stateless, -1,
XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xadc4c77b, L"binding",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Binding, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x7a0cc471, L"passwordChar",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_PasswordChar, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe6f99487, L"hScrollPolicy",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HScrollPolicy, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe6f99487, L"hScrollPolicy",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HScrollPolicy, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x14a32d52, L"pagePosition",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_PagePosition, XFA_SCRIPT_Basic},
{0x8340ea66, L"oddOrEven",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_OddOrEven, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xa85e74f3, L"initialNumber",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_InitialNumber, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe9ba472, L"numbered",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Numbered, XFA_SCRIPT_Basic},
{0xd70798c2, L"blankOrNotBlank",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_BlankOrNotBlank, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x34ae103c, L"reserve",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Reserve, XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xf2009339, L"placement",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Placement, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x42fed1fd, L"contentType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ContentType, XFA_SCRIPT_Basic},
{0x54fa722c, L"transferEncoding",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TransferEncoding, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc4547a08, L"maxLength",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxLength, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xdb55fec5, L"href",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Href, XFA_SCRIPT_Basic},
{0x29418bb7, L"abbr",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Abbr, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf531b059, L"writingScript",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_WritingScript, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1b8dce3e, L"action",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Action, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x9dcc3ab3, L"trailer",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Trailer, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc8da4da7, L"target",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Target, XFA_SCRIPT_Basic},
{0xcbcaf66d, L"leader",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Leader, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xb3543a6, L"max",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_InstanceManager_Max, -1,
XFA_SCRIPT_Basic},
{0xb356ca4, L"min",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_InstanceManager_Min, -1,
XFA_SCRIPT_Basic},
{0x6f544d49, L"count",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_InstanceManager_Count, -1,
XFA_SCRIPT_Basic},
{0x25363, L"to",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_To, XFA_SCRIPT_Basic},
{0xa0933954, L"unicodeRange",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_UnicodeRange, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xcd7f7b54, L"from",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_From, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x4ef3d02c, L"orientation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Orientation, XFA_SCRIPT_Basic},
{0x65e30c67, L"imagingBBox",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ImagingBBox, XFA_SCRIPT_Basic},
{0x9041d4b0, L"short",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Short, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe349d044, L"stock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Stock, XFA_SCRIPT_Basic},
{0xf6b4afb0, L"long",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Long, XFA_SCRIPT_Basic},
{0x5ce6195, L"vScrollPolicy",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_VScrollPolicy, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x1ef3a64a, L"allowRichText",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AllowRichText, XFA_SCRIPT_Basic},
{0x5a32e493, L"multiLine",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MultiLine, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe6f99487, L"hScrollPolicy",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HScrollPolicy, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xd52482e0, L"maxEntries",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxEntries, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x42fed1fd, L"contentType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ContentType, XFA_SCRIPT_Basic},
{0x8855805f, L"contains",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Contains, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xe372ae97, L"isNull",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_IsNull, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x2b5df51e, L"dataDescription",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DataDescription, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbb8df5d, L"ref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Ref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x226ca8f1, L"operation",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Operation, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc8da4da7, L"target",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Target, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbb8df5d, L"ref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Ref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x42fed1fd, L"contentType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ContentType, XFA_SCRIPT_Basic},
{0x54fa722c, L"transferEncoding",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TransferEncoding, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xf197844d, L"match",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Match, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd996fa9b, L"hand",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Hand, XFA_SCRIPT_Basic},
{0x21aed, L"id",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Id, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x28dee6e9, L"format",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Encrypt_Format, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x68, L"h", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_H, XFA_SCRIPT_Basic},
{0x77, L"w", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_W, XFA_SCRIPT_Basic},
{0x78, L"x", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_X, XFA_SCRIPT_Basic},
{0x79, L"y", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Y, XFA_SCRIPT_Basic},
{0x2282c73, L"hAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_HAlign, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2ee7678f, L"rotate",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Rotate, XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0x7a7cc341, L"vAlign",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_VAlign, XFA_SCRIPT_Basic},
{0x7c2ff6ae, L"maxH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxH, XFA_SCRIPT_Basic},
{0x7c2ff6bd, L"maxW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MaxW, XFA_SCRIPT_Basic},
{0x7d02356c, L"minH",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinH, XFA_SCRIPT_Basic},
{0x7d02357b, L"minW",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_MinW, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xa03cf627, L"rawValue",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xac06e2b0, L"colSpan",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ColSpan, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbc8fa350, L"locale",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Locale, XFA_SCRIPT_Basic},
{0xc2bd40fd, L"anchorType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_AnchorType, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x39cdb0a2, L"priority",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Priority, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xeb511b54, L"disable",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Disable, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Value, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x21aed, L"id",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Id, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xcb0ac9, L"lineThrough",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LineThrough, XFA_SCRIPT_Basic},
{0x2c1c7f1, L"typeface",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Typeface, XFA_SCRIPT_Basic},
{0x8c74ae9, L"fontHorizontalScale",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_FontHorizontalScale, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2cd79033, L"kerningMode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_KerningMode, XFA_SCRIPT_Basic},
{0x3a0273a6, L"underline",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Underline, XFA_SCRIPT_Basic},
{0x4873c601, L"baselineShift",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_BaselineShift, XFA_SCRIPT_Basic},
{0x4b319767, L"overlinePeriod",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_OverlinePeriod, XFA_SCRIPT_Basic},
{0x79543055, L"letterSpacing",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LetterSpacing, XFA_SCRIPT_Basic},
{0x8ec6204c, L"lineThroughPeriod",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LineThroughPeriod, XFA_SCRIPT_Basic},
{0x907c7719, L"fontVerticalScale",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_FontVerticalScale, XFA_SCRIPT_Basic},
{0xa686975b, L"size",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Size, XFA_SCRIPT_Basic},
{0xb5e49bf2, L"posture",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Posture, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbd6e1d88, L"weight",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Weight, XFA_SCRIPT_Basic},
{0xbd96a0e9, L"underlinePeriod",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_UnderlinePeriod, XFA_SCRIPT_Basic},
{0xc0ec9fa4, L"overline",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Overline, XFA_SCRIPT_Basic},
{0xaf754613, L"checksum",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Form_Checksum, -1,
XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x8e1c2921, L"relevant",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Relevant, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xea7090a0, L"override",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Override, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x9dcc3ab3, L"trailer",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Trailer, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xcbcaf66d, L"leader",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Leader, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x60a61edd, L"codeType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CodeType, XFA_SCRIPT_Basic},
{0xb373a862, L"archive",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Archive, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xe1a26b56, L"codeBase",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_CodeBase, XFA_SCRIPT_Basic},
{0xeb091003, L"classId",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ClassId, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x47d03490, L"connection",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Connection, XFA_SCRIPT_Basic},
{0xc39a88bd, L"labelRef",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_LabelRef, XFA_SCRIPT_Basic},
{0xd50f903a, L"valueRef",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_ValueRef, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xea7090a0, L"override",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Override, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Extras_Type, -1,
XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbb8df5d, L"ref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Ref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x24d85167, L"timeout",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Timeout, XFA_SCRIPT_Basic},
{0x47d03490, L"connection",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Connection, XFA_SCRIPT_Basic},
{0x552d9ad5, L"usage",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usage, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc860f30a, L"delayedOpen",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_DelayedOpen, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x28dee6e9, L"format",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Format, XFA_SCRIPT_Basic},
{0x824f21b7, L"embedPDF",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_EmbedPDF, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc8da4da7, L"target",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Target, XFA_SCRIPT_Basic},
{0xdc75676c, L"textEncoding",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TextEncoding, XFA_SCRIPT_Basic},
{0xf889e747, L"xdpContent",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_XdpContent, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x97be91b, L"content",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Packet_Content, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x4156ee3f, L"delimiter",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Delimiter, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0x21aed, L"id",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Id, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbb8df5d, L"ref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Ref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x21aed, L"id",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Id, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x2f16a382, L"type",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Type, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x453eaf38, L"startNew",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_StartNew, XFA_SCRIPT_Basic},
{0x9dcc3ab3, L"trailer",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Trailer, XFA_SCRIPT_Basic},
{0xa6118c89, L"targetType",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_TargetType, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xc8da4da7, L"target",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Target, XFA_SCRIPT_Basic},
{0xcbcaf66d, L"leader",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Leader, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xabef37e3, L"slope",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Slope, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xd996fa9b, L"hand",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Hand, XFA_SCRIPT_Basic},
{0xa60dd202, L"length",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_NodeList::Script_ListClass_Length, -1,
XFA_SCRIPT_Basic},
{0x20146, L"db", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Source_Db, -1,
XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xb3543a6, L"max", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Occur_Max,
-1, XFA_SCRIPT_Basic},
{0xb356ca4, L"min", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Occur_Min,
-1, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x7d0b5fca, L"initial",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Initial, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x29418bb7, L"abbr",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Abbr, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0xbe52dfbf, L"desc",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic},
{0xf6b47749, L"lock",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL,
XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic},
{0xbb8df5d, L"ref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Ref, XFA_SCRIPT_Basic},
{0xc0811ed, L"use",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic},
{0x570ce835, L"presence",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Presence, XFA_SCRIPT_Basic},
{0xa5b410cf, L"save",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Save, XFA_SCRIPT_Basic},
{0xbc254332, L"usehref",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic},
{0xb2c80857, L"className",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Object::Script_ObjectClass_ClassName, -1,
XFA_SCRIPT_Basic},
{0xa60dd202, L"length",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_NodeList::Script_ListClass_Length, -1,
XFA_SCRIPT_Basic},
{0x31b19c1, L"name",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Name, XFA_SCRIPT_Basic},
{0x9f9d0f9, L"all",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_TreeClass_All, -1,
XFA_SCRIPT_Object},
{0x4df15659, L"nodes",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_TreeClass_Nodes, -1,
XFA_SCRIPT_Object},
{0x78a8d6cf, L"classAll",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_TreeClass_ClassAll, -1,
XFA_SCRIPT_Object},
{0xcad6d8ca, L"parent",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_TreeClass_Parent, -1,
XFA_SCRIPT_Object},
{0xd5679c78, L"index",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_TreeClass_Index, -1,
XFA_SCRIPT_Basic},
{0xdb5b4bce, L"classIndex",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_TreeClass_ClassIndex, -1,
XFA_SCRIPT_Basic},
{0xe4989adf, L"somExpression",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_TreeClass_SomExpression, -1,
XFA_SCRIPT_Basic},
{0x21aed, L"id",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String,
XFA_ATTRIBUTE_Id, XFA_SCRIPT_Basic},
{0x234a1, L"ns", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_NodeClass_Ns,
-1, XFA_SCRIPT_Basic},
{0x50d1a9d1, L"model",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_NodeClass_Model, -1,
XFA_SCRIPT_Object},
{0xacb4823f, L"isContainer",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_NodeClass_IsContainer, -1,
XFA_SCRIPT_Basic},
{0xe372ae97, L"isNull",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_NodeClass_IsNull, -1,
XFA_SCRIPT_Basic},
{0xfe612a5b, L"oneOfChild",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_NodeClass_OneOfChild, -1,
XFA_SCRIPT_Object},
{0x97c1c65, L"context",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ModelClass_Context, -1,
XFA_SCRIPT_Object},
{0x58be2870, L"aliasNode",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ModelClass_AliasNode, -1,
XFA_SCRIPT_Object},
{0xa52682bd, L"{default}",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
{0xd6e27f1d, L"value",
(XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1,
XFA_SCRIPT_Basic},
};
const int32_t g_iSomAttributeCount =
sizeof(g_SomAttributeData) / sizeof(XFA_ATTRIBUTEINFO);
| 45.402155 | 80 | 0.735398 | [
"shape",
"model",
"transform",
"solid"
] |
4363c33d135caa2ece47d0f99894ef015151e253 | 9,619 | cpp | C++ | Board.cpp | VashTheStampede96/2048 | 249023235df3039a71b6fa195b585debf32ecdf7 | [
"MIT"
] | null | null | null | Board.cpp | VashTheStampede96/2048 | 249023235df3039a71b6fa195b585debf32ecdf7 | [
"MIT"
] | null | null | null | Board.cpp | VashTheStampede96/2048 | 249023235df3039a71b6fa195b585debf32ecdf7 | [
"MIT"
] | null | null | null | #include <vector>
#include <iostream>
#include <algorithm>
#include <cmath>
#include "Random.cpp"
#include "Board.hpp"
static const double probOf2 = 0.875;
template<int Row, int Col>
void Board<Row, Col>:: updateMaxTile() {
for(auto & row : board) {
for(auto & val : row)
maxTile = max(maxTile, val);
}
}
template<int Row, int Col>
void Board<Row, Col>:: updateRank() {
if(playable() == Direction::NOT_VALID)
rank = 0;
else {
double monotone = 0;
double difference = 0;
double space = 0;
// Rank 1 : monotone sequence
double bestMonotone = (Row-1)*Col + Row*(Col-1);
for(int j=Col-1; j>=0; --j) {
for(int i=Row-2; i>=0; --i)
monotone += (board[i][j] >= board[i-1][j]);
}
for(int i=Row-1; i>=0; --i) {
for(int j=1; j<Col; ++j)
monotone += (board[i][j] >= board[i][j-1]);
}
monotone /= bestMonotone;
// Rank 2 : difference
double maxDifference = Row*Col*maxTile;
for(int i=0; i<Row; ++i) {
for(int j=0; j<Col; ++j) {
if(board[i][j] == 0)
continue;
for(int ii=i+1; ii<Row; ++ii) {
if(board[ii][j] > 0) {
difference += abs(board[ii][j] - board[i][j]);
break;
}
}
for(int jj=j+1; jj<Col; ++jj) {
if(board[i][jj] > 0) {
difference += abs(board[i][jj] - board[i][j]);
break;
}
}
}
}
if(difference > maxDifference) {
std::cout << difference << ", " << maxDifference << std::endl;
print(std::cout);
std::cout << std::endl;
}
difference = 1.0 - difference/maxDifference;
// std::cout << maxDifference << std::endl;
//Rank 3 : Get as much as free space on the board
for(auto & row : board) {
for(auto & val : row)
space += val==0;
}
space /= (Row*Col-1.0);
rank = pow(monotone, exponents[0])*pow(difference, exponents[1])*pow(space, exponents[2]);
}
}
template<int Row, int Col>
bool Board<Row, Col>:: horizontalFill(int row, int dir) {
int start = (dir == -1) ? 1 : (Col-2);
int end = (dir == -1) ? Col : -1;
bool flag = false;
for(int c=start; c!=end; c-=dir) {
int i=c;
if(board[row][c] != 0) {
while(i+dir!=-1 and i+dir!=Col and board[row][i+dir]==0) {
swap(board[row][i], board[row][i+dir]);
i += dir;
flag = true;
}
}
}
return flag;
}
template<int Row, int Col>
bool Board<Row, Col>:: horizontalSwipe(int row, int dir) {
int start = (dir == -1) ? 1 : (Col-2);
int end = (dir == -1) ? Col : -1;
bool flag = false;
flag |= horizontalFill(row, dir);
for(int c=start; c!=end; c-=dir) {
if(board[row][c] == board[row][c+dir]) {
flag |= board[row][c]>0;
board[row][c] = 0;
board[row][c+dir] <<= 1;
}
}
flag |= horizontalFill(row, dir);
return flag;
}
template<int Row, int Col>
bool Board<Row, Col>:: verticalFill(int col, int dir) {
int start = (dir == -1) ? 1 : (Row-2);
int end = (dir == -1) ? Row : -1;
bool flag = false;
for(int r=start; r!=end; r-=dir) {
int i=r;
if(board[r][col] != 0) {
while(i+dir!=-1 and i+dir!=Row and board[i+dir][col]==0) {
swap(board[i][col], board[i+dir][col]);
i += dir;
flag = true;
}
}
}
return flag;
}
template<int Row, int Col>
bool Board<Row, Col>:: verticalSwipe(int col, int dir) {
int start = (dir == -1) ? 1 : (Row-2);
int end = (dir == -1) ? Row : -1;
bool flag = false;
flag |= verticalFill(col, dir);
for(int r=start; r!=end; r-=dir) {
if(board[r][col] == board[r+dir][col]) {
flag |= board[r][col]>0;
board[r][col] = 0;
board[r+dir][col] <<= 1;
}
}
flag |= verticalFill(col, dir);
return flag;
}
template<int Row, int Col>
int Board<Row, Col>:: generateTile() {
std::vector<std::pair<int, int>> freePos;
freePos.reserve(Row * Col);
for(int i=0; i<Row; ++i) {
for(int j=0; j<Col; ++j) {
if(board[i][j] == 0)
freePos.emplace_back(i, j);
}
}
auto pos = freePos[random_ab(0, freePos.size())];
return board[pos.first][pos.second] = (random8() <= probOf2) ? 2 : 4;
}
template<int Row, int Col>
std::pair<Direction, double> Board<Row, Col>:: recBestMove(int K) {
if(K == 0)
return {playable(), (playable() == Direction::NOT_VALID ? 0 : rank)};
Direction bestDir = Direction::NOT_VALID;
double bestRank = 0;
double expectedRank = 0;
for(int i=3; i>=0; --i) {
Direction dir = m[i];
auto tmp = new Board<Row, Col>(*this);
int gen = tmp->swipe(dir);
if(gen != 0) {
auto deepMove = tmp->recBestMove(K-1);
if(deepMove.first != Direction::NOT_VALID) {
double p = (gen == 2 ? probOf2 : (1.0-probOf2));
double recRank = p * deepMove.second;
expectedRank += recRank;
if(bestRank <= recRank) {
bestRank = recRank;
bestDir = dir;
}
}
}
delete tmp;
}
return {bestDir, expectedRank};
}
/* --------------------------------------------------------- P U B L I C ---------------------------------------------------------- */
template<int Row, int Col>
Board<Row, Col>:: Board() : nOfMoves(0), maxTile(0), rank(0.0) {
for(auto & row : board) {
for(auto & val : row)
val = 0;
}
int nOfRandom = max(1, Row * Col / 8);
for(int i=0, r, c; i<nOfRandom; ++i) {
r = random_ab(0, Row);
c = random_ab(0, Col);
board[r][c] = (random8() <= probOf2 ? 2 : 4);
maxTile = max(maxTile, board[r][c]);
}
}
template<int Row, int Col>
Board<Row, Col>:: Board(Board<Row, Col> & other) : nOfMoves(other.nOfMoves), maxTile(other.maxTile), rank(other.rank), board(other.board) {
// Empty
}
template<int Row, int Col>
void Board<Row, Col>:: print(ostream & out) {
for(auto & row : board) {
for(auto & val : row)
out << val << " ";
out << std::endl;
}
}
template<int Row, int Col>
bool Board<Row, Col>:: autoSwipe(Direction direction) {
bool flag = false;
switch(direction) {
case Direction::UP:
for(int c=0; c<Col; ++c)
flag |= verticalSwipe(c, -1);
break;
case Direction::RIGHT:
for(int r=0; r<Row; ++r)
flag |= horizontalSwipe(r, +1);
break;
case Direction::DOWN:
for(int c=0; c<Col; ++c)
flag |= verticalSwipe(c, +1);
break;
case Direction::LEFT:
for(int r=0; r<Row; ++r)
flag |= horizontalSwipe(r, -1);
break;
default:
std::cerr << "Swipe direction not valid!\n";
break;
}
updateRank();
return flag;
}
template<int Row, int Col>
int Board<Row, Col>:: swipe(Direction direction) {
bool flag = autoSwipe(direction);
int generated = 0;
if(flag) {
++nOfMoves;
generated = generateTile();
updateMaxTile();
}
return generated;
}
template<int Row, int Col>
int Board<Row, Col>:: getLeader() {
return maxTile;
}
template<int Row, int Col>
int Board<Row, Col>:: getLife() {
return nOfMoves;
}
template<int Row, int Col>
double Board<Row, Col>:: getRank() {
return rank;
}
template<int Row, int Col>
Direction Board<Row, Col>:: bestMove(int DEPTH) {
Board<Row, Col> *cpy = new Board<Row, Col>(*this);
Direction ans = cpy->recBestMove(DEPTH).first;
delete cpy;
return (ans == Direction::NOT_VALID ? playable() : ans);
}
template<int Row, int Col>
Direction Board<Row, Col>:: playable() {
bool flag = false;
Direction _move = Direction::NOT_VALID;
for(int r=0; r<Row and not flag; ++r) {
for(int c=0; c<Col and not flag; ++c) {
if(r > 0) {
flag = (board[r][c] == board[r-1][c]) or (board[r][c] != 0 and board[r-1][c] == 0);
if(flag) {
_move = Direction::UP;
continue;
}
}
if(r < Row-1) {
flag = (board[r][c] == board[r+1][c]) or (board[r][c] != 0 and board[r+1][c] == 0);
if(flag) {
_move = Direction::DOWN;
continue;
}
}
if(c > 0) {
flag = (board[r][c] == board[r][c-1]) or (board[r][c] != 0 and board[r][c-1] == 0);
if(flag) {
_move = Direction::LEFT;
continue;
}
}
if(c < Col-1) {
flag = (board[r][c] == board[r][c+1]) or (board[r][c] != 0 and board[r][c+1] == 0);
if(flag) {
_move = Direction::RIGHT;
continue;
}
}
}
}
return _move;
}
| 26.868715 | 139 | 0.459403 | [
"vector"
] |
436eeba68d7436b9fd595ce75b30154176288a91 | 2,643 | hpp | C++ | src/ai/composite/ai.hpp | blackberry/Wesnoth | 8b307689158db568ecc6cc3b537e8d382ccea449 | [
"Unlicense"
] | 12 | 2015-03-04T15:07:00.000Z | 2019-09-13T16:31:06.000Z | src/ai/composite/ai.hpp | blackberry/Wesnoth | 8b307689158db568ecc6cc3b537e8d382ccea449 | [
"Unlicense"
] | null | null | null | src/ai/composite/ai.hpp | blackberry/Wesnoth | 8b307689158db568ecc6cc3b537e8d382ccea449 | [
"Unlicense"
] | 5 | 2017-04-22T08:16:48.000Z | 2020-07-12T03:35:16.000Z | /* $Id: ai.hpp 48153 2011-01-01 15:57:50Z mordante $ */
/*
Copyright (C) 2009 - 2011 by Yurii Chernyi <terraninfo@terraninfo.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
/**
* @file
* Composite AI with turn sequence which is a vector of stages
*/
#ifndef AI_COMPOSITE_AI_HPP_INCLUDED
#define AI_COMPOSITE_AI_HPP_INCLUDED
#include "contexts.hpp"
#include "../interface.hpp"
#include "component.hpp"
#ifdef _MSC_VER
#pragma warning(push)
//silence "inherits via dominance" warnings
#pragma warning(disable:4250)
#endif
//============================================================================
namespace ai {
class ai_composite : public ai_context, public virtual default_ai_context_proxy, public interface, public component {
public:
/**
* Constructor
*/
ai_composite( default_ai_context &context, const config &cfg );
/**
* Destructor
*/
virtual ~ai_composite();
/**
* Play the turn
*/
void play_turn();
/**
* Evaluate command (using fai)
*/
virtual std::string evaluate(const std::string& str);
/**
* On new turn
*/
virtual void new_turn();
std::string describe_self() const;
/**
* serialize
*/
virtual config to_config() const;
int get_recursion_count() const;
void switch_side(side_number side);
virtual bool add_goal(const config &cfg);
virtual bool add_stage(const config &cfg);
void create_stage(std::vector<stage_ptr> &stages, const config &cfg);
void create_goal(std::vector<goal_ptr> &goals, const config &cfg);
void create_engine(std::vector<engine_ptr> &engines, const config &cfg);
void on_create();
/**
* unwrap
*/
virtual ai_context& get_ai_context();
virtual std::string get_id() const;
virtual std::string get_name() const;
virtual std::string get_engine() const;
protected:
/**
* Config of the AI
*/
const config &cfg_;
/**
* Stages of the composite AI
*/
std::vector< stage_ptr > stages_;
/**
* Recursion counter
*/
recursion_counter recursion_counter_;
};
} //end of namespace ai
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif
| 19.152174 | 118 | 0.6451 | [
"vector"
] |
436f0eb96c3f37a4ca6016f5b6064ed388ea7318 | 4,048 | cc | C++ | src/persistents_with_classid.cc | nodesource/persistents-with-classid | 68ee25e829161cc29f576f50cc200a1e1c6ceb4d | [
"MIT"
] | 2 | 2016-09-17T10:35:41.000Z | 2021-11-13T01:46:02.000Z | src/persistents_with_classid.cc | nodesource/persistents-with-classid | 68ee25e829161cc29f576f50cc200a1e1c6ceb4d | [
"MIT"
] | 4 | 2016-06-15T02:14:19.000Z | 2019-05-10T21:28:57.000Z | src/persistents_with_classid.cc | nodesource/persistents-with-classid | 68ee25e829161cc29f576f50cc200a1e1c6ceb4d | [
"MIT"
] | 1 | 2021-11-13T01:45:56.000Z | 2021-11-13T01:45:56.000Z | #include <v8.h>
#include <node.h>
#include <vector>
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::Persistent;
using v8::PersistentHandleVisitor;
using v8::Uint32;
using v8::Value;
using v8::V8;
#ifndef assert
// make some nervous IDEs/vim plugins happy
void assert(bool);
#endif
template <class TypeName>
inline Local<TypeName> PersistentToLocal(Isolate* isolate,
const Persistent<TypeName>* pst) {
if (pst->IsWeak()) {
return Local<TypeName>::New(isolate, *pst);
} else {
return *reinterpret_cast<Local<TypeName>*>(
const_cast<Persistent<TypeName>*>(pst));
}
}
class PersistentHandleWithClassId {
public:
PersistentHandleWithClassId(Isolate* isolate, uint32_t id, Local<Object> value)
: id_(id){
obj_p_.Reset(isolate, value);
}
~PersistentHandleWithClassId() {
obj_p_.Reset();
}
Local<Object> value() {
return PersistentToLocal(isolate_, &obj_p_);
}
uint32_t id() {
return id_;
}
private:
uint32_t id_;
Persistent<Object> obj_p_;
Isolate* isolate_;
};
class PersistentHandleWithClassIdVisitor : public PersistentHandleVisitor {
public:
PersistentHandleWithClassIdVisitor(Isolate* isolate,
Local<Function> fn,
uint32_t ids)
: ids_(ids) {
fn_p_.Reset(isolate, fn);
};
~PersistentHandleWithClassIdVisitor() {
fn_p_.Reset();
for (auto h : handles_) {
delete h;
}
handles_.clear();
}
virtual void VisitPersistentHandle(Persistent<Value>* value,
uint16_t class_id) {
Isolate* isolate = Isolate::GetCurrent();
HandleScope handle_scope(isolate);
// class_id adjustment for AsyncWrap
if (class_id >= 0xA1C && class_id < 0xA1C + 100)
class_id = class_id - 0xA1C;
if (!((1 << class_id) & ids_))
return;
Local<Value> val = PersistentToLocal(isolate, value);
if (val.IsEmpty() || !val->IsObject())
return;
Local<Object> obj = val.As<Object>();
add_(isolate, class_id, obj);
}
void report_handles(Isolate* isolate) {
Local<Function> fn = PersistentToLocal(isolate, &fn_p_).As<Function>();
for (auto h : handles_) {
report_(isolate, fn, h);
}
}
private:
Persistent<Function> fn_p_;
const uint32_t ids_;
std::vector<PersistentHandleWithClassId*> handles_;
void add_(Isolate* isolate, uint32_t id, Local<Object> value) {
PersistentHandleWithClassId* handle = new PersistentHandleWithClassId(isolate, id, value);
handles_.push_back(handle);
}
void report_(Isolate* isolate, Local<Function> fn, PersistentHandleWithClassId* handle) {
Local<v8::Context> context = isolate->GetCurrentContext();
Local<Value> argv[] = { Integer::New(isolate, handle->id()), handle->value() };
fn->Call(context, Null(isolate), 2, argv);
}
};
static void Visit(const FunctionCallbackInfo<Value>& info) {
Isolate* isolate = info.GetIsolate();
Local<v8::Context> context = isolate->GetCurrentContext();
assert(info[0]->IsFunction());
assert(info[1]->IsUint32());
PersistentHandleWithClassIdVisitor visitor(isolate,
info[0].As<Function>(),
info[1]->Uint32Value(context).ToChecked());
// This function introduced with v8 v3.30.37 upgrade Nov 13, 2014
// (https://github.com/nodesource/nsolid-node/commit/5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1)
// before that it was V8::VisitHandlesWithClassIds(isolate, &visitor).
isolate->VisitHandlesWithClassIds(&visitor);
visitor.report_handles(isolate);
}
static void InitVisitor(Local<Object> exports) {
NODE_SET_METHOD(exports, "visit", Visit);
}
NODE_MODULE(persistents_with_classid, InitVisitor)
| 28.307692 | 96 | 0.638834 | [
"object",
"vector"
] |
437012a635f0607a5607ea274f40ee8c432ce6ad | 321 | cpp | C++ | src/MRigidBody.cpp | viktorcpp/endless2.0save | 9824aebd56346f1b9526b730063b84918bd6ac08 | [
"MIT"
] | null | null | null | src/MRigidBody.cpp | viktorcpp/endless2.0save | 9824aebd56346f1b9526b730063b84918bd6ac08 | [
"MIT"
] | null | null | null | src/MRigidBody.cpp | viktorcpp/endless2.0save | 9824aebd56346f1b9526b730063b84918bd6ac08 | [
"MIT"
] | null | null | null |
namespace endless
{
std::vector<PxActor*>& MRigidBody::Rigid( PxActor* newrigid )
{
if( newrigid != nullptr )
rigid.push_back(newrigid);
return rigid;
} // Rigid
MRigidBody::MRigidBody():
rigid()
{}
MRigidBody::~MRigidBody()
{}
} // namespace endless
| 15.285714 | 65 | 0.554517 | [
"vector"
] |
43702087eb423bac311d78b9901294f6e69bed26 | 5,191 | cpp | C++ | tests/apinames.cpp | ibiscum/rtaudio | 59457b909aaadd25cfdb3bd967f3b289543f2353 | [
"MIT"
] | null | null | null | tests/apinames.cpp | ibiscum/rtaudio | 59457b909aaadd25cfdb3bd967f3b289543f2353 | [
"MIT"
] | null | null | null | tests/apinames.cpp | ibiscum/rtaudio | 59457b909aaadd25cfdb3bd967f3b289543f2353 | [
"MIT"
] | null | null | null | /******************************************/
/*
apinames.cpp
by Jean Pierre Cimalando, 2018.
This program tests parts of RtAudio related
to API names, the conversion from name to API
and vice-versa.
*/
/******************************************/
#include "RtAudio.h"
#include <cctype>
#include <cstdlib>
#include <iostream>
int test_cpp() {
std::vector<RtAudio::Api> apis;
RtAudio::getCompiledApi( apis );
// ensure the known APIs return valid names
std::cout << "API names by identifier (C++):\n";
for (auto & api : apis) {
const std::string name = RtAudio::getApiName(api);
if (name.empty()) {
std::cout << "Invalid name for API " << (int)api << "\n";
exit(1);
}
const std::string displayName = RtAudio::getApiDisplayName(api);
if (displayName.empty()) {
std::cout << "Invalid display name for API " << (int)api << "\n";
exit(1);
}
std::cout << "* " << (int)api << " '" << name << "': '" << displayName << "'\n";
}
// ensure unknown APIs return the empty string
{
const std::string name = RtAudio::getApiName((RtAudio::Api)-1);
if (!name.empty()) {
std::cout << "Bad string for invalid API '" << name << "'\n";
exit(1);
}
const std::string displayName = RtAudio::getApiDisplayName((RtAudio::Api)-1);
if (displayName!="Unknown") {
std::cout << "Bad display string for invalid API '" << displayName << "'\n";
exit(1);
}
}
// try getting API identifier by name
std::cout << "API identifiers by name (C++):\n";
for (auto & i : apis) {
std::string name = RtAudio::getApiName(i);
if ( RtAudio::getCompiledApiByName(name) != i ) {
std::cout << "Bad identifier for API '" << name << "'\n";
exit( 1 );
}
std::cout << "* '" << name << "': " << (int)i << "\n";
for ( size_t j = 0; j < name.size(); ++j )
name[j] = (j & 1) ? toupper(name[j]) : tolower(name[j]);
RtAudio::Api api = RtAudio::getCompiledApiByName(name);
if ( api != RtAudio::UNSPECIFIED ) {
std::cout << "Identifier " << (int)api << " for invalid API '" << name << "'\n";
exit( 1 );
}
}
// try getting an API identifier by unknown name
{
RtAudio::Api api;
api = RtAudio::getCompiledApiByName("");
if ( api != RtAudio::UNSPECIFIED ) {
std::cout << "Bad identifier for unknown API name\n";
exit( 1 );
}
}
return 0;
}
#include "rtaudio_c.h"
int test_c() {
const rtaudio_api_t *apis = rtaudio_compiled_api();
// ensure the known APIs return valid names
std::cout << "API names by identifier (C):\n";
for ( size_t i = 0; apis[i] != RTAUDIO_API_UNSPECIFIED; ++i) {
const std::string name = rtaudio_api_name(apis[i]);
if (name.empty()) {
std::cout << "Invalid name for API " << (int)apis[i] << "\n";
exit(1);
}
const std::string displayName = rtaudio_api_display_name(apis[i]);
if (displayName.empty()) {
std::cout << "Invalid display name for API " << (int)apis[i] << "\n";
exit(1);
}
std::cout << "* " << (int)apis[i] << " '" << name << "': '" << displayName << "'\n";
}
// ensure unknown APIs return the empty string
{
const char *s = rtaudio_api_name((rtaudio_api_t)-1);
const std::string name(s?s:"");
if (!name.empty()) {
std::cout << "Bad string for invalid API '" << name << "'\n";
exit(1);
}
s = rtaudio_api_display_name((rtaudio_api_t)-1);
const std::string displayName(s?s:"");
if (displayName!="Unknown") {
std::cout << "Bad display string for invalid API '" << displayName << "'\n";
exit(1);
}
}
// try getting API identifier by name
std::cout << "API identifiers by name (C):\n";
for ( size_t i = 0; apis[i] != RTAUDIO_API_UNSPECIFIED ; ++i ) {
const char *s = rtaudio_api_name(apis[i]);
std::string name(s?s:"");
if ( rtaudio_compiled_api_by_name(name.c_str()) != apis[i] ) {
std::cout << "Bad identifier for API '" << name << "'\n";
exit( 1 );
}
std::cout << "* '" << name << "': " << (int)apis[i] << "\n";
for ( size_t j = 0; j < name.size(); ++j )
name[j] = (j & 1) ? toupper(name[j]) : tolower(name[j]);
rtaudio_api_t api = rtaudio_compiled_api_by_name(name.c_str());
if ( api != RTAUDIO_API_UNSPECIFIED ) {
std::cout << "Identifier " << (int)api << " for invalid API '" << name << "'\n";
exit( 1 );
}
}
// try getting an API identifier by unknown name
{
rtaudio_api_t api;
api = rtaudio_compiled_api_by_name("");
if ( api != RTAUDIO_API_UNSPECIFIED ) {
std::cout << "Bad identifier for unknown API name\n";
exit( 1 );
}
}
return 0;
}
int main()
{
test_cpp();
test_c();
}
| 32.85443 | 92 | 0.503371 | [
"vector"
] |
4372617002afc130860d353dcc607418e9b6c160 | 8,336 | cpp | C++ | source/b1ig/exprg.cpp | basic-1/basic-1 | ddb253e0c98970042ba5502f745c8289bfc07398 | [
"MIT"
] | null | null | null | source/b1ig/exprg.cpp | basic-1/basic-1 | ddb253e0c98970042ba5502f745c8289bfc07398 | [
"MIT"
] | null | null | null | source/b1ig/exprg.cpp | basic-1/basic-1 | ddb253e0c98970042ba5502f745c8289bfc07398 | [
"MIT"
] | 1 | 2020-08-29T17:50:09.000Z | 2020-08-29T17:50:09.000Z | /*
BASIC1 interpreter
Copyright (c) 2020-2021 Nikolay Pletnev
MIT license
exprg.cpp: external interpreter function samples for loading program
from file, navigating through program lines, caching line numbers and
expressions in form of RPN
*/
#include <vector>
#include <stack>
#include <map>
#include <iterator>
extern "C"
{
#include "b1rpn.h"
#include "b1int.h"
#include "b1err.h"
}
#if B1_T_PROG_LINE_CNT_MAX_VALUE > UINT16_MAX || B1_T_INDEX_MAX_VALUE > UINT16_MAX
#error current RPN caching implementation does not work with B1_T_PROG_LINE_CNT and B1_T_INDEX types larger than 16 bit
#endif
// line number cache
static std::map<B1_T_LINE_NUM, B1_T_PROG_LINE_CNT> b1_ex_prg_line_num_cache;
// FOR/NEXT statement line counters cache
static std::stack<B1_T_PROG_LINE_CNT> b1_ex_prg_for_line_cnt_stack;
static std::map<B1_T_PROG_LINE_CNT, B1_T_PROG_LINE_CNT> b1_ex_prg_for_line_cnt_cache;
#ifdef B1_FEATURE_STMT_WHILE_WEND
// WHILE/WEND statement line counters cache
static std::stack<B1_T_PROG_LINE_CNT> b1_ex_prg_while_line_cnt_stack;
static std::map<B1_T_PROG_LINE_CNT, B1_T_PROG_LINE_CNT> b1_ex_prg_while_line_cnt_cache;
#endif
// DATA statement line counters cache
#ifdef B1_FEATURE_STMT_DATA_READ
static std::vector<std::pair<B1_T_PROG_LINE_CNT, B1_T_INDEX>> b1_ex_prg_data_line_cnt_cache;
#endif
#ifdef B1_FEATURE_RPN_CACHING
static std::map<uint32_t, std::pair<B1_T_INDEX, std::vector<B1_RPNREC>>> b1_ex_prg_rpn_expr_cache;
#endif
static std::vector<std::vector<B1_T_CHAR>> b1_ex_prg_lines;
B1_T_ERROR b1_ex_prg_set_program(const std::vector<std::vector<B1_T_CHAR>> *program_lines)
{
if(!b1_ex_prg_lines.empty())
{
b1_ex_prg_line_num_cache.clear();
while(!b1_ex_prg_for_line_cnt_stack.empty())
{
b1_ex_prg_for_line_cnt_stack.pop();
}
b1_ex_prg_for_line_cnt_cache.clear();
#ifdef B1_FEATURE_STMT_WHILE_WEND
while(!b1_ex_prg_while_line_cnt_stack.empty())
{
b1_ex_prg_while_line_cnt_stack.pop();
}
b1_ex_prg_while_line_cnt_cache.clear();
#endif
#ifdef B1_FEATURE_STMT_DATA_READ
b1_ex_prg_data_line_cnt_cache.clear();
#endif
#ifdef B1_FEATURE_RPN_CACHING
b1_ex_prg_rpn_expr_cache.clear();
#endif
b1_ex_prg_lines.clear();
}
b1_ex_prg_lines = *program_lines;
return B1_RES_OK;
}
static B1_T_ERROR b1_ex_prg_get_next_prog_line()
{
B1_T_PROG_LINE_CNT line_cnt;
line_cnt = b1_curr_prog_line_cnt;
if(line_cnt >= b1_ex_prg_lines.size())
{
return B1_RES_EPROGUNEND;
}
b1_progline = b1_ex_prg_lines[line_cnt].data();
b1_curr_prog_line_cnt = line_cnt + 1;
return B1_RES_OK;
}
static B1_T_ERROR b1_ex_prg_get_first_prog_line()
{
b1_curr_prog_line_cnt = 0;
return b1_ex_prg_get_next_prog_line();
}
// caches line numbers (allowing faster program navigation), the cached data can be used by b1_ex_prg_get_prog_line and other functions
extern "C" B1_T_ERROR b1_ex_prg_cache_curr_line_num(B1_T_LINE_NUM curr_line_num, uint8_t stmt)
{
#ifdef B1_FEATURE_STMT_DATA_READ
if(stmt == B1_ID_STMT_DATA)
{
b1_ex_prg_data_line_cnt_cache.push_back(std::pair<B1_T_PROG_LINE_CNT, B1_T_INDEX>(b1_curr_prog_line_cnt, b1_curr_prog_line_offset));
}
#endif
if(curr_line_num != B1_T_LINE_NUM_ABSENT)
{
b1_ex_prg_line_num_cache[curr_line_num] = b1_curr_prog_line_cnt - 1;
}
// move FOR statement line counter to tmp. stack
if(stmt == B1_ID_STMT_FOR)
{
b1_ex_prg_for_line_cnt_stack.push(b1_curr_prog_line_cnt);
}
if(stmt == B1_ID_STMT_NEXT && !b1_ex_prg_for_line_cnt_stack.empty())
{
b1_ex_prg_for_line_cnt_cache[b1_ex_prg_for_line_cnt_stack.top()] = b1_curr_prog_line_cnt;
b1_ex_prg_for_line_cnt_stack.pop();
}
#ifdef B1_FEATURE_STMT_WHILE_WEND
// move WHILE statement line counter to tmp. stack
if(stmt == B1_ID_STMT_WHILE)
{
b1_ex_prg_while_line_cnt_stack.push(b1_curr_prog_line_cnt);
}
if(stmt == B1_ID_STMT_WEND && !b1_ex_prg_while_line_cnt_stack.empty())
{
b1_ex_prg_while_line_cnt_cache[b1_ex_prg_while_line_cnt_stack.top()] = b1_curr_prog_line_cnt;
b1_ex_prg_while_line_cnt_stack.pop();
}
#endif
return B1_RES_OK;
}
// the function should set b1_progline and b1_curr_prog_line_cnt global variables according to the program line
// number requested via next_line_num argument. the argument can be either BASIC line number or one of the next constants:
// B1_T_LINE_NUM_FIRST, B1_T_LINE_NUM_NEXT. can return the next values (error codes): B1_RES_OK, B1_RES_ELINENNOTFND,
// B1_RES_EPROGUNEND, B1_RES_EENVFAT
extern "C" B1_T_ERROR b1_ex_prg_get_prog_line(B1_T_LINE_NUM next_line_num)
{
if(next_line_num == B1_T_LINE_NUM_FIRST)
{
return b1_ex_prg_get_first_prog_line();
}
if(next_line_num == B1_T_LINE_NUM_NEXT)
{
return b1_ex_prg_get_next_prog_line();
}
auto line_it = b1_ex_prg_line_num_cache.find(next_line_num);
if(line_it == b1_ex_prg_line_num_cache.end())
{
return B1_RES_ELINENNOTFND;
}
b1_progline = b1_ex_prg_lines[line_it->second].data();
b1_curr_prog_line_cnt = line_it->second + 1;
return B1_RES_OK;
}
// sets the NEXT statement line counter for the current FOR statement
extern "C" B1_T_ERROR b1_ex_prg_for_go_next()
{
auto line_cnt_it = b1_ex_prg_for_line_cnt_cache.find(b1_curr_prog_line_cnt);
if(line_cnt_it == b1_ex_prg_for_line_cnt_cache.end())
{
return B1_RES_EFORWONXT;
}
b1_curr_prog_line_cnt = line_cnt_it->second;
return B1_RES_OK;
}
#ifdef B1_FEATURE_STMT_WHILE_WEND
// sets the WEND statement line counter for the current WHILE statement
extern "C" B1_T_ERROR b1_ex_prg_while_go_wend()
{
auto line_cnt_it = b1_ex_prg_while_line_cnt_cache.find(b1_curr_prog_line_cnt);
if(line_cnt_it == b1_ex_prg_while_line_cnt_cache.end())
{
return B1_RES_EWHILEWOWND;
}
b1_curr_prog_line_cnt = line_cnt_it->second;
return B1_RES_OK;
}
#endif
#ifdef B1_FEATURE_STMT_DATA_READ
// sets the next DATA stamtement line counter (b1_data_curr_line_cnt and b1_data_curr_line_offset),
// next_line_num can be either valid line number or B1_T_LINE_NUM_FIRST, B1_T_LINE_NUM_NEXT constants.
// possible return codes: B1_RES_OK, B1_RES_EDATAEND, B1_RES_ELINENNOTFND, B1_RES_EENVFAT, etc.
extern "C" B1_T_ERROR b1_ex_prg_data_go_next(B1_T_LINE_NUM next_line_num)
{
if(b1_ex_prg_data_line_cnt_cache.empty())
{
return B1_RES_EDATAEND;
}
if(next_line_num == B1_T_LINE_NUM_FIRST)
{
b1_data_curr_line_cnt = b1_ex_prg_data_line_cnt_cache[0].first;
}
else
if(next_line_num != B1_T_LINE_NUM_NEXT)
{
auto line_it = b1_ex_prg_line_num_cache.find(next_line_num);
if(line_it == b1_ex_prg_line_num_cache.end())
{
return B1_RES_ELINENNOTFND;
}
b1_data_curr_line_cnt = line_it->second + 1;
}
for(auto i = b1_ex_prg_data_line_cnt_cache.begin(); ; i++)
{
if(i == b1_ex_prg_data_line_cnt_cache.end() || i->first > b1_data_curr_line_cnt)
{
return B1_RES_EDATAEND;
}
if(i->first == b1_data_curr_line_cnt)
{
if(next_line_num == B1_T_LINE_NUM_NEXT)
{
i++;
if(i == b1_ex_prg_data_line_cnt_cache.end())
{
return B1_RES_EDATAEND;
}
}
b1_data_curr_line_cnt = i->first;
b1_data_curr_line_offset = i->second;
return B1_RES_OK;
}
}
return B1_RES_OK;
}
#endif
#ifdef B1_FEATURE_RPN_CACHING
extern "C" B1_T_ERROR b1_ex_prg_rpn_cache(B1_T_INDEX offset, B1_T_INDEX continue_offset)
{
std::vector<B1_RPNREC> rpn;
// Do not cache empty or small RPN
if(b1_rpn[0].flags == 0 || b1_rpn[1].flags == 0)
{
return B1_RES_OK;
}
for(B1_T_INDEX i = 0; ; i++)
{
rpn.push_back(b1_rpn[i]);
if(b1_rpn[i].flags == 0)
{
break;
}
}
b1_ex_prg_rpn_expr_cache[(((uint32_t)b1_curr_prog_line_cnt) << 16) + offset] = std::pair<B1_T_INDEX, std::vector<B1_RPNREC>>(continue_offset, rpn);
return B1_RES_OK;
}
extern "C" B1_T_ERROR b1_ex_prg_rpn_get_cached(B1_T_INDEX offset, B1_T_INDEX *continue_offset)
{
auto expr_rpn_it = b1_ex_prg_rpn_expr_cache.find((((uint32_t)b1_curr_prog_line_cnt) << 16) + offset);
if(expr_rpn_it != b1_ex_prg_rpn_expr_cache.end())
{
if(continue_offset != NULL)
{
*continue_offset = expr_rpn_it->second.first;
}
b1_rpn = expr_rpn_it->second.second.data();
}
return B1_RES_OK;
}
#endif
| 26.977346 | 149 | 0.75072 | [
"vector"
] |
4374b3894d7d75fa269479379fe237393df8b32d | 1,626 | cpp | C++ | aws-cpp-sdk-mediaconvert/source/model/OutputGroupDetail.cpp | Neusoft-Technology-Solutions/aws-sdk-cpp | 88c041828b0dbee18a297c3cfe98c5ecd0706d0b | [
"Apache-2.0"
] | 1 | 2022-02-10T08:06:54.000Z | 2022-02-10T08:06:54.000Z | aws-cpp-sdk-mediaconvert/source/model/OutputGroupDetail.cpp | Neusoft-Technology-Solutions/aws-sdk-cpp | 88c041828b0dbee18a297c3cfe98c5ecd0706d0b | [
"Apache-2.0"
] | 1 | 2022-01-03T23:59:37.000Z | 2022-01-03T23:59:37.000Z | aws-cpp-sdk-mediaconvert/source/model/OutputGroupDetail.cpp | ravindra-wagh/aws-sdk-cpp | 7d5ff01b3c3b872f31ca98fb4ce868cd01e97696 | [
"Apache-2.0"
] | 1 | 2021-11-09T11:58:03.000Z | 2021-11-09T11:58:03.000Z | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/mediaconvert/model/OutputGroupDetail.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace MediaConvert
{
namespace Model
{
OutputGroupDetail::OutputGroupDetail() :
m_outputDetailsHasBeenSet(false)
{
}
OutputGroupDetail::OutputGroupDetail(JsonView jsonValue) :
m_outputDetailsHasBeenSet(false)
{
*this = jsonValue;
}
OutputGroupDetail& OutputGroupDetail::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("outputDetails"))
{
Array<JsonView> outputDetailsJsonList = jsonValue.GetArray("outputDetails");
for(unsigned outputDetailsIndex = 0; outputDetailsIndex < outputDetailsJsonList.GetLength(); ++outputDetailsIndex)
{
m_outputDetails.push_back(outputDetailsJsonList[outputDetailsIndex].AsObject());
}
m_outputDetailsHasBeenSet = true;
}
return *this;
}
JsonValue OutputGroupDetail::Jsonize() const
{
JsonValue payload;
if(m_outputDetailsHasBeenSet)
{
Array<JsonValue> outputDetailsJsonList(m_outputDetails.size());
for(unsigned outputDetailsIndex = 0; outputDetailsIndex < outputDetailsJsonList.GetLength(); ++outputDetailsIndex)
{
outputDetailsJsonList[outputDetailsIndex].AsObject(m_outputDetails[outputDetailsIndex].Jsonize());
}
payload.WithArray("outputDetails", std::move(outputDetailsJsonList));
}
return payload;
}
} // namespace Model
} // namespace MediaConvert
} // namespace Aws
| 23.911765 | 118 | 0.757073 | [
"model"
] |
4376bbb5de6c34e4da00d6ac6734b56066f7723f | 2,107 | cpp | C++ | 232-implement-queue-using-stacks/implement-queue-using-stacks.cpp | nagestx/MyLeetCode | ef2a98b48485a0cebc442bbbbdb2690ba51484e1 | [
"MIT"
] | 3 | 2018-12-15T14:07:12.000Z | 2020-07-19T23:18:09.000Z | 232-implement-queue-using-stacks/implement-queue-using-stacks.cpp | yangyangu/MyLeetCode | ef2a98b48485a0cebc442bbbbdb2690ba51484e1 | [
"MIT"
] | null | null | null | 232-implement-queue-using-stacks/implement-queue-using-stacks.cpp | yangyangu/MyLeetCode | ef2a98b48485a0cebc442bbbbdb2690ba51484e1 | [
"MIT"
] | null | null | null | // Implement the following operations of a queue using stacks.
//
//
// push(x) -- Push element x to the back of queue.
// pop() -- Removes the element from in front of queue.
// peek() -- Get the front element.
// empty() -- Return whether the queue is empty.
//
//
// Example:
//
//
// MyQueue queue = new MyQueue();
//
// queue.push(1);
// queue.push(2);
// queue.peek(); // returns 1
// queue.pop(); // returns 1
// queue.empty(); // returns false
//
// Notes:
//
//
// You must use only standard operations of a stack -- which means only push to top, peek/pop from top, size, and is empty operations are valid.
// Depending on your language, stack may not be supported natively. You may simulate a stack by using a list or deque (double-ended queue), as long as you use only standard operations of a stack.
// You may assume that all operations are valid (for example, no pop or peek operations will be called on an empty queue).
//
//
class MyQueue {
private:
stack<int> stk1, stk2;
public:
/** Initialize your data structure here. */
MyQueue() {
}
/** Push element x to the back of queue. */
void push(int x) {
while(!stk2.empty()){
stk1.push(stk2.top());
stk2.pop();
}
stk1.push(x);
}
/** Removes the element from in front of queue and returns that element. */
int pop() {
while(!stk1.empty()){
stk2.push(stk1.top());
stk1.pop();
}
int t = stk2.top();
stk2.pop();
return t;
}
/** Get the front element. */
int peek() {
while(!stk1.empty()){
stk2.push(stk1.top());
stk1.pop();
}
return stk2.top();
}
/** Returns whether the queue is empty. */
bool empty() {
return stk1.empty() && stk2.empty();
}
};
/**
* Your MyQueue object will be instantiated and called as such:
* MyQueue obj = new MyQueue();
* obj.push(x);
* int param_2 = obj.pop();
* int param_3 = obj.peek();
* bool param_4 = obj.empty();
*/
| 25.385542 | 197 | 0.566208 | [
"object"
] |
4379f111666845ae6c23b9d7d0f91a3aa2011598 | 11,023 | hpp | C++ | modules/mmdb/EntryDataList.hpp | dracc/VCMP-SqMod | d3e6adea147f5b2cae5119ddd6028833aa625c09 | [
"MIT"
] | null | null | null | modules/mmdb/EntryDataList.hpp | dracc/VCMP-SqMod | d3e6adea147f5b2cae5119ddd6028833aa625c09 | [
"MIT"
] | null | null | null | modules/mmdb/EntryDataList.hpp | dracc/VCMP-SqMod | d3e6adea147f5b2cae5119ddd6028833aa625c09 | [
"MIT"
] | null | null | null | #ifndef _SQMMDB_ENTRYDATALIST_HPP_
#define _SQMMDB_ENTRYDATALIST_HPP_
// ------------------------------------------------------------------------------------------------
#include "Handle/Database.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* Class that can hold and be used inspect database meta-data.
*/
class EntryDataList
{
public:
// --------------------------------------------------------------------------------------------
typedef MMDB_entry_data_list_s Type; // The managed type.
// --------------------------------------------------------------------------------------------
typedef Type* Pointer; // Pointer to the managed type.
typedef const Type* ConstPtr; // Constant pointer to the managed type.
// --------------------------------------------------------------------------------------------
typedef Type& Reference; // Reference to the managed type.
typedef const Type& ConstRef; // Constant reference to the managed type.
protected:
/* --------------------------------------------------------------------------------------------
* Validate the managed database handle and throw an error if invalid.
*/
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
void Validate(CCStr file, Int32 line) const;
#else
void Validate() const;
#endif // _DEBUG
/* --------------------------------------------------------------------------------------------
* Validate the managed database handle and throw an error if invalid.
*/
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
Pointer GetValid(CCStr file, Int32 line) const;
#else
Pointer GetValid() const;
#endif // _DEBUG
/* --------------------------------------------------------------------------------------------
* Validate the managed database handle and throw an error if invalid.
*/
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
Pointer GetValidElem(CCStr file, Int32 line) const;
#else
Pointer GetValidElem() const;
#endif // _DEBUG
private:
// ---------------------------------------------------------------------------------------------
DbRef m_Handle; // The database associated with this meta-data.
Pointer m_List; // The managed entry data list.
Pointer m_Elem; // The currently processed element from the list.
public:
/* --------------------------------------------------------------------------------------------
* Construct and with a specific entry list.
*/
EntryDataList(const DbRef & db, Pointer list)
: m_Handle(db), m_List(list), m_Elem(list)
{
/* ... */
}
/* --------------------------------------------------------------------------------------------
* Default constructor. (null)
*/
EntryDataList()
: m_Handle(), m_List(nullptr), m_Elem(nullptr)
{
/* ... */
}
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
*/
EntryDataList(const EntryDataList &) = delete;
/* --------------------------------------------------------------------------------------------
* Move constructor.
*/
EntryDataList(EntryDataList && o)
: m_Handle(o.m_Handle)
, m_List(o.m_List)
, m_Elem(o.m_Elem)
{
o.m_List = nullptr;
o.m_Elem = nullptr;
}
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~EntryDataList()
{
// Do we have to free any list?
if (m_List)
{
MMDB_free_entry_data_list(m_List);
}
}
/* --------------------------------------------------------------------------------------------
* Copy assignment operator. (disabled)
*/
EntryDataList & operator = (const EntryDataList &) = delete;
/* --------------------------------------------------------------------------------------------
* Move assignment operator.
*/
EntryDataList & operator = (EntryDataList && o)
{
if (m_List != o.m_List)
{
m_Handle = o.m_Handle;
m_List = o.m_List;
m_Elem = o.m_Elem;
o.m_List = nullptr;
o.m_Elem = nullptr;
}
return *this;
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
CSStr ToString() const
{
return m_Elem ? AsTypeStr(m_Elem->entry_data.type) : _SC("invalid");
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to retrieve the name from instances of this type.
*/
static SQInteger Typename(HSQUIRRELVM vm);
/* --------------------------------------------------------------------------------------------
* See whether this instance references a valid database and element pointer.
*/
bool IsValid() const
{
return m_Handle && m_Elem;
}
/* --------------------------------------------------------------------------------------------
* Release the manages handles/pointers and become a null instance.
*/
void Release()
{
m_Handle.Reset();
// Do we have to free any list?
if (m_List)
{
MMDB_free_entry_data_list(m_List);
}
// Finally, release those as well
m_List = nullptr;
m_Elem = nullptr;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the database associated with the managed handle/pointer.
*/
Database GetDatabase() const;
/* --------------------------------------------------------------------------------------------
* Return the number of active references to the managed database instance.
*/
Uint32 GetRefCount() const
{
return m_Handle.Count();
}
/* --------------------------------------------------------------------------------------------
* See whether a valid element is currently processed.
*/
bool HaveElement() const
{
return m_Elem;
}
/* --------------------------------------------------------------------------------------------
* Used to retrieve the type of the current element as a string.
*/
CSStr TypeName() const
{
return AsTypeStr(SQMOD_GET_VALID_ELEM(*this)->entry_data.type);
}
/* --------------------------------------------------------------------------------------------
* Return the total entries in the list.
*/
Uint32 GetCount() const;
/* --------------------------------------------------------------------------------------------
* Go to the next element.
*/
bool Next();
/* --------------------------------------------------------------------------------------------
* Advance a certain number of elements.
*/
bool Advance(SQInteger n);
/* --------------------------------------------------------------------------------------------
* Go back to the first element in the list.
*/
void Reset()
{
m_Elem = SQMOD_GET_VALID_ELEM(*this);
}
/* --------------------------------------------------------------------------------------------
* See whether a valid element is currently processed.
*/
bool HasData() const
{
return ConvTo< bool >::From(SQMOD_GET_VALID_ELEM(*this)->entry_data.has_data);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the type identifier of the current element.
*/
SQInteger GetType() const
{
return ConvTo< SQInteger >::From(SQMOD_GET_VALID_ELEM(*this)->entry_data.type);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the offset of the current element.
*/
SQInteger GetOffset() const
{
return ConvTo< SQInteger >::From(SQMOD_GET_VALID_ELEM(*this)->entry_data.offset);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the offset of the next element.
*/
SQInteger DataSize() const
{
return ConvTo< SQInteger >::From(SQMOD_GET_VALID_ELEM(*this)->entry_data.data_size);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the value from the current element as a boolean.
*/
bool GetBool() const
{
return GetEntryAsBool(SQMOD_GET_VALID_ELEM(*this)->entry_data);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the value from the current element as a native integer.
*/
SQInteger GetInteger() const
{
return GetEntryAsInteger(SQMOD_GET_VALID_ELEM(*this)->entry_data);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the value from the current element as a floating point.
*/
SQFloat GetFloat() const
{
return GetEntryAsFloat(SQMOD_GET_VALID_ELEM(*this)->entry_data);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the value from the current element as a long integer.
*/
Object GetLong() const
{
return GetEntryAsLong(SQMOD_GET_VALID_ELEM(*this)->entry_data);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the value from the current element as a string.
*/
Object GetString() const
{
return GetEntryAsString(SQMOD_GET_VALID_ELEM(*this)->entry_data);
}
/* --------------------------------------------------------------------------------------------
* Retrieve the value from the current element as a stream of bytes.
*/
Object GetBytes() const
{
return GetEntryAsBytes(SQMOD_GET_VALID_ELEM(*this)->entry_data);
}
/* --------------------------------------------------------------------------------------------
* Dumpt the contents of the list to the specified list.
*/
void DumpTo(CSStr filepath) const
{
DumpTo(filepath, 0);
}
/* --------------------------------------------------------------------------------------------
* Dumpt the contents of the list to the specified list.
*/
void DumpTo(CSStr filepath, Int32 indent) const;
};
} // Namespace:: SqMod
#endif // _SQMMDB_ENTRYDATALIST_HPP_
| 34.446875 | 100 | 0.388279 | [
"object"
] |
437a6ddc56c21e4c0880e5e70641e7e8f634e410 | 17,817 | hpp | C++ | source/Base/Quaternion.hpp | dracc/VCMP-SqMod | d3e6adea147f5b2cae5119ddd6028833aa625c09 | [
"MIT"
] | null | null | null | source/Base/Quaternion.hpp | dracc/VCMP-SqMod | d3e6adea147f5b2cae5119ddd6028833aa625c09 | [
"MIT"
] | null | null | null | source/Base/Quaternion.hpp | dracc/VCMP-SqMod | d3e6adea147f5b2cae5119ddd6028833aa625c09 | [
"MIT"
] | null | null | null | #ifndef _BASE_QUATERNION_HPP_
#define _BASE_QUATERNION_HPP_
// ------------------------------------------------------------------------------------------------
#include "SqBase.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* Quaternion class for representing rotations.
*/
struct Quaternion
{
/* --------------------------------------------------------------------------------------------
* The type of value used by components of type.
*/
typedef float Value;
/* --------------------------------------------------------------------------------------------
* Helper instances for common values mostly used as return types or comparison.
*/
static const Quaternion NIL;
static const Quaternion MIN;
static const Quaternion MAX;
static const Quaternion IDENTITY;
/* --------------------------------------------------------------------------------------------
* The delimiter character to be used when extracting values from strings.
*/
static SQChar Delim;
/* --------------------------------------------------------------------------------------------
* The x, y, z and w components of this type.
*/
Value x, y, z, w;
/* --------------------------------------------------------------------------------------------
* Default constructor.
*/
Quaternion();
/* --------------------------------------------------------------------------------------------
* Construct from scalar value.
*/
explicit Quaternion(Value sv);
/* --------------------------------------------------------------------------------------------
* Construct from Euler angles (in degrees.)
*/
Quaternion(Value xv, Value yv, Value zv);
/* --------------------------------------------------------------------------------------------
* Construct from individual values.
*/
Quaternion(Value xv, Value yv, Value zv, Value wv);
/* --------------------------------------------------------------------------------------------
* Copy constructor.
*/
Quaternion(const Quaternion & o) = default;
/* --------------------------------------------------------------------------------------------
* Move constructor.
*/
Quaternion(Quaternion && o) = default;
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~Quaternion() = default;
/* --------------------------------------------------------------------------------------------
* Copy assignment operator.
*/
Quaternion & operator = (const Quaternion & o) = default;
/* --------------------------------------------------------------------------------------------
* Move assignment operator.
*/
Quaternion & operator = (Quaternion && o) = default;
/* --------------------------------------------------------------------------------------------
* Scalar value assignment operator.
*/
Quaternion & operator = (Value s);
/* --------------------------------------------------------------------------------------------
* Euler assignment operator.
*/
Quaternion & operator = (const Vector3 & q);
/* --------------------------------------------------------------------------------------------
* Four-dimensional vector assignment operator threated as a three-dimensional vector.
*/
Quaternion & operator = (const Vector4 & q);
/* --------------------------------------------------------------------------------------------
* Addition assignment operator.
*/
Quaternion & operator += (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* Subtraction assignment operator.
*/
Quaternion & operator -= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* Multiplication assignment operator.
*/
Quaternion & operator *= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* Division assignment operator.
*/
Quaternion & operator /= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* Modulo assignment operator.
*/
Quaternion & operator %= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* Scalar value addition assignment operator.
*/
Quaternion & operator += (Value s);
/* --------------------------------------------------------------------------------------------
* Scalar value subtraction assignment operator.
*/
Quaternion & operator -= (Value s);
/* --------------------------------------------------------------------------------------------
* Scalar value multiplication assignment operator.
*/
Quaternion & operator *= (Value s);
/* --------------------------------------------------------------------------------------------
* Scalar value division assignment operator.
*/
Quaternion & operator /= (Value s);
/* --------------------------------------------------------------------------------------------
* Scalar value modulo assignment operator.
*/
Quaternion & operator %= (Value s);
/* --------------------------------------------------------------------------------------------
* Pre-increment operator.
*/
Quaternion & operator ++ ();
/* --------------------------------------------------------------------------------------------
* Pre-decrement operator.
*/
Quaternion & operator -- ();
/* --------------------------------------------------------------------------------------------
* Post-increment operator.
*/
Quaternion operator ++ (int);
/* --------------------------------------------------------------------------------------------
* Post-decrement operator.
*/
Quaternion operator -- (int);
/* --------------------------------------------------------------------------------------------
* Addition operator.
*/
Quaternion operator + (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Subtraction operator.
*/
Quaternion operator - (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Multiplication operator.
*/
Quaternion operator * (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Division operator.
*/
Quaternion operator / (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Modulo operator.
*/
Quaternion operator % (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Scalar value addition operator.
*/
Quaternion operator + (Value s) const;
/* --------------------------------------------------------------------------------------------
* Scalar value subtraction operator.
*/
Quaternion operator - (Value s) const;
/* --------------------------------------------------------------------------------------------
* Scalar value multiplication operator.
*/
Quaternion operator * (Value s) const;
/* --------------------------------------------------------------------------------------------
* Scalar value division operator.
*/
Quaternion operator / (Value s) const;
/* --------------------------------------------------------------------------------------------
* Scalar value modulo operator.
*/
Quaternion operator % (Value s) const;
/* --------------------------------------------------------------------------------------------
* Unary plus operator.
*/
Quaternion operator + () const;
/* --------------------------------------------------------------------------------------------
* Unary minus operator.
*/
Quaternion operator - () const;
/* --------------------------------------------------------------------------------------------
* Equality comparison operator.
*/
bool operator == (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Inequality comparison operator.
*/
bool operator != (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Less than comparison operator.
*/
bool operator < (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Greater than comparison operator.
*/
bool operator > (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Less than or equal comparison operator.
*/
bool operator <= (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Greater than or equal comparison operator.
*/
bool operator >= (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare two instances of this type.
*/
Int32 Cmp(const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(SQFloat s) const
{
return Cmp(Quaternion(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(SQInteger s) const
{
return Cmp(Quaternion(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{
return Cmp(Quaternion(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(std::nullptr_t) const
{
return Cmp(Quaternion(static_cast< Value >(0)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
CSStr ToString() const;
/* --------------------------------------------------------------------------------------------
* Set all components to the specified scalar value.
*/
void SetScalar(Value ns);
/* --------------------------------------------------------------------------------------------
* Copy the values from another instance of this type.
*/
void SetQuaternion(const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* Set all components to the specified values.
*/
void SetQuaternionEx(Value nx, Value ny, Value nz, Value nw);
/* --------------------------------------------------------------------------------------------
* Copy the values from a three-dimensional vector as euler rotation.
*/
void SetVector3(const Vector3 & v);
/* --------------------------------------------------------------------------------------------
* Copy the values from a three-dimensional vector as euler rotation.
*/
void SetVector3Ex(Value nx, Value ny, Value nz);
/* --------------------------------------------------------------------------------------------
* Copy the values from a four-dimensional vector.
*/
void SetVector4(const Vector4 & v);
/* --------------------------------------------------------------------------------------------
* Set the values extracted from the specified string using the specified delimiter.
*/
void SetStr(SQChar delim, StackStrF & values);
/* --------------------------------------------------------------------------------------------
* Generate random values for all components of this instance.
*/
void Generate();
/* --------------------------------------------------------------------------------------------
* Generate random values for all components of this instance within the specified bounds.
*/
void Generate(Value min, Value max);
/* --------------------------------------------------------------------------------------------
* Generate random values for all components of this instance within the specified bounds.
*/
void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin, Value zmax, Value wmin, Value wmax);
/* --------------------------------------------------------------------------------------------
* Clear the component values to default.
*/
void Clear()
{
x = 0.0, y = 0.0, z = 0.0, w = 0.0;
}
/* --------------------------------------------------------------------------------------------
* Retrieve a new instance of this type with absolute component values.
*/
Quaternion Abs() const;
/* --------------------------------------------------------------------------------------------
* Return whether is NaN.
*/
bool IsNaN() const;
/* --------------------------------------------------------------------------------------------
* Return squared length.
*/
Value LengthSquared() const;
/* --------------------------------------------------------------------------------------------
* Calculate dot product.
*/
Value DotProduct(const Quaternion & quat) const;
/* --------------------------------------------------------------------------------------------
* Return conjugate.
*/
Quaternion Conjugate() const;
/* --------------------------------------------------------------------------------------------
* Normalize to unit length.
*/
void Normalize();
/* --------------------------------------------------------------------------------------------
* Return normalized to unit length.
*/
Quaternion Normalized() const;
/* --------------------------------------------------------------------------------------------
* Define from an angle (in degrees) and axis.
*/
void FromAngleAxis(Value angle, const Vector3 & axis);
/* --------------------------------------------------------------------------------------------
* Define from the rotation difference between two direction vectors.
*/
void FromRotationTo(const Vector3 & start, const Vector3 & end);
/* --------------------------------------------------------------------------------------------
* Return inverse.
*/
Quaternion Inverse() const;
/* --------------------------------------------------------------------------------------------
* Return Euler angles in degrees.
*/
Vector3 ToEuler() const;
/* --------------------------------------------------------------------------------------------
* Return yaw angle in degrees.
*/
Value YawAngle() const;
/* --------------------------------------------------------------------------------------------
* Return pitch angle in degrees.
*/
Value PitchAngle() const;
/* --------------------------------------------------------------------------------------------
* Return roll angle in degrees.
*/
Value RollAngle() const;
/* --------------------------------------------------------------------------------------------
* Spherical interpolation with another quaternion.
*/
Quaternion Slerp(Quaternion quat, Value t) const;
/* --------------------------------------------------------------------------------------------
* Normalized linear interpolation with another quaternion.
*/
Quaternion Nlerp(const Quaternion & quat, Value t) const;
/* --------------------------------------------------------------------------------------------
* Normalized linear interpolation with another quaternion.
*/
Quaternion NlerpEx(const Quaternion & quat, Value t, bool shortest_path) const;
/* --------------------------------------------------------------------------------------------
* Extract the values for components of the Quaternion type from a string.
*/
static const Quaternion & Get(StackStrF & str);
/* --------------------------------------------------------------------------------------------
* Extract the values for components of the Quaternion type from a string.
*/
static const Quaternion & GetEx(SQChar delim, StackStrF & str);
};
} // Namespace:: SqMod
#endif // _BASE_QUATERNION_HPP_
| 38.986871 | 114 | 0.324858 | [
"vector"
] |
438091835246017ad0505f438e1dc563f8d57c0d | 2,495 | cpp | C++ | src/Sparrow/Sparrow/Implementations/RealTimeSpectroscopy/IR/IntensitiesCalculator.cpp | qcscine/sparrow | 387e56ed8da78e10d96861758c509f7c375dcf07 | [
"BSD-3-Clause"
] | 45 | 2019-06-12T20:04:00.000Z | 2022-02-28T21:43:54.000Z | src/Sparrow/Sparrow/Implementations/RealTimeSpectroscopy/IR/IntensitiesCalculator.cpp | qcscine/sparrow | 387e56ed8da78e10d96861758c509f7c375dcf07 | [
"BSD-3-Clause"
] | 12 | 2019-06-12T23:53:57.000Z | 2022-03-28T18:35:57.000Z | src/Sparrow/Sparrow/Implementations/RealTimeSpectroscopy/IR/IntensitiesCalculator.cpp | qcscine/sparrow | 387e56ed8da78e10d96861758c509f7c375dcf07 | [
"BSD-3-Clause"
] | 11 | 2019-06-22T22:52:51.000Z | 2022-03-11T16:59:59.000Z | /**
* @file
* @copyright This code is licensed under the 3-clause BSD license.\n
* Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.\n
* See LICENSE.txt for details.
*/
#define _USE_MATH_DEFINES
#include "IntensitiesCalculator.h"
#include "../Utils/LineWidthGenerator.h"
#include <cmath>
#include <iostream>
namespace Scine {
namespace Sparrow {
namespace RealTimeSpectroscopy {
constexpr double cSquared = 1.6021765 * 1.6021765e-38;
constexpr double coulombForceConstant = 8.9875517873681e9;
constexpr double avogadrosNumber = 6.02214199e23;
constexpr double c = 299792458.;
constexpr double atomicMassUnit = 1.6605387280149467e-27;
constexpr double conversionFactor =
cSquared * M_PI * coulombForceConstant * avogadrosNumber / (3. * c * c) / atomicMassUnit / 1000.;
const Eigen::VectorXd IntensitiesCalculator::getAdsorptionCoefficients() const {
return squaredNormalDipoleGradient_ * conversionFactor;
}
Eigen::VectorXd IntensitiesCalculator::calculateRelativeVibrationalIntensities() {
Eigen::VectorXd relativeIntensities = squaredNormalDipoleGradient_;
relativeIntensities /= relativeIntensities.maxCoeff();
return relativeIntensities;
}
void IntensitiesCalculator::setSquaredNormalDipoleGradient(const Eigen::VectorXd& newSquaredNormalDipoleGradient) {
squaredNormalDipoleGradient_ = newSquaredNormalDipoleGradient;
}
Eigen::VectorXd
IntensitiesCalculator::transformCartesianToSquaredNormalDipoleGradient(const Eigen::MatrixXd& massWeightedEigenvectors,
const Eigen::MatrixX3d& cartesianDipoleMoment,
const std::vector<double>& masses) {
int nAtoms = masses.size();
Eigen::Matrix3Xd massWeightedDipoleGradient = cartesianDipoleMoment.transpose();
for (int atom = 0; atom < nAtoms; ++atom) {
massWeightedDipoleGradient.middleCols(3 * atom, 3) /= std::sqrt(masses[atom]);
}
// get mass weighted eigenvector matrix A and calculate the three components of du/dQ (ux, uy, uz) as
// (du/dQ)' = (du/dR)' * A = (A' * du/dR)'. In eigen Matrix3Xd is a 3x3N matrix representing (du/dR)' (' =
// transposed). calculates the squared norm
Eigen::VectorXd normalDipoleGradient = (massWeightedDipoleGradient * massWeightedEigenvectors).colwise().squaredNorm();
return normalDipoleGradient;
}
} // namespace RealTimeSpectroscopy
} // namespace Sparrow
} // namespace Scine
| 42.288136 | 121 | 0.728657 | [
"vector"
] |
438157a9cb92cf153d585e65eb64666f62bf81d0 | 4,111 | cpp | C++ | examples/opencl/plot3.cpp | FloopCZ/forge | 98d568eb009eb521bb3d4a8804df81f86c6e9119 | [
"BSD-3-Clause"
] | null | null | null | examples/opencl/plot3.cpp | FloopCZ/forge | 98d568eb009eb521bb3d4a8804df81f86c6e9119 | [
"BSD-3-Clause"
] | null | null | null | examples/opencl/plot3.cpp | FloopCZ/forge | 98d568eb009eb521bb3d4a8804df81f86c6e9119 | [
"BSD-3-Clause"
] | null | null | null | /*******************************************************
* Copyright (c) 2015-2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <forge.h>
#include "cl_helpers.h"
#include <mutex>
#include <complex>
#include <cmath>
#include <vector>
#include <iostream>
#include <iterator>
#include <algorithm>
const unsigned DIMX = 1000;
const unsigned DIMY = 800;
static const float ZMIN = 0.1f;
static const float ZMAX = 10.f;
const float DX = 0.005f;
static const unsigned ZSIZE = (unsigned)((ZMAX-ZMIN)/DX+1);
using namespace std;
#define USE_FORGE_OPENCL_COPY_HELPERS
#include <ComputeCopy.h>
static const std::string sincos_surf_kernel =
"kernel void generateCurve(global float* out, const float t, const float dx, const float zmin, const unsigned SIZE)\n"
"{\n"
" int offset = get_global_id(0);\n"
"\n"
" float z = zmin + offset*dx;\n"
" if (offset < SIZE) {\n"
" out[offset*3 + 0] = cos(z*t+t)/z;\n"
" out[offset*3 + 1] = sin(z*t+t)/z;\n"
" out[offset*3 + 2] = z + 0.1*sin(t);\n"
" }\n"
"}\n";
inline int divup(int a, int b)
{
return (a+b-1)/b;
}
void kernel(cl::Buffer& devOut, cl::CommandQueue& queue, float t)
{
static std::once_flag compileFlag;
static cl::Program prog;
static cl::Kernel kern;
std::call_once(compileFlag,
[queue]() {
prog = cl::Program(queue.getInfo<CL_QUEUE_CONTEXT>(), sincos_surf_kernel, true);
kern = cl::Kernel(prog, "generateCurve");
});
NDRange global(ZSIZE);
kern.setArg(0, devOut);
kern.setArg(1, t);
kern.setArg(2, DX);
kern.setArg(3, ZMIN);
kern.setArg(4, ZSIZE);
queue.enqueueNDRangeKernel(kern, cl::NullRange, global);
}
int main(void)
{
try {
/*
* First Forge call should be a window creation call
* so that necessary OpenGL context is created for any
* other forge::* object to be created successfully
*/
forge::Window wnd(DIMX, DIMY, "Three dimensional line plot demo");
wnd.makeCurrent();
forge::Chart chart(FG_CHART_3D);
chart.setAxesLabelFormat("%3.1f", "%3.1f", "%.2e");
chart.setAxesLimits(-1.1f, 1.1f, -1.1f, 1.1f, 0.f, 10.f);
chart.setAxesTitles("x-axis", "y-axis", "z-axis");
forge::Plot plot3 = chart.plot(ZSIZE, forge::f32);
/*
* Helper function to create a CLGL interop context.
* This function checks for if the extension is available
* and creates the context on the appropriate device.
* Note: context and queue are defined in cl_helpers.h
*/
context = createCLGLContext(wnd);
Device device = context.getInfo<CL_CONTEXT_DEVICES>()[0];
queue = CommandQueue(context, device);
cl::Buffer devOut(context, CL_MEM_READ_WRITE, sizeof(float) * ZSIZE * 3);
static float t=0;
kernel(devOut, queue, t);
GfxHandle* handle;
createGLBuffer(&handle, plot3.vertices(), FORGE_VERTEX_BUFFER);
/* copy your data into the pixel buffer object exposed by
* forge::Surface class and then proceed to rendering.
* To help the users with copying the data from compute
* memory to display memory, Forge provides copy headers
* along with the library to help with this task
*/
copyToGLBuffer(handle, (ComputeResourceHandle)devOut(), plot3.verticesSize());
do {
t+=0.01f;
kernel(devOut, queue, t);
copyToGLBuffer(handle, (ComputeResourceHandle)devOut(), plot3.verticesSize());
wnd.draw(chart);
} while(!wnd.close());
releaseGLBuffer(handle);
}catch (forge::Error err) {
std::cout << err.what() << "(" << err.err() << ")" << std::endl;
} catch (cl::Error err) {
std::cout << err.what() << "(" << err.err() << ")" << std::endl;
}
return 0;
}
| 30.227941 | 118 | 0.596692 | [
"object",
"vector"
] |
438345f344d0360829e8fac148306089b70b1df2 | 17,806 | cpp | C++ | third_party/niflib/src/obj/NiSequence.cpp | tcoppex/dojima | e9e2da8097c6ca5359ea5a26714a044a3ee83fe8 | [
"Unlicense"
] | null | null | null | third_party/niflib/src/obj/NiSequence.cpp | tcoppex/dojima | e9e2da8097c6ca5359ea5a26714a044a3ee83fe8 | [
"Unlicense"
] | null | null | null | third_party/niflib/src/obj/NiSequence.cpp | tcoppex/dojima | e9e2da8097c6ca5359ea5a26714a044a3ee83fe8 | [
"Unlicense"
] | null | null | null | /* Copyright (c) 2006, NIF File Format Library and Tools
All rights reserved. Please see niflib.h for license. */
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script. Only //
// add custom code in the designated areas or it will be overwritten during //
// the next update. //
//-----------------------------------NOTICE----------------------------------//
//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//
#include "nif/FixLink.h"
#include "nif/ObjectRegistry.h"
#include "nif/NIF_IO.h"
#include "nif/obj/NiSequence.h"
#include "nif/gen/ControllerLink.h"
#include "nif/obj/NiInterpolator.h"
#include "nif/obj/NiObject.h"
#include "nif/obj/NiStringPalette.h"
#include "nif/obj/NiTimeController.h"
#include "nif/obj/NiTextKeyExtraData.h"
using namespace Niflib;
//Definition of TYPE constant
const Type NiSequence::TYPE("NiSequence", &NiObject::TYPE );
NiSequence::NiSequence() : textKeys(NULL), unknownInt4((int)0), unknownInt5((int)0), numControlledBlocks((unsigned int)0), unknownInt1((unsigned int)0) {
//--BEGIN CONSTRUCTOR CUSTOM CODE--//
//--END CUSTOM CODE--//
}
NiSequence::~NiSequence() {
//--BEGIN DESTRUCTOR CUSTOM CODE--//
//--END CUSTOM CODE--//
}
const Type & NiSequence::GetType() const {
return TYPE;
}
NiObject * NiSequence::Create() {
return new NiSequence;
}
void NiSequence::Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ) {
//--BEGIN PRE-READ CUSTOM CODE--//
//--END CUSTOM CODE--//
unsigned int block_num;
NiObject::Read( in, link_stack, info );
NifStream( name, in, info );
if ( info.version <= 0x0A010000 ) {
NifStream( textKeysName, in, info );
NifStream( block_num, in, info );
link_stack.push_back( block_num );
};
if ( ( info.version >= 0x14030009 ) && ( info.version <= 0x14030009 ) && ( info.userVersion == 131072 ) ) {
NifStream( unknownInt4, in, info );
NifStream( unknownInt5, in, info );
};
NifStream( numControlledBlocks, in, info );
if ( info.version >= 0x0A01006A ) {
NifStream( unknownInt1, in, info );
};
controlledBlocks.resize(numControlledBlocks);
for (unsigned int i1 = 0; i1 < controlledBlocks.size(); i1++) {
if ( info.version <= 0x0A010000 ) {
NifStream( controlledBlocks[i1].targetName, in, info );
NifStream( block_num, in, info );
link_stack.push_back( block_num );
};
if ( info.version >= 0x0A01006A ) {
NifStream( block_num, in, info );
link_stack.push_back( block_num );
NifStream( block_num, in, info );
link_stack.push_back( block_num );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( block_num, in, info );
link_stack.push_back( block_num );
NifStream( controlledBlocks[i1].unknownShort0, in, info );
};
if ( ( info.version >= 0x0A01006A ) && ( (info.userVersion >= 10) ) ) {
NifStream( controlledBlocks[i1].priority, in, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( block_num, in, info );
link_stack.push_back( block_num );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].nodeName, in, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].nodeName, in, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].nodeNameOffset, in, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].propertyType, in, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].propertyType, in, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].propertyTypeOffset, in, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].controllerType, in, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].controllerType, in, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].controllerTypeOffset, in, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].variable1, in, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].variable1, in, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].variable1Offset, in, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].variable2, in, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].variable2, in, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].variable2Offset, in, info );
};
};
//--BEGIN POST-READ CUSTOM CODE--//
//--END CUSTOM CODE--//
}
void NiSequence::Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info ) const {
//--BEGIN PRE-WRITE CUSTOM CODE--//
//--END CUSTOM CODE--//
NiObject::Write( out, link_map, missing_link_stack, info );
numControlledBlocks = (unsigned int)(controlledBlocks.size());
NifStream( name, out, info );
if ( info.version <= 0x0A010000 ) {
NifStream( textKeysName, out, info );
if ( info.version < VER_3_3_0_13 ) {
WritePtr32( &(*textKeys), out );
} else {
if ( textKeys != NULL ) {
map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(textKeys) );
if (it != link_map.end()) {
NifStream( it->second, out, info );
missing_link_stack.push_back( NULL );
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( textKeys );
}
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( NULL );
}
}
};
if ( ( info.version >= 0x14030009 ) && ( info.version <= 0x14030009 ) && ( info.userVersion == 131072 ) ) {
NifStream( unknownInt4, out, info );
NifStream( unknownInt5, out, info );
};
NifStream( numControlledBlocks, out, info );
if ( info.version >= 0x0A01006A ) {
NifStream( unknownInt1, out, info );
};
for (unsigned int i1 = 0; i1 < controlledBlocks.size(); i1++) {
if ( info.version <= 0x0A010000 ) {
NifStream( controlledBlocks[i1].targetName, out, info );
if ( info.version < VER_3_3_0_13 ) {
WritePtr32( &(*controlledBlocks[i1].controller), out );
} else {
if ( controlledBlocks[i1].controller != NULL ) {
map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(controlledBlocks[i1].controller) );
if (it != link_map.end()) {
NifStream( it->second, out, info );
missing_link_stack.push_back( NULL );
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( controlledBlocks[i1].controller );
}
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( NULL );
}
}
};
if ( info.version >= 0x0A01006A ) {
if ( info.version < VER_3_3_0_13 ) {
WritePtr32( &(*controlledBlocks[i1].interpolator), out );
} else {
if ( controlledBlocks[i1].interpolator != NULL ) {
map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(controlledBlocks[i1].interpolator) );
if (it != link_map.end()) {
NifStream( it->second, out, info );
missing_link_stack.push_back( NULL );
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( controlledBlocks[i1].interpolator );
}
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( NULL );
}
}
if ( info.version < VER_3_3_0_13 ) {
WritePtr32( &(*controlledBlocks[i1].controller), out );
} else {
if ( controlledBlocks[i1].controller != NULL ) {
map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(controlledBlocks[i1].controller) );
if (it != link_map.end()) {
NifStream( it->second, out, info );
missing_link_stack.push_back( NULL );
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( controlledBlocks[i1].controller );
}
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( NULL );
}
}
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
if ( info.version < VER_3_3_0_13 ) {
WritePtr32( &(*controlledBlocks[i1].unknownLink2), out );
} else {
if ( controlledBlocks[i1].unknownLink2 != NULL ) {
map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(controlledBlocks[i1].unknownLink2) );
if (it != link_map.end()) {
NifStream( it->second, out, info );
missing_link_stack.push_back( NULL );
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( controlledBlocks[i1].unknownLink2 );
}
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( NULL );
}
}
NifStream( controlledBlocks[i1].unknownShort0, out, info );
};
if ( ( info.version >= 0x0A01006A ) && ( (info.userVersion >= 10) ) ) {
NifStream( controlledBlocks[i1].priority, out, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
if ( info.version < VER_3_3_0_13 ) {
WritePtr32( &(*controlledBlocks[i1].stringPalette), out );
} else {
if ( controlledBlocks[i1].stringPalette != NULL ) {
map<NiObjectRef,unsigned int>::const_iterator it = link_map.find( StaticCast<NiObject>(controlledBlocks[i1].stringPalette) );
if (it != link_map.end()) {
NifStream( it->second, out, info );
missing_link_stack.push_back( NULL );
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( controlledBlocks[i1].stringPalette );
}
} else {
NifStream( 0xFFFFFFFF, out, info );
missing_link_stack.push_back( NULL );
}
}
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].nodeName, out, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].nodeName, out, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].nodeNameOffset, out, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].propertyType, out, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].propertyType, out, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].propertyTypeOffset, out, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].controllerType, out, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].controllerType, out, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].controllerTypeOffset, out, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].variable1, out, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].variable1, out, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].variable1Offset, out, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
NifStream( controlledBlocks[i1].variable2, out, info );
};
if ( info.version >= 0x14010003 ) {
NifStream( controlledBlocks[i1].variable2, out, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
NifStream( controlledBlocks[i1].variable2Offset, out, info );
};
};
//--BEGIN POST-WRITE CUSTOM CODE--//
//--END CUSTOM CODE--//
}
std::string NiSequence::asString( bool verbose ) const {
//--BEGIN PRE-STRING CUSTOM CODE--//
//--END CUSTOM CODE--//
stringstream out;
unsigned int array_output_count = 0;
out << NiObject::asString();
numControlledBlocks = (unsigned int)(controlledBlocks.size());
out << " Name: " << name << endl;
out << " Text Keys Name: " << textKeysName << endl;
out << " Text Keys: " << textKeys << endl;
out << " Unknown Int 4: " << unknownInt4 << endl;
out << " Unknown Int 5: " << unknownInt5 << endl;
out << " Num Controlled Blocks: " << numControlledBlocks << endl;
out << " Unknown Int 1: " << unknownInt1 << endl;
array_output_count = 0;
for (unsigned int i1 = 0; i1 < controlledBlocks.size(); i1++) {
if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
break;
};
out << " Target Name: " << controlledBlocks[i1].targetName << endl;
out << " Controller: " << controlledBlocks[i1].controller << endl;
out << " Interpolator: " << controlledBlocks[i1].interpolator << endl;
out << " Unknown Link 2: " << controlledBlocks[i1].unknownLink2 << endl;
out << " Unknown Short 0: " << controlledBlocks[i1].unknownShort0 << endl;
out << " Priority: " << controlledBlocks[i1].priority << endl;
out << " String Palette: " << controlledBlocks[i1].stringPalette << endl;
out << " Node Name: " << controlledBlocks[i1].nodeName << endl;
out << " Node Name Offset: " << controlledBlocks[i1].nodeNameOffset << endl;
out << " Property Type: " << controlledBlocks[i1].propertyType << endl;
out << " Property Type Offset: " << controlledBlocks[i1].propertyTypeOffset << endl;
out << " Controller Type: " << controlledBlocks[i1].controllerType << endl;
out << " Controller Type Offset: " << controlledBlocks[i1].controllerTypeOffset << endl;
out << " Variable 1: " << controlledBlocks[i1].variable1 << endl;
out << " Variable 1 Offset: " << controlledBlocks[i1].variable1Offset << endl;
out << " Variable 2: " << controlledBlocks[i1].variable2 << endl;
out << " Variable 2 Offset: " << controlledBlocks[i1].variable2Offset << endl;
};
return out.str();
//--BEGIN POST-STRING CUSTOM CODE--//
//--END CUSTOM CODE--//
}
void NiSequence::FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info ) {
//--BEGIN PRE-FIXLINKS CUSTOM CODE--//
//--END CUSTOM CODE--//
NiObject::FixLinks( objects, link_stack, missing_link_stack, info );
if ( info.version <= 0x0A010000 ) {
textKeys = FixLink<NiTextKeyExtraData>( objects, link_stack, missing_link_stack, info );
};
for (unsigned int i1 = 0; i1 < controlledBlocks.size(); i1++) {
if ( info.version <= 0x0A010000 ) {
controlledBlocks[i1].controller = FixLink<NiTimeController>( objects, link_stack, missing_link_stack, info );
};
if ( info.version >= 0x0A01006A ) {
controlledBlocks[i1].interpolator = FixLink<NiInterpolator>( objects, link_stack, missing_link_stack, info );
controlledBlocks[i1].controller = FixLink<NiTimeController>( objects, link_stack, missing_link_stack, info );
};
if ( ( info.version >= 0x0A01006A ) && ( info.version <= 0x0A01006A ) ) {
controlledBlocks[i1].unknownLink2 = FixLink<NiObject>( objects, link_stack, missing_link_stack, info );
};
if ( ( info.version >= 0x0A020000 ) && ( info.version <= 0x14000005 ) ) {
controlledBlocks[i1].stringPalette = FixLink<NiStringPalette>( objects, link_stack, missing_link_stack, info );
};
};
//--BEGIN POST-FIXLINKS CUSTOM CODE--//
//--END CUSTOM CODE--//
}
std::list<NiObjectRef> NiSequence::GetRefs() const {
list<Ref<NiObject> > refs;
refs = NiObject::GetRefs();
if ( textKeys != NULL )
refs.push_back(StaticCast<NiObject>(textKeys));
for (unsigned int i1 = 0; i1 < controlledBlocks.size(); i1++) {
if ( controlledBlocks[i1].controller != NULL )
refs.push_back(StaticCast<NiObject>(controlledBlocks[i1].controller));
if ( controlledBlocks[i1].interpolator != NULL )
refs.push_back(StaticCast<NiObject>(controlledBlocks[i1].interpolator));
if ( controlledBlocks[i1].unknownLink2 != NULL )
refs.push_back(StaticCast<NiObject>(controlledBlocks[i1].unknownLink2));
if ( controlledBlocks[i1].stringPalette != NULL )
refs.push_back(StaticCast<NiObject>(controlledBlocks[i1].stringPalette));
};
return refs;
}
std::list<NiObject *> NiSequence::GetPtrs() const {
list<NiObject *> ptrs;
ptrs = NiObject::GetPtrs();
for (unsigned int i1 = 0; i1 < controlledBlocks.size(); i1++) {
};
return ptrs;
}
//--BEGIN MISC CUSTOM CODE--//
string NiSequence::GetName() const {
return name;
}
void NiSequence::SetName( const string & value ) {
name = value;
}
string NiSequence::GetTextKeysName() const {
return textKeysName;
}
void NiSequence::SetTextKeysName( const string & value ) {
textKeysName = value;
}
Ref<NiTextKeyExtraData > NiSequence::GetTextKeys() const {
return textKeys;
}
void NiSequence::SetTextKeys( Ref<NiTextKeyExtraData > value ) {
textKeys = value;
}
vector<ControllerLink > NiSequence::GetControlledBlocks() const {
return controlledBlocks;
}
void NiSequence::SetControlledBlocks( const vector<ControllerLink >& value ) {
controlledBlocks = value;
}
//--END CUSTOM CODE--//
| 38.708696 | 171 | 0.649051 | [
"vector"
] |
4388ec0f2760940aa38b4c88415794bfb24e8e15 | 17,142 | cpp | C++ | pxr/imaging/hdx/testenv/testHdxPickResolveMode.cpp | yurivict/USD | 3b097e3ba8fabf1777a1256e241ea15df83f3065 | [
"Apache-2.0"
] | 1 | 2022-03-16T01:40:10.000Z | 2022-03-16T01:40:10.000Z | pxr/imaging/hdx/testenv/testHdxPickResolveMode.cpp | yurivict/USD | 3b097e3ba8fabf1777a1256e241ea15df83f3065 | [
"Apache-2.0"
] | null | null | null | pxr/imaging/hdx/testenv/testHdxPickResolveMode.cpp | yurivict/USD | 3b097e3ba8fabf1777a1256e241ea15df83f3065 | [
"Apache-2.0"
] | 1 | 2018-10-03T19:08:33.000Z | 2018-10-03T19:08:33.000Z | //
// Copyright 2020 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#include "pxr/pxr.h"
#include "pxr/imaging/garch/glDebugWindow.h"
#include "pxr/imaging/hd/mesh.h"
#include "pxr/imaging/hd/selection.h"
#include "pxr/imaging/hdSt/unitTestGLDrawing.h"
#include "pxr/imaging/hdSt/unitTestHelper.h"
#include "pxr/imaging/hdx/pickTask.h"
#include "pxr/imaging/hdx/selectionTask.h"
#include "pxr/imaging/hdx/selectionTracker.h"
#include "pxr/imaging/hdx/tokens.h"
#include "pxr/imaging/hdx/renderTask.h"
#include "pxr/imaging/hdx/unitTestDelegate.h"
#include "pxr/imaging/hdx/unitTestUtils.h"
#include "pxr/base/tf/errorMark.h"
#include <iostream>
#include <memory>
PXR_NAMESPACE_USING_DIRECTIVE
TF_DEFINE_PRIVATE_TOKENS(
_tokens,
(meshPoints)
(pickables)
);
class Hdx_TestDriver : public HdSt_TestDriverBase<Hdx_UnitTestDelegate>
{
public:
Hdx_TestDriver(TfToken const &reprName);
void DrawWithSelection(GfVec4d const &viewport,
HdxSelectionTrackerSharedPtr selTracker);
HdSelectionSharedPtr Pick(GfVec2i const &startPos, GfVec2i const &endPos,
int width, int height, GfFrustum const &frustum,
GfMatrix4d const &viewMatrix, TfToken const &pickTarget,
TfToken const &resolveMode, HdxPickHitVector *allHits);
protected:
void _Init(HdReprSelector const &reprSelector) override;
private:
HdRprimCollection _pickablesCol;
};
Hdx_TestDriver::Hdx_TestDriver(TfToken const &reprName)
{
_Init(HdReprSelector(reprName));
}
void
Hdx_TestDriver::_Init(HdReprSelector const &reprSelector)
{
_SetupSceneDelegate();
Hdx_UnitTestDelegate &delegate = GetDelegate();
// prepare render task
SdfPath renderSetupTask("/renderSetupTask");
SdfPath renderTask("/renderTask");
SdfPath selectionTask("/selectionTask");
SdfPath pickTask("/pickTask");
delegate.AddRenderSetupTask(renderSetupTask);
delegate.AddRenderTask(renderTask);
delegate.AddSelectionTask(selectionTask);
delegate.AddPickTask(pickTask);
// Add a meshPoints repr since it isn't populated in
// HdRenderIndex::_ConfigureReprs
HdMesh::ConfigureRepr(_tokens->meshPoints,
HdMeshReprDesc(HdMeshGeomStylePoints,
HdCullStyleNothing,
HdMeshReprDescTokens->pointColor,
/*flatShadingEnabled=*/true,
/*blendWireframeColor=*/false));
// Use wireframe and enable points for edge and point picking.
const auto sceneReprSel = HdReprSelector(HdReprTokens->wireOnSurf,
HdReprTokens->disabled,
_tokens->meshPoints);
// render task parameters.
VtValue vParam = delegate.GetTaskParam(renderSetupTask, HdTokens->params);
HdxRenderTaskParams param = vParam.Get<HdxRenderTaskParams>();
param.enableLighting = true; // use default lighting
delegate.SetTaskParam(renderSetupTask, HdTokens->params, VtValue(param));
delegate.SetTaskParam(renderTask, HdTokens->collection,
VtValue(HdRprimCollection(HdTokens->geometry, sceneReprSel)));
HdxSelectionTaskParams selParam;
selParam.enableSelection = true;
selParam.selectionColor = GfVec4f(1, 1, 0, 1);
selParam.locateColor = GfVec4f(1, 0, 1, 1);
delegate.SetTaskParam(
selectionTask, HdTokens->params, VtValue(selParam));
// picking
_pickablesCol = HdRprimCollection(_tokens->pickables, sceneReprSel);
// We have to unfortunately explictly add collections besides 'geometry'
// See HdRenderIndex constructor.
delegate.GetRenderIndex().GetChangeTracker().AddCollection(
_tokens->pickables);
}
void
Hdx_TestDriver::DrawWithSelection(GfVec4d const &viewport,
HdxSelectionTrackerSharedPtr selTracker)
{
SdfPath renderSetupTask("/renderSetupTask");
SdfPath renderTask("/renderTask");
SdfPath selectionTask("/selectionTask");
HdxRenderTaskParams param = GetDelegate().GetTaskParam(
renderSetupTask, HdTokens->params).Get<HdxRenderTaskParams>();
param.viewport = viewport;
param.aovBindings = _aovBindings;
GetDelegate().SetTaskParam(
renderSetupTask, HdTokens->params, VtValue(param));
HdTaskSharedPtrVector tasks;
tasks.push_back(GetDelegate().GetRenderIndex().GetTask(renderSetupTask));
tasks.push_back(GetDelegate().GetRenderIndex().GetTask(renderTask));
tasks.push_back(GetDelegate().GetRenderIndex().GetTask(selectionTask));
_GetEngine()->SetTaskContextData(
HdxTokens->selectionState, VtValue(selTracker));
_GetEngine()->Execute(&GetDelegate().GetRenderIndex(), &tasks);
}
HdSelectionSharedPtr
Hdx_TestDriver::Pick(GfVec2i const &startPos, GfVec2i const &endPos,
int width, int height, GfFrustum const &frustum,
GfMatrix4d const &viewMatrix, TfToken const &pickTarget,
TfToken const &resolveMode, HdxPickHitVector *allHits)
{
HdxPickTaskContextParams p;
p.resolution = HdxUnitTestUtils::CalculatePickResolution(
startPos, endPos, GfVec2i(4,4));
p.pickTarget = pickTarget;
p.resolveMode = resolveMode;
p.viewMatrix = viewMatrix;
p.projectionMatrix = HdxUnitTestUtils::ComputePickingProjectionMatrix(
startPos, endPos, GfVec2i(width, height), frustum);
p.collection = _pickablesCol;
p.outHits = allHits;
HdTaskSharedPtrVector tasks;
tasks.push_back(GetDelegate().GetRenderIndex().GetTask(
SdfPath("/pickTask")));
VtValue pickParams(p);
_GetEngine()->SetTaskContextData(HdxPickTokens->pickParams, pickParams);
_GetEngine()->Execute(&GetDelegate().GetRenderIndex(), &tasks);
return HdxUnitTestUtils::TranslateHitsToSelection(
p.pickTarget, HdSelection::HighlightModeSelect, *allHits);
}
// --------------------------------------------------------------------------
class My_TestGLDrawing : public HdSt_UnitTestGLDrawing
{
public:
My_TestGLDrawing()
{
SetCameraRotate(0, 0);
SetCameraTranslate(GfVec3f(0));
_reprName = HdReprTokens->wireOnSurf;
_refineLevel = 0;
}
void DrawScene();
void DrawMarquee();
// HdSt_UnitTestGLDrawing overrides
void InitTest() override;
void UninitTest() override;
void DrawTest() override;
void OffscreenTest() override;
void Present(uint32_t framebuffer) override;
void MousePress(int button, int x, int y, int modKeys) override;
void MouseRelease(int button, int x, int y, int modKeys) override;
void MouseMove(int x, int y, int modKeys) override;
protected:
void ParseArgs(int argc, char *argv[]) override;
void _InitScene();
HdSelectionSharedPtr _Pick(
GfVec2i const& startPos, GfVec2i const& endPos,
TfToken const& pickTarget,
TfToken const& resolveMode,
HdxPickHitVector *allHits);
private:
std::unique_ptr<Hdx_TestDriver> _driver;
HdxUnitTestUtils::Marquee _marquee;
HdxSelectionTrackerSharedPtr _selTracker;
TfToken _reprName;
int _refineLevel;
GfVec2i _startPos, _endPos;
};
////////////////////////////////////////////////////////////
static GfMatrix4d
_GetTranslate(float tx, float ty, float tz)
{
GfMatrix4d m(1.0f);
m.SetRow(3, GfVec4f(tx, ty, tz, 1.0));
return m;
}
void
My_TestGLDrawing::InitTest()
{
_driver = std::make_unique<Hdx_TestDriver>(_reprName);
Hdx_UnitTestDelegate &delegate = _driver->GetDelegate();
delegate.SetRefineLevel(_refineLevel);
_selTracker.reset(new HdxSelectionTracker);
// prepare scene
_InitScene();
SetCameraTranslate(GfVec3f(0, 0, -20));
_marquee.InitGLResources();
_driver->SetClearColor(GfVec4f(0.1f, 0.1f, 0.1f, 1.0f));
_driver->SetClearDepth(1.0f);
_driver->SetupAovs(GetWidth(), GetHeight());
}
void
My_TestGLDrawing::UninitTest()
{
_marquee.DestroyGLResources();
}
void
My_TestGLDrawing::_InitScene()
{
Hdx_UnitTestDelegate &delegate = _driver->GetDelegate();
delegate.AddCube(SdfPath("/cube0"), _GetTranslate( 5, 0, 5));
delegate.AddCube(SdfPath("/cube1"), _GetTranslate(-5, 0, 5));
delegate.AddCube(SdfPath("/cube2"), _GetTranslate(-5, 0,-5));
delegate.AddCube(SdfPath("/cube3"), _GetTranslate( 5, 0,-5));
{
delegate.AddInstancer(SdfPath("/instancerTop"));
delegate.AddCube(SdfPath("/protoTop"),
GfMatrix4d(1), false, SdfPath("/instancerTop"));
std::vector<SdfPath> prototypes;
prototypes.push_back(SdfPath("/protoTop"));
VtVec3fArray scale(3);
VtVec4fArray rotate(3);
VtVec3fArray translate(3);
VtIntArray prototypeIndex(3);
scale[0] = GfVec3f(1);
rotate[0] = GfVec4f(0);
translate[0] = GfVec3f(3, 0, 2);
prototypeIndex[0] = 0;
scale[1] = GfVec3f(1);
rotate[1] = GfVec4f(0);
translate[1] = GfVec3f(0, 0, 2);
prototypeIndex[1] = 0;
scale[2] = GfVec3f(1);
rotate[2] = GfVec4f(0);
translate[2] = GfVec3f(-3, 0, 2);
prototypeIndex[2] = 0;
delegate.SetInstancerProperties(SdfPath("/instancerTop"),
prototypeIndex,
scale, rotate, translate);
}
{
delegate.AddInstancer(SdfPath("/instancerBottom"));
delegate.AddTet(SdfPath("/protoBottom"),
GfMatrix4d(1), false, SdfPath("/instancerBottom"));
delegate.SetRefineLevel(SdfPath("/protoBottom"), 2);
std::vector<SdfPath> prototypes;
prototypes.push_back(SdfPath("/protoBottom"));
VtVec3fArray scale(3);
VtVec4fArray rotate(3);
VtVec3fArray translate(3);
VtIntArray prototypeIndex(3);
scale[0] = GfVec3f(1);
rotate[0] = GfVec4f(0);
translate[0] = GfVec3f(3, 0, -2);
prototypeIndex[0] = 0;
scale[1] = GfVec3f(1);
rotate[1] = GfVec4f(0);
translate[1] = GfVec3f(0, 0, -2);
prototypeIndex[1] = 0;
scale[2] = GfVec3f(1);
rotate[2] = GfVec4f(0);
translate[2] = GfVec3f(-3, 0, -2);
prototypeIndex[2] = 0;
delegate.SetInstancerProperties(SdfPath("/instancerBottom"),
prototypeIndex,
scale, rotate, translate);
}
}
HdSelectionSharedPtr
My_TestGLDrawing::_Pick(GfVec2i const& startPos, GfVec2i const& endPos,
TfToken const& pickTarget,
TfToken const& resolveMode,
HdxPickHitVector *allHits)
{
if (!allHits) {
return HdSelectionSharedPtr();
}
return _driver->Pick(startPos, endPos, GetWidth(), GetHeight(),
GetFrustum(), GetViewMatrix(), pickTarget, resolveMode, allHits);
}
void
My_TestGLDrawing::DrawTest()
{
DrawScene();
DrawMarquee();
}
void
My_TestGLDrawing::OffscreenTest()
{
DrawScene();
HdxPickHitVector allHits;
const HdSelection::HighlightMode mode = HdSelection::HighlightModeSelect;
// Use the same "marquee" style area pick with different resolve modes
// This picks:
// instances 0 and 1 of /protoTop and /protoBottom
// cube0 and cube3
GfVec2i pickStartPos(270, 80);
GfVec2i pickEndPos(500, 400);
// 1. Nearest to camera
{
HdSelectionSharedPtr selection = _Pick(pickStartPos, pickEndPos,
HdxPickTokens->pickPrimsAndInstances,
HdxPickTokens->resolveNearestToCamera,
&allHits);
TF_VERIFY(allHits.size() == 1);
TF_VERIFY(selection->GetSelectedPrimPaths(mode).size() == 1);
TF_VERIFY(selection->GetSelectedPrimPaths(mode)[0] ==
SdfPath("/protoTop"));
}
// 2. Nearest to center (of pick region)
{
allHits.clear();
HdSelectionSharedPtr selection = _Pick(pickStartPos, pickEndPos,
HdxPickTokens->pickPrimsAndInstances,
HdxPickTokens->resolveNearestToCenter,
&allHits);
TF_VERIFY(allHits.size() == 1);
TF_VERIFY(selection->GetSelectedPrimPaths(mode).size() == 1);
TF_VERIFY(selection->GetSelectedPrimPaths(mode)[0]
== SdfPath("/protoBottom"));
}
// 3. Unique
{
// The pick target influences what a "unique" hit is, so cycle through
// all the supported pickTarget, and verify that a different number of
// hits is returned each time.
TfTokenVector pickTargets = {
HdxPickTokens->pickPrimsAndInstances,
HdxPickTokens->pickFaces,
HdxPickTokens->pickEdges,
HdxPickTokens->pickPoints
};
size_t expectedHitCount[] = {
6 /*primsAndInstances*/,
69 /*faces*/,
135 /*edges*/,
41 /*points*/};
for (size_t i = 0; i < pickTargets.size(); i++) {
allHits.clear();
HdSelectionSharedPtr selection = _Pick(pickStartPos, pickEndPos,
pickTargets[i],
HdxPickTokens->resolveUnique,
&allHits);
std::cout << "allHits: " << allHits.size()
<< " expectedHitCount: " << expectedHitCount[i]
<< std::endl;
TF_VERIFY(allHits.size() == expectedHitCount[i]);
}
}
// 4. All
{
allHits.clear();
HdSelectionSharedPtr selection = _Pick(pickStartPos, pickEndPos,
HdxPickTokens->pickPrimsAndInstances,
HdxPickTokens->resolveAll,
&allHits);
TF_VERIFY(allHits.size() == 22515);
}
}
void
My_TestGLDrawing::DrawScene()
{
int width = GetWidth(), height = GetHeight();
GfMatrix4d viewMatrix = GetViewMatrix();
GfFrustum frustum = GetFrustum();
GfVec4d viewport(0, 0, width, height);
GfMatrix4d projMatrix = frustum.ComputeProjectionMatrix();
_driver->GetDelegate().SetCamera(viewMatrix, projMatrix);
_driver->UpdateAovDimensions(width, height);
_driver->DrawWithSelection(viewport, _selTracker);
}
void
My_TestGLDrawing::DrawMarquee()
{
_marquee.Draw(GetWidth(), GetHeight(), _startPos, _endPos);
}
void
My_TestGLDrawing::Present(uint32_t framebuffer)
{
_driver->Present(GetWidth(), GetHeight(), framebuffer);
}
void
My_TestGLDrawing::MousePress(int button, int x, int y, int modKeys)
{
HdSt_UnitTestGLDrawing::MousePress(button, x, y, modKeys);
_startPos = _endPos = GetMousePos();
}
void
My_TestGLDrawing::MouseRelease(int button, int x, int y, int modKeys)
{
HdSt_UnitTestGLDrawing::MouseRelease(button, x, y, modKeys);
if (!(modKeys & GarchGLDebugWindow::Alt)) {
std::cout << "Pick region: (" << _startPos << ") to (" << _endPos
<< ")" << std::endl;
HdxPickHitVector allHits;
HdSelectionSharedPtr selection = _Pick(_startPos, _endPos,
HdxPickTokens->pickPrimsAndInstances,
HdxPickTokens->resolveNearestToCenter,
&allHits);
_selTracker->SetSelection(selection);
}
_startPos = _endPos = GfVec2i(0);
}
void
My_TestGLDrawing::MouseMove(int x, int y, int modKeys)
{
HdSt_UnitTestGLDrawing::MouseMove(x, y, modKeys);
if (!(modKeys & GarchGLDebugWindow::Alt)) {
_endPos = GetMousePos();
}
}
void
My_TestGLDrawing::ParseArgs(int argc, char *argv[])
{
for (int i=0; i<argc; ++i) {
std::string arg(argv[i]);
if (arg == "--repr") {
_reprName = TfToken(argv[++i]);
} else if (arg == "--refineLevel") {
_refineLevel = atoi(argv[++i]);
}
}
}
void
BasicTest(int argc, char *argv[])
{
My_TestGLDrawing driver;
driver.RunTest(argc, argv);
}
int main(int argc, char *argv[])
{
TfErrorMark mark;
BasicTest(argc, argv);
if (mark.IsClean()) {
std::cout << "OK" << std::endl;
return EXIT_SUCCESS;
} else {
std::cout << "FAILED" << std::endl;
return EXIT_FAILURE;
}
}
| 31.054348 | 78 | 0.644674 | [
"mesh",
"geometry",
"render",
"vector"
] |
438a17fc3c39364fc39b176425e8ca4dd6ed6553 | 420 | hpp | C++ | PSE/include/set_b.hpp | srharris91/OrrSommerfeld_Squire | 92a1dcdc8e982238c7ed8f287622293f9cc60e73 | [
"MIT"
] | null | null | null | PSE/include/set_b.hpp | srharris91/OrrSommerfeld_Squire | 92a1dcdc8e982238c7ed8f287622293f9cc60e73 | [
"MIT"
] | null | null | null | PSE/include/set_b.hpp | srharris91/OrrSommerfeld_Squire | 92a1dcdc8e982238c7ed8f287622293f9cc60e73 | [
"MIT"
] | 1 | 2020-09-25T15:09:43.000Z | 2020-09-25T15:09:43.000Z | #ifndef SET_b_H
#define SET_b_H
#include <petscksp.h>
namespace PSE
{
/**
*
* \brief set b vector from B and q as b=B*q
* \return 0 if successful
*/
PetscInt set_b(
const Mat &B, ///< [in] B matrix
const Vec &qn, ///< [in] qn vector to multiply
Vec &b ///< [in,out] b Vec (already initialized)
);
}
#endif
| 21 | 76 | 0.47381 | [
"vector"
] |
438cd276ca608e5a685464d75d75a8742f3c2ce3 | 2,833 | cpp | C++ | sources/CameraCalibration/Calibration.cpp | Mugichoko445/DRMarkerHiding | 2b61d8408cee040bf5e7d0128c20818f2c47a24e | [
"BSD-3-Clause"
] | 1 | 2022-01-08T03:25:13.000Z | 2022-01-08T03:25:13.000Z | sources/CameraCalibration/Calibration.cpp | Mugichoko445/DRMarkerHiding | 2b61d8408cee040bf5e7d0128c20818f2c47a24e | [
"BSD-3-Clause"
] | null | null | null | sources/CameraCalibration/Calibration.cpp | Mugichoko445/DRMarkerHiding | 2b61d8408cee040bf5e7d0128c20818f2c47a24e | [
"BSD-3-Clause"
] | null | null | null | #include "Calibration.h"
bool io::SaveIntrinsics(const std::string& filename, const cv::Size& imageSize, cv::InputArray cameraMatrix, cv::InputArray distCoeffs)
{
auto dir = fs::path(filename).parent_path();
if (fs::create_directories(dir))
{
std::cout << "[SaveIntrinsics] Created a directory " << dir << std::endl;
}
cv::FileStorage fs;
fs.open(filename, cv::FileStorage::WRITE);
if (!fs.isOpened())
{
std::cerr << "[SaveIntrinsics] Failed to open " << filename << std::endl;
return false;
}
std::cout << "[SaveIntrinsics] Opened " + filename << std::endl;
fs << "imageSize" << imageSize;
fs << "cameraMatrix" << cameraMatrix.getMat();
fs << "distCoeffs" << distCoeffs.getMat();
return true;
}
bool io::ReadIntrinsics(const std::string& filename, cv::Size& imageSize, cv::OutputArray cameraMatrix, cv::OutputArray distCoeffs)
{
if (!fs::exists(filename))
{
std::cerr << "[ReadIntrinsics] " << filename << " does not exist!" << std::endl;
return false;
}
cv::FileStorage fs;
fs.open(filename, cv::FileStorage::READ);
if (!fs.isOpened())
{
std::cerr << "[SaveIntrinsics] Failed to open " << filename << std::endl;
return false;
}
std::cout << "[ReadIntrinsics] Opened " + filename << std::endl;
cv::Mat tmpCameraMatrix, tmpDistCoeffs;
fs["imageSize"] >> imageSize;
fs["cameraMatrix"] >> tmpCameraMatrix;
fs["distCoeffs"] >> tmpDistCoeffs;
tmpCameraMatrix.copyTo(cameraMatrix);
tmpDistCoeffs.copyTo(distCoeffs);
return true;
}
Calibration::Calibration(int gridWidth, int gridHeight, float size) : grid(gridWidth, gridHeight), size(size)
{
// 3D corners of your checkerboard
for (int y = 0; y < grid.height; ++y) for (int x = 0; x < grid.width; ++x)
{
pts3d.push_back(cv::Point3f(y * this->size, x * this->size, 0.0f));
}
}
Calibration::~Calibration()
{
// pass
}
void Calibration::Run(const cv::Size& imageSize, cv::InputOutputArray cameraMatrix, cv::InputOutputArray distCoeffs)
{
std::vector<std::vector<cv::Point3f>> vPts3d;
vPts3d.resize(vPts2d.size(), pts3d);
std::vector<cv::Mat> rvecs, tvecs;
cv::calibrateCamera(vPts3d, vPts2d, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs);
}
bool Calibration::DetectCorners(cv::InputArray image, cv::OutputArray viz)
{
assert(image.type() == CV_8U || image.type() == CV_8UC3);
cv::Mat gray = image.getMat();
if (gray.type() == CV_8UC3) cv::cvtColor(image, gray, cv::COLOR_BGR2GRAY);
std::vector<cv::Point2f> pts2d;
auto found = cv::findChessboardCorners(gray, grid, pts2d);
if (found)
{
cv::cornerSubPix(gray, pts2d, cv::Size(5, 5), cv::Size(-1, -1), cv::TermCriteria(cv::TermCriteria::EPS + cv::TermCriteria::COUNT, 30, 0.1));
vPts2d.push_back(pts2d);
cv::Mat imageViz = image.getMat().clone();
cv::drawChessboardCorners(imageViz, grid, pts2d, found);
imageViz.copyTo(viz);
}
return found;
}
| 28.33 | 142 | 0.682669 | [
"vector",
"3d"
] |
438dc6930e3da15aab5af5c91d6f29ae3411872f | 3,052 | hpp | C++ | Code/Cpp/detect_marks.hpp | sgino209/Bracelet_decoder | d1b557254355601b277924313b760b6b30b48326 | [
"Apache-2.0"
] | null | null | null | Code/Cpp/detect_marks.hpp | sgino209/Bracelet_decoder | d1b557254355601b277924313b760b6b30b48326 | [
"Apache-2.0"
] | null | null | null | Code/Cpp/detect_marks.hpp | sgino209/Bracelet_decoder | d1b557254355601b277924313b760b6b30b48326 | [
"Apache-2.0"
] | null | null | null | // Bracelet-Decoder algo app
// (c) Shahar Gino, September-2017, sgino209@gmail.com
#ifndef DETECT_MARKS_HPP
#define DETECT_MARKS_HPP
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "auxiliary.hpp"
#include "possible_marks.hpp"
#include "decode_marks.hpp"
class PossibleMark;
typedef std::vector<PossibleMark> mark_list_t;
typedef struct {
double rotation_angle_deg;
unsigned int centroid_x;
unsigned int centroid_y;
} rotation_align_t;
// Find all possible bracelet marks (finds all contours that could be representing marks):
double find_possible_marks(mark_list_t &possible_marks_final, cv::Mat &frame_gray, cv::Mat &frame_thresh, unsigned int MinPixelWidth,
unsigned int MaxPixelWidth, unsigned int MinPixelHeight, unsigned int MaxPixelHeight, double MinAspectRatio,
double MaxAspectRatio, unsigned int MinPixelArea, unsigned int MaxPixelArea, double MinExtent, double MaxExtent,
double MinTexture, double MaxTexture, double MaxDrift, unsigned int PerspectiveMode, std::string FindContoursMode,
unsigned int HoughParams1, unsigned int HoughParams2, unsigned int HoughParams3,unsigned int HoughParams4,
unsigned int HoughParams5, unsigned int HoughParams6, bool debugMode, std::map<std::string,cv::Mat>* debug_imgs=nullptr);
// Remove outliers in a given 2D data-set of possible-marks
mark_list_t remove_outliers(mark_list_t possible_marks_list, double MaxDrift, bool debugMode);
// SVD decomposition for rotation alignment, adds intCenterX/Y_r attributes and returns angle and centroid estimation:
rotation_align_t rotation_alignment(mark_list_t &possible_marks_list, bool debugMode);
// Wrapper function for Perspective Alignment:
void perspective_alignment(mark_list_t &possible_marks_list, unsigned int PerspectiveMode, double rotation_angle_deg, bool debugMode);
void perspective_alignment_opt0(mark_list_t &possible_marks_list, double rotation_angle_deg, bool debugMode);
void perspective_alignment_opt1(mark_list_t &possible_marks_list, bool debugMode);
// Auxiliary function - Gets a Circle (x,y,radius) and returns the corresponding contour (array of x,y points)
std::vector<cv::Point> circle_to_contour(cv::Vec3f circle, unsigned int points_per_contour, float resize_factor);
// Auxiliary function - Gets a Circle (x,y,radius) and a vector of Circles, and return minimal distance
unsigned int dist_to_closest_circle(cv::Vec3f circle, std::vector<cv::Vec3f> circles);
// Auxiliary function - calculates median for a given vector:
template <class T>
double median_calc(std::vector<T> data_vec);
// Auxiliary function - prints a point vector:
template <class T>
void print_point_vec(std::vector<T> data_vec);
// Auxiliary function - prints a mark vector:
template <class T>
void print_mark_vec(std::vector<T> data_vec);
#endif //DETECT_MARKS_HPP
| 46.242424 | 148 | 0.773919 | [
"vector"
] |
43924a3addd442a0acd9743159274a6fb8b44e33 | 38,361 | cc | C++ | c-deps/rocksdb/db/version_set_test.cc | Yangjxxxxx/ZNBase | dcf993b73250dd5cb63041f4d9cf098941f67b2b | [
"MIT",
"BSD-3-Clause"
] | 2,189 | 2016-04-02T21:49:13.000Z | 2022-03-31T23:31:07.000Z | c-deps/rocksdb/db/version_set_test.cc | Yangjxxxxx/ZNBase | dcf993b73250dd5cb63041f4d9cf098941f67b2b | [
"MIT",
"BSD-3-Clause"
] | 2,798 | 2016-04-11T18:01:05.000Z | 2022-01-15T23:05:39.000Z | c-deps/rocksdb/db/version_set_test.cc | Yangjxxxxx/ZNBase | dcf993b73250dd5cb63041f4d9cf098941f67b2b | [
"MIT",
"BSD-3-Clause"
] | 908 | 2016-03-23T18:26:20.000Z | 2022-03-07T21:43:27.000Z | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "db/version_set.h"
#include "db/log_writer.h"
#include "table/mock_table.h"
#include "util/logging.h"
#include "util/string_util.h"
#include "util/testharness.h"
#include "util/testutil.h"
namespace rocksdb {
class GenerateLevelFilesBriefTest : public testing::Test {
public:
std::vector<FileMetaData*> files_;
LevelFilesBrief file_level_;
Arena arena_;
GenerateLevelFilesBriefTest() { }
~GenerateLevelFilesBriefTest() override {
for (size_t i = 0; i < files_.size(); i++) {
delete files_[i];
}
}
void Add(const char* smallest, const char* largest,
SequenceNumber smallest_seq = 100,
SequenceNumber largest_seq = 100) {
FileMetaData* f = new FileMetaData;
f->fd = FileDescriptor(files_.size() + 1, 0, 0);
f->smallest = InternalKey(smallest, smallest_seq, kTypeValue);
f->largest = InternalKey(largest, largest_seq, kTypeValue);
files_.push_back(f);
}
int Compare() {
int diff = 0;
for (size_t i = 0; i < files_.size(); i++) {
if (file_level_.files[i].fd.GetNumber() != files_[i]->fd.GetNumber()) {
diff++;
}
}
return diff;
}
};
TEST_F(GenerateLevelFilesBriefTest, Empty) {
DoGenerateLevelFilesBrief(&file_level_, files_, &arena_);
ASSERT_EQ(0u, file_level_.num_files);
ASSERT_EQ(0, Compare());
}
TEST_F(GenerateLevelFilesBriefTest, Single) {
Add("p", "q");
DoGenerateLevelFilesBrief(&file_level_, files_, &arena_);
ASSERT_EQ(1u, file_level_.num_files);
ASSERT_EQ(0, Compare());
}
TEST_F(GenerateLevelFilesBriefTest, Multiple) {
Add("150", "200");
Add("200", "250");
Add("300", "350");
Add("400", "450");
DoGenerateLevelFilesBrief(&file_level_, files_, &arena_);
ASSERT_EQ(4u, file_level_.num_files);
ASSERT_EQ(0, Compare());
}
class CountingLogger : public Logger {
public:
CountingLogger() : log_count(0) {}
using Logger::Logv;
void Logv(const char* /*format*/, va_list /*ap*/) override { log_count++; }
int log_count;
};
Options GetOptionsWithNumLevels(int num_levels,
std::shared_ptr<CountingLogger> logger) {
Options opt;
opt.num_levels = num_levels;
opt.info_log = logger;
return opt;
}
class VersionStorageInfoTest : public testing::Test {
public:
const Comparator* ucmp_;
InternalKeyComparator icmp_;
std::shared_ptr<CountingLogger> logger_;
Options options_;
ImmutableCFOptions ioptions_;
MutableCFOptions mutable_cf_options_;
VersionStorageInfo vstorage_;
InternalKey GetInternalKey(const char* ukey,
SequenceNumber smallest_seq = 100) {
return InternalKey(ukey, smallest_seq, kTypeValue);
}
VersionStorageInfoTest()
: ucmp_(BytewiseComparator()),
icmp_(ucmp_),
logger_(new CountingLogger()),
options_(GetOptionsWithNumLevels(6, logger_)),
ioptions_(options_),
mutable_cf_options_(options_),
vstorage_(&icmp_, ucmp_, 6, kCompactionStyleLevel, nullptr, false) {}
~VersionStorageInfoTest() override {
for (int i = 0; i < vstorage_.num_levels(); i++) {
for (auto* f : vstorage_.LevelFiles(i)) {
if (--f->refs == 0) {
delete f;
}
}
}
}
void Add(int level, uint32_t file_number, const char* smallest,
const char* largest, uint64_t file_size = 0) {
assert(level < vstorage_.num_levels());
FileMetaData* f = new FileMetaData;
f->fd = FileDescriptor(file_number, 0, file_size);
f->smallest = GetInternalKey(smallest, 0);
f->largest = GetInternalKey(largest, 0);
f->compensated_file_size = file_size;
f->refs = 0;
f->num_entries = 0;
f->num_deletions = 0;
vstorage_.AddFile(level, f);
}
void Add(int level, uint32_t file_number, const InternalKey& smallest,
const InternalKey& largest, uint64_t file_size = 0) {
assert(level < vstorage_.num_levels());
FileMetaData* f = new FileMetaData;
f->fd = FileDescriptor(file_number, 0, file_size);
f->smallest = smallest;
f->largest = largest;
f->compensated_file_size = file_size;
f->refs = 0;
f->num_entries = 0;
f->num_deletions = 0;
vstorage_.AddFile(level, f);
}
std::string GetOverlappingFiles(int level, const InternalKey& begin,
const InternalKey& end) {
std::vector<FileMetaData*> inputs;
vstorage_.GetOverlappingInputs(level, &begin, &end, &inputs);
std::string result;
for (size_t i = 0; i < inputs.size(); ++i) {
if (i > 0) {
result += ",";
}
AppendNumberTo(&result, inputs[i]->fd.GetNumber());
}
return result;
}
};
TEST_F(VersionStorageInfoTest, MaxBytesForLevelStatic) {
ioptions_.level_compaction_dynamic_level_bytes = false;
mutable_cf_options_.max_bytes_for_level_base = 10;
mutable_cf_options_.max_bytes_for_level_multiplier = 5;
Add(4, 100U, "1", "2");
Add(5, 101U, "1", "2");
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(vstorage_.MaxBytesForLevel(1), 10U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(2), 50U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(3), 250U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(4), 1250U);
ASSERT_EQ(0, logger_->log_count);
}
TEST_F(VersionStorageInfoTest, MaxBytesForLevelDynamic) {
ioptions_.level_compaction_dynamic_level_bytes = true;
mutable_cf_options_.max_bytes_for_level_base = 1000;
mutable_cf_options_.max_bytes_for_level_multiplier = 5;
Add(5, 1U, "1", "2", 500U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(0, logger_->log_count);
ASSERT_EQ(vstorage_.base_level(), 5);
Add(5, 2U, "3", "4", 550U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(0, logger_->log_count);
ASSERT_EQ(vstorage_.MaxBytesForLevel(4), 1000U);
ASSERT_EQ(vstorage_.base_level(), 4);
Add(4, 3U, "3", "4", 550U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(0, logger_->log_count);
ASSERT_EQ(vstorage_.MaxBytesForLevel(4), 1000U);
ASSERT_EQ(vstorage_.base_level(), 4);
Add(3, 4U, "3", "4", 250U);
Add(3, 5U, "5", "7", 300U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(1, logger_->log_count);
ASSERT_EQ(vstorage_.MaxBytesForLevel(4), 1005U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(3), 1000U);
ASSERT_EQ(vstorage_.base_level(), 3);
Add(1, 6U, "3", "4", 5U);
Add(1, 7U, "8", "9", 5U);
logger_->log_count = 0;
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(1, logger_->log_count);
ASSERT_GT(vstorage_.MaxBytesForLevel(4), 1005U);
ASSERT_GT(vstorage_.MaxBytesForLevel(3), 1005U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(2), 1005U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(1), 1000U);
ASSERT_EQ(vstorage_.base_level(), 1);
}
TEST_F(VersionStorageInfoTest, MaxBytesForLevelDynamicLotsOfData) {
ioptions_.level_compaction_dynamic_level_bytes = true;
mutable_cf_options_.max_bytes_for_level_base = 100;
mutable_cf_options_.max_bytes_for_level_multiplier = 2;
Add(0, 1U, "1", "2", 50U);
Add(1, 2U, "1", "2", 50U);
Add(2, 3U, "1", "2", 500U);
Add(3, 4U, "1", "2", 500U);
Add(4, 5U, "1", "2", 1700U);
Add(5, 6U, "1", "2", 500U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(vstorage_.MaxBytesForLevel(4), 800U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(3), 400U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(2), 200U);
ASSERT_EQ(vstorage_.MaxBytesForLevel(1), 100U);
ASSERT_EQ(vstorage_.base_level(), 1);
ASSERT_EQ(0, logger_->log_count);
}
TEST_F(VersionStorageInfoTest, MaxBytesForLevelDynamicLargeLevel) {
uint64_t kOneGB = 1000U * 1000U * 1000U;
ioptions_.level_compaction_dynamic_level_bytes = true;
mutable_cf_options_.max_bytes_for_level_base = 10U * kOneGB;
mutable_cf_options_.max_bytes_for_level_multiplier = 10;
Add(0, 1U, "1", "2", 50U);
Add(3, 4U, "1", "2", 32U * kOneGB);
Add(4, 5U, "1", "2", 500U * kOneGB);
Add(5, 6U, "1", "2", 3000U * kOneGB);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(vstorage_.MaxBytesForLevel(5), 3000U * kOneGB);
ASSERT_EQ(vstorage_.MaxBytesForLevel(4), 300U * kOneGB);
ASSERT_EQ(vstorage_.MaxBytesForLevel(3), 30U * kOneGB);
ASSERT_EQ(vstorage_.MaxBytesForLevel(2), 10U * kOneGB);
ASSERT_EQ(vstorage_.base_level(), 2);
ASSERT_EQ(0, logger_->log_count);
}
TEST_F(VersionStorageInfoTest, MaxBytesForLevelDynamicWithLargeL0_1) {
ioptions_.level_compaction_dynamic_level_bytes = true;
mutable_cf_options_.max_bytes_for_level_base = 40000;
mutable_cf_options_.max_bytes_for_level_multiplier = 5;
mutable_cf_options_.level0_file_num_compaction_trigger = 2;
Add(0, 1U, "1", "2", 10000U);
Add(0, 2U, "1", "2", 10000U);
Add(0, 3U, "1", "2", 10000U);
Add(5, 4U, "1", "2", 1286250U);
Add(4, 5U, "1", "2", 200000U);
Add(3, 6U, "1", "2", 40000U);
Add(2, 7U, "1", "2", 8000U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(0, logger_->log_count);
ASSERT_EQ(2, vstorage_.base_level());
// level multiplier should be 3.5
ASSERT_EQ(vstorage_.level_multiplier(), 5.0);
// Level size should be around 30,000, 105,000, 367,500
ASSERT_EQ(40000U, vstorage_.MaxBytesForLevel(2));
ASSERT_EQ(51450U, vstorage_.MaxBytesForLevel(3));
ASSERT_EQ(257250U, vstorage_.MaxBytesForLevel(4));
}
TEST_F(VersionStorageInfoTest, MaxBytesForLevelDynamicWithLargeL0_2) {
ioptions_.level_compaction_dynamic_level_bytes = true;
mutable_cf_options_.max_bytes_for_level_base = 10000;
mutable_cf_options_.max_bytes_for_level_multiplier = 5;
mutable_cf_options_.level0_file_num_compaction_trigger = 2;
Add(0, 11U, "1", "2", 10000U);
Add(0, 12U, "1", "2", 10000U);
Add(0, 13U, "1", "2", 10000U);
Add(5, 4U, "1", "2", 1286250U);
Add(4, 5U, "1", "2", 200000U);
Add(3, 6U, "1", "2", 40000U);
Add(2, 7U, "1", "2", 8000U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(0, logger_->log_count);
ASSERT_EQ(2, vstorage_.base_level());
// level multiplier should be 3.5
ASSERT_LT(vstorage_.level_multiplier(), 3.6);
ASSERT_GT(vstorage_.level_multiplier(), 3.4);
// Level size should be around 30,000, 105,000, 367,500
ASSERT_EQ(30000U, vstorage_.MaxBytesForLevel(2));
ASSERT_LT(vstorage_.MaxBytesForLevel(3), 110000U);
ASSERT_GT(vstorage_.MaxBytesForLevel(3), 100000U);
ASSERT_LT(vstorage_.MaxBytesForLevel(4), 370000U);
ASSERT_GT(vstorage_.MaxBytesForLevel(4), 360000U);
}
TEST_F(VersionStorageInfoTest, MaxBytesForLevelDynamicWithLargeL0_3) {
ioptions_.level_compaction_dynamic_level_bytes = true;
mutable_cf_options_.max_bytes_for_level_base = 10000;
mutable_cf_options_.max_bytes_for_level_multiplier = 5;
mutable_cf_options_.level0_file_num_compaction_trigger = 2;
Add(0, 11U, "1", "2", 5000U);
Add(0, 12U, "1", "2", 5000U);
Add(0, 13U, "1", "2", 5000U);
Add(0, 14U, "1", "2", 5000U);
Add(0, 15U, "1", "2", 5000U);
Add(0, 16U, "1", "2", 5000U);
Add(5, 4U, "1", "2", 1286250U);
Add(4, 5U, "1", "2", 200000U);
Add(3, 6U, "1", "2", 40000U);
Add(2, 7U, "1", "2", 8000U);
vstorage_.CalculateBaseBytes(ioptions_, mutable_cf_options_);
ASSERT_EQ(0, logger_->log_count);
ASSERT_EQ(2, vstorage_.base_level());
// level multiplier should be 3.5
ASSERT_LT(vstorage_.level_multiplier(), 3.6);
ASSERT_GT(vstorage_.level_multiplier(), 3.4);
// Level size should be around 30,000, 105,000, 367,500
ASSERT_EQ(30000U, vstorage_.MaxBytesForLevel(2));
ASSERT_LT(vstorage_.MaxBytesForLevel(3), 110000U);
ASSERT_GT(vstorage_.MaxBytesForLevel(3), 100000U);
ASSERT_LT(vstorage_.MaxBytesForLevel(4), 370000U);
ASSERT_GT(vstorage_.MaxBytesForLevel(4), 360000U);
}
TEST_F(VersionStorageInfoTest, EstimateLiveDataSize) {
// Test whether the overlaps are detected as expected
Add(1, 1U, "4", "7", 1U); // Perfect overlap with last level
Add(2, 2U, "3", "5", 1U); // Partial overlap with last level
Add(2, 3U, "6", "8", 1U); // Partial overlap with last level
Add(3, 4U, "1", "9", 1U); // Contains range of last level
Add(4, 5U, "4", "5", 1U); // Inside range of last level
Add(4, 5U, "6", "7", 1U); // Inside range of last level
Add(5, 6U, "4", "7", 10U);
ASSERT_EQ(10U, vstorage_.EstimateLiveDataSize());
}
TEST_F(VersionStorageInfoTest, EstimateLiveDataSize2) {
Add(0, 1U, "9", "9", 1U); // Level 0 is not ordered
Add(0, 1U, "5", "6", 1U); // Ignored because of [5,6] in l1
Add(1, 1U, "1", "2", 1U); // Ignored because of [2,3] in l2
Add(1, 2U, "3", "4", 1U); // Ignored because of [2,3] in l2
Add(1, 3U, "5", "6", 1U);
Add(2, 4U, "2", "3", 1U);
Add(3, 5U, "7", "8", 1U);
ASSERT_EQ(4U, vstorage_.EstimateLiveDataSize());
}
TEST_F(VersionStorageInfoTest, GetOverlappingInputs) {
// Two files that overlap at the range deletion tombstone sentinel.
Add(1, 1U, {"a", 0, kTypeValue}, {"b", kMaxSequenceNumber, kTypeRangeDeletion}, 1);
Add(1, 2U, {"b", 0, kTypeValue}, {"c", 0, kTypeValue}, 1);
// Two files that overlap at the same user key.
Add(1, 3U, {"d", 0, kTypeValue}, {"e", kMaxSequenceNumber, kTypeValue}, 1);
Add(1, 4U, {"e", 0, kTypeValue}, {"f", 0, kTypeValue}, 1);
// Two files that do not overlap.
Add(1, 5U, {"g", 0, kTypeValue}, {"h", 0, kTypeValue}, 1);
Add(1, 6U, {"i", 0, kTypeValue}, {"j", 0, kTypeValue}, 1);
vstorage_.UpdateNumNonEmptyLevels();
vstorage_.GenerateLevelFilesBrief();
ASSERT_EQ("1,2", GetOverlappingFiles(
1, {"a", 0, kTypeValue}, {"b", 0, kTypeValue}));
ASSERT_EQ("1", GetOverlappingFiles(
1, {"a", 0, kTypeValue}, {"b", kMaxSequenceNumber, kTypeRangeDeletion}));
ASSERT_EQ("2", GetOverlappingFiles(
1, {"b", kMaxSequenceNumber, kTypeValue}, {"c", 0, kTypeValue}));
ASSERT_EQ("3,4", GetOverlappingFiles(
1, {"d", 0, kTypeValue}, {"e", 0, kTypeValue}));
ASSERT_EQ("3", GetOverlappingFiles(
1, {"d", 0, kTypeValue}, {"e", kMaxSequenceNumber, kTypeRangeDeletion}));
ASSERT_EQ("3,4", GetOverlappingFiles(
1, {"e", kMaxSequenceNumber, kTypeValue}, {"f", 0, kTypeValue}));
ASSERT_EQ("3,4", GetOverlappingFiles(
1, {"e", 0, kTypeValue}, {"f", 0, kTypeValue}));
ASSERT_EQ("5", GetOverlappingFiles(
1, {"g", 0, kTypeValue}, {"h", 0, kTypeValue}));
ASSERT_EQ("6", GetOverlappingFiles(
1, {"i", 0, kTypeValue}, {"j", 0, kTypeValue}));
}
class FindLevelFileTest : public testing::Test {
public:
LevelFilesBrief file_level_;
bool disjoint_sorted_files_;
Arena arena_;
FindLevelFileTest() : disjoint_sorted_files_(true) { }
~FindLevelFileTest() override {}
void LevelFileInit(size_t num = 0) {
char* mem = arena_.AllocateAligned(num * sizeof(FdWithKeyRange));
file_level_.files = new (mem)FdWithKeyRange[num];
file_level_.num_files = 0;
}
void Add(const char* smallest, const char* largest,
SequenceNumber smallest_seq = 100,
SequenceNumber largest_seq = 100) {
InternalKey smallest_key = InternalKey(smallest, smallest_seq, kTypeValue);
InternalKey largest_key = InternalKey(largest, largest_seq, kTypeValue);
Slice smallest_slice = smallest_key.Encode();
Slice largest_slice = largest_key.Encode();
char* mem = arena_.AllocateAligned(
smallest_slice.size() + largest_slice.size());
memcpy(mem, smallest_slice.data(), smallest_slice.size());
memcpy(mem + smallest_slice.size(), largest_slice.data(),
largest_slice.size());
// add to file_level_
size_t num = file_level_.num_files;
auto& file = file_level_.files[num];
file.fd = FileDescriptor(num + 1, 0, 0);
file.smallest_key = Slice(mem, smallest_slice.size());
file.largest_key = Slice(mem + smallest_slice.size(),
largest_slice.size());
file_level_.num_files++;
}
int Find(const char* key) {
InternalKey target(key, 100, kTypeValue);
InternalKeyComparator cmp(BytewiseComparator());
return FindFile(cmp, file_level_, target.Encode());
}
bool Overlaps(const char* smallest, const char* largest) {
InternalKeyComparator cmp(BytewiseComparator());
Slice s(smallest != nullptr ? smallest : "");
Slice l(largest != nullptr ? largest : "");
return SomeFileOverlapsRange(cmp, disjoint_sorted_files_, file_level_,
(smallest != nullptr ? &s : nullptr),
(largest != nullptr ? &l : nullptr));
}
};
TEST_F(FindLevelFileTest, LevelEmpty) {
LevelFileInit(0);
ASSERT_EQ(0, Find("foo"));
ASSERT_TRUE(! Overlaps("a", "z"));
ASSERT_TRUE(! Overlaps(nullptr, "z"));
ASSERT_TRUE(! Overlaps("a", nullptr));
ASSERT_TRUE(! Overlaps(nullptr, nullptr));
}
TEST_F(FindLevelFileTest, LevelSingle) {
LevelFileInit(1);
Add("p", "q");
ASSERT_EQ(0, Find("a"));
ASSERT_EQ(0, Find("p"));
ASSERT_EQ(0, Find("p1"));
ASSERT_EQ(0, Find("q"));
ASSERT_EQ(1, Find("q1"));
ASSERT_EQ(1, Find("z"));
ASSERT_TRUE(! Overlaps("a", "b"));
ASSERT_TRUE(! Overlaps("z1", "z2"));
ASSERT_TRUE(Overlaps("a", "p"));
ASSERT_TRUE(Overlaps("a", "q"));
ASSERT_TRUE(Overlaps("a", "z"));
ASSERT_TRUE(Overlaps("p", "p1"));
ASSERT_TRUE(Overlaps("p", "q"));
ASSERT_TRUE(Overlaps("p", "z"));
ASSERT_TRUE(Overlaps("p1", "p2"));
ASSERT_TRUE(Overlaps("p1", "z"));
ASSERT_TRUE(Overlaps("q", "q"));
ASSERT_TRUE(Overlaps("q", "q1"));
ASSERT_TRUE(! Overlaps(nullptr, "j"));
ASSERT_TRUE(! Overlaps("r", nullptr));
ASSERT_TRUE(Overlaps(nullptr, "p"));
ASSERT_TRUE(Overlaps(nullptr, "p1"));
ASSERT_TRUE(Overlaps("q", nullptr));
ASSERT_TRUE(Overlaps(nullptr, nullptr));
}
TEST_F(FindLevelFileTest, LevelMultiple) {
LevelFileInit(4);
Add("150", "200");
Add("200", "250");
Add("300", "350");
Add("400", "450");
ASSERT_EQ(0, Find("100"));
ASSERT_EQ(0, Find("150"));
ASSERT_EQ(0, Find("151"));
ASSERT_EQ(0, Find("199"));
ASSERT_EQ(0, Find("200"));
ASSERT_EQ(1, Find("201"));
ASSERT_EQ(1, Find("249"));
ASSERT_EQ(1, Find("250"));
ASSERT_EQ(2, Find("251"));
ASSERT_EQ(2, Find("299"));
ASSERT_EQ(2, Find("300"));
ASSERT_EQ(2, Find("349"));
ASSERT_EQ(2, Find("350"));
ASSERT_EQ(3, Find("351"));
ASSERT_EQ(3, Find("400"));
ASSERT_EQ(3, Find("450"));
ASSERT_EQ(4, Find("451"));
ASSERT_TRUE(! Overlaps("100", "149"));
ASSERT_TRUE(! Overlaps("251", "299"));
ASSERT_TRUE(! Overlaps("451", "500"));
ASSERT_TRUE(! Overlaps("351", "399"));
ASSERT_TRUE(Overlaps("100", "150"));
ASSERT_TRUE(Overlaps("100", "200"));
ASSERT_TRUE(Overlaps("100", "300"));
ASSERT_TRUE(Overlaps("100", "400"));
ASSERT_TRUE(Overlaps("100", "500"));
ASSERT_TRUE(Overlaps("375", "400"));
ASSERT_TRUE(Overlaps("450", "450"));
ASSERT_TRUE(Overlaps("450", "500"));
}
TEST_F(FindLevelFileTest, LevelMultipleNullBoundaries) {
LevelFileInit(4);
Add("150", "200");
Add("200", "250");
Add("300", "350");
Add("400", "450");
ASSERT_TRUE(! Overlaps(nullptr, "149"));
ASSERT_TRUE(! Overlaps("451", nullptr));
ASSERT_TRUE(Overlaps(nullptr, nullptr));
ASSERT_TRUE(Overlaps(nullptr, "150"));
ASSERT_TRUE(Overlaps(nullptr, "199"));
ASSERT_TRUE(Overlaps(nullptr, "200"));
ASSERT_TRUE(Overlaps(nullptr, "201"));
ASSERT_TRUE(Overlaps(nullptr, "400"));
ASSERT_TRUE(Overlaps(nullptr, "800"));
ASSERT_TRUE(Overlaps("100", nullptr));
ASSERT_TRUE(Overlaps("200", nullptr));
ASSERT_TRUE(Overlaps("449", nullptr));
ASSERT_TRUE(Overlaps("450", nullptr));
}
TEST_F(FindLevelFileTest, LevelOverlapSequenceChecks) {
LevelFileInit(1);
Add("200", "200", 5000, 3000);
ASSERT_TRUE(! Overlaps("199", "199"));
ASSERT_TRUE(! Overlaps("201", "300"));
ASSERT_TRUE(Overlaps("200", "200"));
ASSERT_TRUE(Overlaps("190", "200"));
ASSERT_TRUE(Overlaps("200", "210"));
}
TEST_F(FindLevelFileTest, LevelOverlappingFiles) {
LevelFileInit(2);
Add("150", "600");
Add("400", "500");
disjoint_sorted_files_ = false;
ASSERT_TRUE(! Overlaps("100", "149"));
ASSERT_TRUE(! Overlaps("601", "700"));
ASSERT_TRUE(Overlaps("100", "150"));
ASSERT_TRUE(Overlaps("100", "200"));
ASSERT_TRUE(Overlaps("100", "300"));
ASSERT_TRUE(Overlaps("100", "400"));
ASSERT_TRUE(Overlaps("100", "500"));
ASSERT_TRUE(Overlaps("375", "400"));
ASSERT_TRUE(Overlaps("450", "450"));
ASSERT_TRUE(Overlaps("450", "500"));
ASSERT_TRUE(Overlaps("450", "700"));
ASSERT_TRUE(Overlaps("600", "700"));
}
class VersionSetTestBase {
public:
const static std::string kColumnFamilyName1;
const static std::string kColumnFamilyName2;
const static std::string kColumnFamilyName3;
VersionSetTestBase()
: env_(Env::Default()),
dbname_(test::PerThreadDBPath("version_set_test")),
db_options_(),
mutable_cf_options_(cf_options_),
table_cache_(NewLRUCache(50000, 16)),
write_buffer_manager_(db_options_.db_write_buffer_size),
versions_(new VersionSet(dbname_, &db_options_, env_options_,
table_cache_.get(), &write_buffer_manager_,
&write_controller_)),
shutting_down_(false),
mock_table_factory_(std::make_shared<mock::MockTableFactory>()) {
EXPECT_OK(env_->CreateDirIfMissing(dbname_));
db_options_.db_paths.emplace_back(dbname_,
std::numeric_limits<uint64_t>::max());
}
void PrepareManifest(std::vector<ColumnFamilyDescriptor>* column_families,
SequenceNumber* last_seqno,
std::unique_ptr<log::Writer>* log_writer) {
assert(column_families != nullptr);
assert(last_seqno != nullptr);
assert(log_writer != nullptr);
VersionEdit new_db;
new_db.SetLogNumber(0);
new_db.SetNextFile(2);
new_db.SetLastSequence(0);
const std::vector<std::string> cf_names = {
kDefaultColumnFamilyName, kColumnFamilyName1, kColumnFamilyName2,
kColumnFamilyName3};
const int kInitialNumOfCfs = static_cast<int>(cf_names.size());
autovector<VersionEdit> new_cfs;
uint64_t last_seq = 1;
uint32_t cf_id = 1;
for (int i = 1; i != kInitialNumOfCfs; ++i) {
VersionEdit new_cf;
new_cf.AddColumnFamily(cf_names[i]);
new_cf.SetColumnFamily(cf_id++);
new_cf.SetLogNumber(0);
new_cf.SetNextFile(2);
new_cf.SetLastSequence(last_seq++);
new_cfs.emplace_back(new_cf);
}
*last_seqno = last_seq;
const std::string manifest = DescriptorFileName(dbname_, 1);
std::unique_ptr<WritableFile> file;
Status s = env_->NewWritableFile(
manifest, &file, env_->OptimizeForManifestWrite(env_options_));
ASSERT_OK(s);
std::unique_ptr<WritableFileWriter> file_writer(
new WritableFileWriter(std::move(file), manifest, env_options_));
{
log_writer->reset(new log::Writer(std::move(file_writer), 0, false));
std::string record;
new_db.EncodeTo(&record);
s = (*log_writer)->AddRecord(record);
for (const auto& e : new_cfs) {
record.clear();
e.EncodeTo(&record);
s = (*log_writer)->AddRecord(record);
ASSERT_OK(s);
}
}
ASSERT_OK(s);
cf_options_.table_factory = mock_table_factory_;
for (const auto& cf_name : cf_names) {
column_families->emplace_back(cf_name, cf_options_);
}
}
// Create DB with 3 column families.
void NewDB() {
std::vector<ColumnFamilyDescriptor> column_families;
SequenceNumber last_seqno;
std::unique_ptr<log::Writer> log_writer;
PrepareManifest(&column_families, &last_seqno, &log_writer);
log_writer.reset();
// Make "CURRENT" file point to the new manifest file.
Status s = SetCurrentFile(env_, dbname_, 1, nullptr);
ASSERT_OK(s);
EXPECT_OK(versions_->Recover(column_families, false));
EXPECT_EQ(column_families.size(),
versions_->GetColumnFamilySet()->NumberOfColumnFamilies());
}
Env* env_;
const std::string dbname_;
EnvOptions env_options_;
ImmutableDBOptions db_options_;
ColumnFamilyOptions cf_options_;
MutableCFOptions mutable_cf_options_;
std::shared_ptr<Cache> table_cache_;
WriteController write_controller_;
WriteBufferManager write_buffer_manager_;
std::shared_ptr<VersionSet> versions_;
InstrumentedMutex mutex_;
std::atomic<bool> shutting_down_;
std::shared_ptr<mock::MockTableFactory> mock_table_factory_;
};
const std::string VersionSetTestBase::kColumnFamilyName1 = "alice";
const std::string VersionSetTestBase::kColumnFamilyName2 = "bob";
const std::string VersionSetTestBase::kColumnFamilyName3 = "charles";
class VersionSetTest : public VersionSetTestBase, public testing::Test {
public:
VersionSetTest() : VersionSetTestBase() {}
};
TEST_F(VersionSetTest, SameColumnFamilyGroupCommit) {
NewDB();
const int kGroupSize = 5;
autovector<VersionEdit> edits;
for (int i = 0; i != kGroupSize; ++i) {
edits.emplace_back(VersionEdit());
}
autovector<ColumnFamilyData*> cfds;
autovector<const MutableCFOptions*> all_mutable_cf_options;
autovector<autovector<VersionEdit*>> edit_lists;
for (int i = 0; i != kGroupSize; ++i) {
cfds.emplace_back(versions_->GetColumnFamilySet()->GetDefault());
all_mutable_cf_options.emplace_back(&mutable_cf_options_);
autovector<VersionEdit*> edit_list;
edit_list.emplace_back(&edits[i]);
edit_lists.emplace_back(edit_list);
}
SyncPoint::GetInstance()->DisableProcessing();
SyncPoint::GetInstance()->ClearAllCallBacks();
int count = 0;
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::ProcessManifestWrites:SameColumnFamily", [&](void* arg) {
uint32_t* cf_id = reinterpret_cast<uint32_t*>(arg);
EXPECT_EQ(0, *cf_id);
++count;
});
SyncPoint::GetInstance()->EnableProcessing();
mutex_.Lock();
Status s =
versions_->LogAndApply(cfds, all_mutable_cf_options, edit_lists, &mutex_);
mutex_.Unlock();
EXPECT_OK(s);
EXPECT_EQ(kGroupSize - 1, count);
}
TEST_F(VersionSetTest, HandleValidAtomicGroup) {
std::vector<ColumnFamilyDescriptor> column_families;
SequenceNumber last_seqno;
std::unique_ptr<log::Writer> log_writer;
PrepareManifest(&column_families, &last_seqno, &log_writer);
// Append multiple version edits that form an atomic group
const int kAtomicGroupSize = 3;
std::vector<VersionEdit> edits(kAtomicGroupSize);
int remaining = kAtomicGroupSize;
for (size_t i = 0; i != edits.size(); ++i) {
edits[i].SetLogNumber(0);
edits[i].SetNextFile(2);
edits[i].MarkAtomicGroup(--remaining);
edits[i].SetLastSequence(last_seqno++);
}
Status s;
for (const auto& edit : edits) {
std::string record;
edit.EncodeTo(&record);
s = log_writer->AddRecord(record);
ASSERT_OK(s);
}
log_writer.reset();
s = SetCurrentFile(env_, dbname_, 1, nullptr);
ASSERT_OK(s);
SyncPoint::GetInstance()->DisableProcessing();
SyncPoint::GetInstance()->ClearAllCallBacks();
bool first_in_atomic_group = false;
bool last_in_atomic_group = false;
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::Recover:FirstInAtomicGroup", [&](void* arg) {
VersionEdit* e = reinterpret_cast<VersionEdit*>(arg);
EXPECT_EQ(edits.front().DebugString(),
e->DebugString()); // compare based on value
first_in_atomic_group = true;
});
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::Recover:LastInAtomicGroup", [&](void* arg) {
VersionEdit* e = reinterpret_cast<VersionEdit*>(arg);
EXPECT_EQ(edits.back().DebugString(),
e->DebugString()); // compare based on value
EXPECT_TRUE(first_in_atomic_group);
last_in_atomic_group = true;
});
SyncPoint::GetInstance()->EnableProcessing();
EXPECT_OK(versions_->Recover(column_families, false));
EXPECT_EQ(column_families.size(),
versions_->GetColumnFamilySet()->NumberOfColumnFamilies());
EXPECT_TRUE(first_in_atomic_group);
EXPECT_TRUE(last_in_atomic_group);
}
TEST_F(VersionSetTest, HandleIncompleteTrailingAtomicGroup) {
std::vector<ColumnFamilyDescriptor> column_families;
SequenceNumber last_seqno;
std::unique_ptr<log::Writer> log_writer;
PrepareManifest(&column_families, &last_seqno, &log_writer);
// Append multiple version edits that form an atomic group
const int kAtomicGroupSize = 4;
const int kNumberOfPersistedVersionEdits = kAtomicGroupSize - 1;
std::vector<VersionEdit> edits(kNumberOfPersistedVersionEdits);
int remaining = kAtomicGroupSize;
for (size_t i = 0; i != edits.size(); ++i) {
edits[i].SetLogNumber(0);
edits[i].SetNextFile(2);
edits[i].MarkAtomicGroup(--remaining);
edits[i].SetLastSequence(last_seqno++);
}
Status s;
for (const auto& edit : edits) {
std::string record;
edit.EncodeTo(&record);
s = log_writer->AddRecord(record);
ASSERT_OK(s);
}
log_writer.reset();
s = SetCurrentFile(env_, dbname_, 1, nullptr);
ASSERT_OK(s);
SyncPoint::GetInstance()->DisableProcessing();
SyncPoint::GetInstance()->ClearAllCallBacks();
bool first_in_atomic_group = false;
bool last_in_atomic_group = false;
size_t num = 0;
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::Recover:FirstInAtomicGroup", [&](void* arg) {
VersionEdit* e = reinterpret_cast<VersionEdit*>(arg);
EXPECT_EQ(edits.front().DebugString(),
e->DebugString()); // compare based on value
first_in_atomic_group = true;
});
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::Recover:LastInAtomicGroup",
[&](void* /* arg */) { last_in_atomic_group = true; });
SyncPoint::GetInstance()->SetCallBack("VersionSet::Recover:AtomicGroup",
[&](void* /* arg */) { ++num; });
SyncPoint::GetInstance()->EnableProcessing();
EXPECT_OK(versions_->Recover(column_families, false));
EXPECT_EQ(column_families.size(),
versions_->GetColumnFamilySet()->NumberOfColumnFamilies());
EXPECT_TRUE(first_in_atomic_group);
EXPECT_FALSE(last_in_atomic_group);
EXPECT_EQ(kNumberOfPersistedVersionEdits, num);
}
TEST_F(VersionSetTest, HandleCorruptedAtomicGroup) {
std::vector<ColumnFamilyDescriptor> column_families;
SequenceNumber last_seqno;
std::unique_ptr<log::Writer> log_writer;
PrepareManifest(&column_families, &last_seqno, &log_writer);
// Append multiple version edits that form an atomic group
const int kAtomicGroupSize = 4;
std::vector<VersionEdit> edits(kAtomicGroupSize);
int remaining = kAtomicGroupSize;
for (size_t i = 0; i != edits.size(); ++i) {
edits[i].SetLogNumber(0);
edits[i].SetNextFile(2);
if (i != (kAtomicGroupSize / 2)) {
edits[i].MarkAtomicGroup(--remaining);
}
edits[i].SetLastSequence(last_seqno++);
}
Status s;
for (const auto& edit : edits) {
std::string record;
edit.EncodeTo(&record);
s = log_writer->AddRecord(record);
ASSERT_OK(s);
}
log_writer.reset();
s = SetCurrentFile(env_, dbname_, 1, nullptr);
ASSERT_OK(s);
SyncPoint::GetInstance()->DisableProcessing();
SyncPoint::GetInstance()->ClearAllCallBacks();
bool mixed = false;
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::Recover:AtomicGroupMixedWithNormalEdits", [&](void* arg) {
VersionEdit* e = reinterpret_cast<VersionEdit*>(arg);
EXPECT_EQ(edits[kAtomicGroupSize / 2].DebugString(), e->DebugString());
mixed = true;
});
SyncPoint::GetInstance()->EnableProcessing();
EXPECT_NOK(versions_->Recover(column_families, false));
EXPECT_EQ(column_families.size(),
versions_->GetColumnFamilySet()->NumberOfColumnFamilies());
EXPECT_TRUE(mixed);
}
TEST_F(VersionSetTest, HandleIncorrectAtomicGroupSize) {
std::vector<ColumnFamilyDescriptor> column_families;
SequenceNumber last_seqno;
std::unique_ptr<log::Writer> log_writer;
PrepareManifest(&column_families, &last_seqno, &log_writer);
// Append multiple version edits that form an atomic group
const int kAtomicGroupSize = 4;
std::vector<VersionEdit> edits(kAtomicGroupSize);
int remaining = kAtomicGroupSize;
for (size_t i = 0; i != edits.size(); ++i) {
edits[i].SetLogNumber(0);
edits[i].SetNextFile(2);
if (i != 1) {
edits[i].MarkAtomicGroup(--remaining);
} else {
edits[i].MarkAtomicGroup(remaining--);
}
edits[i].SetLastSequence(last_seqno++);
}
Status s;
for (const auto& edit : edits) {
std::string record;
edit.EncodeTo(&record);
s = log_writer->AddRecord(record);
ASSERT_OK(s);
}
log_writer.reset();
s = SetCurrentFile(env_, dbname_, 1, nullptr);
ASSERT_OK(s);
SyncPoint::GetInstance()->DisableProcessing();
SyncPoint::GetInstance()->ClearAllCallBacks();
bool incorrect_group_size = false;
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::Recover:IncorrectAtomicGroupSize", [&](void* arg) {
VersionEdit* e = reinterpret_cast<VersionEdit*>(arg);
EXPECT_EQ(edits[1].DebugString(), e->DebugString());
incorrect_group_size = true;
});
SyncPoint::GetInstance()->EnableProcessing();
EXPECT_NOK(versions_->Recover(column_families, false));
EXPECT_EQ(column_families.size(),
versions_->GetColumnFamilySet()->NumberOfColumnFamilies());
EXPECT_TRUE(incorrect_group_size);
}
class VersionSetTestDropOneCF : public VersionSetTestBase,
public testing::TestWithParam<std::string> {
public:
VersionSetTestDropOneCF() : VersionSetTestBase() {}
};
// This test simulates the following execution sequence
// Time thread1 bg_flush_thr
// | Prepare version edits (e1,e2,e3) for atomic
// | flush cf1, cf2, cf3
// | Enqueue e to drop cfi
// | to manifest_writers_
// | Enqueue (e1,e2,e3) to manifest_writers_
// |
// | Apply e,
// | cfi.IsDropped() is true
// | Apply (e1,e2,e3),
// | since cfi.IsDropped() == true, we need to
// | drop ei and write the rest to MANIFEST.
// V
//
// Repeat the test for i = 1, 2, 3 to simulate dropping the first, middle and
// last column family in an atomic group.
TEST_P(VersionSetTestDropOneCF, HandleDroppedColumnFamilyInAtomicGroup) {
std::vector<ColumnFamilyDescriptor> column_families;
SequenceNumber last_seqno;
std::unique_ptr<log::Writer> log_writer;
PrepareManifest(&column_families, &last_seqno, &log_writer);
Status s = SetCurrentFile(env_, dbname_, 1, nullptr);
ASSERT_OK(s);
EXPECT_OK(versions_->Recover(column_families, false /* read_only */));
EXPECT_EQ(column_families.size(),
versions_->GetColumnFamilySet()->NumberOfColumnFamilies());
const int kAtomicGroupSize = 3;
const std::vector<std::string> non_default_cf_names = {
kColumnFamilyName1, kColumnFamilyName2, kColumnFamilyName3};
// Drop one column family
VersionEdit drop_cf_edit;
drop_cf_edit.DropColumnFamily();
const std::string cf_to_drop_name(GetParam());
auto cfd_to_drop =
versions_->GetColumnFamilySet()->GetColumnFamily(cf_to_drop_name);
ASSERT_NE(nullptr, cfd_to_drop);
// Increase its refcount because cfd_to_drop is used later, and we need to
// prevent it from being deleted.
cfd_to_drop->Ref();
drop_cf_edit.SetColumnFamily(cfd_to_drop->GetID());
mutex_.Lock();
s = versions_->LogAndApply(cfd_to_drop,
*cfd_to_drop->GetLatestMutableCFOptions(),
&drop_cf_edit, &mutex_);
mutex_.Unlock();
ASSERT_OK(s);
std::vector<VersionEdit> edits(kAtomicGroupSize);
uint32_t remaining = kAtomicGroupSize;
size_t i = 0;
autovector<ColumnFamilyData*> cfds;
autovector<const MutableCFOptions*> mutable_cf_options_list;
autovector<autovector<VersionEdit*>> edit_lists;
for (const auto& cf_name : non_default_cf_names) {
auto cfd = (cf_name != cf_to_drop_name)
? versions_->GetColumnFamilySet()->GetColumnFamily(cf_name)
: cfd_to_drop;
ASSERT_NE(nullptr, cfd);
cfds.push_back(cfd);
mutable_cf_options_list.emplace_back(cfd->GetLatestMutableCFOptions());
edits[i].SetColumnFamily(cfd->GetID());
edits[i].SetLogNumber(0);
edits[i].SetNextFile(2);
edits[i].MarkAtomicGroup(--remaining);
edits[i].SetLastSequence(last_seqno++);
autovector<VersionEdit*> tmp_edits;
tmp_edits.push_back(&edits[i]);
edit_lists.emplace_back(tmp_edits);
++i;
}
int called = 0;
SyncPoint::GetInstance()->DisableProcessing();
SyncPoint::GetInstance()->ClearAllCallBacks();
SyncPoint::GetInstance()->SetCallBack(
"VersionSet::ProcessManifestWrites:CheckOneAtomicGroup", [&](void* arg) {
std::vector<VersionEdit*>* tmp_edits =
reinterpret_cast<std::vector<VersionEdit*>*>(arg);
EXPECT_EQ(kAtomicGroupSize - 1, tmp_edits->size());
for (const auto e : *tmp_edits) {
bool found = false;
for (const auto& e2 : edits) {
if (&e2 == e) {
found = true;
break;
}
}
ASSERT_TRUE(found);
}
++called;
});
SyncPoint::GetInstance()->EnableProcessing();
mutex_.Lock();
s = versions_->LogAndApply(cfds, mutable_cf_options_list, edit_lists,
&mutex_);
mutex_.Unlock();
ASSERT_OK(s);
ASSERT_EQ(1, called);
if (cfd_to_drop->Unref()) {
delete cfd_to_drop;
cfd_to_drop = nullptr;
}
}
INSTANTIATE_TEST_CASE_P(
AtomicGroup, VersionSetTestDropOneCF,
testing::Values(VersionSetTestBase::kColumnFamilyName1,
VersionSetTestBase::kColumnFamilyName2,
VersionSetTestBase::kColumnFamilyName3));
} // namespace rocksdb
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
| 34.937158 | 85 | 0.675634 | [
"vector"
] |
43969079b3d5b2e038bbcffa1a556fd36ba3662a | 629 | cpp | C++ | src/point_distribution.cpp | GrimshawA/libseed | f869327ae6c3e0be247a90d9c4e24e4592600198 | [
"MIT"
] | 1 | 2020-03-04T15:01:44.000Z | 2020-03-04T15:01:44.000Z | src/point_distribution.cpp | GrimshawA/libconjuring | f869327ae6c3e0be247a90d9c4e24e4592600198 | [
"MIT"
] | null | null | null | src/point_distribution.cpp | GrimshawA/libconjuring | f869327ae6c3e0be247a90d9c4e24e4592600198 | [
"MIT"
] | 1 | 2019-03-11T20:58:46.000Z | 2019-03-11T20:58:46.000Z | #include "conjuring/point_distribution.hpp"
#include <random>
#include <cstdint>
namespace pcg
{
point_distribution::point_distribution()
{
}
std::vector<glm::vec2> point_distribution::even(int num, int width, int height)
{
std::default_random_engine generator;
std::uniform_int_distribution<int> distribution(0,width);
std::uniform_int_distribution<int> distribution2(0,height);
std::vector<glm::vec2> pts(num);
for (auto& p : pts)
{
p.x = distribution(generator);
p.y = distribution2(generator);
}
return pts;
}
}
| 20.966667 | 83 | 0.624801 | [
"vector"
] |
4397c45c65e00f7a918751a49340eda4615b4387 | 7,202 | hh | C++ | silicon/api.hh | hazemataya94/silicon | d733ec934110020196c0d104ed9129ea041a99ce | [
"MIT"
] | 2,025 | 2015-01-05T16:41:36.000Z | 2022-03-19T21:02:50.000Z | silicon/api.hh | hazemataya94/silicon | d733ec934110020196c0d104ed9129ea041a99ce | [
"MIT"
] | 68 | 2015-01-19T14:10:20.000Z | 2022-02-01T18:25:15.000Z | silicon/api.hh | hazemataya94/silicon | d733ec934110020196c0d104ed9129ea041a99ce | [
"MIT"
] | 196 | 2015-01-19T12:00:16.000Z | 2022-02-21T14:40:34.000Z | #pragma once
#include <type_traits>
#include <iod/sio.hh>
#include <iod/symbol.hh>
#include <iod/sio_utils.hh>
#include <iod/tuple_utils.hh>
#include <iod/callable_traits.hh>
#include <iod/di.hh>
#include <iod/bind_method.hh>
#include <silicon/di_factories.hh>
#include <silicon/http_route.hh>
#include <silicon/rmq_route.hh>
#include <silicon/middleware_factories.hh>
namespace sl
{
using namespace iod;
using iod::D;
template <typename U, typename G, typename P>
struct procedure_args
{
// return
auto to_sio() {}
};
// template <typename A>
// auto procedure_arguments_remove_optionals_f()
// {
// return foreach(A()) | [] (auto m)
// {
// return static_if<is_optional<decltype(m.value())>::value>(
// [] (auto m) { return m.symbol() = m.value().value; },
// [] (auto m) { return m.symbol() = m.value(); },
// m);
// };
// }
// template <typename A>
// struct procedure_arguments_remove_optionals
// {
// typedef decltype(procedure_arguments_remove_optionals_f<A>()) type;
// };
// template <typename A>
// using procedure_arguments_remove_optionals_t = typename procedure_arguments_remove_optionals<A>::type;
template <typename Ro, typename A, typename Ret, typename F>
struct procedure
{
typedef A arguments_type;
typedef Ro route_type;
typedef Ret return_type;
typedef F function_type;
typedef typename Ro::path_type path_type;
procedure(F f, Ro route)
: f_(f), default_args_(route.all_params()), route_(route)
{
}
auto function() const { return f_; }
auto default_arguments() const { return default_args_; }
auto path() const { return route_.path; }
auto route() const { return route_; }
private:
F f_;
arguments_type default_args_;
Ro route_;
};
// Bind procedure arguments.
template <typename F, typename... U>
auto bind_procedure2(F f, std::tuple<U...>*)
{
return [f] (U... args)
{
return f(std::forward<U>(args)...);
};
}
// Bind procedure arguments.
template <typename F, typename... A>
auto bind_procedure_arguments(F f, sio<A...>)
{
typedef sio<A...> params_type;
//typedef set_default_string_parameter_t<sio<A...>> params_type;
return bind_procedure2(f, (callable_arguments_tuple_t<decltype(&F::template operator()<params_type>)>*)0);
}
template <typename T> struct first_sio_of_tuple;
template <typename... T> struct first_sio_of_tuple2;
template <>
struct first_sio_of_tuple2<>
{
typedef sio<> type;
};
template <typename... U, typename... T>
struct first_sio_of_tuple2<sio<U...>, T...>
{
typedef sio<U...> type;
};
template <typename... U, typename... T>
struct first_sio_of_tuple2<sio<U...>&&, T...>
{
typedef sio<U...> type;
};
template <typename... U, typename... T>
struct first_sio_of_tuple2<const sio<U...>&, T...>
{
typedef sio<U...> type;
};
template <typename U, typename... T>
struct first_sio_of_tuple2<U, T...> : public first_sio_of_tuple2<T...> {};
template <typename... T>
struct first_sio_of_tuple<std::tuple<T...>> : public first_sio_of_tuple2<T...> {};
template <typename T>
using first_sio_of_tuple_t = typename first_sio_of_tuple<T>::type;
template <typename F, typename Ro>
auto make_procedure2(F fun, Ro route)
{
static_assert(is_callable<F>::value, "F must be callable.");
typedef first_sio_of_tuple_t<std::remove_reference_t<callable_arguments_tuple_t<F>>> A;
typedef std::remove_reference_t<callable_return_type_t<F>> Ret;
return procedure<Ro, A, Ret, F>(fun, route);
}
// If m.attributes not empty, bind procedure arguments.
template <typename R, typename F>
auto make_procedure(std::enable_if_t<!is_callable<decltype(std::declval<F>())>::value>*,
R r, F f)
{
auto binded_f = bind_procedure_arguments(f, r.all_params());
return make_procedure2(binded_f, r);
}
// If m.value is callable (i.e. not templated), just forward it.
template <typename R, typename F>
auto make_procedure(std::enable_if_t<is_callable<decltype(std::declval<F>())>::value>*,
R r, F f)
{
return make_procedure2(f, r);
}
template <typename R, typename P>
struct api_node
{
R route;
P content;
};
template <typename R, typename C>
auto make_api_node(R route, C content)
{
return api_node<R, C>{route, content};
}
// // parse_api: Transform the api object into a tree of route / procedures.
// template <typename R, typename... T>
// auto parse_api(std::tuple<T...> api, R route)
// {
// return foreach(api) | [&] (auto m) // m should be iod::assign_exp
// {
// return static_if<is_tuple<decltype(m.right)>::value>(
// [&] (auto m) { // If sio, recursion.
// auto r = internal::make_http_route(route, m.left);
// return make_api_node(r, parse_api(m.right, r));
// },
// [&] (auto m) { // Else, register the procedure.
// auto r = internal::make_http_route(route, m.left);
// return make_api_node(r, make_procedure(0, r, m.right));
// }, m);
// };
// }
// parse_api: Transform the api object into a tree of route / procedures.
template <typename R, typename... T>
auto prefix_api(R route, std::tuple<T...> api)
{
return foreach(api) | [&] (auto m)
{
return static_if<is_tuple<decltype(m.content)>::value>(
[&] (auto m) { // If tuple, plug it under route.
auto r = route_cat(route, m.route);
return make_api_node(r, prefix_api(r, m.content));
},
[&] (auto m) { // Else, register the procedure.
auto r = route_cat(route, m.route);
return make_api_node(r, make_procedure(0, r, m.content.function()));
}, m);
};
}
// parse_api: Transform the api object into a tree of route / procedures.
template <typename R, typename... T>
auto parse_api(std::tuple<T...> api, R route)
{
return foreach(api) | [&] (auto m) // m should be iod::assign_exp
{
return static_if<is_tuple<decltype(m.right)>::value>(
[&] (auto m) { // If api_node, plug it under route.
auto r = route_cat(route, m.left);
return make_api_node(r, prefix_api(r, m.right));
},
[&] (auto m) { // Else, register the procedure.
auto r = route_cat(route, m.left);
return make_api_node(r, make_procedure(0, r, m.right));
}, m);
};
}
template <typename T, typename M>
decltype(auto) instantiate_factory(M& middlewares_tuple)
{
return di_factories_call([](T t) { return t; },
middlewares_tuple);
}
template <typename R, typename... P>
auto api(R root, P... procs)
{
return parse_api(std::make_tuple(procs...), root);
}
template <typename... P>
auto http_api(P... procs)
{
return parse_api(std::make_tuple(procs...), http_route<>());
}
inline auto http_api()
{
return D();
}
namespace rmq
{
template <typename... P>
auto api(P... procs)
{
return parse_api(std::make_tuple(procs...), route<>());
}
}
}
| 28.243137 | 110 | 0.6208 | [
"object",
"transform"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.