• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ deleteData函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中deleteData函数的典型用法代码示例。如果您正苦于以下问题:C++ deleteData函数的具体用法?C++ deleteData怎么用?C++ deleteData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了deleteData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: dictDelete

/*************************************************************
* Function		:	dictDelete
* Author		:       bulldozer.ma
* Date			:       2015-11-01
* Input			:       char *str, dict *pHeader, unsigned int len
* Output 		:       N/A
* Return 		:       int 
* Other			:       N/A
* Description 		:      	dictDelete 
**************************************************************/
int dictDelete(char *str, dict *pHeader, unsigned int len)
{
	if (NULL == str || NULL == pHeader|| 0 >= len)
	{
		return DICT_ERROR;
	}
	int iRet = DICT_ERROR;
	dictht *ht = pHeader->ht[0];
	iRet = deleteData(ht, str, len);
	if (DICT_ERROR == iRet)
	{
		return deleteData( pHeader->ht[1],  str,  len);
	}
	return iRet;
}
开发者ID:mayuedong,项目名称:dictionary,代码行数:25,代码来源:dict.c


示例2: ftell

// Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const LLString& path )
{
	S32 len = path.size();
	if( len < 5 )
	{
		return false;
	}
	
	LLString extension = path.substr( len - 4, 4 );
	LLString::toLower(extension);
	if( ".tga" != extension )
	{
		return false;
	}
	
	FILE* file = LLFile::fopen(path.c_str(), "rb");	/* Flawfinder: ignore */
	if( !file )
	{
		llwarns << "Couldn't open file " << path << llendl;
		return false;
	}

	S32 file_size = 0;
	if (!fseek(file, 0, SEEK_END))
	{
		file_size = ftell(file);
		fseek(file, 0, SEEK_SET);
	}

	U8* buffer = allocateData(file_size);
	S32 bytes_read = fread(buffer, 1, file_size, file);
	if( bytes_read != file_size )
	{
		deleteData();
		llwarns << "Couldn't read file " << path << llendl;
		return false;
	}

	fclose( file );

	if( !updateData() )
	{
		llwarns << "Couldn't decode file " << path << llendl;
		deleteData();
		return false;
	}
	return true;
}
开发者ID:Boy,项目名称:netbook,代码行数:49,代码来源:llimagetga.cpp


示例3: LL_WARNS

// Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const std::string& path )
{
	S32 len = path.size();
	if( len < 5 )
	{
		return false;
	}
	
	std::string extension = gDirUtilp->getExtension(path);
	if( "tga" != extension )
	{
		return false;
	}
	
	LLFILE* file = LLFile::fopen(path, "rb");	/* Flawfinder: ignore */
	if( !file )
	{
		LL_WARNS() << "Couldn't open file " << path << LL_ENDL;
		return false;
	}

	S32 file_size = 0;
	if (!fseek(file, 0, SEEK_END))
	{
		file_size = ftell(file);
		fseek(file, 0, SEEK_SET);
	}

	U8* buffer = allocateData(file_size);
	S32 bytes_read = fread(buffer, 1, file_size, file);
	if( bytes_read != file_size )
	{
		deleteData();
		LL_WARNS() << "Couldn't read file " << path << LL_ENDL;
		fclose(file);
		return false;
	}

	fclose( file );

	if( !updateData() )
	{
		LL_WARNS() << "Couldn't decode file " << path << LL_ENDL;
		deleteData();
		return false;
	}
	return true;
}
开发者ID:AlchemyDev,项目名称:Carbon,代码行数:49,代码来源:llimagetga.cpp


示例4: connect

void urinalysis::initConnect()
{
    //从串口获取数据
    connect(m_port, SIGNAL(dataInfo(float,float)), this, SLOT(getPortData(float,float)));

    //给ARC赋值
    connect(ui->ALBLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setARC(QString)));
    connect(ui->CRELineEdit, SIGNAL(textChanged(QString)), this, SLOT(setARC(QString)));

    //清除
    connect(ui->clearPushButton, SIGNAL(clicked()), this, SLOT(clearForms()));

    //查询
    connect(ui->searchButton, SIGNAL(clicked()), this, SLOT(fillTableWidget()));

    //保存数据
    connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(saveData()));

    //显示tablewidget内容
    connect(ui->tableWidget, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(setForms(int,int)));

    //关闭窗口
    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));

    //删除数据
    connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteData()));

    //打印
    connect(ui->printButton, SIGNAL(clicked()), this, SLOT(print()));
}
开发者ID:zmjstime,项目名称:collection,代码行数:30,代码来源:urinalysis.cpp


示例5: mt1

