当前位置: 首页>>代码示例>>C++>>正文


C++ InvalidateCache函数代码示例

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


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

示例1: Close

//
// Set image info from a file
//
bool CCCDFile::Open(const gchar *filepath, CmpackOpenMode mode, GError **error)
{
	Close();

	// Check file path
	if (mode != CMPACK_OPEN_CREATE) {
		if (!filepath || !g_file_test(filepath, G_FILE_TEST_IS_REGULAR)) {
			g_set_error(error, g_AppError, 0, "The file does not exists.");
			return false;
		}
	} else {
		if (!filepath) {
			g_set_error(error, g_AppError, 0, "Invalid file path.");
			return false;
		}
	}

	// Open file
	char *f = g_locale_from_utf8(filepath, -1, NULL, NULL, NULL);
	int res = cmpack_ccd_open(&m_Handle, f, mode, 0);
	if (res!=0) {
		char *msg = cmpack_formaterror(res);
		g_set_error(error, g_AppError, res, msg);
		cmpack_free(msg);
	}

	InvalidateCache();
	g_free(f);
	return res==0;
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:33,代码来源:ccdfile_class.cpp

示例2: cmpack_ccd_close

//
// Clear data
//
bool CCCDFile::Close(GError **error)
{
	if (m_Handle) {
		int res = cmpack_ccd_close(m_Handle);
		if (res!=0) {
			char *msg = cmpack_formaterror(res);
			g_set_error(error, g_AppError, res, msg);
			cmpack_free(msg);
			return false;
		}
		m_Handle = NULL;
		m_Object.Clear();
		m_Location.Clear();
		g_free(m_Filter);
		m_Filter = NULL;
		g_free(m_FormatName);
		m_FormatName = NULL;
		g_free(m_Observer);
		m_Observer = NULL;
		g_free(m_Telescope);
		m_Telescope = NULL;
		g_free(m_Instrument);
		m_Instrument = NULL;
		m_AvgFrames = m_SumFrames = 0;
	}
	InvalidateCache();
	return true;
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:31,代码来源:ccdfile_class.cpp

示例3: ReadEllipseSimple

BOOL EllipseRecordHandler::ReadEllipseSimple(CXaraFileRecord *pCXaraFileRecord)
{
	BOOL ok = TRUE;

	NodeRegularShape * pEllipse;
	DocCoord CentrePoint;
	INT32 Height;
	INT32 Width;

	pEllipse = new NodeRegularShape;

	if (ok) ok = SetupShape(pEllipse);
	if (ok) ok = SetIsCircular(pEllipse, TRUE);

	if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
	if (ok) ok = SetCentrePoint(pEllipse, CentrePoint);

	if (ok) ok = pCXaraFileRecord->ReadINT32(&Width);
	if (ok) ok = pCXaraFileRecord->ReadINT32(&Height);
	if (ok) ok = SetHeightAndWidth(pEllipse, Height, Width);

	if (ok) ok = InvalidateCache(pEllipse);
	if (ok) ok = InsertNode(pEllipse);

	return ok;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:26,代码来源:rechellp.cpp

示例4: Add

    bool Add(_tK const &Key, _tV const &Value)
        {
        _tRelOp RelOp;
        tNode *pNew    = nullptr;
        tNode *pParent = nullptr;

        if (!pRoot)
            pNew = new tNode(Key, Value);
        else
            {
            tNode *pNode = dynamic_cast<tNode *>(FindNode(dynamic_cast<tNode *>(pRoot), Key, &pParent));
            if (pNode)
                return false;           // Key is already present in Tree.
            pNew = new tNode(Key, Value);
            }

        if (!pParent)
            pRoot = pNew;
        else
            {
            pNew->pUp = pParent;
            if (RelOp(Key, pParent->KV.first))  pParent->pLeft  = pNew;
            else                                pParent->pRight = pNew;
            }

        InvalidateCache();

        ++NodeCount;
        return true;
        }                               // Add()
开发者ID:JamesLane,项目名称:BinSearchTree,代码行数:30,代码来源:BinSearchTree.hpp

示例5: ReadRectangleSimple

BOOL RectangleRecordHandler::ReadRectangleSimple(CXaraFileRecord *pCXaraFileRecord)
{
	BOOL ok = TRUE;

	NodeRegularShape * pRectangle;
	DocCoord CentrePoint;
	INT32 Height;
	INT32 Width;

	pRectangle = new NodeRegularShape;

	if (ok) ok = SetupShape(pRectangle);
	if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides);

	if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
	if (ok) ok = SetCentrePoint(pRectangle, CentrePoint);

	if (ok) ok = pCXaraFileRecord->ReadINT32(&Width);
	if (ok) ok = pCXaraFileRecord->ReadINT32(&Height);
	if (ok) ok = SetHeightAndWidth(pRectangle, Height, Width);

	if (ok) ok = InvalidateCache(pRectangle);
	if (ok) ok = InsertNode(pRectangle);

	return ok;
}
开发者ID:vata,项目名称:xarino,代码行数:26,代码来源:rechrect.cpp

示例6: ReadEllipseComplex

BOOL EllipseRecordHandler::ReadEllipseComplex(CXaraFileRecord *pCXaraFileRecord)
{
	BOOL ok = TRUE;

	NodeRegularShape *pEllipse;
	DocCoord CentrePoint;
	DocCoord MajorAxis;
	DocCoord MinorAxis;

	pEllipse = new NodeRegularShape;

	if (ok) ok = SetupShape(pEllipse);
	if (ok) ok = SetIsCircular(pEllipse, TRUE);

	if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
	if (ok) ok = SetCentrePoint(pEllipse, CentrePoint);

	if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0);
	if (ok) ok = SetMajorAxis(pEllipse, MajorAxis);

	if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0);
	if (ok) ok = SetMinorAxis(pEllipse, MinorAxis);

	if (ok) ok = InvalidateCache(pEllipse);
	if (ok) ok = InsertNode(pEllipse);

	return ok;
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:28,代码来源:rechellp.cpp

示例7: ReadRectangleSimpleRoundedReformed

BOOL RectangleRecordHandler::ReadRectangleSimpleRoundedReformed(CXaraFileRecord *pCXaraFileRecord)
{
	BOOL ok = TRUE;

	NodeRegularShape * pRectangle;
	DocCoord CentrePoint;
	INT32 Height;
	INT32 Width;
	double Curvature;
	
	pRectangle = new NodeRegularShape;


	if (ok) ok = SetupShape(pRectangle);
	if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides);
	if (ok) ok = SetIsRounded(pRectangle, TRUE);

	if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
	if (ok) ok = SetCentrePoint(pRectangle, CentrePoint);

	if (ok) ok = pCXaraFileRecord->ReadINT32(&Width);
	if (ok) ok = pCXaraFileRecord->ReadINT32(&Height);
	if (ok) ok = SetHeightAndWidth(pRectangle, Height, Width);

	if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&Curvature);
	if (ok) ok = SetCurvature(pRectangle, Curvature);

	if (ok) ok = pCXaraFileRecord->ReadPath(&(pRectangle->EdgePath1));

	if (ok) ok = InvalidateCache(pRectangle);
	if (ok) ok = InsertNode(pRectangle);

	return ok;
}
开发者ID:vata,项目名称:xarino,代码行数:34,代码来源:rechrect.cpp

