OpenASIP 2.2
Loading...
Searching...
No Matches
SymbolElement.icc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 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 SymbolElement.icc
26 *
27 * Inline definitions of SymbolElement class.
28 *
29 * @author Jussi Nykänen 2003 (nykanen-no.spam-cs.tut.fi)
30 * @author Mikael Lepistö 18.12.2003 (tmlepist-no.spam-cs.tut.fi)
31 * @note reviewed 22 October 2003 by ml, jn, ao, tr
32 *
33 * @note rating: yellow
34 */
35
36namespace TPEF {
37
38/**
39 * Returns is the element absolute or relocating.
40 *
41 * @return Is the element absolute or relocating.
42 */
43inline bool
44SymbolElement::absolute() const {
45 return absolute_;
46}
47
48/**
49 * Sets is the element absolute or relocating.
50 *
51 * @param anAbsoluteness True if absolute,
52 */
53inline void
54SymbolElement::setAbsolute(bool anAbsoluteness) {
55 absolute_ = anAbsoluteness;
56}
57
58/**
59 * Returns the binding type.
60 *
61 * @return The binding type.
62 */
63inline SymbolElement::SymbolBinding
64SymbolElement::binding() const {
65 return bind_;
66}
67
68/**
69 * Sets the binding type.
70 *
71 * @param aBind The binding type.
72 */
73inline void
74SymbolElement::setBinding(SymbolBinding aBind) {
75 bind_ = aBind;
76}
77
78/**
79 * Returns the name.
80 *
81 * @return The name.
82 */
83inline Chunk*
84SymbolElement::name() const {
85 return dynamic_cast<Chunk*>(name_->pointer());
86}
87
88/**
89 * Sets the name.
90 *
91 * @param aName The name.
92 */
93inline void
94SymbolElement::setName(const ReferenceManager::SafePointer* aName) {
95 name_ = aName;
96}
97
98/**
99 * Sets the name.
100 *
101 * @param aName The name.
102 */
103inline void
104SymbolElement::setName(Chunk* aName) {
105 name_ = ReferenceManager::SafePointer::replaceReference(name_, aName);
106}
107
108/**
109 * Returns the section to which the symbol belong.
110 *
111 * @return The section to which the symbol belong.
112 */
113inline Section*
114SymbolElement::section() const {
115 return dynamic_cast<Section*>(section_->pointer());
116}
117
118/**
119 * Sets the section to which the symbol belong.
120 *
121 * @param aSect The section to which symbol belong.
122 */
123inline void
124SymbolElement::setSection(const ReferenceManager::SafePointer* aSect) {
125 section_ = aSect;
126}
127
128/**
129 * Sets the section to which the symbol belong.
130 *
131 * @param aSect The section to which symbol belong.
132 */
133inline void
134SymbolElement::setSection(Section* aSect) {
135 section_ = ReferenceManager::SafePointer::replaceReference(section_, aSect);
136}
137
138}