OpenASIP 2.2
Loading...
Searching...
No Matches
NetlistPortGroup.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2015 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/*
25 * @file NetlistPortGroup.hh
26 *
27 * Declaration of NetlistPortGroup class.
28 *
29 * Created on: 24.4.2015
30 * @author: Henry Linjamäki (henry.linjamaki-no.spam-tut.fi)
31 * @note rating: red
32 */
33
34#ifndef NETLISTPORTGROUP_HH
35#define NETLISTPORTGROUP_HH
36
37#include <vector>
38#include <cstddef> // size_t
39
40#include "NetlistPort.hh"
41
42#include "Exception.hh"
43#include "SignalGroup.hh"
44
45namespace ProGe {
46
47class BaseNetlistBlock;
48class NetlistPort;
49
50/*
51 * Presents a group of NetlistPorts belonging together.
52 */
54public:
55
56 friend class BaseNetlistBlock; // For registration management.
57
58 typedef std::vector<NetlistPort*> PortContainerType;
59
61
62 template <typename... PortType>
63 NetlistPortGroup(SignalGroup groupType, PortType... ts);
64
65 virtual ~NetlistPortGroup();
66
67 size_t portCount() const;
68 const NetlistPort& portAt(size_t index) const;
69 NetlistPort& portAt(size_t index);
70 void addPort(NetlistPort& port);
71 bool hasPortBySignal(SignalType type) const;
72 const NetlistPort& portBySignal(SignalType type) const;
73
74 void clear();
75
76 bool hasParent() const;
77 const BaseNetlistBlock& parent() const;
79
80 void assignSignalGroup(SignalGroup signalGroup);
82
83 virtual NetlistPortGroup* clone(bool asMirrored = false) const;
84
85 typedef PortContainerType::iterator iterator;
86 typedef PortContainerType::const_iterator const_iterator;
87 typedef PortContainerType::reverse_iterator reverse_iterator;
88 typedef PortContainerType::const_reverse_iterator const_reverse_iterator;
89
91 iterator end();
92 const_iterator begin() const;
93 const_iterator end() const;
98
99protected:
100 NetlistPortGroup(const NetlistPortGroup&, bool asMirrored = false);
101
102private:
104
106
107 void setParent(BaseNetlistBlock* newParent);
108
109 /// The parent block where the group belongs to.
111 /// The ports belonging to this group by reference.
113 /// The usage/implemented interface of the group.
115};
116
117
118
119} /* namespace ProGe */
120#include "NetlistPortGroup.icc"
121
122#endif /* NETLISTPORTGROUP_HH_ */
PortContainerType ports_
The ports belonging to this group by reference.
const NetlistPort & portAt(size_t index) const
std::vector< NetlistPort * > PortContainerType
SignalGroup signalGroup_
The usage/implemented interface of the group.
BaseNetlistBlock * parent_
The parent block where the group belongs to.
PortContainerType::iterator iterator
void addPort(NetlistPort &port)
bool hasPortBySignal(SignalType type) const
NetlistPortGroup(SignalGroup groupType, PortType... ts)
NetlistPortGroup & operator=(const NetlistPortGroup &)
SignalGroup assignedSignalGroup() const
PortContainerType::reverse_iterator reverse_iterator
const NetlistPort & portBySignal(SignalType type) const
virtual NetlistPortGroup * clone(bool asMirrored=false) const
PortContainerType::const_reverse_iterator const_reverse_iterator
void setParent(BaseNetlistBlock *newParent)
PortContainerType::const_iterator const_iterator
void assignSignalGroup(SignalGroup signalGroup)
const BaseNetlistBlock & parent() const
reverse_iterator rbegin()
Definition FUGen.hh:54