示例8: UpdateSlotObjects

bool EDetailManager::UpdateObjects(bool bUpdateTex, bool bUpdateSelectedOnly)
{
	m_Base.ReloadImage();
	if (!m_Base.Valid()){ 
    	ELog.DlgMsg(mtError,"Invalid base texture!");
    	return false;
    }
	if (objects.empty()){
    	ELog.DlgMsg(mtError,"Object list empty!");
     	return false;
    }
    // update objects
    SPBItem* pb = UI->ProgressStart(dtH.size_x*dtH.size_z,"Updating objects...");
    for (u32 z=0; z<dtH.size_z; z++)
        for (u32 x=0; x<dtH.size_x; x++){
        	if (!bUpdateSelectedOnly||(bUpdateSelectedOnly&&m_Selected[z*dtH.size_x+x]))
	        	UpdateSlotObjects(x,z);
	        pb->Inc();
        }
    UI->ProgressEnd(pb);

    InvalidateCache		();

    return true;
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:25,代码来源:ESceneDOTools_Generate.cpp

示例9: GetTextExtent

void
ClueListBox::CalculateNumberWidth()
{
    // Calculate the max width, filling in missing values
    int max_width = 0;
    container_t::iterator item_it = m_items.begin();
    std::vector<int>::iterator it, end;
    for (it = m_numWidths.begin(), end = m_numWidths.end(); it != end; ++it)
    {
        int & width = *it;
        // If there is no width for this item, calculate it
        if (width == -1)
            GetTextExtent(wxString::Format(_T("%d."), item_it->Number()), &width, NULL, NULL, NULL);
        if (width > max_width)
            max_width = width;
        ++item_it;
    }

    // Test to see if the cache needs to be invalidated
    if (max_width != m_numWidth)
    {
        m_numWidth = max_width;
        InvalidateCache();
    }
}
开发者ID:brho,项目名称:xword,代码行数:25,代码来源:ClueListBox.cpp

示例10: ReadRectangleComplexRounded

BOOL RectangleRecordHandler::ReadRectangleComplexRounded(CXaraFileRecord *pCXaraFileRecord)
{
	BOOL ok = TRUE;

	NodeRegularShape * pRectangle;
	DocCoord CentrePoint;
	DocCoord MajorAxis;
	DocCoord MinorAxis;
	double Curvature;
	
	pRectangle = new NodeRegularShape;

	if (ok) ok = SetupShape(pRectangle);
	if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides);
	if (ok) ok = SetIsRounded(pRectangle, TRUE);

	if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
	if (ok) ok = SetCentrePoint(pRectangle, CentrePoint);

	if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0);
	if (ok) ok = SetMajorAxis(pRectangle, MajorAxis);

	if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0);
	if (ok) ok = SetMinorAxis(pRectangle, MinorAxis);

	if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&Curvature);
	if (ok) ok = SetCurvature(pRectangle, Curvature);

	if (ok) ok = InvalidateCache(pRectangle);
	if (ok) ok = InsertNode(pRectangle);

	return ok;
}
开发者ID:vata,项目名称:xarino,代码行数:33,代码来源:rechrect.cpp

示例11: ClearSlots

void EDetailManager::ClearSlots()
{
    ZeroMemory			(&dtH,sizeof(DetailHeader));
    xr_free				(dtSlots);
	m_Selected.clear	();
    InvalidateCache		();
}
开发者ID:2asoft,项目名称:xray,代码行数:7,代码来源:ESceneDOTools.cpp

示例12: CalcPageStartPos

/**
read a page length data into iActive page and return iActive page if read is successful.
*/
TDynamicDirCachePage* CDynamicDirCache::UpdateActivePageL(TInt64 aPos)
    {
    // align the page position
    TInt64 pageStartMedPos = CalcPageStartPos(aPos);

    if (iActivePage->StartPos() == pageStartMedPos && iActivePage->IsValid())
        {
        return iActivePage;
        }

    __PRINT2(_L("CDynamicDirCache::UpdateActivePageL(aPos=%lx, active=%lx)"), aPos, iActivePage->StartPos());

    // set start med pos value, no other effects, only available to active page
    iActivePage->SetPos(pageStartMedPos);

    // read data, make active page valid
    TUint8* data = iActivePage->PtrInPage(iActivePage->iStartMedPos);
    TPtr8 dataPtr(data, iPageSizeInBytes);
    const TInt nErr = iDrive.ReadNonCritical(iActivePage->iStartMedPos, iPageSizeInBytes, dataPtr);
    if(nErr !=KErrNone)
        {
        // some serious problem occured during reading, invalidate cache.
        InvalidateCache();
        User::Leave(nErr);
        }
    iActivePage->SetValid(ETrue);

    return iActivePage;
    }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:32,代码来源:sl_dir_cache.cpp

示例13: ReadRectangleComplexRoundedReformed

