# Hurricane Documentation

# Hurricane VLSI Database

Entity.h
1 // ****************************************************************************************************
2 // File: ./hurricane/Entity.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_ENTITY
21 #define HURRICANE_ENTITY
22
23 #include <functional>
24 #include "hurricane/DBo.h"
25 #include "hurricane/Entities.h"
26 #include "hurricane/Box.h"
27
28 namespace Hurricane {
29
30 class Cell;
31 class Quark;
32 class SharedPath;
33
34
35 // -------------------------------------------------------------------
36 // Class : "Hurricane::Entity".
37
38 class Entity : public DBo
39 {
40 public:
41 typedef DBo Inherit;
42 public:
43 virtual Cell* getCell () const = 0;
44 virtual Box getBoundingBox () const = 0;
45 virtual void _toJson ( JsonWriter* ) const;
46 virtual string _getString () const;
47 virtual Record* _getRecord () const;
48 Quark* _getQuark ( SharedPath* sharedPath = NULL ) const;
49 protected:
50 Entity ();
51 virtual ~Entity () throw(Error);
52 virtual void _postCreate ();
53 virtual void _preDestroy ();
54 };
55
56
57 // -------------------------------------------------------------------
58 // Class : "Hurricane::JsonEntity".
59
60 class JsonEntity : public JsonDBo {
61 public:
62 JsonEntity ( unsigned long flags );
63 template<typename T> inline void update ( JsonStack&, T );
64 };
65
66
67 template<typename T> inline void JsonEntity::update ( JsonStack& stack, T hobject )
68 {
69 unsigned int jsonId = get<int64_t>(stack,"_id");
70
71 JsonDBo::update<T>( stack, hobject );
72 stack.addEntity( jsonId, hobject );
73 }
74
75
76 // -------------------------------------------------------------------
77 // Class : "JsonEntityRef".
78
79 class JsonEntityRef : public JsonObject {
80 public:
81 static void initialize ();
82 JsonEntityRef ( unsigned long flags );
83 virtual string getTypeName () const;
84 virtual JsonEntityRef* clone ( unsigned long ) const;
85 virtual void toData ( JsonStack& );
86 };
87
88
89 } // Hurricane namespace.
90
91
92 INSPECTOR_P_SUPPORT(Hurricane::Entity);
93
94
95 #endif // HURRICANE_ENTITY
96
97 // ****************************************************************************************************
98 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
99 // ****************************************************************************************************
Hurricane::Quark
Quark description (API)
Definition: Quark.h:35
Hurricane::Error
Error description (API)
Definition: Error.h:43
Hurricane::Cell
The model (API).
Definition: Cell.h:66
Hurricane::DBo
DataBase object root class (API).
Definition: DBo.h:47
Hurricane::Entity
Occurrenceable objects root class (API).
Definition: Entity.h:38
Hurricane::JsonStack
JSON Parser Stack.
Definition: JsonObject.h:249
Hurricane::Box
Box description (API)
Definition: Box.h:31
Entity
Hurricane::Entity::getBoundingBox
virtual Box getBoundingBox() const =0
Hurricane::Entity::getCell
virtual Cell * getCell() const =0
Hurricane
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5