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 private:
41 static FastRTTI _fastRTTI;
42 public:
43 static inline const FastRTTI& fastRTTI ();
44 virtual const FastRTTI& vfastRTTI () const;
45 public:
46 virtual Cell* getCell () const = 0;
47 virtual Box getBoundingBox () const = 0;
48 virtual void _toJson ( JsonWriter* ) const;
49 virtual string _getString () const;
50 virtual Record* _getRecord () const;
51 Quark* _getQuark ( SharedPath* sharedPath = NULL ) const;
52 protected:
53 Entity ();
54 virtual ~Entity ();
55 virtual void _postCreate ();
56 virtual void _preDestroy ();
57 };
58
59
60 inline const FastRTTI& Entity::fastRTTI () { return _fastRTTI; }
61
62
63// -------------------------------------------------------------------
64// Class : "Hurricane::JsonEntity".
65
66 class JsonEntity : public JsonDBo {
67 public:
68 JsonEntity ( unsigned long flags );
69 template<typename T> inline void update ( JsonStack&, T );
70 };
71
72
73 template<typename T> inline void JsonEntity::update ( JsonStack& stack, T hobject )
74 {
75 unsigned int jsonId = get<int64_t>(stack,"_id");
76
77 JsonDBo::update<T>( stack, hobject );
78 stack.addEntity( jsonId, hobject );
79 }
80
81
82// -------------------------------------------------------------------
83// Class : "JsonEntityRef".
84
85 class JsonEntityRef : public JsonObject {
86 public:
87 static void initialize ();
88 JsonEntityRef ( unsigned long flags );
89 virtual string getTypeName () const;
90 virtual JsonEntityRef* clone ( unsigned long ) const;
91 virtual void toData ( JsonStack& );
92 };
93
94
95} // Hurricane namespace.
96
97
98INSPECTOR_P_SUPPORT(Hurricane::Entity);
99
100// ****************************************************************************************************
101// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
102// ****************************************************************************************************
Box description (API).
Definition Box.h:30
The model (API).
Definition Cell.h:64
Occurrenceable objects root class (API).
Definition Entity.h:37
virtual Box getBoundingBox() const =0
virtual Cell * getCell() const =0
Support for JSON export.
Definition JsonObject.h:83
virtual std::string getTypeName() const =0
T get(JsonStack &, const std::string &key) const
Definition JsonObject.h:382
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.16.1 on Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved