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


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