本文整理汇总了C++中deleteAll函数的典型用法代码示例。如果您正苦于以下问题:C++ deleteAll函数的具体用法?C++ deleteAll怎么用?C++ deleteAll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteAll函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteAll
void MusicDataDownloadThread::downLoadFinished()
{
if(!m_file)
{
deleteAll();
return;
}
m_timer.stop();
m_file->flush();
m_file->close();
QVariant redirectionTarget = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if(m_reply->error())
{
m_file->remove();
}
else if(!redirectionTarget.isNull())
{
m_redirection = true;
m_reply->deleteLater();
m_file->open(QIODevice::WriteOnly);
m_file->resize(0);
startRequest(m_reply->url().resolved(redirectionTarget.toUrl()));
return;
}
else
{
emit downLoadDataChanged("Data");
M_LOGGER_INFO("data download has finished!");
}
deleteAll();
}
示例2: deleteAll
void HCTree::deleteAll(HCNode *root) {
if (root == 0) return;
deleteAll(root->c0);
deleteAll(root->c1);
delete(root);
root = 0;
}
示例3: gzclose
void Parser::close(void) {
if (file) {
gzclose(file);
file = NULL;
}
deleteAll(calls);
deleteAll(functions);
deleteAll(structs);
deleteAll(enums);
deleteAll(bitmasks);
}
示例4: deleteAllWorld
void deleteAllWorld(){
deleteAll(wWalls);
deleteAll(wEntities);
deleteAll(wSoftEntities);
//delete every light and set it to null
for(int i=0; i<LIGHT_COUNT;i++){
if(wLights[i]!=NULL){
delete wLights[i];
wLights[i]=NULL;
}
}
}
示例5: deleteAll
void MusicRadioSongsThread::downLoadFinished()
{
if(m_reply == nullptr)
{
deleteAll();
return;
}
if(m_reply->error() == QNetworkReply::NoError)
{
QByteArray bytes = m_reply->readAll();
#ifdef MUSIC_QT_5
QJsonParseError jsonError;
QJsonDocument parseDoucment = QJsonDocument::fromJson(bytes, &jsonError);
///Put the data into Json
if(jsonError.error != QJsonParseError::NoError ||
!parseDoucment.isObject())
{
deleteAll();
return ;
}
QJsonObject jsonObject = parseDoucment.object();
if(jsonObject.contains("data"))
{
jsonObject = jsonObject.value("data").toObject();
if(jsonObject.contains("songList"))
{
QJsonArray array = jsonObject.value("songList").toArray();
foreach(QJsonValue value, array)
{
if(!value.isObject())
{
continue;
}
QJsonObject object = value.toObject();
m_songInfo.m_songUrl = object.value("songLink").toString();
m_songInfo.m_songName = object.value("songName").toString();
m_songInfo.m_artistName = object.value("artistName").toString();
m_songInfo.m_songPicUrl = object.value("songPicRadio").toString();
m_songInfo.m_albumName = object.value("albumName").toString();
QString lrcLink = object.value("lrcLink").toString();
if(!lrcLink.contains( LRC_PREFIX ))
{
lrcLink = LRC_PREFIX + lrcLink;
}
m_songInfo.m_lrcUrl = lrcLink;
}
}
示例6: while
/*!
The SLRefGroup::shapeInit checks the validity of the referenced node. To avoid
endless loops a refShape node is not allowed to refShape its ancestors. An
ancestor of a refShape node is group node followed along the previous pointers
with lower depth than the depth of the refShape node.
*/
void SLRefGroup::shapeInit(SLSceneView* sv)
{
// cummulate wm with referenced wm
SLShape* ref = (SLShape*)_refGroup;
_wm *= ref->m();
_wmI.setMatrix(_wm.inverse());
_wmN.setMatrix(_wmI.mat3());
_wmN.transpose();
// check circular references
SLNode* parent = this->parent();
while (parent)
{ if (parent==_refGroup)
SL_EXIT_MSG("Reference node produces a never ending loop.");
parent = parent->parent();
}
// set transparency flag
_aabb.hasAlpha(((SLShape*)_refGroup)->aabb()->hasAlpha());
// delete all child references
if (_first) deleteAll();
// loop through the referenced group and add a SLRefShape or SLRefGroup
SLNode* current = ((SLGroup*)_refGroup)->first();
while (current)
{ if (typeid(*current)==typeid(SLGroup))
addNode(new SLRefGroup((SLGroup*)current, name()+"_"+current->name()));
else addNode(new SLRefShape((SLShape*)current, name()+"_"+current->name()));
((SLShape*)_last)->wm(_wm);
((SLShape*)_last)->depth(depth()+1);
((SLShape*)_last)->shapeInit(sv);
current = current->next();
}
}
示例7: writeSettings
PluginManager::~PluginManager()
{
writeSettings();
stopAll();
deleteAll();
qDeleteAll(m_pluginSpecs);
}
示例8: deleteAll
void Parser::setBookmark(const ParseBookmark &bookmark) {
file->setCurrentOffset(bookmark.offset);
next_call_no = bookmark.next_call_no;
// Simply ignore all pending calls
deleteAll(calls);
}
示例9: main
int main(int argc, char *argv[]){
if(argc<3){
printf("useage:./solve file time_limit\n");
return 0;
}
srand(11);
read_inst(argv[1]);
int time_limit=atoi(argv[2]);
//solveIP(10);
solveLP();
cpu_time();
int cnt=0;
double ratio=0.5;
int i=len_rdCost1-1;
double maxRdc=0.0;
maxIte=n*10;
while(cpu_time()<time_limit && maxRdc<UB-LB-EPSILON){
double t_remain=time_limit-cpu_time();
if(t_remain<EPSILON) break;
if(i<0) maxRdc= UB - LB;
else maxRdc=rdCost_sort1[i].value-EPSILON;
printf("iteration %d, cup_time:%lf, maxRdc %lf, LB =%lf\n", cnt, cpu_time(),maxRdc, LB);
solveIP(t_remain,cnt, maxRdc);
cnt++;
printf("--------------\n\n");
i--;
//while(i>=0&&rdCost_sort1[i].value<maxRdc+0.1){i--;}
}
printf("best LB is %lf, cpu_time %lf\n", LB, cpu_time());
deleteAll();
return 0;
}
示例10: M_LOGGER_INFO
void MusicDownLoadQueryKWThread::startToPage(int offset)
{
if(!m_manager)
{
return;
}
M_LOGGER_INFO(QString("%1 startToPage %2").arg(getClassName()).arg(offset));
deleteAll();
QUrl musicUrl = MusicUtils::Algorithm::mdII(KW_SONG_SEARCH_URL, false)
.arg(m_searchText).arg(offset).arg(m_pageSize);
m_interrupt = true;
m_pageTotal = 0;
m_pageIndex = offset;
QNetworkRequest request;
request.setUrl(musicUrl);
request.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
request.setRawHeader("User-Agent", MusicUtils::Algorithm::mdII(KW_UA_URL_1, ALG_UA_KEY, false).toUtf8());
setSslConfiguration(&request);
m_reply = m_manager->get(request);
connect(m_reply, SIGNAL(finished()), SLOT(downLoadFinished()));
connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(replyError(QNetworkReply::NetworkError)));
}
示例11: findMax
void MAX7219::displayText(){
//printf("Start displayText()\n");
vector<MAX7219::Punkt> ausgabe = MAX7219::text;
//printf("vector übergeben\n");
int displayIndex=0;
int maxX = findMax(MAX7219::text);
//printf("maxX: %d\n", maxX);
//printf("Start while\n");
while(displayIndex-2 < maxX)
{
deleteAll();
MAX7219_buffer_out();
int zweiDimArray[8][8] = {0};
//printf("displayIndex: %d\n", displayIndex);
//zweiDimArray[8][8] = { 0 };
for(int i = 0; i < ausgabe.size();i++){
if(ausgabe.at(i).x<displayIndex+8 && ausgabe.at(i).x>=displayIndex)
{
zweiDimArray[ausgabe.at(i).x - displayIndex][ausgabe.at(i).y] = 1;
}
}
displayIndex++;
//printf("Print Led\n");
displayZeichen(zweiDimArray);
MAX7219_buffer_out(); // Output the buffer
//usleep(200000);
usleep(200000);
}
//printf("Ende displayText()\n");
}
示例12: cleanUp
/*------------------------------------------------------------*/
void cleanUp( void )
{
#if defined(SHOW_OBJECTS_AT_EXIT)
MyObject* t;
t = head;
while( t != NULL ) {
switch( t->type ) {
case OBJ_RECTANGLE:
printf( "\nRectangle with coordinates (%d,%d) and (%d,%d)\n",
t->x0, t->y0, t->x1, t->y1 );
break;
case OBJ_SQUARE:
printf( "\nSquare with coordinates (%d,%d) and (%d,%d)\n",
t->x0, t->y0, t->x1, t->y1 );
break;
default:
printf( "\nUnknown object type found.\n" );
break;
}; // switch.
// always show the colors for all objects.
printf( "Colors: Red - %f, Green - %f, Blue - %f\n",
t->r, t->g, t->b );
t = t->next;
}// while
#endif
deleteAll();
// post any quitting messages...
printf( "Good bye\n" );
}
示例13: deleteAll
returnValue BoxConstraint::init( const Grid& grid_ ){
deleteAll();
grid = grid_;
nb = 0;
var = 0;
index = 0;
blb = 0;
bub = 0;
residuumXL = new DMatrix[grid.getNumPoints()];
residuumXU = new DMatrix[grid.getNumPoints()];
residuumXAL = new DMatrix[grid.getNumPoints()];
residuumXAU = new DMatrix[grid.getNumPoints()];
residuumPL = new DMatrix[1 ];
residuumPU = new DMatrix[1 ];
residuumUL = new DMatrix[grid.getNumPoints()];
residuumUU = new DMatrix[grid.getNumPoints()];
residuumWL = new DMatrix[grid.getNumPoints()];
residuumWU = new DMatrix[grid.getNumPoints()];
return SUCCESSFUL_RETURN;
}
示例14: handleMenu
/*------------------------------------------------------------*/
void handleMenu( int value )
{
switch( value ) {
case MENU_EDIT:
p_state = EDIT_OBJ;
break;
case MENU_DELETE:
p_state = DELETE_OBJ;
break;
case MENU_CLEAR:
deleteAll();
break;
case MENU_SWAP:
#if defined(SHOW_TEXT_STEPS)
printf( "Swapping buffers.\n" );
#endif
glutSwapBuffers();
glutSwapBuffers();
break;
case MENU_EXIT:
cleanUp();
exit(0);
};
}
示例15: tr
void VideoCapture::onSave()
{
myTimer.stop();
QString fileFormat="mpg";
QString initialPath = QDir::currentPath() + "/"+myFileName+"." + fileFormat;
QString fileName = QFileDialog::getSaveFileName(myParent, tr("Save As"),
initialPath,
tr("%1 Files (*.%2);;All Files (*)")
.arg(QString(fileFormat.toUpper()))
.arg(QString(fileFormat)));
if (fileName.isEmpty())
{
return;
}
else
{
// QMessageBox::information(0, "start", fileName);
/* for (int i = 1; i<=myFrame;i++)
{
QString fn = myFileName+QString::number(i).rightJustified (5, '0');
QImage img;
bool ok;
ok = img.load (fn+".bmp");
if (!ok)
{
QMessageBox::warning (0, "gif", fn+".bmp");
}
ok = img.save(fn+".jpg");
if (!ok)
{
QMessageBox::warning (0, "jpeg", fn+".jpg");
}
// QFile::remove (fn+".bmp");
}
*/
int sW = Options::VideoWidth;
int sH = Options::VideoHeight;
int r = Options::VideoRate;
QString command;
QString keys = //" -t "+ QString::number(endTime)+
QString::number(sW) + " "+QString::number(sH)+" " + QString::number(r);
QString bat = QCoreApplication::applicationDirPath ()+"/";
command = bat + "mpeg.bat "+myFileName+" "+ fileName + " "+ keys;// +" >a.txt";
// "D:/PRADISWORK/bin/debug-vc6/ffmpeg.exe -f image2 -i "+myFileName+"%%05d.bmp -target vcd -sameq -y "+ fileName + " >a.txt";
command = command.replace("\\","/");
// qWarning(command);
// system ("cd "+);
// QMessageBox::warning (0, "jpeg", command);
system(command.toAscii().data());
deleteAll();
}
};