OpenASIP 2.2
Loading...
Searching...
No Matches
SourceField.hh
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 SourceField.hh
26 *
27 * Declaration of SourceField class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_SOURCE_FIELD_HH
34#define TTA_SOURCE_FIELD_HH
35
36#include "SlotField.hh"
37
39class BridgeEncoding;
40
41/**
42 * SourceField class represents the source field of a move slot.
43 *
44 * It is a specialisation of InstructionField class. In addition to socket
45 * encodings, a source field may encode an inline immediate or up to two
46 * bridge sources.
47 */
48class SourceField : public SlotField {
49public:
51 SourceField(const ObjectState* state, MoveSlot& parent);
52 virtual ~SourceField();
53
54 void addBridgeEncoding(BridgeEncoding& encoding);
56 bool hasBridgeEncoding(const std::string& bridge) const;
57 BridgeEncoding& bridgeEncoding(const std::string& bridge) const;
58 int bridgeEncodingCount() const;
59 BridgeEncoding& bridgeEncoding(int index) const;
60
63 bool hasImmediateEncoding() const;
65
66 // methods inherited from InstructionField
67 virtual int width() const;
68
69 // methods inherited from Serializable interface
70 virtual void loadState(const ObjectState* state);
71 virtual ObjectState* saveState() const;
72
73 /// ObjectState name for source field.
74 static const std::string OSNAME_SOURCE_FIELD;
75
76private:
77 /// Container type for bridge encodings.
78 typedef std::vector<BridgeEncoding*> BridgeEncodingTable;
79
82
83 /// Container for bridge encodings.
85 /// The immediate encoding.
87};
88
89#endif
MoveSlot * parent() const
Definition SlotField.cc:98
ImmediateEncoding * immEncoding_
The immediate encoding.
BridgeEncodingTable bridgeEncodings_
Container for bridge encodings.
void clearBridgeEncodings()
int bridgeEncodingCount() const
virtual void loadState(const ObjectState *state)
void unsetImmediateEncoding()
static const std::string OSNAME_SOURCE_FIELD
ObjectState name for source field.
void addBridgeEncoding(BridgeEncoding &encoding)
bool hasBridgeEncoding(const std::string &bridge) const
virtual int width() const
void removeBridgeEncoding(BridgeEncoding &encoding)
std::vector< BridgeEncoding * > BridgeEncodingTable
Container type for bridge encodings.
void clearImmediateEncoding()
virtual ~SourceField()
ImmediateEncoding & immediateEncoding() const
void setImmediateEncoding(ImmediateEncoding &encoding)
bool hasImmediateEncoding() const
virtual ObjectState * saveState() const
BridgeEncoding & bridgeEncoding(const std::string &bridge) const