Hurricane VLSI Database


DataBase.h
1 // ****************************************************************************************************
2 // File: ./hurricane/DataBase.h
3 // Authors: R. Escassut
4 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
5 //
6 // This file is part of Hurricane.
7 //
8 // Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
9 // Lesser General Public License as published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
11 //
12 // Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
13 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
17 // not, see <http://www.gnu.org/licenses/>.
18 // ****************************************************************************************************
19 
20 #ifndef HURRICANE_DATA_BASE
21 #define HURRICANE_DATA_BASE
22 
23 #include <functional>
24 #include <map>
25 #include "hurricane/DBo.h"
26 #include "hurricane/DbU.h"
27 
28 namespace Hurricane {
29 
30 class Cell;
31 class Library;
32 class Technology;
33 
34 
35 
36 // ****************************************************************************************************
37 // DataBase declaration
38 // ****************************************************************************************************
39 
40 class DataBase : public DBo {
41 // ************************
42 
43 // Types
44 // *****
45 
46  public: typedef DBo Inherit;
47  public: enum Flags { NoFlags = 0
48  , CreateLib =(1<<0)
49  , WarnCreateLib=(1<<2) };
50 
51 // Attributes
52 // **********
53 
54  private: static DataBase* _db;
55  private: Technology* _technology;
56  private: Library* _rootLibrary;
57  private: function<Hurricane::Cell*(string)> _cellLoader;
58 
59 // Constructors
60 // ************
61 
62  protected: DataBase();
63 
64 // Others
65 // ******
66 
67  protected: virtual void _postCreate();
68 
69  protected: virtual void _preDestroy();
70 
71  public: virtual void _toJson(JsonWriter*) const;
72  public: virtual string _getTypeName() const {return _TName("DataBase");};
73  public: virtual string _getString() const;
74  public: virtual Record* _getRecord() const;
75 
76  public: void _setTechnology(Technology* technology) {_technology = technology;};
77  public: void _setRootLibrary(Library* rootLibrary) {_rootLibrary = rootLibrary;};
78  public: void _setCellLoader(function<Hurricane::Cell*(string)> loader) { _cellLoader=loader; };
79 
80  public: static DataBase* create();
81 
82 // Accessors
83 // *********
84 
85  public: Technology* getTechnology() const {return _technology;};
86  public: Library* getRootLibrary() const {return _rootLibrary;};
87  public: Library* getLibrary(string,unsigned int flags);
88  public: Cell* getCell(string, unsigned int flags);
89  public: Cell* getCell(string);
90  public: void clear();
91  public: static DataBase* getDB();
92 
93 };
94 
95 
96 
97 // ****************************************************************************************************
98 // JsonDataBase declaration
99 // ****************************************************************************************************
100 
101 class JsonDataBase : public JsonDBo {
102 // ********************************
103 
104  public: static void initialize();
105  public: JsonDataBase(unsigned long flags);
106  public: virtual string getTypeName() const;
107  public: virtual JsonDataBase* clone(unsigned long) const;
108  public: virtual void toData(JsonStack&);
109 };
110 
111 
112 } // End of Hurricane namespace.
113 
114 
115 INSPECTOR_P_SUPPORT(Hurricane::DataBase);
116 
117 
118 #endif // HURRICANE_DATA_BASE
119 
120 
121 // ****************************************************************************************************
122 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
123 // ****************************************************************************************************
The model (API).
Definition: Cell.h:64
DataBase object root class (API).
Definition: DBo.h:45
The whole DataBase (API).
Definition: DataBase.h:40
Technology * getTechnology() const
Definition: DataBase.h:85
Library * getRootLibrary() const
Definition: DataBase.h:86
static DataBase * getDB()
static DataBase * create()
JSON Parser Stack.
Definition: JsonObject.h:249
Library description (API)
Definition: Library.h:38
Technological rules description (API).
Definition: Technology.h:62
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5


Generated by doxygen 1.9.1 on Thu Aug 11 2022 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved