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


C++ GetStartPosition函数代码示例

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


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

示例1: GetStartPosition

void CConnections::RemoveAll()
{

	POSITION pos;
	CString sKey;
	pos = GetStartPosition();
	CConnection* pConnection;
	
	while (NULL!=pos) {
		GetNextAssoc(pos,sKey,pConnection);
		Remove(sKey);
		pos = GetStartPosition();
	}

}
开发者ID:SherlockLee,项目名称:ComUsbEthModbusMaster,代码行数:15,代码来源:Connections.cpp

示例2: CCAttrMap

CCAttrMap* CCAttrMap::Copy()
{
	CCAttrMap		   *pNewAttrMap = new CCAttrMap( GetCount() );
	if( pNewAttrMap != NULL )
	{
		// iterating all (key, value) pairs
		for( iterator Pos = GetStartPosition(); Pos != GetEndPosition(); )
		{
			CCRuntimeClass *pType;
			void	   *pVal;
			GetNextAssoc( Pos, pType, pVal );

			// Get the attribute value of this attribute
			NodeAttribute* pAttr = (NodeAttribute*)pVal;

			// Copy the attribute
			NodeAttribute* pNewAttr = (NodeAttribute*) (pAttr->SimpleCopy());

			// Stick the new attr into the new attr map
			if (pNewAttr != NULL)
				pNewAttrMap->SetAt(pNewAttr->GetAttributeType(),pNewAttr);
		}
	}

	pNewAttrMap->attrMapCreator = attrMapCreator;

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

示例3: GetStartPosition

void CCAttrMap::ApplyAttributesToNode(NodeRenderableInk * pInk)
{
	iterator			pos = GetStartPosition();

	while( pos != GetEndPosition() )
	{
		CCRuntimeClass *pKey;
		void		   *pVal;
		GetNextAssoc(pos, pKey, pVal);

		NodeAttribute * pAttr = (NodeAttribute *)pVal;

		// copy the attribute
		if( pAttr->CanBeAppliedToObject() )
		{
			NodeAttribute * pAttrCopy = NULL;
			pAttr->NodeCopy((Node **)(&pAttrCopy));
			
			pAttrCopy->AttachNode(pInk, LASTCHILD);

			// nb now that GLAs have an independent flag to indicate when
			// they are copied from the default, it is safe to fix linkages
			// this ensures that GLA defaults get copied when BlendRefs are
			// made from complex nodes, and that they are found when MakeAppliedAttributes
			// calls FindAppliedAttributes on the unattached subtree
			// TODO??
			// What about just copying compound node's Parent pointers to 
			// pseudo attach the tree, rather than copying applied attrs to unattached tree
			// Just need to watch when deleting that it doesn't do anything to the
			// parents pointers - which it shouldn't surely?
			pAttrCopy->LinkToGeometry(pInk);
		}
	}
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:34,代码来源:attrmap.cpp

示例4: TransformBrushFills

void CCAttrMap::TransformBrushFills(TransformBase& Trans)
{
	CCRuntimeClass	   *pType;
	void			   *pVal;
	for( iterator Pos = GetStartPosition(); Pos != GetEndPosition(); )
	{
		GetNextAssoc(Pos,pType,pVal);
		if (pVal != NULL)
		{
			NodeAttribute* pNodeAttr = (NodeAttribute *)pVal;
			
			// check that we are not about to set line width to zero
			if( pNodeAttr->IsALineWidthAttr() && Trans.TransLines != FALSE )
			{
				INT32 Test = labs( INT32(Trans.GetScalar().MakeDouble() * ((AttrLineWidth*)pNodeAttr)->Value.LineWidth) );		
				if (Test <= 10)
					Trans.TransLines = FALSE;
			}

			if (!pNodeAttr->NeedsToRenderAtEachBrushStroke())
				pNodeAttr->Transform(Trans);
		}
	}


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

示例5: GetStartPosition

// Iterate over the tuples in the sorter in batches/vectors of the given size
void Sorter::VectorizedIterate(
    CodeGen &codegen, llvm::Value *sorter_ptr, uint32_t vector_size,
    Sorter::VectorizedIterateCallback &callback) const {
  llvm::Value *start_pos = GetStartPosition(codegen, sorter_ptr);

  llvm::Value *num_tuples = GetNumberOfStoredTuples(codegen, sorter_ptr);

  // Determine the number of bytes to skip per vector
  llvm::Value *vec_sz = codegen.Const32(vector_size);
  llvm::Value *tuple_size = GetTupleSize(codegen);
  llvm::Value *skip = codegen->CreateMul(vec_sz, tuple_size);

  lang::VectorizedLoop loop{
      codegen, num_tuples, vector_size, {{"pos", start_pos}}};
  {
    llvm::Value *curr_pos = loop.GetLoopVar(0);
    auto curr_range = loop.GetCurrentRange();

    // Provide an accessor into the sorted space
    SorterAccess sorter_access{*this, start_pos};

    // Issue the callback
    callback.ProcessEntries(codegen, curr_range.start, curr_range.end,
                            sorter_access);

    // Bump the pointer by the size of a tuple
    llvm::Value *next_pos = codegen->CreateInBoundsGEP(curr_pos, skip);
    loop.LoopEnd(codegen, {next_pos});
  }
}
开发者ID:wy4515,项目名称:peloton,代码行数:31,代码来源:sorter.cpp

示例6: GetFileSize

__int64 FileReader::GetFilePointer()
{
//	BoostThread Boost;

	LARGE_INTEGER li;
	li.QuadPart = 0;
	li.LowPart = ::SetFilePointer(m_hFile, 0, &li.HighPart, FILE_CURRENT);

	__int64 start;
	__int64 length = 0;
	GetFileSize(&start, &length);

	__int64 startPos = 0;
	GetStartPosition(&startPos);

	if (startPos > 0)
	{
		if(startPos > (__int64)li.QuadPart)
			li.QuadPart = (__int64)(length - startPos + (__int64)li.QuadPart);
		else
			li.QuadPart = (__int64)((__int64)li.QuadPart - startPos);
	}

	return li.QuadPart;
}
开发者ID:Erls-Corporation,项目名称:MediaPortal-1,代码行数:25,代码来源:FileReader.cpp

示例7: GetStartPosition

CCtrlItem* CDevObjDoc::GetCancelItem()
{
	if (m_bObjectsIsDeleting)
		return NULL;

	CCtrlObj* pFindObj = NULL; 

	POSITION posItem = GetStartPosition();
	while (posItem != NULL)
	{
		CCtrlItem* pItem = (CCtrlItem *)GetNextItem(posItem);
		if (pItem != NULL)
		{
			CCtrlObj* pCtrlObj = pItem->m_pCtrlObj;
			ATLASSERT(pCtrlObj != NULL);

			if (pCtrlObj->m_bCancel)
			{
				if (pFindObj == NULL || pCtrlObj->m_nTabIndex < pFindObj->m_nTabIndex)
					pFindObj = pCtrlObj;
			}
		}
	}

	return pFindObj != NULL ? pFindObj->m_pClientItem : NULL;
}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:26,代码来源:DevObjDoc.cpp

示例8: ATLASSERT

int CDevObjDoc::SetItemTabOrder(CCtrlItem* pItem, int nTabOrder)
{
	ATLASSERT(GetCtrlItemCount() > 0);

	if (nTabOrder >= GetCtrlItemCount())
		nTabOrder = GetCtrlItemCount() - 1;

	int nOldTabOrder = pItem->m_pCtrlObj->m_nTabIndex;
	
	POSITION posItem = GetStartPosition();
	while (posItem != NULL)
	{
		CCtrlItem* pItemT = (CCtrlItem *)GetNextItem(posItem);
		if (pItemT != NULL)
		{
			CCtrlObj* pCtrlObj = pItemT->m_pCtrlObj;
			ATLASSERT(pCtrlObj != NULL);

			if (pItemT == pItem)
			{
				pCtrlObj->m_nTabIndex = nTabOrder;
			}
			else
			{
				if (pCtrlObj->m_nTabIndex > nOldTabOrder)
					pCtrlObj->m_nTabIndex--;
				if (pCtrlObj->m_nTabIndex >= nTabOrder && nTabOrder >= 0)
					pCtrlObj->m_nTabIndex++;
			}
		}
	}

	return nTabOrder;
}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:34,代码来源:DevObjDoc.cpp

示例9: ASSERT_VALID

COleClientItem* COleDocument::GetInPlaceActiveItem(CWnd* pWnd)
{
	ASSERT_VALID(this);
	ASSERT(pWnd != NULL);
	ASSERT_VALID(pWnd);

	// check for any item active on the immediate frame of pWndContainer
	//  (two active objects on same frame are not supported)
	if (!pWnd->IsFrameWnd())
	{
		CFrameWnd* pFrameWnd = pWnd->GetParentFrame();
		if (pFrameWnd != NULL)
			pWnd = pFrameWnd;
	}

	POSITION pos = GetStartPosition();
	COleClientItem* pItem;
	while ((pItem = GetNextClientItem(pos)) != NULL)
	{
		if (pItem->m_pView != NULL && pItem->IsInPlaceActive() &&
			(pItem->m_pView == pWnd ||
			 pItem->m_pView->GetParentFrame() == pWnd))
		{
			// that item is active on pWndContainer
			return pItem;
		}
	}

	// no item active on that window
	return NULL;
}
开发者ID:Rupan,项目名称:winscp,代码行数:31,代码来源:oleui1.cpp

示例10: GetStartPosition

void CABMOfficeSystemcppDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}

	// Calling the base class COleDocument enables serialization
	//  of the container document's COleClientItem objects.
	COleDocument::Serialize(ar);
	// activate the first one
	if (!ar.IsStoring())
	{
		POSITION posItem = GetStartPosition();
		if (posItem != NULL)
		{
			CDocItem* pItem = GetNextItem(posItem);
			POSITION posView = GetFirstViewPosition();
			COleDocObjectItem *pDocObjectItem = DYNAMIC_DOWNCAST(COleDocObjectItem, pItem);
			if (posView != NULL && pDocObjectItem != NULL)
			{
				CView* pView = GetNextView(posView);
				pDocObjectItem->DoVerb(OLEIVERB_SHOW, pView);
			}
		}
	}
}
开发者ID:abmadmin,项目名称:ABM-Office-System-Cpp,代码行数:31,代码来源:ABM-Office-System-cppDoc.cpp

示例11: TransformForBrush

void CCAttrMap::TransformForBrush(TransformBase& Trans)
{
	CCRuntimeClass	   *pType;
	void			   *pVal;
	for( iterator Pos = GetStartPosition(); Pos != GetEndPosition(); )
	{
		GetNextAssoc(Pos,pType,pVal);
		if (pVal != NULL)
		{
			NodeAttribute* pNodeAttr = (NodeAttribute *)pVal;
			
			// check that we are not about to set line width to zero
			if( pNodeAttr->IsALineWidthAttr() && Trans.TransLines != FALSE )
			{
				double Test =  Trans.GetScalar().MakeDouble() * (double)((AttrLineWidth*)pNodeAttr)->Value.LineWidth;
		//		TRACEUSER( "Diccon", _T("Scale line width by %f\n"), Test);
				if (Test <= 1.0)
				{
				//	TRACEUSER( "Diccon", _T("Setting line width scaling OFF\n"));
					Trans.TransLines = FALSE;
				}
			}

			if (pNodeAttr->NeedsToRenderAtEachBrushStroke())
				pNodeAttr->Transform(Trans);
		}
	}
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:28,代码来源:attrmap.cpp

示例12: ASSERT_VALID

COleDocument::~COleDocument()
{
	ASSERT_VALID(this);

#ifdef _DEBUG
	if (!m_docItemList.IsEmpty())
		TRACE(traceOle, 0, "Warning: destroying COleDocument with %d doc items.\n",
			m_docItemList.GetCount());
#endif

	// remove all doc-items from the list before shutting down the storage
	POSITION pos = GetStartPosition();
	while (pos != NULL)
	{
		CDocItem* pItem = GetNextItem(pos);
		ASSERT(pItem != NULL);
		delete pItem;
	}

	// release the hold on the document storage
	RELEASE(m_lpRootStg);
	CoTaskMemFree(m_ptd);

	AfxOleUnlockApp();
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:25,代码来源:oledoc1.cpp

示例13: ASSERT_VALID

BOOL COleDocument::ApplyPrintDevice(const DVTARGETDEVICE* ptd)
{
	ASSERT_VALID(this);
	ASSERT(ptd == NULL || AfxIsValidAddress(ptd, (size_t)ptd->tdSize, FALSE));

	// allocate copy of target device
	if (ptd != NULL)
	{
		DVTARGETDEVICE* ptdNew = _AfxOleCopyTargetDevice((DVTARGETDEVICE*)ptd);
		if (ptdNew == NULL)
			return FALSE;
		ptd = ptdNew;
	}
	// remove old target device from memory
	CoTaskMemFree(m_ptd);
	m_ptd = (DVTARGETDEVICE*)ptd;

	// Note: updating all the client items does not refresh the pres. cache
	POSITION pos = GetStartPosition();
	COleClientItem* pItem;
	while ((pItem = GetNextClientItem(pos)) != NULL)
	{
		// update all the client items with new target device
		pItem->SetPrintDevice(ptd);
	}
	return TRUE;
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:27,代码来源:oledoc2.cpp

示例14: GetStartPosition

BOOL COleDocument::SaveModified()
{
	// determine if necessary to discard changes
	if (::InSendMessage())
	{
		POSITION pos = GetStartPosition();
		COleClientItem* pItem;
		while ((pItem = GetNextClientItem(pos)) != NULL)
		{
			ASSERT(pItem->m_lpObject != NULL);
			SCODE sc = pItem->m_lpObject->IsUpToDate();
			if (sc != OLE_E_NOTRUNNING && FAILED(sc))
			{
				// inside inter-app SendMessage limits the user's choices
				CString name = m_strPathName;
				if (name.IsEmpty())
					VERIFY(name.LoadString(AFX_IDS_UNTITLED));

				CString prompt;
				AfxFormatString1(prompt, AFX_IDP_ASK_TO_DISCARD, name);
				return AfxMessageBox(prompt, MB_OKCANCEL|MB_DEFBUTTON2,
					AFX_IDP_ASK_TO_DISCARD) == IDOK;
			}
		}
	}

	// sometimes items change without a notification, so we have to
	//  update the document's modified flag before calling
	//  CDocument::SaveModified.
	UpdateModifiedFlag();

	return CDocument::SaveModified();
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:33,代码来源:oledoc1.cpp

示例15: ASSERT_VALID

COleClientItem* COleLinkingDoc::OnFindEmbeddedItem(LPCTSTR lpszItemName)
{
	ASSERT_VALID(this);
	ASSERT(AfxIsValidString(lpszItemName));

	// default implementation walks list of client items looking for
	//  a case sensitive match

	POSITION pos = GetStartPosition();
	COleClientItem* pItem;
	while ((pItem = GetNextClientItem(pos)) != NULL)
	{
		// a client item is running if there is a match in name
		//  and the m_lpObject is also running.
		TCHAR szItemName[OLE_MAXITEMNAME];
		pItem->GetItemName(szItemName, _countof(szItemName));
		if (lstrcmp(szItemName, lpszItemName) == 0)
			return pItem;
	}

	TRACE(traceOle, 1, "Warning: default COleLinkingDoc::OnFindEmbeddedItem\n");
	TRACE(traceOle, 1, _T("\timplementation failed to find item '%s'.\n"), lpszItemName);

	return NULL;    // no matching item found
}
开发者ID:jbeaurain,项目名称:omaha_vs2010,代码行数:25,代码来源:olelink.cpp


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