本文整理汇总了C++中GetStartPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStartPosition函数的具体用法?C++ GetStartPosition怎么用?C++ GetStartPosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetStartPosition函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetCount
// percentChunk is a number between 0 and 100, the amoun of % points that this will eat up
void CSerialMapStringToOb::storeSerialize(CArchive &ar, CSimpleProgressBar* pProgress, int percentChunk)
{
if(ar.IsStoring())
{
CObject* pObj;
CString sKey;
int sz = GetCount();
int iProgCount=0;
int lastPer=0;
int basePer = 0;
if(pProgress)
basePer = pProgress->m_nPercentage;
POSITION p = GetStartPosition( );
while(p)
{
GetNextAssoc(p, sKey, pObj);
if(pObj)
pObj->Serialize(ar);
if(pProgress)
{
++iProgCount;
int per = basePer + int(percentChunk*iProgCount/sz);
if(per >= lastPer + 2)
pProgress->Step(per);
}
}
}
else
{
ASSERT(FALSE); // can only output serialize
}
}
开发者ID:StephenMcConnel,项目名称:CarlaLegacy,代码行数:34,代码来源:SerialMapStringToOb.cpp
示例17: GetFileSize
int64_t FileReader::GetFilePointer()
{
#ifdef _WIN32
LARGE_INTEGER li;
li.QuadPart = 0;
li.LowPart = ::SetFilePointer(m_hFile, 0, &li.HighPart, FILE_CURRENT);
int64_t start;
int64_t length = 0;
GetFileSize(&start, &length);
int64_t startPos = 0;
GetStartPosition(&startPos);
if (startPos > 0)
{
if(startPos > (int64_t)li.QuadPart)
li.QuadPart = (int64_t)(length - startPos + (int64_t)li.QuadPart);
else
li.QuadPart = (int64_t)((int64_t)li.QuadPart - startPos);
}
return li.QuadPart;
#else
#error FIXME: Add a GetFilePointer() implementation for your OS
return 0;
#endif
}
开发者ID:macardi,项目名称:xbmc,代码行数:28,代码来源:FileReader.cpp
示例18: Orb
void OrbLogic::Update(float time_step) {
//Check for orbs to delete
for(int i = 0; i < active_orbs.size(); i++) {
if(!active_orbs[i]->active && active_orbs[i]->state == Orb::OFFSCREEN) {
delete active_orbs[i];
active_orbs.erase(active_orbs.begin() + i);
}
}
for(int i = 0; i < active_black_orbs.size(); i++) {
if(!active_black_orbs[i]->active && active_black_orbs[i]->state == Orb::OFFSCREEN) {
delete active_black_orbs[i];
active_black_orbs.erase(active_black_orbs.begin() + i);
}
}
//Updated difficulty as time goes on
if( difficulty_timer.seconds() >= 100) {
black_orbs+=2;
difficulty_timer.reset();
}
//Decides when to add new orbs every 10 seconds
if(logic_timer.seconds() >= 10) {
if(random.rand_lt(5) > 0 ) { //80% of the time send out reds
active_orbs.push_back( new Orb(Orb::RED, GetStartPosition()));
active_orbs.push_back(new Orb(Orb::RED, GetStartPosition()));
active_orbs.push_back(new Orb(Orb::RED, GetStartPosition()));
}
if(random.rand_lt(2)) { //50% of the time send out greens
active_orbs.push_back(new Orb(Orb::GREEN, GetStartPosition()));
active_orbs.push_back(new Orb(Orb::GREEN, GetStartPosition()));
}
if(random.rand_lt(3) == 1) { //30% of the time send out blues
active_orbs.push_back(new Orb(Orb::BLUE, GetStartPosition()));
}
if(active_black_orbs.size() < black_orbs) {
int orbs_needed = black_orbs - active_black_orbs.size();
for(int i = 0; i <orbs_needed; i++) {
active_black_orbs.push_back(new Orb(Orb::BLACK, GetStartPosition()));
}
}
logic_timer.reset();
}
for(int i = 0; i < active_orbs.size(); i++) {
active_orbs[i]->Update(time_step);
}
for(int i = 0; i < active_black_orbs.size(); i++) {
active_black_orbs[i]->Update(time_step);
}
}
开发者ID:cdatkins,项目名称:Color-Kingdom,代码行数:59,代码来源:orb_logic.cpp
示例19: GetStartPosition
void CMapFunctionProperties::PrintMap()
{
CMainFrame* pMainFrame = (CMainFrame*)::AfxGetMainWnd();
CObject *pNext;
CFunctionProperties *pCurrent = NULL;
POSITION pos;
TCHAR buffer[8];
if( GetCount() == 0 )
{
pMainFrame->m_wndOutputTabView.AddMsg1(_T("FunctionProperties Map is Empty"));
}
else
{
pMainFrame->m_wndOutputTabView.AddMsg1(_T("*** FUNCTION PROPERTIES MAP ***"));
pos = GetStartPosition();
while( pos != NULL )
{
CString ref = _T("REF_");
CString strItem = _T("ITEM_");
CString strFile = _T("FILE_");
CString strPath = _T("PATH_");
CString strLang = _T("LANG");
CString strRType = _T("RETURN_TYPE");
GetNextAssoc(pos, ref, pNext);
pCurrent = (CFunctionProperties *) pNext;
pMainFrame->m_wndOutputTabView.AddMsg1(ref);
HTREEITEM hItem = pCurrent->getItem();
int item = (int )hItem;
strItem += _itot( item, buffer, 10 );
pMainFrame->m_wndOutputTabView.AddMsg1(strItem);
strFile += (const TCHAR *)pCurrent->getFile();
pMainFrame->m_wndOutputTabView.AddMsg1(strFile);
strPath += (const TCHAR *)pCurrent->getPath();
pMainFrame->m_wndOutputTabView.AddMsg1(strPath);
int lang = pCurrent->getLanguage();
strLang = _itot( lang, buffer, 10 );
pMainFrame->m_wndOutputTabView.AddMsg1(strLang);
int rtype = pCurrent->getReturnType();
strRType = _itot( rtype, buffer, 10 );
pMainFrame->m_wndOutputTabView.AddMsg1(strRType);
pMainFrame->m_wndOutputTabView.AddMsg1(_T("************************"));
}
}
}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:55,代码来源:FunctionProperties.cpp
示例20: sr
void SubRectAllocator::GetRect(CRect& rect, const Subtitle* s, const Align& align, int tlb, int brb)
{
SubRect sr(rect, s->m_layer);
sr.rect.InflateRect(tlb, tlb, brb, brb);
StringMapW<SubRect>::CPair* pPair = Lookup(s->m_name);
if(pPair && pPair->m_value.rect != sr.rect) {
RemoveKey(s->m_name);
pPair = NULL;
}
if(!pPair) {
bool vertical = s->m_direction.primary == _T("down") || s->m_direction.primary == _T("up");
bool fOK = false;
while(!fOK) {
fOK = true;
POSITION pos = GetStartPosition();
while(pos) {
const SubRect& sr2 = GetNextValue(pos);
if(sr.layer == sr2.layer && !(sr.rect & sr2.rect).IsRectEmpty()) {
if(vertical) {
if(align.h < 0.5) {
sr.rect.right = sr2.rect.right + sr.rect.Width();
sr.rect.left = sr2.rect.right;
} else {
sr.rect.left = sr2.rect.left - sr.rect.Width();
sr.rect.right = sr2.rect.left;
}
} else {
if(align.v < 0.5) {
sr.rect.bottom = sr2.rect.bottom + sr.rect.Height();
sr.rect.top = sr2.rect.bottom;
} else {
sr.rect.top = sr2.rect.top - sr.rect.Height();
sr.rect.bottom = sr2.rect.top;
}
}
fOK = false;
}
}
}
SetAt(s->m_name, sr);
rect = sr.rect;
rect.DeflateRect(tlb, tlb, brb, brb);
}
}
开发者ID:DieBagger,项目名称:MediaPortal-1,代码行数:54,代码来源:Renderer.cpp
注:本文中的GetStartPosition函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论