本文整理汇总了C++中pl函数的典型用法代码示例。如果您正苦于以下问题:C++ pl函数的具体用法?C++ pl怎么用?C++ pl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: in
void ThousandClientDataParser::inListAllNewGame(QByteArray &data)
{
QDataStream in(data);
QList<GameThousand> gamesList;
QList<Player> players;
QString player;
quint16 time,id;
quint8 number;
int size,nick_size;
in>>size;
for(int i=0; i<size; i++) {
players.clear();
in>>id;
in>>number;
for(quint8 j=0; j<number; j++) {
in>>nick_size;
in>>player;
Player pl(player);
players.append(pl);
}
in>>time;
GameThousand game(players,number,time);
gamesList.append(game);
}
emit(compliteListAllNewGame(gamesList));
}
示例2: compile
/**
* compile one file if filename is NULL redirect do to stdin/stdout
* @param file filename
* @return
*/
void compile(char *file) {
if (file == NULL || filename_typeof(file) == 'c') {
global_table_index = 0;
local_table_index = NUMBER_OF_GLOBALS;
while_table_index = 0;
tag_table_index = 0;
inclsp =
iflevel =
skiplevel =
swstp =
litptr =
stkp =
errcnt =
ncmp =
lastst =
//quote[1] =
0;
input2 = -1;
//quote[0] = '"';
cmode = 1;
glbflag = 1;
nxtlab = 0;
litlab = getlabel();
defmac("end\tmemory");
//add_global("memory", ARRAY, CCHAR, 0, EXTERN);
//add_global("stack", ARRAY, CCHAR, 0, EXTERN);
rglobal_table_index = global_table_index; //rglbptr = glbptr;
//add_global("etext", ARRAY, CCHAR, 0, EXTERN);
//add_global("edata", ARRAY, CCHAR, 0, EXTERN);
defmac("short\tint");
initmac();
// compiler body
if (file == NULL) {
input = 0;
} else if (!openin(file))
return;
if (file == NULL) {
output = 1;
} else if (!openout())
return;
header();
code_segment_gtext();
parse();
close(input);
data_segment_gdata();
dumplits();
dumpglbs();
errorsummary();
trailer();
oflush();
close(output);
pl("");
errs = errs || errfile;
} else {
writee("Don't understand file ");
writee(file);
errs = 1;
}
}
示例3: openin
openin()
{
input=0; /* none to start with */
while(input==0){ /* any above 1 allowed */
kill(); /* clear line */
if(eof)break; /* if user said none */
pl("Input filename? ");
gets(line); /* get a name */
if(ch()==0)
{eof=1;break;} /* none given... */
if((input=fopen(line,"r"))==NULL)
{input=0; /* can't open it */
pl("Open failure");
}
}
kill(); /* erase line */
}
示例4: clearbatch
clearbatch()
{
nl();
nl();
put("1Really clear batch [4y/N1]:2 ");
if(ny())
{
nl();
pl("4Batch not cleared.");
}
else
{
nl();
pl("4Batch cleared.");
que.files=0;
}
}
示例5: main
int
main (int argc, char *argv[])
{
QCoreApplication app(argc,argv);
subway::dubway::PluginLoader pl((app.applicationDirPath()+"/plugin.so").toLocal8Bit());
QObject *qo = pl.instance ("A");
QMetaObject::invokeMethod (qo, "testa");
return app.exec();
}
示例6: main
int main()
{
Arr_with_hist_2 arr;
// Insert s1, s2 and s3 incrementally:
Segment_2 s1(Point_2(0, 3), Point_2(4, 3));
insert(arr, s1);
Segment_2 s2(Point_2(3, 2), Point_2(3, 5));
insert(arr, s2);
Segment_2 s3(Point_2(2, 3), Point_2(5, 3));
insert(arr, s3);
// Insert three additional segments aggregately:
Segment_2 segs[3];
segs[0] = Segment_2(Point_2(2, 6), Point_2(7, 1));
segs[1] = Segment_2(Point_2(0, 0), Point_2(2, 6));
segs[2] = Segment_2(Point_2(3, 4), Point_2(6, 4));
insert(arr, segs, segs + 3);
// Print out the curves and the number of edges each one induces.
Arr_with_hist_2::Curve_iterator cit;
std::cout << "The arrangement contains "
<< arr.number_of_curves() << " curves:" << std::endl;
for (cit = arr.curves_begin(); cit != arr.curves_end(); ++cit)
std::cout << "Curve [" << *cit << "] induces "
<< arr.number_of_induced_edges(cit) << " edges." << std::endl;
// Print the arrangement edges, along with the list of curves that
// induce each edge.
Arr_with_hist_2::Edge_iterator eit;
Arr_with_hist_2::Originating_curve_iterator ocit;
std::cout << "The arrangement is comprised of "
<< arr.number_of_edges() << " edges:" << std::endl;
for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) {
std::cout << "[" << eit->curve() << "]. Originating curves: ";
for (ocit = arr.originating_curves_begin (eit);
ocit != arr.originating_curves_end (eit); ++ocit)
{
std::cout << " [" << *ocit << "]" << std::flush;
}
std::cout << std::endl;
}
// Perform some point-location queries:
Point_location pl(arr);
Point_2 p1(4, 6);
point_location_query(pl, p1);
Point_2 p2(6, 2);
point_location_query(pl, p2);
Point_2 p3(2, 4);
point_location_query(pl, p3);
return 0;
}
示例7: DrawPolyLine
void DrawPolyLine( AcGiWorldDraw* mode, const AcGePoint3d& spt, const AcGePoint3d& ept, double width )
{
AcDbPolyline pl( 2 );
pl.addVertexAt( 0, Point3D_To_2D( spt ) );
pl.addVertexAt( 1, Point3D_To_2D( ept ) );
pl.setConstantWidth( width );
pl.worldDraw( mode );
}
示例8: create
shared_hid_file create(const std::string& filepath, const file_access_props& aprops)
{
hid_t file_id;
shared_hid_proplist pl(proplist::create(proplist::_H5P_FILE_ACCESS));
aprops.apply(pl.hid());
H5CPP_ERR_ON_NEG(file_id = H5Fcreate(filepath.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, pl.id()));
return shared_hid_file(hid_file(file_id));
}
示例9: title
title(char *list)
{
char s[80];
int i,line,len,width;
line=strlen(list);
if(line%2==0)
width=30;
else
width=29;
len=(width-line)/2;
ansic(6);
s[0]=0;
s[0]=214; /* 218 */
for(i=0;i < width;i++)
s[i+1]=196;
s[i]=183; /* 191 */
s[i+1]=0;
pl(s);
s[0]=186; /* 179 */
for(i=0;i < len;i++)
s[i+1]=32;
s[i]=0;
strcat(s,"7");
strcat(s,list);
strcat(s,"6");
put(s);
for(i=0;i < len;i++)
s[i]=32;
s[i]=186; /* 179 */
s[i+1]=0;
pl(s);
s[0]=211; /* 192 */
for(i=0;i < width;i++)
s[i+1]=196;
s[i]=189; /* 217 */
s[i+1]=0;
pl(s);
nl();
}
示例10: pl
bool KstPluginDialogI::editObject() {
KstCPluginPtr pp = kst_cast<KstCPlugin>(_dp);
if (!pp) { // something is dreadfully wrong - this should never happen
return false;
}
KstWriteLocker pl(pp);
if (_tagName->text() != pp->tagName() && KstData::self()->dataTagNameNotUnique(_tagName->text())) {
_tagName->setFocus();
return false;
}
pp->setTagName(KstObjectTag(_tagName->text(), KstObjectTag::globalTagContext)); // FIXME: tag context always global?
int pitem = _w->PluginCombo->currentItem();
KstSharedPtr<Plugin> pPtr = PluginCollection::self()->plugin(_pluginList[pitem]);
pp->setRecursed(false);
pp->inputVectors().clear();
pp->inputScalars().clear();
pp->inputStrings().clear();
// Save the vectors and scalars
if (!saveInputs(pp, pPtr)) {
KMessageBox::sorry(this, i18n("There is an error in the inputs you entered."));
return false;
}
if (pitem >= 0 && _w->PluginCombo->count() > 0) {
pp->setPlugin(pPtr);
}
if (!saveOutputs(pp, pPtr)) {
KMessageBox::sorry(this, i18n("There is an error in the outputs you entered."));
return false;
}
if (!pp->isValid()) {
KMessageBox::sorry(this, i18n("There is an error in the plugin you entered."));
return false;
}
pp->setRecursed(false);
if (pp->recursion()) {
pp->setRecursed(true);
KMessageBox::sorry(this, i18n("There is a recursion resulting from the plugin you entered."));
return false;
}
pp->setDirty();
emit modified();
return true;
}
示例11: main
int main() {
std::cout << "initial:\n";
Plorg pl("JNU");
pl.show();
std::cout << "update ci:\n";
pl.updateCI(3);
pl.show();
return 0;
}
示例12: pl
int MusicLib::addtoPlaylist(Song & song, char* playlist)
{
int rtn = 0;
Playlist pl(playlist);
if(playlists.contains(pl)) // pulls playlist if existent
rtn = 1; // playlist did not need to be added
pl.addSong(song); // add song
playlists.put(pl); // [re-]insert playlist w/ new song
return rtn;
}
示例13: Q_ASSERT
bool BinnedMapDialogI::newObject() {
//called upon clicking 'ok' in 'new' mode
//return false if the specified objects can't be made, otherwise true
QString tagName = _tagName->text();
if (tagName != defaultTag && KstData::self()->dataTagNameNotUnique(tagName, true, this)) {
_tagName->setFocus();
return false;
}
//Need to create a new object rather than use the one in KstDataObject pluginList
BinnedMapPtr map = kst_cast<BinnedMap>(KstDataObject::createPlugin("Binned Map"));
Q_ASSERT(map); //should never happen...
KstWriteLocker pl(map);
if (tagName == defaultTag) {
tagName = KST::suggestPluginName("binnedmap");
}
map->setTagName(KstObjectTag::fromString(tagName));
// Save the vectors and scalars
if (!editSingleObject(map) || !map->isValid()) {
KMessageBox::sorry(this, i18n("There is an error in the values you entered."));
return false;
}
map->setMap(_w->_binnedMap->text());
map->setHitsMap(_w->_hitsMap->text());
if (!map || !map->isValid()) {
KMessageBox::sorry(this, i18n("There is an error in the binned map you entered."));
return false;
}
//xxxx
map->setXMin(_w->_Xmin->text().toDouble());
map->setXMax(_w->_Xmax->text().toDouble());
map->setYMin(_w->_Ymin->text().toDouble());
map->setYMax(_w->_Ymax->text().toDouble());
map->setNX(_w->_Xn->value());
map->setNY(_w->_Yn->value());
map->setAutoBin(_w->_realTimeAutoBin->isChecked());
map->setDirty();
KST::dataObjectList.lock().writeLock();
KST::dataObjectList.append(map.data());
KST::dataObjectList.lock().unlock();
map = 0L; // drop the reference
emit modified();
return true;
}
示例14: Init
TCGbool TCGClient::main(TCGint argc, TCGchar **argv)
{
Init(argc, argv, NULL);
try
{
BasicWindow<Playback<CPlaybackAdapter>> win(m_play);
TokenizerType tok(m_tokHeader, &m_stream);
#ifdef API_DUMP
ApiAnalyzer apiAnalyzer(g_args.analyze, TCG_DEBUG_OUTPUT_PATH, NULL, g_args);
CPlayer pl(win, *m_pLibs, tok.fileformatversion(), &apiAnalyzer, &m_stream);
#else
CPlayer pl(win, *m_pLibs, tok.fileformatversion(), &m_stream);
#endif
Parser parser(pl, tok);
g_pPlayer = &pl;
#ifdef API_DUMP
apiAnalyzer.SetPlayer(&pl);
#endif
TCGLOG(TCG_INFO, TCG_CLIENT_OS, "Start cloud render playback...\n");
parser.ParseAll();
TCGLOG(TCG_INFO, TCG_CLIENT_OS, "\ncloud render playback is completed.\n\n");
}
catch (const exception& e)
{
std::string err = e.what();
TCGLOG(TCG_ERROR, TCG_CLIENT_OS, "\n\nException: %s\n\n", err.c_str());
tcgOS_TerminalUninit();
tcgOS_Sync();
}
catch (...)
{
TCGLOG(TCG_ERROR, TCG_CLIENT_OS, "Unexpected Exception\n");
tcgOS_TerminalUninit();
tcgOS_Sync();
}
return TCG_TRUE;
}
示例15: delbatfile
delbatfile()
{
char s[80];
int i;
nl();
nl();
if(que.files==0)
{
pl("4No files in batch.");
return;
}
while(1)
{
put("1Delete which file from batch [4Name/Number1][4?/List1]:2 ");
input(s,50);
switch(s[0])
{
case 0:
return;
case '?':
listbatch();
nl();
break;
default:
i=atoi(s);
if(i < 1 || i > que.files)
{
nl();
pl("4Invalid file.");
return;
}
else
{
delbfile(i);
return;
}
}
}
}