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


C++ GetRoot函数代码示例

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


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

示例1: PROFILER_LABEL

bool
ClientLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
                                           void* aCallbackData,
                                           EndTransactionFlags)
{
  PROFILER_LABEL("ClientLayerManager", "EndTransactionInternal",
    js::ProfileEntry::Category::GRAPHICS);

#ifdef MOZ_LAYERS_HAVE_LOG
  MOZ_LAYERS_LOG(("  ----- (beginning paint)"));
  Log();
#endif
  profiler_tracing("Paint", "Rasterize", TRACING_INTERVAL_START);

  NS_ASSERTION(InConstruction(), "Should be in construction phase");
  mPhase = PHASE_DRAWING;

  ClientLayer* root = ClientLayer::ToClientLayer(GetRoot());

  mTransactionIncomplete = false;
      
  // Apply pending tree updates before recomputing effective
  // properties.
  GetRoot()->ApplyPendingUpdatesToSubtree();
    
  mPaintedLayerCallback = aCallback;
  mPaintedLayerCallbackData = aCallbackData;

  GetRoot()->ComputeEffectiveTransforms(Matrix4x4());

  root->RenderLayer();
  if (!mRepeatTransaction && !GetRoot()->GetInvalidRegion().IsEmpty()) {
    GetRoot()->Mutated();
  }

  if (!mIsRepeatTransaction) {
    mAnimationReadyTime = TimeStamp::Now();
    GetRoot()->StartPendingAnimations(mAnimationReadyTime);
  }

  mPaintedLayerCallback = nullptr;
  mPaintedLayerCallbackData = nullptr;

  // Go back to the construction phase if the transaction isn't complete.
  // Layout will update the layer tree and call EndTransaction().
  mPhase = mTransactionIncomplete ? PHASE_CONSTRUCTION : PHASE_NONE;

  NS_ASSERTION(!aCallback || !mTransactionIncomplete,
               "If callback is not null, transaction must be complete");

  if (gfxPlatform::GetPlatform()->DidRenderingDeviceReset()) {
    FrameLayerBuilder::InvalidateAllLayers(this);
  }

  return !mTransactionIncomplete;
}
开发者ID:Phoxygen,项目名称:gecko-dev,代码行数:56,代码来源:ClientLayerManager.cpp

示例2: locker

VOID* KBinaryTree::SearchData(VOID* data, ULONG dwCompareParam)
{
  KLocker locker(&m_KSynchroObject);
  KBinaryTreeNode* pNode = GetRoot();
  VOID*       pData = NULL;

  if (pNode != NULL)
  {  
    pNode = pNode->SearchByNode(data, m_pCompare, dwCompareParam);
    if (pNode != NULL)
      pData = pNode->m_pData;
  }

  return pData;
}
开发者ID:Artorios,项目名称:rootkit.com,代码行数:15,代码来源:KBinaryTree.cpp

示例3: NS_ENSURE_ARG_POINTER