BOOL RectangleRecordHandler::ReadRectangleComplexRoundedReformed(CXaraFileRecord *pCXaraFileRecord)
{
	BOOL ok = TRUE;

	NodeRegularShape * pRectangle;
	DocCoord MajorAxis;
	DocCoord MinorAxis;
	Matrix TransformMatrix;
	double Curvature;
	
	pRectangle = new NodeRegularShape;

	if (ok) ok = SetupShape(pRectangle);
	if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides);
	if (ok) ok = SetIsRounded(pRectangle, TRUE);

	if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0);
	if (ok) ok = SetMajorAxis(pRectangle, MajorAxis);

	if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0);
	if (ok) ok = SetMinorAxis(pRectangle, MinorAxis);

	if (ok) ok = pCXaraFileRecord->ReadMatrix(&TransformMatrix);
	if (ok) ok = SetTransformMatrix(pRectangle, TransformMatrix);

	if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&Curvature);
	if (ok) ok = SetCurvature(pRectangle, Curvature);

	if (ok) ok = pCXaraFileRecord->ReadPath(&(pRectangle->EdgePath1));

	if (ok) ok = InvalidateCache(pRectangle);
	if (ok) ok = InsertNode(pRectangle);

	return ok;
}
开发者ID:vata,项目名称:xarino,代码行数:35,代码来源:rechrect.cpp

示例14: Log2

/**
    2nd stage constructor.
    @param  aNumPages number of pages in the directory cache.
    @param  aPageSizeLog2       Log2 of the page size in bytes, this is the cache read granularity
    @param  aWrGranularityLog2  Log2(cache write granularity)
*/
void CMediaWTCache::InitialiseL(TUint32 aNumPages, TUint32 aPageSizeLog2, TUint32 aWrGranularityLog2)
    {
    ASSERT(aNumPages && aPageSizeLog2);
    
    __PRINT3(_L("#CMediaWTCache::InitialiseL() Pages=%d, PageSzLog2=%d, WrGrLog2:%d"), aNumPages, aPageSizeLog2, aWrGranularityLog2);

    ASSERT(aNumPages);
    ASSERT(aPageSizeLog2);
    
    if(aWrGranularityLog2)
        {
        ASSERT(aWrGranularityLog2 >= KDefSectorSzLog2 && aWrGranularityLog2 <= aPageSizeLog2);
        }
    
    iPageSizeLog2 = aPageSizeLog2; 
    iWrGranularityLog2 = aWrGranularityLog2;

    //-- create cache pages
    for(TUint cnt=0; cnt<aNumPages; ++cnt)
        {
        CWTCachePage* pPage = CWTCachePage::NewL(aPageSizeLog2);
        iPages.AppendL(pPage);
        }

    InvalidateCache();  
    }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:32,代码来源:sl_cache.cpp

示例15: ReadRectangleSimpleStellated

BOOL RectangleRecordHandler::ReadRectangleSimpleStellated(CXaraFileRecord *pCXaraFileRecord)
{
	BOOL ok = TRUE;

	NodeRegularShape * pRectangle;
	DocCoord CentrePoint;
	INT32 Height;
	INT32 Width;
	double StellationRadius;
	double StellationOffset;

	pRectangle = new NodeRegularShape;

	if (ok) ok = SetupShape(pRectangle);
	if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides);
	if (ok) ok = SetIsStellated(pRectangle, TRUE);

	if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
	if (ok) ok = SetCentrePoint(pRectangle, CentrePoint);

	if (ok) ok = pCXaraFileRecord->ReadINT32(&Width);
	if (ok) ok = pCXaraFileRecord->ReadINT32(&Height);
	if (ok) ok = SetHeightAndWidth(pRectangle, Height, Width);

	if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&StellationRadius);
	if (ok) ok = SetStellationRadius(pRectangle, StellationRadius);

	if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&StellationOffset);
	if (ok) ok = SetStellationOffset(pRectangle, StellationOffset);

	if (ok) ok = InvalidateCache(pRectangle);
	if (ok) ok = InsertNode(pRectangle);

	return ok;
}
开发者ID:vata,项目名称:xarino,代码行数:35,代码来源:rechrect.cpp


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