OpenASIP  2.0
AnnotatedInstructionElement.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 AnnotatedInstructionElement.hh
26  *
27  * Declaration of AnnotatedInstructionElement class.
28  *
29  * @author Pekka Jääskeläinen 2006 (pekka.jaaskelainen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_ANNOTATED_INSTRUCTION_ELEMENT_HH
34 #define TTA_ANNOTATED_INSTRUCTION_ELEMENT_HH
35 
36 #include <string>
37 #include <map>
38 
39 #include "ProgramAnnotation.hh"
40 #include "Exception.hh"
41 
42 class TCEString;
43 
44 namespace TTAProgram {
45 
46 /**
47  * AnnotatedInstructionElements provide an interface for the classes that
48  * can be attached an instruction annotation.
49  *
50  * Basically the TerminalImmediate and Move inherit this to provide such
51  * capabilities.
52  */
54 public:
57 
61  int index,
63  int annotationCount(
65  void removeAnnotations(
67  bool hasAnnotations(
69  bool hasAnnotation(ProgramAnnotation::Id id, const TCEString& data) const;
70 
72 
73 private:
74  /// a type for the container of the annotations
75  typedef std::multimap<ProgramAnnotation::Id, ProgramAnnotation>
77 
78  /// container for annotations
80 };
81 
82 }
83 
84 #endif
TTAProgram::AnnotatedInstructionElement
Definition: AnnotatedInstructionElement.hh:53
TTAProgram
Definition: Estimator.hh:65
TTAProgram::AnnotatedInstructionElement::AnnotatedInstructionElement
AnnotatedInstructionElement()
Definition: AnnotatedInstructionElement.cc:48
Exception.hh
TTAProgram::AnnotatedInstructionElement::setAnnotation
void setAnnotation(const ProgramAnnotation &annotation)
Definition: AnnotatedInstructionElement.cc:79
TTAProgram::AnnotatedInstructionElement::AnnotationIndex
std::multimap< ProgramAnnotation::Id, ProgramAnnotation > AnnotationIndex
a type for the container of the annotations
Definition: AnnotatedInstructionElement.hh:76
TTAProgram::ProgramAnnotation::ANN_UNDEF_ID
@ ANN_UNDEF_ID
an illegal annotation ID (the id is only 24 bits, this has more meaningful bits)
Definition: ProgramAnnotation.hh:202
TTAProgram::AnnotatedInstructionElement::copyAnnotationsFrom
void copyAnnotationsFrom(const AnnotatedInstructionElement &other)
Definition: AnnotatedInstructionElement.cc:193
TTAProgram::AnnotatedInstructionElement::annotations_
AnnotationIndex annotations_
container for annotations
Definition: AnnotatedInstructionElement.hh:79
TTAProgram::ProgramAnnotation::Id
Id
the ID in TPEF is 24 bits, here enum
Definition: ProgramAnnotation.hh:52
TTAProgram::AnnotatedInstructionElement::hasAnnotation
bool hasAnnotation(ProgramAnnotation::Id id, const TCEString &data) const
Definition: AnnotatedInstructionElement.cc:174
TTAProgram::AnnotatedInstructionElement::~AnnotatedInstructionElement
~AnnotatedInstructionElement()
Definition: AnnotatedInstructionElement.cc:54
TTAProgram::AnnotatedInstructionElement::hasAnnotations
bool hasAnnotations(ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
Definition: AnnotatedInstructionElement.cc:165
TTAProgram::AnnotatedInstructionElement::annotation
ProgramAnnotation annotation(int index, ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
Definition: AnnotatedInstructionElement.cc:100
TTAProgram::AnnotatedInstructionElement::addAnnotation
void addAnnotation(const ProgramAnnotation &annotation)
Definition: AnnotatedInstructionElement.cc:63
TCEString
Definition: TCEString.hh:53
TTAProgram::ProgramAnnotation
Definition: ProgramAnnotation.hh:49
TTAProgram::AnnotatedInstructionElement::removeAnnotations
void removeAnnotations(ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID)
Definition: AnnotatedInstructionElement.cc:146
ProgramAnnotation.hh
TTAProgram::AnnotatedInstructionElement::annotationCount
int annotationCount(ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
Definition: AnnotatedInstructionElement.cc:133