1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
30 #include <rsctree.hxx>
34 /****************** C L A S S E S ****************************************/
37 /*********** R s c I n c o n s i s t e n t *******************************/
38 class RscInconsistent
{
40 RscId aFirstId
; //Paar von inkonsistenten Id's
42 RscInconsistent( const RscId
& rFirst
, const RscId
& rSecond
){
48 DECLARE_LIST( RscInconsList
, RscInconsistent
* )
50 /******************* O b j N o d e ***************************************/
51 class ObjNode
: public IdNode
{
52 RscId aRscId
; // Id der Resource
53 CLASS_DATA pRscObj
;// pointer to a resourceobject
54 sal_uLong lFileKey
;// Dateischluessel
56 using NameNode::Search
;
59 using NameNode::Insert
;
61 ObjNode( const RscId
& rId
, CLASS_DATA pData
, sal_uLong lKey
);
62 ObjNode
* DelObjNode( RscTop
* pClass
, sal_uLong lFileKey
);
63 sal_uInt32
GetId() const;
64 RscId
GetRscId(){ return( aRscId
); }
65 sal_uLong
GetFileKey(){ return lFileKey
; };
66 ObjNode
* Search( const RscId
&rName
) const{
67 // search the index in the b-tree
68 return( (ObjNode
*)IdNode::Search( rName
) );
70 sal_Bool
Insert( ObjNode
* pTN
){
71 // insert a new node in the b-tree
72 return( IdNode::Insert( (IdNode
*)pTN
) );
74 CLASS_DATA
GetRscObj(){
75 // get the Object from this Node
78 sal_Bool
IsConsistent( RscInconsList
* pList
= NULL
);
81 /******************* R e f N o d e ***************************************/
82 class RefNode
: public IdNode
{
83 Atom nTypNameId
; // index of a Name in a hashtabel
85 using NameNode::Search
;
88 using NameNode::Insert
;
90 ObjNode
* pObjBiTree
; // Zeiger auf Objektbaum
92 sal_uInt32
GetId() const;
93 RefNode
* Search( Atom typ
) const{
94 // search the index in the b-tree
95 return( (RefNode
*)IdNode::Search( typ
) );
97 sal_Bool
Insert( RefNode
* pTN
){
98 // insert a new node in the b-tree
99 return( IdNode::Insert( (IdNode
*)pTN
) );
101 sal_Bool
PutObjNode( ObjNode
* pPutObject
);
103 // insert new node in b-tree pObjBiTree
104 ObjNode
* GetObjNode( const RscId
&rRscId
);
106 ObjNode
* GetObjNode(){
108 return( pObjBiTree
);
112 #endif // _RSCCLOBJ_HXX