// virtual
U8* LLImageBase::allocateData(S32 size)
{
	LLMemType mt1((LLMemType::EMemType)mMemType);
	
	if (size < 0)
	{
		size = mWidth * mHeight * mComponents;
		if (size <= 0)
		{
			llerrs << llformat("LLImageBase::allocateData called with bad dimentions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl;
		}
	}
	else if (size <= 0 || (size > 4096*4096*16 && sSizeOverride == FALSE))
	{
		llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
	}
	
	if (!mData || size != mDataSize)
	{
		deleteData(); // virtual
		mBadBufferAllocation = FALSE ;
		mData = new U8[size];
		if (!mData)
		{
			llwarns << "allocate image data: " << size << llendl;
			size = 0 ;
			mWidth = mHeight = 0 ;
			mBadBufferAllocation = TRUE ;
		}
		mDataSize = size;
	}

	return mData;
}
开发者ID:CharleyLevenque,项目名称:SingularityViewer,代码行数:35,代码来源:llimage.cpp


示例6: deleteData

void Widget::mainProcedure(double** tempA, double* tempB, double* tempF)
{
    //перевірка нетут, або взагалі непотрібна
//    if(!(nEq<nArgs))
//    {
//        QMessageBox::critical(NULL,tr(""),tr("Невірні дані\nКількість невідомих повинна бути строго більше кількості рівнянь."),QMessageBox::Ok);
//        return;
//    }
    //перевіряємо обмеження
    for(int i=0;i<nEq;i++)
    {
        if(tempB[i]<0)
        {
            QMessageBox::critical(NULL,tr(""),tr("Невірні дані\nПеревірте вектор В."),QMessageBox::Ok);
            return;
        }
    }
    if(direction==tr("min"))
    {
        for(int i=0;i<nArgs;i++)
            tempF[i]=-tempF[i];
    }
    //чистимо минулі данні
    deleteData();

    //відправляємо дані на аналіз та створення першої симплекс таблиці
    genFirstSTable(tempA,tempF,tempB,rel);
    //запускаємо обчислення
    m_result=calc();
    showHideInput(false);
    fillTables();
    p2->setChecked(false);
}
开发者ID:mik9,项目名称:mmethod,代码行数:33,代码来源:widget.cpp


示例7: main

int main (int argc, char** argv) {
	struct usb_device *dev;

	if (argc < 2) {
		perr ("Should be called with one argument: 'read' or 'delete'\n", 2);
	}

	while (1) {
		if ((dev = findDev(0x0e6a, 0x0101)) == NULL) {
			perr ("Waiting for device...\n", 0);
		} else {
			break;
		}
		usleep (300000);
	}

	usb_dev_handle *hdl = open_device (dev);

	if (!strcmp(argv[1], "read")) {
		readData (hdl);
	} else if (!strcmp(argv[1], "delete")) {
		deleteData (hdl);
	} else {
		perr ("Invalid command line argument.\n", 3);
	}

	close_device (hdl);

	return 0;
}
开发者ID:johnlepikhin,项目名称:catbeat,代码行数:30,代码来源:catbeat.c


示例8: deleteData

LLImageRaw::~LLImageRaw()
{
	// NOTE: ~LLimageBase() call to deleteData() calls LLImageBase::deleteData()
	//        NOT LLImageRaw::deleteData()
	deleteData();
	--sRawImageCount;
}
开发者ID:gabeharms,项目名称:firestorm,代码行数:7,代码来源:llimage.cpp


示例9: mt1

// virtual
U8* LLImageBase::allocateData(S32 size)
{
	LLMemType mt1(mMemType);
	
	if (size < 0)
	{
		size = mWidth * mHeight * mComponents;
		if (size <= 0)
		{
			llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << llendl;
		}
	}
	else if (size <= 0 || (size > 4096*4096*16 && !mAllowOverSize))
	{
		llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
	}
	
	if (!mData || size != mDataSize)
	{
		deleteData(); // virtual
		mBadBufferAllocation = false ;
		mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
		if (!mData)
		{
			llwarns << "allocate image data: " << size << llendl;
			size = 0 ;
			mWidth = mHeight = 0 ;
			mBadBufferAllocation = true ;
		}
		mDataSize = size;
	}

	return mData;
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:35,代码来源:llimage.cpp


示例10: QWidget

Widget::Widget(QWidget *parent) : QWidget (parent)
{
    mainLayout=new QVBoxLayout(this);
    m_input=new inputWidget;
    m_help=new QWebView;
    m_help->load(QUrl("help/help.html"));

    QHBoxLayout* v=new QHBoxLayout;
    QPushButton* p1=new QPushButton(tr("Почати розрахунки"));
    QPushButton* pF=new QPushButton(tr("Завантажити з файлу"));
    p2=new QPushButton(tr("Показати поля вводу"));
    p2->setCheckable(true);
    p2->setChecked(true);
    QPushButton* p3=new QPushButton(tr("Очистити результати"));
    QPushButton* pH=new QPushButton(tr("Допомога"));
    p1->setMinimumWidth(160);
    p2->setMinimumWidth(200);
    p3->setMinimumWidth(200);
    v->addWidget(p1);
    v->addWidget(pF);
    v->addWidget(p2);
    v->addWidget(p3);
    v->addWidget(pH);
    m_buttonGroupBox=new QGroupBox;
    m_buttonGroupBox->setLayout(v);
    connect(p1,SIGNAL(clicked()),this,SLOT(getDatasFromForm()));
    connect(p2,SIGNAL(clicked(bool)),this,SLOT(showHideInput(bool)));
    connect(p3,SIGNAL(clicked()),this,SLOT(deleteData()));
    connect(pF,SIGNAL(clicked()),this,SLOT(getDatasFromFile()));
    connect(pH,SIGNAL(clicked()),this,SLOT(showHelp()));
    connect(m_input,SIGNAL(nEqChanged(QSize)),this,SLOT(myResize(QSize)));

#ifdef WITH_EFFECTS
    QCheckBox* ch=new QCheckBox(tr("Увімкнути ефекти"));
    ch->setChecked(true);
    connect(ch,SIGNAL(clicked(bool)),this,SLOT(changeEffects(bool)));
    //v->addWidget(ch);
    m_enableEffects=true;
    m_ani=new QPropertyAnimation(this,"size");
#endif

    mainLayout->addWidget(m_buttonGroupBox,0,Qt::AlignTop);

    QVBoxLayout* m_inputL=new QVBoxLayout;
    m_inputL->addWidget(m_input);
    m_inputGB=new QGroupBox;
    m_inputGB->setLayout(m_inputL);
    mainLayout->addWidget(m_inputGB,0,Qt::AlignTop);
    mainLayout->addStretch(1);

    f=NULL;

    tablesScrollArea=NULL;
    tablesGroupBox=NULL;
    tablesLayout=NULL;

    m_isTables=false;
    m_isData=false;
}
开发者ID:mik9,项目名称:mmethod,代码行数:59,代码来源:widget.cpp


示例11: deleteData

LLImageRaw::~LLImageRaw()
{
	// NOTE: ~LLimageBase() call to deleteData() calls LLImageBase::deleteData()
	//        NOT LLImageRaw::deleteData()
	deleteData();
	--sRawImageCount;
	setInCache(false);
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:8,代码来源:llimage.cpp


示例12: DOM_DOMException

void CharacterDataImpl::replaceData(unsigned int offset, unsigned int count,
                                    const DOMString &dat)
{
    if (isReadOnly())
        throw DOM_DOMException(
        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
    deleteData(offset, count);
    insertData(offset, dat);
};
开发者ID:syoutetu,项目名称:ColladaViewer_VC8,代码行数:9,代码来源:CharacterDataImpl.cpp


示例13: mycudaCompute

int mycudaCompute()
{
    // ri scrivo la funzione di update presente in dll "seriale"
    // utilizzando "GPUCompute(boidSet)" come chiamata cuda anzichè la normale "compute()"

    unsigned int simulationLenght,progress;
    int exitValue;

    int test=0;

    progress=0;
    simulationLenght=(unsigned int)ceil(simParameters.fps * simParameters.lenght);

    _Output(&cacheFileOption);

    while((!abortSimulation) && (progress<=simulationLenght))
    {
        Channel *channels;

        channels=(Channel*)malloc(sizeof(Channel)*info.option);

        GPUCompute(boidSet);

        // data management
        cachingData(channels);

        // write data
        writeData(progress,channels);

        // update the index job progress
        simulationProgress = ((int)(100*progress)/simulationLenght);

        //advance to the next frame
        progress++;
        test++;
        // free channels memory
        freeChannel(channels);
    }

    simulationProgress=100;

    closeMethod();
    if(abortSimulation)
    {
        printf("Simulation interrupted\n");
        deleteData();
        exitValue=INTERRUPTED_SIM;
    }
    // restoring abortSimulation flag
    abortSimulation=FALSE;
    exitValue=SUCCESS_SIM;

    // free resources
    free(boidSet);
    return exitValue;
}
开发者ID:casconero,项目名称:Bad-Boids,代码行数:56,代码来源:cforcuda.c


示例14: DOMException

void DOMCharacterDataImpl::replaceData(const DOMNode *node, XMLSize_t offset, XMLSize_t count,
                                    const XMLCh *dat)
{
    if (castToNodeImpl(node)->isReadOnly())
        throw DOMException(
        DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager);

    deleteData(node, offset, count);
    insertData(node, offset, dat);
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:10,代码来源:DOMCharacterDataImpl.cpp


示例15: parentNode

Text* CDATASection::splitText(unsigned long offset)
{
	Node* pParent = parentNode();
	if (!pParent) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR);
	int n = length() - offset;
	Text* pNew = ownerDocument()->createCDATASection(substringData(offset, n));
	deleteData(offset, n);
	pParent->insertBefore(pNew, nextSibling())->release();
	return pNew;
}
开发者ID:macchina-io,项目名称:macchina.io,代码行数:10,代码来源:CDATASection.cpp


示例16: deleteData

	Map<keyType, valueType>& Map<keyType, valueType>::operator = (const Map<keyType, valueType> & rhs)
	{
		if(this == &rhs) return *this;
		if(this->size() > 0)
		{
			deleteData();
		}
		addToThisFrom(rhs);
		return *this;
	}
开发者ID:Mherishere,项目名称:MovieRentalSite,代码行数:10,代码来源:map_impl.hpp


示例17: update

// update simulation
void  update()
{
	unsigned int simulationLenght,progress;
	
	progress=0;
	simulationLenght=(unsigned int)ceil(simParameters.fps * simParameters.lenght);

	_Output(&cacheFileOption);
	
	while((!abortSimulation) && (progress<=simulationLenght))
	{
		Channel *channels;
		channels=(Channel*)malloc(sizeof(Channel)*info.option);

		// compute Boids' new positions, velocities, accelerations 
		compute();

		// data management
		cachingData(channels);

		// write data
		writeData(progress,channels);

		// update Boids properties and kdtree 
		updateBoids();

		// update the index job progress 
		simulationProgress = ((int)(100*progress)/simulationLenght);

		//advance to the next frame
		progress++;

		// free channels memory
		freeChannel(channels);
	}

	simulationProgress=100;
	
	closeMethod();
	if(abortSimulation)
	{
		printf("Simulation interrupted\n");
		deleteData();
	}
	// restoring abortSimulation flag
	abortSimulation=FALSE;

	// free resources
	free(boidSet);	
	kd_free(k3);
}
开发者ID:100cells,项目名称:Bad-Boids,代码行数:52,代码来源:Simulation.c


示例18: mp_FXDesc

ProjectCentral::ProjectCentral(const QString& PrjPath):
  mp_FXDesc(NULL),mp_AdvancedFXDesc(NULL)
{
  openfluid::base::RuntimeEnvironment::instance()->linkToProject();

  mp_FXDesc = new openfluid::fluidx::FluidXDescriptor(&m_IOListener);

  if (PrjPath == "")
  {
    setDefaultDescriptors();
  }
  else
  {
    try
    {
      mp_FXDesc->loadFromDirectory(openfluid::base::ProjectManager::instance()->getInputDir());
    }
    catch (openfluid::base::Exception& E)
    {
      //because we're in a constructor catch, so destructor is not called
      deleteData();
      throw;
    }
  }

  try
  {
    mp_AdvancedFXDesc = new openfluid::fluidx::AdvancedFluidXDescriptor(*mp_FXDesc);
  }
  catch (openfluid::base::Exception& E)
  {
    //because we're in a constructor catch, so destructor is not called
    deleteData();
    throw;
  }

  check();
}
开发者ID:jylfc0307,项目名称:openfluid-1,代码行数:38,代码来源:ProjectCentral.cpp


示例19: main

int main() {

    float3 *A, *B;
    size_t size, i;
    size = N;
    A=allocData(size);
    B=allocData(size);
    initData(B,size,2.5);

/* Perform the computation on the device */
#pragma acc parallel loop present(A,B)
    for (i=0; i < size; ++i) {
       A[i].x = B[i].x + (float) i;
       A[i].y = B[i].y + (float) i*2;
       A[i].z = B[i].z + (float) i*3;
    }
/* Copy back the results */ 
#pragma acc update self(A[0:size])
    printData(A, size);
    deleteData(A);
    deleteData(B);
    exit(0);
}
开发者ID:rmfarber,项目名称:ParallelProgrammingWithOpenACC,代码行数:23,代码来源:unstructured_data.struct.c


示例20: test_delete_integer_data_in_queue1

void test_delete_integer_data_in_queue1() {
    Queue* queue = createQueue();
    int removedData;
    int data1 = 10 , data2 = 20 , data3 = 30;

    insertData(queue , &data1 , 1);
    insertData(queue , &data2 , 3);
    insertData(queue , &data3 , 2);

    ASSERT(queue->length == 3);
    removedData =*(int*)deleteData(queue);
    ASSERT(queue->length == 2);
    ASSERT(removedData == 10);
}
开发者ID:KavitaJadhav,项目名称:DSA,代码行数:14,代码来源:priorityQueueTest.c



注:本文中的deleteData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ deleteDemandDrivenData函数代码示例发布时间:2022-05-30
下一篇:
C++ deleteAndZero函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap