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


Generated by doxygen 1.9.7 on Fri Sep 27 2024 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved