本文整理汇总了C++中LOCAL函数的典型用法代码示例。如果您正苦于以下问题:C++ LOCAL函数的具体用法?C++ LOCAL怎么用?C++ LOCAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOCAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collection_check1_aux
template<typename T> void collection_check1_aux (T* table, size_t nb)
{
/** We create a collection. */
Collection<T>* c = new CollectionFile<T> ("foo");
LOCAL(c);
/** We insert some items. */
for (size_t i=0; i<nb; i++) { c->insert (table[i]); }
/** We have to flush to be sure all items are in the collection. */
c->flush();
/** We check we have the correct number of items. */
CPPUNIT_ASSERT (c->getNbItems() == (int)nb);
/** We iterate the collection. */
Iterator<T>* it = c->iterator();
LOCAL(it);
/** We check we get the correct items. */
size_t i=0;
for (it->first(); !it->isDone(); it->next()) { CPPUNIT_ASSERT (it->item() == table[i++]); }
/** We delete physically the collection. */
//c->remove ();
}
示例2: QVBoxLayout
void QToDoContent::initUI()
{
QVBoxLayout *vlay = new QVBoxLayout(this);
QWidget *centerWidget = new QWidget(this);
QGridLayout *grid = new QGridLayout(centerWidget);
vlay->setContentsMargins(0,0,0,0);
grid->setContentsMargins(0,0,0,0);
grid->setSpacing(5);
m_tree = new QTreeView(centerWidget);
m_tree->setGeometry(QRect(0,0,400,300));
m_tree->setMaximumWidth(200);
m_edit = new QTextEdit(centerWidget);
m_okBtn = new QPureColorButton(centerWidget);
m_cancelBtn = new QPureColorButton(centerWidget);
m_okBtn->setMaximumHeight(40);
m_cancelBtn->setMaximumHeight(40);
connect(m_okBtn,SIGNAL(clicked()),this,SLOT(ok_clicked()));
connect(m_cancelBtn,SIGNAL(clicked()),this,SLOT(close()));
m_okBtn->setButtonText(LOCAL("确认选择"));
m_cancelBtn->setButtonText(LOCAL("取消"));
m_okBtn->setMaximumWidth(80);
m_cancelBtn->setMaximumWidth(80);
m_model = new QStandardItemModel(this);
m_model->setColumnCount(2);
m_tree->setModel(m_model);
m_tree->setColumnWidth(0,600);
grid->addWidget(m_tree,0,0,3,1,Qt::AlignLeft);
grid->addWidget(m_edit,0,1,2,8);
grid->addWidget(m_okBtn,2,6,1,1);
grid->addWidget(m_cancelBtn,2,7,1,1);
vlay->addWidget(centerWidget);
}
示例3: QDialog
SearchDlg::SearchDlg(QWidget *parent) :
QDialog(parent),
ui(new Ui::SearchDlg)
{
ui->setupUi(this);
Qt::WindowFlags flags=Qt::Dialog;
flags |=Qt::WindowMinimizeButtonHint |Qt::WindowMaximizeButtonHint;
setWindowFlags(flags);
this->setWindowTitle(LOCAL("查找用户"));
itemModel_ = new QStandardItemModel(0,4,this);
itemModel_->setHeaderData(0,Qt::Horizontal,LOCAL("财政通行证账号"));
itemModel_->setHeaderData(1,Qt::Horizontal,LOCAL("姓名"));
itemModel_->setHeaderData(2,Qt::Horizontal,LOCAL("用户名"));
itemModel_->setHeaderData(3,Qt::Horizontal,tr("Email"));
ui->treeView->setColumnWidth(0,250);
ui->treeView->setColumnWidth(1,100);
ui->treeView->setColumnWidth(2,100);
ui->treeView->setColumnWidth(3,200);
ui->treeView->setModel(itemModel_);
ui->pushButton_AddContact->setEnabled(false);
//flag_search = 0;
connect(ui->treeView,SIGNAL(clicked(QModelIndex)),this,SLOT(treeClick(QModelIndex)));
connect(ui->pushButton_find,SIGNAL(clicked()),this,SLOT(btnSearchClick()));
connect(ui->pushButton_AddContact,SIGNAL(clicked()),this,SLOT(addContactClick()));
//connect(ui->radioButton_id, SIGNAL(clicked(bool)), this, SLOT(slotchangeID()));
//connect(ui->radioButton_name, SIGNAL(clicked(bool)), this, SLOT(slotchangeName()));
bool check;
check= connect(Listwindow::Instance(),SIGNAL(handleSearch(QString)),this,SLOT(handleSearch(QString)));
check = connect(this, SIGNAL(addnewfreind(QString)), Listwindow::Instance(), SLOT(slotaddnew(QString)));
Q_ASSERT(check);
type_ = AddContact;
}
示例4: astserial
uint32_t
astserial(int serial, uint32_t op)
{
uint32_t r;
uint32_t* v;
switch (serial)
{
case AST_SERIAL_ENVIRON:
v = &LOCAL(env_serial);
break;
case AST_SERIAL_LOCALE:
v = &LOCAL(locale.serial);
break;
case AST_SERIAL_RESTART:
v = &GLOBAL(restart);
break;
default:
return 0;
}
r = asoget32(v);
switch (op)
{
case AST_SERIAL_get:
switch (r)
{
case AST_SERIAL_except:
asocas32(v, r, AST_SERIAL_always);
break;
}
break;
case AST_SERIAL_inc:
switch (r)
{
case AST_SERIAL_always:
break;
case AST_SERIAL_except:
asocas32(v, r, AST_SERIAL_always);
r = asoget32(v);
break;
case AST_SERIAL_max:
if (asocas32(v, r, 1) == r)
{
r = asoget32(v);
break;
}
/*FALLTHROUGH*/
default:
r = asoinc32(v) + 1;
break;
}
break;
case AST_SERIAL_always:
case AST_SERIAL_except:
asocas32(v, r, op);
break;
}
return r;
}
示例5: CollectLocalVar_VisitAssignNode
static kbool_t CollectLocalVar_VisitAssignNode(KVISITOR_PARAM)
{
kUntypedNode *left = kUntypedNode_At(node, 1);
kUntypedNode *right = kUntypedNode_At(node, 2);
if(kUntypedNode_node(left) == KNode_Local) {
LOCAL(left->typeAttr, left->index);
KLIB VisitNode(kctx, builder, right, thunk);
} else{
LOCAL(KType_Object, (khalfword_t)left->index);
KLIB VisitNode(kctx, builder, right, thunk);
}
return true;
}
示例6: main
int main (int argc, char* argv[])
{
/** We create a command line parser. */
OptionsParser parser ("bankgen");
const char* OUTPUT_PREFIX = "-out";
const char* SEQ_LEN = "-seq-len";
const char* READ_LEN = "-read-len";
const char* OVERLAP_LEN = "-overlap-len";
const char* COVERAGE = "-coverage";
parser.push_back (new OptionOneParam (OUTPUT_PREFIX, "output prefix", true));
parser.push_back (new OptionOneParam (SEQ_LEN, "sequence length", false, "1000000"));
parser.push_back (new OptionOneParam (READ_LEN, "read length", false, "150" ));
parser.push_back (new OptionOneParam (OVERLAP_LEN, "overlap between two reads", false, "50" ));
parser.push_back (new OptionOneParam (COVERAGE, "coverage", false, "3" ));
try
{
/** We parse the user options. */
IProperties* options = parser.parse (argc, argv);
/** We create the random sequence. */
IBank* randomBank = new BankRandom (1, options->getInt(SEQ_LEN));
LOCAL (randomBank);
/** We create the reads bank. */
IBank* readsBank = new BankSplitter (
randomBank,
options->getInt(READ_LEN),
options->getInt(OVERLAP_LEN),
options->getInt(COVERAGE)
);
LOCAL (readsBank);
/** We save the random bank. */
SaveAsFasta (randomBank, options->getStr(OUTPUT_PREFIX) + "_sequence.fa");
/** We save the reads bank. */
SaveAsFasta (readsBank, options->getStr(OUTPUT_PREFIX) + "_reads.fa");
}
catch (OptionFailure& e)
{
e.getParser().displayErrors (stdout);
e.getParser().displayHelp (stdout);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
示例7: qDebug
void QHttpDownLoad::finished()
{
qDebug()<<"Download Finished";
if ( !m_error )
{
QMessageBox::information(NULL,LOCAL("已完成"),LOCAL("文件下载完毕"),0);
}else
{
QMessageBox::information(NULL,LOCAL("错误"),LOCAL("文件下载出错"),0);
}
m_file->close();
delete m_file;
}
示例8: main
int main (int argc, char* argv[])
{
if (argc < 2)
{
std::cerr << "you must provide a bank." << std::endl;
return EXIT_FAILURE;
}
// We define a try/catch block in case some method fails
try
{
// We declare an input Bank and use it locally
IBank* inputBank = Bank::open (argv[1]);
LOCAL (inputBank);
// We create a sequence iterator for the bank with progress information
ProgressIterator<Sequence> iter (*inputBank, "Iterating sequences");
// We loop over sequences.
for (iter.first(); !iter.isDone(); iter.next())
{
// Note that we do nothing inside the sequence iterating loop
}
}
catch (Exception& e)
{
std::cerr << "EXCEPTION: " << e.getMessage() << std::endl;
}
}
示例9: qDebug
void QJSCore::PicAcq()
{
qDebug()<<LOCAL("采集图像。。。。。。");
byte head[2] = PIC_ACQ;
Cmd::Command &cmd = m_dev->createCommand(head,NULL,0);
m_dev->sendCmd(cmd);
}
示例10: main
int main (int argc, char* argv[])
{
// We get a command line parser for graphs available options.
IOptionsParser* parser = Graph::getOptionsParser();
LOCAL (parser);
// We use a try/catch block in case we have some command line parsing issue.
try
{
// We parse the user options.
parser->parse (argc, argv);
// We create the graph with the provided options.
Graph graph = Graph::create (parser->getProperties());
// We dump some information about the graph.
std::cout << graph.getInfo() << std::endl;
}
catch (OptionFailure& e)
{
return e.displayErrors (std::cout);
}
catch (Exception& e)
{
std::cerr << "EXCEPTION: " << e.getMessage() << std::endl;
}
return EXIT_SUCCESS;
}
示例11: main
int main (int argc, char* argv[])
{
// We get the file name from the user arguments
const char* filename = argc >= 2 ? argv[1] : "";
// We get information about the bank.
u_int64_t nbSequences=0, dataSize=0, seqMaxSize=0, seqMinSize=~0;
// We declare a Bank instance.
IBank* bank = Bank::open (filename);
LOCAL (bank);
// IN A NEAR FUTURE, WE WILL HAVE STL LIKE ITERATORS.
#if 0
for (BankFasta::iterator it = bank->begin(); it != bank->end(); ++it)
{
Sequence& seq = *it;
Data& data = seq.getData();
nbSequences ++;
if (data.size() > seqMaxSize) { seqMaxSize = data.size(); }
if (data.size() < seqMinSize) { seqMinSize = data.size(); }
dataSize += data.size ();
}
#endif
std::cout << "data size : " << dataSize << std::endl;
std::cout << "sequence number : " << nbSequences << std::endl;
std::cout << "sequence max size : " << seqMaxSize << std::endl;
std::cout << "sequence min size : " << seqMinSize << std::endl;
}
示例12: LOCAL
void MPHFAlgorithm<span,Abundance_t,NodeState_t>::check ()
{
size_t nb_iterated = 0;
Iterator<Count>* itKmers = _solidCounts->iterator(); LOCAL (itKmers);
// TODO parallize that too
for (itKmers->first(); !itKmers->isDone(); itKmers->next())
{
Count& count = itKmers->item();
/** We get the current abundance. */
Abundance_t abundance = (*_abundanceMap)[count.value];
// sanity check (thank god i wrote this, was useful for spruce) //todo change this now that abundance is discretized
/* if (abundance!=count.abundance && abundance<MAX_ABUNDANCE)
{
std::cout << "debug info: " << (int)abundance << " " << (int)count.abundance << std::endl;
typename AbundanceMap::Hash::Code h = _abundanceMap->getCode (count.value);
size_t n = _abundanceMap->size();
std::cout << "debug info: " << h << " / " << n << std::endl;
throw Exception ("ERROR: MPHF isn't injective (abundance population failed)");
}*/
nb_iterated ++;
}
if (nb_iterated != _abundanceMap->size() && _abundanceMap->size() > 3)
{
throw Exception ("ERROR during abundance population: itKmers iterated over %d/%d kmers only", nb_iterated, _abundanceMap->size());
}
}
示例13: setType
void SearchDlg::setType(int tp)
{
type_ = tp;
if ( tp == UserSearch )
{
ui->pushButton_AddContact->setText(LOCAL("选择"));
}
}
示例14: info
void QHttpDownLoad::downloadFile(QString url)
{
QFileInfo info(url);
QString fn = info.fileName();
m_file = new QFile(fn);
qDebug()<<"File Name: "<<fn;
if ( m_file->exists() )
{
int res = 0;
QString title = LOCAL("提示"), text = LOCAL("文件已存在,是否重复下载?");
res = QMessageBox::information(NULL,title,text,QMessageBox::Yes,QMessageBox::No);
if ( res != QMessageBox::Yes)
{
delete m_file;
m_file = NULL;
qDebug()<<"Do not overwrite";
}else
{
qDebug()<<"Overwrite";
m_file->open(QIODevice::WriteOnly);
QNetworkRequest &request = QNetworkRequest(QUrl(url));
m_error = false;
m_reply = m_nam->get(request);
connect(m_reply,SIGNAL(readyRead()),this,SLOT(readyRead()));
connect(m_reply,SIGNAL(finished()),this,SLOT(finished()));
connect(m_reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
}
}else
{
qDebug()<<"Download";
m_file->open(QIODevice::WriteOnly);
QNetworkRequest &request = QNetworkRequest(QUrl(url));
m_error = false;
m_reply = m_nam->get(request);
connect(m_reply,SIGNAL(readyRead()),this,SLOT(readyRead()));
connect(m_reply,SIGNAL(finished()),this,SLOT(finished()));
connect(m_reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
}
}
示例15: QDialog
//查找好友
FindFriend::FindFriend(QWidget *parent) :
QDialog(parent),
ui(new Ui::FindFriend)
{
ui->setupUi(this);
Qt::WindowFlags flags=Qt::Dialog;
flags |=Qt::WindowMinimizeButtonHint ;
setWindowFlags(flags);
this->setWindowTitle(LOCAL("添加好友"));
connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(addFriend()));
}