Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_RSC_INC_RSCCLOBJ_HXX
20 : #define INCLUDED_RSC_INC_RSCCLOBJ_HXX
21 :
22 : #include <rsctree.hxx>
23 : #include <rscdef.hxx>
24 : #include <rscall.h>
25 :
26 : /******************* O b j N o d e ***************************************/
27 37984 : class ObjNode : public IdNode
28 : {
29 : RscId aRscId; // Id der Resource
30 : CLASS_DATA pRscObj;// pointer to a resourceobject
31 : sal_uLong lFileKey;// Dateischluessel
32 : protected:
33 : using NameNode::Search;
34 :
35 : public:
36 : using NameNode::Insert;
37 :
38 : ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey );
39 : ObjNode * DelObjNode( RscTop * pClass, sal_uLong lFileKey );
40 : sal_uInt32 GetId() const SAL_OVERRIDE;
41 18992 : RscId GetRscId(){ return aRscId; }
42 19047 : sal_uLong GetFileKey(){ return lFileKey; };
43 7 : ObjNode* Search( const RscId &rName ) const //< search the index in the b-tree
44 : {
45 7 : return static_cast<ObjNode *>(IdNode::Search( rName ));
46 : }
47 18291 : bool Insert( ObjNode* pTN ) //< insert a new node in the b-tree
48 :
49 : {
50 18291 : return IdNode::Insert( static_cast<IdNode *>(pTN) );
51 : }
52 75972 : CLASS_DATA GetRscObj() //< get the Object from this Node
53 :
54 : {
55 75972 : return pRscObj;
56 : }
57 : bool IsConsistent();
58 : };
59 :
60 : /******************* R e f N o d e ***************************************/
61 76311 : class RefNode : public IdNode
62 : {
63 : Atom nTypNameId; // index of a Name in a hashtabel
64 : protected:
65 : using NameNode::Search;
66 :
67 : public:
68 : using NameNode::Insert;
69 :
70 : ObjNode* pObjBiTree; // Zeiger auf Objektbaum
71 : RefNode( Atom nTyp );
72 : sal_uInt32 GetId() const SAL_OVERRIDE;
73 : RefNode* Search( Atom typ ) const //< search the index in the b-tree
74 : {
75 : return static_cast<RefNode *>(IdNode::Search( typ ));
76 : }
77 15429 : bool Insert( RefNode* pTN ) //< insert a new node in the b-tree
78 : {
79 15429 : return IdNode::Insert( static_cast<IdNode *>(pTN) );
80 : }
81 : bool PutObjNode( ObjNode * pPutObject );
82 :
83 : // insert new node in b-tree pObjBiTree
84 : ObjNode * GetObjNode( const RscId &rRscId );
85 :
86 47576 : ObjNode * GetObjNode()
87 : {
88 : // hole pObjBiTree
89 47576 : return pObjBiTree;
90 : }
91 : };
92 :
93 : #endif // INCLUDED_RSC_INC_RSCCLOBJ_HXX
94 :
95 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|