# Hurricane Documentation

# Hurricane VLSI Database

Hook.h
1 // ****************************************************************************************************
2 // File: ./hurricane/Hook.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_HOOK
21 #define HURRICANE_HOOK
22
23 #include "hurricane/Error.h"
24 #include "hurricane/Hooks.h"
25
26 namespace Hurricane {
27
28 class Component;
29
30
31
32 // ****************************************************************************************************
33 // Hook declaration
34 // ****************************************************************************************************
35
36 class Hook {
37 // *********
38
39 typedef Hook* (*compToHook_t)(Component*);
40
41 // Attributes
42 // **********
43
44 private: static map<string,compToHook_t> _compToHookMap;
45 private: Hook* _nextHook;
46
47 // Constructors
48 // ************
49
50 protected: Hook();
51
52 private: Hook(const Hook& hook); // not implemented to forbid copy construction
53
54 // Destructor
55 // **********
56
57 protected: virtual ~Hook() throw(Error);
58
59 // Operators
60 // *********
61
62 private: Hook& operator=(const Hook& hook); // not implemented to forbid assignment
63
64 // Accessors
65 // *********
66
67 public: virtual Component* getComponent() const = 0;
68
69 public: Hook* getNextHook() const;
70 public: Hook* getPreviousHook() const;
71
72 public: Hook* getMasterHook() const;
73 public: Hook* getNextMasterHook() const;
74 public: Hook* getPreviousMasterHook() const;
75
76 public: Hooks getHooks() const;
77 public: Hooks getSlaveHooks() const;
78
79 // Filters
80 // *******
81
82 public: static HookFilter getIsMasterFilter();
83
84 // Predicates
85 // **********
86
87 public: virtual bool isMaster() const = 0;
88
89 public: bool isAttached() const;
90
91 // Updators
92 // ********
93
94 public: Hook* detach();
95 public: Hook* attach(Hook* hook);
96 public: Hook* merge(Hook* hook);
97 public: void _setNextHook(Hook* hook);
98
99 // Others
100 // ******
101
102 public: static void addCompToHook(const string&, compToHook_t );
103 public: static Hook* compToHook(const string& tname, Component* );
104 public: string toJson() const;
105 public: virtual string _getTypeName() const = 0;
106 public: virtual string _getString() const = 0;
107 public: virtual Record* _getRecord() const;
108
109 };
110
111
112 } // End of Hurricane namespace.
113
114
115 INSPECTOR_P_SUPPORT(Hurricane::Hook);
116
117
118 #endif // HURRICANE_HOOK
119
120
121 // ****************************************************************************************************
122 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
123 // ****************************************************************************************************
Hurricane::Hook::getSlaveHooks
Hooks getSlaveHooks() const
Hurricane::Hook::getHooks
Hooks getHooks() const
Hurricane::Hook::isMaster
virtual bool isMaster() const =0
Hurricane::Component
Component description (API)
Definition: Component.h:42
Hurricane::Hook::getPreviousHook
Hook * getPreviousHook() const
Hurricane::Error
Error description (API)
Definition: Error.h:43
Hurricane::GenericFilter
Generic Filter auto-pointer.
Definition: Filter.h:27
Hurricane::Hook::isAttached
bool isAttached() const
Hurricane::Hook::getComponent
virtual Component * getComponent() const =0
Hurricane::Hook::attach
Hook * attach(Hook *hook)
Hurricane::GenericCollection
Generic Collection auto-pointer.
Definition: Collection.h:28
Hurricane::Hook::getMasterHook
Hook * getMasterHook() const
Hurricane::Hook::getPreviousMasterHook
Hook * getPreviousMasterHook() const
Hurricane::Hook::detach
Hook * detach()
Hurricane::Hook
Hook description (API)
Definition: Hook.h:36
Hurricane::Hook::merge
Hook * merge(Hook *hook)
Hurricane
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5
Hurricane::Hook::getNextMasterHook
Hook * getNextMasterHook() const
Hurricane::Hook::getNextHook
Hook * getNextHook() const