本文整理汇总了C++中checkData函数的典型用法代码示例。如果您正苦于以下问题:C++ checkData函数的具体用法?C++ checkData怎么用?C++ checkData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char** argv )
{
/* loop variables */
int x,y;
/* Create matrixes */
unsigned int * input_array;
unsigned int * serial_array;
unsigned int * output_array;
unsigned int * filter_list;
/* Initialize the data. Values don't matter much. */
posix_memalign ( (void**)&input_array, 4096, DATA_LEN * sizeof(unsigned int));
// input_array = (unsigned int*) posix_memalign ( DATA_LEN * sizeof(unsigned int), 4096);
for (x=0; x<DATA_LEN; x++)
{
input_array[x] = x % 2048;
}
/* start with an empty *all zeros* output array */
posix_memalign ( (void**)&output_array, 4096, DATA_LEN * sizeof(unsigned int));
memset ( output_array, 0, DATA_LEN );
posix_memalign ( (void**)&serial_array, 4096, DATA_LEN * sizeof(unsigned int));
memset ( serial_array, 0, DATA_LEN );
/* Initialize the filter. Values don't matter much. */
filter_list = (unsigned int*) malloc ( FILTER_LEN * sizeof(unsigned int));
for (y=0; y<FILTER_LEN; y++)
{
filter_list[y] = y;
}
/* Execute at a variety of filter lengths */
for ( int filter_len =16; filter_len<=FILTER_LEN; filter_len*=2)
{
serialDataFirst ( DATA_LEN, input_array, serial_array, filter_len, filter_list );
memset ( output_array, 0, DATA_LEN );
serialFilterFirst ( DATA_LEN, input_array, output_array, filter_len, filter_list );
checkData ( serial_array, output_array );
memset ( output_array, 0, DATA_LEN );
//omp_set_num_threads(16);
parallelFilterFirst ( DATA_LEN, input_array, output_array, filter_len, filter_list );
checkData ( serial_array, output_array );
memset ( output_array, 0, DATA_LEN );
parallelDataFirst ( DATA_LEN, input_array, output_array, filter_len, filter_list );
checkData ( serial_array, output_array );
memset ( output_array, 0, DATA_LEN );
}
}
开发者ID:kzhang12,项目名称:Parallel-Programming,代码行数:52,代码来源:filter.c
示例2: QDialog
PlaceInformationDialog::PlaceInformationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::PlaceInformationDialog)
{
ui->setupUi(this);
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(ui->lineEditNumber, SIGNAL(editingFinished()), this, SLOT(checkData()));
connect(ui->lineEditPLZ, SIGNAL(editingFinished()), this, SLOT(checkData()));
connect(ui->lineEditStreet, SIGNAL(editingFinished()), this, SLOT(checkData()));
connect(ui->lineEditTown, SIGNAL(editingFinished()), this, SLOT(checkData()));
}
开发者ID:lbproductions,项目名称:psnewmodel,代码行数:13,代码来源:placeinformationdialog.cpp
示例3: checkData
bool SudokuBox::checkResult() {
bool ret = true;
//XXX optimization: only check the error index and changed index.
m_setErrors.clear();
std::vector<int> index_array;
//1.check each row
for (int row = 0; row < m_iRows; row++) {
index_array.clear();
for (int col = 0; col < m_iCols; col++) {
index_array.push_back(m_iCols * row + col);
}
ret &= checkData(index_array);
}
//2.check each column
for (int col = 0; col < m_iCols; col++) {
index_array.clear();
for (int row = 0; row < m_iRows; row++) {
index_array.push_back(m_iCols * row + col);
}
ret &= checkData(index_array);
}
//3.check each grid
if (m_stagedata.cols_per_grid > 1 && m_stagedata.rows_per_grid > 1) {
int count = m_stagedata.grids_in_col * m_stagedata.grids_in_row;
// int cell_count = m_stagedata.rows_per_grid * m_stagedata.cols_per_grid;
for (int grid = 0; grid < count; grid++) {
index_array.clear();
int start_col = (grid % m_stagedata.grids_in_col) * m_stagedata.cols_per_grid;
int start_row = (grid / m_stagedata.grids_in_col) * m_stagedata.rows_per_grid;
int start = start_row * m_iCols + start_col;
for (int row = 0; row < m_stagedata.rows_per_grid; row++) {
for (int col = 0; col < m_stagedata.cols_per_grid; col++) {
index_array.push_back(start + row * m_iCols + col);
}
}
ret &= checkData(index_array);
}
}
//4.check if each cell filled with valid number
for (int index = 0; index < m_iRows*m_iCols; index++) {
if (m_pData[index] <= 0)
return false;
}
return ret;
}
开发者ID:gitter-badger,项目名称:kidsudoku,代码行数:51,代码来源:SudokuBox.cpp
示例4: QMainWindow
MainWindow::MainWindow(QIODevice *ioDev, QWidget *parent) :
QMainWindow(parent),
ioDev(ioDev),
ui(new Ui::MainWindow)
{
this->setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
ui->setupUi(this);
connect(ioDev, SIGNAL(readyRead()), this, SLOT(onReadyRead()));
//edited
AbstractSerial *tempDev = (AbstractSerial *) ioDev;
tempDev->setDtr(false);
tempDev->setRts(true);
save="";
readFormatedTimer = new QTimer(this);
readFormatedTimer->start(1000);
connect(readFormatedTimer,SIGNAL(timeout()),this,SLOT(checkData()));
///
readWaitTimer = new QTimer(this);
connect(readWaitTimer, SIGNAL(timeout()), this, SLOT(onReadyRead()));
onReadyRead();
}
开发者ID:ienzam,项目名称:Qt-Device-Chat,代码行数:25,代码来源:mainwindow.cpp
示例5: close
// Build a PPM from given attributes
//-------------------------------------------------------------------------------------------------
bool PPM::build(const std::string &format, unsigned int width, unsigned int height, unsigned int maxrgb,
const std::vector<unsigned char> &r,
const std::vector<unsigned char> &g,
const std::vector<unsigned char> &b)
{
// Copy the header values
m_format = format;
m_width = width;
m_height = height;
m_maxrgb = maxrgb;
// Check that the values are valid
if(!checkHeader())
{
std::cerr << "Error in build: invalid header values" << std::endl;
close(); // Prevent inconsistant state
return false;
}
// Copy each of the vectors
m_pR = new std::vector<unsigned char>(r);
m_pG = new std::vector<unsigned char>(g);
m_pB = new std::vector<unsigned char>(b);
// Check that the data is valid
if(!checkData())
{
std::cerr << "Error in build: invalid data" << std::endl;
close(); // Prevent inconsistant state
return false;
}
return true;
}
开发者ID:Byron-Miles,项目名称:code-samples,代码行数:36,代码来源:PPM.cpp
示例6: sender
void AddClientDialog::loadQuery()
{
ThreadControl *tc = qobject_cast<ThreadControl *>( sender() );
if( !tc )
return;
int i = tc->getIndexOfLastQuery( qList );
if( i < 0 )
return;
QStringList list = tc->getDataList();
switch(i)
{
case 0:
{
checkData( list );
break;
}
case 1:
{
if( list.count() > 0 )
insertData( list.first() );
break;
}
}
}
开发者ID:petrpopov,项目名称:db_transactions,代码行数:26,代码来源:addclientdialog.cpp
示例7: checkData
void QXmppTransferIncomingJob::_q_disconnected()
{
if (d->state == QXmppTransferJob::FinishedState)
return;
checkData();
}
开发者ID:mtdcr,项目名称:QXmpp,代码行数:7,代码来源:QXmppTransferManager.cpp
示例8: checkData
void BytesTrieTest::TestShortestBranch() {
static const StringAndValue data[]={
{ "a", 1000 },
{ "b", 2000 }
};
checkData(data, UPRV_LENGTHOF(data));
}
开发者ID:MIPS,项目名称:external-icu,代码行数:7,代码来源:bytestrietest.cpp
示例9: doIncise
//文件切割逻辑
void doIncise()
{
checkData();
checkSize();
if (mChang) {
createFile();
}
}
开发者ID:Jackson-soft,项目名称:LongDemo,代码行数:9,代码来源:Backend.hpp
示例10: checkData
void ZipCountryCompleters::filterCountry(const int index)
{
if (!m_Country)
return;
if (!m_Model)
return;
m_Model->filterCountry(m_Country->itemData(index).toInt());
checkData();
}
开发者ID:eads77m,项目名称:freemedforms,代码行数:9,代码来源:zipcountrycompleters.cpp
示例11: m_result
Palapeli::PuzzleCreatorDialog::PuzzleCreatorDialog()
: m_result(0)
, m_imageSelector(new KUrlRequester)
, m_nameEdit(new KLineEdit)
, m_commentEdit(new KLineEdit)
, m_authorEdit(new KLineEdit)
, m_slicerSelector(new Palapeli::SlicerSelector)
, m_slicerConfigMasterWidget(new QStackedWidget)
{
//setup dialog
setCaption(i18nc("@title:window", "Create new puzzle"));
showButton(KDialog::Help, false);
//setup image selector
m_imageSelector->setMode(KFile::File | KFile::LocalOnly | KFile::ExistingOnly);
//build sublayouts
QFormLayout* sourceLayout = new QFormLayout;
sourceLayout->addRow(i18nc("@label:chooser", "Image file:"), m_imageSelector);
sourceLayout->addRow(new QLabel(i18nc("@info", "Please describe below the image which you have chosen.")));
sourceLayout->addRow(i18nc("@label:textbox", "Image name:"), m_nameEdit);
sourceLayout->addRow(i18nc("@label:textbox (like in: This comment is optional.)", "Optional comment:"), m_commentEdit);
sourceLayout->addRow(i18nc("@label:textbox", "Name of image author:"), m_authorEdit);
foreach (const Pala::Slicer* slicer, m_slicerSelector->slicers())
{
m_slicerConfigWidgets[slicer] = new Palapeli::SlicerConfigWidget(slicer);
m_slicerConfigMasterWidget->addWidget(m_slicerConfigWidgets[slicer]);
}
//build page widget items
m_sourcePage = addPage(new QWidget, i18nc("@item:inlistbox (page name in an assistant dialog)", "Choose image"));
m_sourcePage->setHeader(i18nc("@title:tab (page header in an assistant dialog)", "Specify the source image to be sliced into pieces"));
m_sourcePage->widget()->setLayout(sourceLayout);
m_slicerPage = addPage(m_slicerSelector, i18nc("@item:inlistbox (page name in an assistant dialog)", "Choose slicer"));
m_slicerPage->setHeader(i18nc("@title:tab (page header in an assistant dialog)", "Choose a slicing method"));
m_slicerConfigPage = addPage(m_slicerConfigMasterWidget, i18nc("@item:inlistbox (page name in an assistant dialog)", "Configure slicer"));
m_slicerConfigPage->setHeader(i18nc("@title:tab (page header in an assistant dialog)", "Tweak the parameters of the chosen slicing method"));
//wire up stuff
connect(this, SIGNAL(accepted()), this, SLOT(createPuzzle()));
connect(m_imageSelector, SIGNAL(urlSelected(KUrl)), this, SLOT(checkData()));
connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SLOT(checkData()));
connect(m_authorEdit, SIGNAL(textChanged(QString)), this, SLOT(checkData()));
checkData(); //to invalidate first page
connect(m_slicerSelector, SIGNAL(currentSelectionChanged(Palapeli::SlicerSelection)), this, SLOT(updateSlicerSelection(Palapeli::SlicerSelection)));
}
开发者ID:KDE,项目名称:palapeli,代码行数:42,代码来源:puzzlecreator.cpp
示例12: checkData
void PlaceInformationDialog::setPlace(QSharedPointer<Place> place)
{
m_place = place;
ui->lineEditNumber->setText(QString::number(place->houseNumber()));
ui->lineEditPLZ->setText(QString::number(place->postalCode()));
ui->lineEditStreet->setText(place->street());
ui->lineEditTown->setText(place->city());
ui->imageWellIcon->setPixmap(place->cityEmblem());
checkData();
}
开发者ID:lbproductions,项目名称:psnewmodel,代码行数:12,代码来源:placeinformationdialog.cpp
示例13: assert
void Connection::connect(const SocketClient::SharedPtr &client)
{
assert(!mSocketClient);
mSocketClient = client;
mIsConnected = true;
assert(client->isConnected());
mSocketClient->disconnected().connect(std::bind(&Connection::onClientDisconnected, this, std::placeholders::_1));
mSocketClient->readyRead().connect(std::bind(&Connection::onDataAvailable, this, std::placeholders::_1, std::placeholders::_2));
mSocketClient->bytesWritten().connect(std::bind(&Connection::onDataWritten, this, std::placeholders::_1, std::placeholders::_2));
mSocketClient->error().connect(std::bind(&Connection::onSocketError, this, std::placeholders::_1, std::placeholders::_2));
mCheckTimer = EventLoop::eventLoop()->registerTimer([this](int) { checkData(); }, 0, Timer::SingleShot);
}
开发者ID:Andersbakken,项目名称:rct,代码行数:12,代码来源:Connection.cpp
示例14: writeTo
// Write current contents to file
//-------------------------------------------------------------------------------------------------
bool PPM::writeTo(const std::string &filename)
{
// Cheak the header values are valid
if(!checkHeader())
{
std::cerr << "Error in writeTo: invalid header values" << std::endl;
return false;
}
// Check the data is valid
if(!checkData())
{
std::cerr << "Error in writeTo: invalid data" << std::endl;
return false;
}
std::ofstream outFile;
// Open output file in binary mode
outFile.open(filename.c_str(), std::ios::binary);
// Check file open ok
if(!outFile)
{
std::cerr << "Error in writeTo: could not open or create file '" << filename << "'" << std::endl;
return false;
}
// Write header values
outFile << m_format << std::endl;
outFile << "# Created by PPM.cpp" << std::endl;
outFile << m_width << " " << m_height << std::endl;
outFile << m_maxrgb << std::endl;
// Iterate through vectors and write data
char c;
unsigned int size = m_width * m_height;
for(unsigned int i = 0; i < size; ++i)
{
c = (*m_pR)[i];
outFile.write(&c, 1);
c = (*m_pG)[i];
outFile.write(&c, 1);
c = (*m_pB)[i];
outFile.write(&c, 1);
}
// Close the file
outFile.close();
return true;
}
开发者ID:Byron-Miles,项目名称:code-samples,代码行数:54,代码来源:PPM.cpp
示例15: readData
// Read the data
//-------------------------------------------------------------------------------------------------
bool PPM::readData(std::ifstream &inFile)
{
// Read data into r, g and b vectors
// Note: if << is used data that looks like a white space will be skipped
char c;
int length = m_width * m_height;
for(int i = 0; i < length; ++i)
{
// Red
inFile.read(&c, 1); // read a byte
// Check for eof
if(inFile.eof())
{
std::cerr << "Error in readData: unexpected end of file" << std::endl;
return false;
}
// Set value
(*m_pR)[i] = (unsigned char)c;
// Green
inFile.read(&c, 1); // read a byte
// Check for eof
if(inFile.eof())
{
std::cerr << "Error in readData: unexpected end of file" << std::endl;
return false;
}
// Set value
(*m_pG)[i] = (unsigned char)c;
// Blue
inFile.read(&c, 1); // read a byte
// Check for eof
if(inFile.eof())
{
std::cerr << "Error in readData: unexpected end of file" << std::endl;
return false;
}
// Set value
(*m_pB)[i] = (unsigned char)c;
}
// Check the data is valid
if(!checkData())
{
std::cerr << "Error in readData: invalid data" << std::cout;
return false;
}
return true;
}
开发者ID:Byron-Miles,项目名称:code-samples,代码行数:53,代码来源:PPM.cpp
示例16: checkData
void UCharsTrieTest::TestFirstForCodePoint() {
static const StringAndValue data[]={
{ "a", 1 },
{ "a\\ud800", 2 },
{ "a\\U00010000", 3 },
{ "\\ud840", 4 },
{ "\\U00020000\\udbff", 5 },
{ "\\U00020000\\U0010ffff", 6 },
{ "\\U00020000\\U0010ffffz", 7 },
{ "\\U00050000xy", 8 },
{ "\\U00050000xyz", 9 }
};
checkData(data, UPRV_LENGTHOF(data));
}
开发者ID:Acorld,项目名称:WinObjC-Heading,代码行数:14,代码来源:ucharstrietest.cpp
示例17: displayData
QAction *BtMenuView::newAction(QMenu *parentMenu, const QModelIndex &itemIndex) {
QVariant displayData(m_model->data(itemIndex, Qt::DisplayRole));
QVariant iconData(m_model->data(itemIndex, Qt::DecorationRole));
QVariant toolTipData(m_model->data(itemIndex, Qt::ToolTipRole));
QVariant statusTipData(m_model->data(itemIndex, Qt::StatusTipRole));
QVariant whatsThisData(m_model->data(itemIndex, Qt::WhatsThisRole));
QAction *childAction = new QAction(parentMenu);
// Set text:
if (displayData.canConvert(QVariant::String)) {
childAction->setText(displayData.toString());
}
// Set icon:
if (iconData.canConvert(QVariant::Icon)) {
childAction->setIcon(iconData.value<QIcon>());
}
// Set tooltip:
if (toolTipData.canConvert(QVariant::String)) {
childAction->setToolTip(toolTipData.toString());
}
// Set status tip:
if (statusTipData.canConvert(QVariant::String)) {
childAction->setStatusTip(statusTipData.toString());
}
// Set whatsthis:
if (whatsThisData.canConvert(QVariant::String)) {
childAction->setWhatsThis(whatsThisData.toString());
}
// Set checkable:
if (m_model->flags(itemIndex).testFlag(Qt::ItemIsUserCheckable)) {
childAction->setCheckable(true);
}
// Set checked:
QVariant checkData(m_model->data(itemIndex, Qt::CheckStateRole));
bool ok;
Qt::CheckState state = (Qt::CheckState) checkData.toInt(&ok);
if (ok) {
childAction->setChecked(state == Qt::Checked);
}
return childAction;
}
开发者ID:Gandh1PL,项目名称:bibletime,代码行数:49,代码来源:btmenuview.cpp
示例18: writeData
void QXmppTransferIncomingJob::_q_receiveData()
{
if (d->state != QXmppTransferJob::TransferState)
return;
// receive data block
if (d->direction == QXmppTransferJob::IncomingDirection)
{
writeData(d->socksSocket->readAll());
// if we have received all the data, stop here
if (fileSize() && d->done >= fileSize())
checkData();
}
}
开发者ID:mtdcr,项目名称:QXmpp,代码行数:15,代码来源:QXmppTransferManager.cpp
示例19: checkData
void QXmppTransferJob::disconnected()
{
if (m_state == QXmppTransferJob::FinishedState)
return;
// terminate transfer
if (m_direction == QXmppTransferJob::IncomingDirection)
{
checkData();
} else {
if (fileSize() && m_done != fileSize())
terminate(QXmppTransferJob::ProtocolError);
else
terminate(QXmppTransferJob::NoError);
}
}
开发者ID:chloerei,项目名称:qxmpp,代码行数:16,代码来源:QXmppTransferManager.cpp
示例20: checkI
//Verifica se o I foi bem recebido
int checkI(char* buffer,int cns){
int res,i;
char data[15000];
if( buffer[0]!=FLAG
|| buffer[1]!=A
|| buffer[2]!=cns
|| buffer[3]!=(A^cns))
{
return FALSE;
}
else
{
res = getData(buffer,data);
res = checkData(data,res);
return res;
}
}
开发者ID:GuilhermeSCP,项目名称:serial-port-comm-rcom,代码行数:18,代码来源:receiver.c
注:本文中的checkData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论