NS_IMETHODIMP
nsHTMLEditor::ShowInlineTableEditingUI(nsIDOMElement * aCell)
{
  NS_ENSURE_ARG_POINTER(aCell);

  // do nothing if aCell is not a table cell...
  if (!nsHTMLEditUtils::IsTableCell(aCell))
    return NS_OK;

  if (mInlineEditedCell) {
    NS_ERROR("call HideInlineTableEditingUI first");
    return NS_ERROR_UNEXPECTED;
  }

  // the resizers and the shadow will be anonymous children of the body
  nsIDOMElement *bodyElement = GetRoot();
  NS_ENSURE_TRUE(bodyElement, NS_ERROR_NULL_POINTER);

  CreateAnonymousElement(NS_LITERAL_STRING("a"), bodyElement,
                         NS_LITERAL_STRING("mozTableAddColumnBefore"),
                         PR_FALSE, getter_AddRefs(mAddColumnBeforeButton));
  CreateAnonymousElement(NS_LITERAL_STRING("a"), bodyElement,
                         NS_LITERAL_STRING("mozTableRemoveColumn"),
                         PR_FALSE, getter_AddRefs(mRemoveColumnButton));
  CreateAnonymousElement(NS_LITERAL_STRING("a"), bodyElement,
                         NS_LITERAL_STRING("mozTableAddColumnAfter"),
                         PR_FALSE, getter_AddRefs(mAddColumnAfterButton));

  CreateAnonymousElement(NS_LITERAL_STRING("a"), bodyElement,
                         NS_LITERAL_STRING("mozTableAddRowBefore"),
                         PR_FALSE, getter_AddRefs(mAddRowBeforeButton));
  CreateAnonymousElement(NS_LITERAL_STRING("a"), bodyElement,
                         NS_LITERAL_STRING("mozTableRemoveRow"),
                         PR_FALSE, getter_AddRefs(mRemoveRowButton));
  CreateAnonymousElement(NS_LITERAL_STRING("a"), bodyElement,
                         NS_LITERAL_STRING("mozTableAddRowAfter"),
                         PR_FALSE, getter_AddRefs(mAddRowAfterButton));

  AddMouseClickListener(mAddColumnBeforeButton);
  AddMouseClickListener(mRemoveColumnButton);
  AddMouseClickListener(mAddColumnAfterButton);
  AddMouseClickListener(mAddRowBeforeButton);
  AddMouseClickListener(mRemoveRowButton);
  AddMouseClickListener(mAddRowAfterButton);

  mInlineEditedCell = aCell;
  return RefreshInlineTableEditingUI();
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:48,代码来源:nsHTMLInlineTableEditor.cpp

示例4: JoinPathBelow

	FileInfo FileSourceFS::Lookup(const std::string &path)
	{
		const std::string fullpath = JoinPathBelow(GetRoot(), path);
		const std::wstring wfullpath = transcode_utf8_to_utf16(fullpath);
		DWORD attrs = GetFileAttributesW(wfullpath.c_str());
		const FileInfo::FileType ty = file_type_for_attributes(attrs);
		Time::DateTime modtime;
		if (ty == FileInfo::FT_FILE || ty == FileInfo::FT_DIR) {
			HANDLE hfile = CreateFileW(wfullpath.c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
			if (hfile != INVALID_HANDLE_VALUE) {
				modtime = file_modtime_for_handle(hfile);
				CloseHandle(hfile);
			}
		}
		return MakeFileInfo(path, ty, modtime);
	}
开发者ID:RevReese,项目名称:pioneer-sp,代码行数:16,代码来源:FileSystemWin32.cpp

示例5: SetDirection

bool Styx::Update(GameTime time)
{
    Playfield const &pf = *GetPlayfield();

    // create set of possibile directions to move in
    std::vector<Direction> choices;
    for (int n = 0; n < 4; ++n)
    {
        Direction dir = (Direction::Type)n;

        // can't reverse direction
        if (dir.Opposite() == direction)
            continue;

        Playfield::Element element = pf.At(location + dir.GetVector());
        if (element == Playfield::Line)
        {
            choices.push_back(Direction::Type(n));
        }
    }

    // if we have no where to go, reverse
    if (choices.empty())
    {
        direction = direction.Opposite();
    }
    else
    {
        // choose new random direction
        SetDirection(choices[rand() % choices.size()]);

        if (move_toward_player && choices.size() > 1)
        {
            Point pos_player = GetRoot()->GetWorld()->GetPlayer()->GetLocation();
            float min_dist = 0;
            bool first = true;
            foreach (Direction dir, choices)
            {
                float dist = (location + dir.GetVector() - pos_player).Length();
                if (first || dist < min_dist)
                {
                    first = false;
                    min_dist = dist;
                    SetDirection(dir);
                }
            }
        }
开发者ID:kotetsuy,项目名称:xiq,代码行数:47,代码来源:Styx.cpp

示例6: Dispose

bool CBlurayDirectory::GetDirectory(const CURL& url, CFileItemList &items)
{
  Dispose();
  m_url = url;
  std::string root = m_url.GetHostName();
  std::string file = m_url.GetFileName();
  URIUtils::RemoveSlashAtEnd(file);
  URIUtils::RemoveSlashAtEnd(root);

  m_dll = new DllLibbluray();
  if (!m_dll->Load())
  {
    CLog::Log(LOGERROR, "CBlurayDirectory::GetDirectory - failed to load dll");
    return false;
  }

  m_dll->bd_register_dir(DllLibbluray::dir_open);
  m_dll->bd_register_file(DllLibbluray::file_open);
  m_dll->bd_set_debug_handler(DllLibbluray::bluray_logger);
  m_dll->bd_set_debug_mask(DBG_CRIT | DBG_BLURAY | DBG_NAV);

  m_bd = m_dll->bd_open(root.c_str(), NULL);

  if(!m_bd)
  {
    CLog::Log(LOGERROR, "CBlurayDirectory::GetDirectory - failed to open %s", root.c_str());
    return false;
  }

  if(file == "root")
    GetRoot(items);
  else if(file == "root/titles")
    GetTitles(false, items);
  else
  {
    CURL url2 = GetUnderlyingCURL(url);
    CDirectory::CHints hints;
    hints.flags = m_flags;
    if (!CDirectory::GetDirectory(url2, items, hints))
      return false;
  }

  items.AddSortMethod(SortByTrackNumber,  554, LABEL_MASKS("%L", "%D", "%L", ""));    // FileName, Duration | Foldername, empty
  items.AddSortMethod(SortBySize,         553, LABEL_MASKS("%L", "%I", "%L", "%I"));  // FileName, Size | Foldername, Size

  return true;
}
开发者ID:MrMC,项目名称:mrmc,代码行数:47,代码来源:BlurayDirectory.cpp

示例7: main

//////////////////////////////////////////////////////////////////  PUBLIC
//---------------------------------------------------- Fonctions publiques
int main ( void )
{
	InitMemoire ( );
	racine = GetRoot ( );

	FILE * lecture = fopen ( "input.txt" , "r");

	uint64_t * nombre = malloc ( sizeof ( uint64_t ) );
	while ( EOF != (fscanf ( lecture, "%" PRIu64 "", nombre ) ) )
	{
		get_prime_factors ( * nombre );
		print_prime_factors ( * nombre );
	}

	End ( racine );
	return 0;
} //----- fin de Main
开发者ID:PatFin,项目名称:B3157,代码行数:19,代码来源:Question10.2.c

示例8: ComputeMaxNodeVal

void BubbleTree::PrepareDrawing()	{

	DrawTree::PrepareDrawing();
	/*
	if (minmax)	{
		double max = ComputeMaxNodeVal(root);
		double min = ComputeMinNodeVal(root);
		cerr << min << '\t' << max << '\n';
		// exit(1);
		minnodeval = min;
		nodescale = maxnodeval / sqrt(max - min);
	}
	else	{
	*/
		double max = ComputeMaxNodeVal(GetRoot());
		nodescale = maxnodeval / exp(0.5 * nodepower * log(max));
	// }
}
开发者ID:bayesiancook,项目名称:coevol,代码行数:18,代码来源:DrawTree.cpp

示例9: PODOFO_RAISE_ERROR

void PdfPagesTree::DeletePageFromNode( PdfObject* pParent, const PdfObjectList & rlstParents, 
                                       int nIndex, PdfObject* pPage )
{
    if( !pParent || !pPage ) 
    {
        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
    }

    // 1. Delete the reference from the kids array of pParent
    // 2. Decrease count of every node in lstParents (which also includes pParent)
    // 3. Remove empty page nodes

    // TODO: Tell cache to free page object

    // 1. Delete reference
    this->DeletePageNode( pParent, nIndex ) ;

    // 2. Decrease count
    PdfObjectList::const_reverse_iterator itParents = rlstParents.rbegin();
    while( itParents != rlstParents.rend() )
    {
        this->ChangePagesCount( *itParents, -1 );

        ++itParents;
    } 

    // 3. Remove empty pages nodes
    itParents = rlstParents.rbegin();
    while( itParents != rlstParents.rend() )
    {
        // Never delete root node
        if( IsEmptyPageNode( *itParents ) && *itParents != GetRoot() ) 
        {
            PdfObject* pParentOfNode = *(itParents + 1);
            int nKidsIndex = this->GetPosInKids( *itParents, pParentOfNode );
            DeletePageNode( pParentOfNode, nKidsIndex );

            // Delete empty page nodes
            delete this->GetObject()->GetOwner()->RemoveObject( (*itParents)->Reference() );
        }

        ++itParents;
    } 
}
开发者ID:yjwong,项目名称:podofo,代码行数:44,代码来源:PdfPagesTree.cpp

示例10: solve

	inline void solve(void) {
		scanf("%d%d%d", &p, &a, &k);
		Divid(p - 1);
		if (p == 2) {
			if (k == 0) printf("%d\n%d\n", 1, 0);
			else printf("%d\n%d\n",1, 1);
			return;
		}
		int g = GetRoot(p);
		int tmp = Pow(g, a, p);
		VII ret = BabyStep(tmp, k, p);
		SII Ans;
		for (VII::iterator it = ret.begin(); it != ret.end(); it++) {
			Ans.insert(Pow(g, *it, p));
		}
		printf("%d\n", Ans.size());
		for (SII::iterator it = Ans.begin(); it != Ans.end(); it++)
			printf("%d\n", *it);
	}
开发者ID:AiHaibara,项目名称:acm-icpc,代码行数:19,代码来源:1420.cpp

示例11: GetRoot

void wxXmlRcEditDocument::Upgrade()
{
    int v1,v2,v3,v4;
    long version;
    wxXmlNode *node = GetRoot();
    wxString verstr = wxT("0.0.0.0");
    node->GetPropVal(wxT("version"),verstr);
    if (wxSscanf(verstr.c_str(), wxT("%i.%i.%i.%i"),
        &v1, &v2, &v3, &v4) == 4)
        version = v1*256*256*256+v2*256*256+v3*256+v4;
    else
        version = 0;
    if (!version)
    {
        UpgradeNode(node);
    }
    node->DeleteProperty(wxT("version"));
    node->AddProperty(wxT("version"), WX_XMLRES_CURRENT_VERSION_STRING);
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:19,代码来源:editor.cpp

示例12: GetRoot

void CPDF_Document::DeletePage(int iPage) {
  CPDF_Dictionary* pRoot = GetRoot();
  if (!pRoot) {
    return;
  }
  CPDF_Dictionary* pPages = pRoot->GetDict("Pages");
  if (!pPages) {
    return;
  }
  int nPages = pPages->GetInteger("Count");
  if (iPage < 0 || iPage >= nPages) {
    return;
  }
  CFX_ArrayTemplate<CPDF_Dictionary*> stack;
  stack.Add(pPages);
  if (InsertDeletePDFPage(this, pPages, iPage, NULL, FALSE, stack) < 0) {
    return;
  }
  m_PageList.RemoveAt(iPage);
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:20,代码来源:fpdf_edit_doc.cpp

示例13: cElement

// GetNamespaces
void COpcXmlDocument::GetNamespaces(COpcStringMap& cNamespaces)
{
    // clear the current set.
    cNamespaces.RemoveAll();

    // check for a valid root element.
    COpcXmlElement cElement(GetRoot());

    if (cElement == NULL)
    {
        return;
    }

    // add the namespace for the root element.
    COpcString cPrefix = cElement.GetPrefix();

    if (!cPrefix.IsEmpty())
    {
        cNamespaces[cPrefix] = cElement.GetNamespace();
    }

    // fetch the attributes from the root element.
    COpcXmlAttributeList cAttributes;

    if (cElement.GetAttributes(cAttributes) > 0)
    {
        for (UINT ii = 0; ii < cAttributes.GetSize(); ii++)
        {
            if (cAttributes[ii].GetPrefix() == OPCXML_NAMESPACE_ATTRIBUTE)
            {
                COpcString cName = cAttributes[ii].GetQualifiedName().GetName();

                // don't add the default namespace.
                if (!cName.IsEmpty())
                {
                    cNamespaces[cName] = cAttributes[ii].GetValue();
                }
            }
        }
    }
}
开发者ID:OPCFoundation,项目名称:UA-.NET,代码行数:42,代码来源:COpcXmlDocument.cpp

示例14: RemoveMouseClickListener

NS_IMETHODIMP
nsHTMLEditor::HideInlineTableEditingUI()
{
  mInlineEditedCell = nsnull;

  RemoveMouseClickListener(mAddColumnBeforeButton);
  RemoveMouseClickListener(mRemoveColumnButton);
  RemoveMouseClickListener(mAddColumnAfterButton);
  RemoveMouseClickListener(mAddRowBeforeButton);
  RemoveMouseClickListener(mRemoveRowButton);
  RemoveMouseClickListener(mAddRowAfterButton);

  // get the presshell's document observer interface.
  nsCOMPtr<nsIPresShell> ps;
  GetPresShell(getter_AddRefs(ps));
  // We allow the pres shell to be null; when it is, we presume there
  // are no document observers to notify, but we still want to
  // UnbindFromTree.

  // get the root content node.

  nsIDOMElement *bodyElement = GetRoot();

  nsCOMPtr<nsIContent> bodyContent( do_QueryInterface(bodyElement) );
  NS_ENSURE_TRUE(bodyContent, NS_ERROR_FAILURE);

  DeleteRefToAnonymousNode(mAddColumnBeforeButton, bodyContent, ps);
  mAddColumnBeforeButton = nsnull;
  DeleteRefToAnonymousNode(mRemoveColumnButton, bodyContent, ps);
  mRemoveColumnButton = nsnull;
  DeleteRefToAnonymousNode(mAddColumnAfterButton, bodyContent, ps);
  mAddColumnAfterButton = nsnull;
  DeleteRefToAnonymousNode(mAddRowBeforeButton, bodyContent, ps);
  mAddRowBeforeButton = nsnull;
  DeleteRefToAnonymousNode(mRemoveRowButton, bodyContent, ps);
  mRemoveRowButton = nsnull;
  DeleteRefToAnonymousNode(mAddRowAfterButton, bodyContent, ps);
  mAddRowAfterButton = nsnull;

  return NS_OK;
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:41,代码来源:nsHTMLInlineTableEditor.cpp

示例15: Dispose

bool CBlurayDirectory::GetDirectory(const CStdString& path, CFileItemList &items)
{
  Dispose();
  m_url.Parse(path);
  CStdString root = m_url.GetHostName();
  CStdString file = m_url.GetFileName();
  URIUtils::RemoveSlashAtEnd(file);

  m_dll = new DllLibbluray();
  if (!m_dll->Load())
  {
    CLog::Log(LOGERROR, "CBlurayDirectory::GetDirectory - failed to load dll");
    return false;
  }

  m_dll->bd_register_dir(DllLibbluray::dir_open);
  m_dll->bd_register_file(DllLibbluray::file_open);
  m_dll->bd_set_debug_handler(DllLibbluray::bluray_logger);
  m_dll->bd_set_debug_mask(DBG_CRIT | DBG_BLURAY | DBG_NAV);

  m_bd = m_dll->bd_open(root.c_str(), NULL);

  if(!m_bd)
  {
    CLog::Log(LOGERROR, "CBlurayDirectory::GetDirectory - failed to open %s", root.c_str());
    return false;
  }

  if(file == "")
    GetRoot(items);
  else if(file == "titles")
    GetTitles(false, items);
  else
    return false;

  items.AddSortMethod(SORT_METHOD_TRACKNUM , 554, LABEL_MASKS("%L", "%D", "%L", ""));    // FileName, Duration | Foldername, empty
  items.AddSortMethod(SORT_METHOD_SIZE     , 553, LABEL_MASKS("%L", "%I", "%L", "%I"));  // FileName, Size | Foldername, Size

  return true;
}
开发者ID:cpaowner,项目名称:xbmc,代码行数:40,代码来源:BlurayDirectory.cpp


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