OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DisassemblyMove Class Reference

#include <DisassemblyMove.hh>

Inheritance diagram for DisassemblyMove:
Inheritance graph
Collaboration diagram for DisassemblyMove:
Collaboration graph

Public Member Functions

 DisassemblyMove (DisassemblyElement *source, DisassemblyElement *destination, DisassemblyGuard *guard=NULL)
 
virtual ~DisassemblyMove ()
 
virtual std::string toString () const
 
- Public Member Functions inherited from DisassemblyInstructionSlot
virtual ~DisassemblyInstructionSlot ()
 
DisassemblyAnnotationannotation (int index) const
 
void addAnnotation (DisassemblyAnnotation *annotation)
 
int annotationCount () const
 

Private Member Functions

 DisassemblyMove (const DisassemblyMove &)
 Coying not allowed. More...
 
DisassemblyMoveoperator= (const DisassemblyMove &)
 Assignment not allowed. More...
 

Private Attributes

DisassemblyElementsource_
 The source of the move. More...
 
DisassemblyElementdestination_
 The destination of the move. More...
 
DisassemblyGuardguard_
 Possible guard of the move. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DisassemblyInstructionSlot
 DisassemblyInstructionSlot ()
 

Detailed Description

Represents a move in the disassembler.

Definition at line 44 of file DisassemblyMove.hh.

Constructor & Destructor Documentation

◆ DisassemblyMove() [1/2]

DisassemblyMove::DisassemblyMove ( DisassemblyElement source,
DisassemblyElement destination,
DisassemblyGuard guard = NULL 
)

Creates disassembler of a move.

Parameters
sourceThe source element of the move.
destinationThe destination element of the move.
guardMove guard, or NULL if the move is not guarded.

Definition at line 44 of file DisassemblyMove.cc.

47  :
49  source_(source), destination_(destination), guard_(guard) {
50 
51 }

◆ ~DisassemblyMove()

DisassemblyMove::~DisassemblyMove ( )
virtual

The destructor.

Definition at line 57 of file DisassemblyMove.cc.

57  {
58  delete source_;
59  delete destination_;
60  if (guard_ != NULL) {
61  delete guard_;
62  guard_ = NULL;
63  }
64 }

References destination_, guard_, and source_.

◆ DisassemblyMove() [2/2]

DisassemblyMove::DisassemblyMove ( const DisassemblyMove )
private

Coying not allowed.

Member Function Documentation

◆ operator=()

DisassemblyMove& DisassemblyMove::operator= ( const DisassemblyMove )
private

Assignment not allowed.

◆ toString()

std::string DisassemblyMove::toString ( ) const
virtual

Disassembles the move.

Returns
Disassembled move as a string.

Implements DisassemblyInstructionSlot.

Definition at line 73 of file DisassemblyMove.cc.

73  {
74 
75  std::string disassembly;
76  if (guard_ != NULL) {
77  disassembly = guard_->toString();
78  }
79 
80  disassembly =
81  disassembly + source_->toString() + " -> " + destination_->toString();
82 
83  for (int i = 0; i < annotationCount(); i++) {
84  disassembly += annotation(i).toString();
85  }
86 
87  return disassembly;
88 }

References DisassemblyInstructionSlot::annotation(), DisassemblyInstructionSlot::annotationCount(), destination_, guard_, source_, DisassemblyElement::toString(), DisassemblyGuard::toString(), and DisassemblyAnnotation::toString().

Referenced by POMDisassembler::disassemble().

Here is the call graph for this function:

Member Data Documentation

◆ destination_

DisassemblyElement* DisassemblyMove::destination_
private

The destination of the move.

Definition at line 63 of file DisassemblyMove.hh.

Referenced by toString(), and ~DisassemblyMove().

◆ guard_

DisassemblyGuard* DisassemblyMove::guard_
private

Possible guard of the move.

Definition at line 65 of file DisassemblyMove.hh.

Referenced by toString(), and ~DisassemblyMove().

◆ source_

DisassemblyElement* DisassemblyMove::source_
private

The source of the move.

Definition at line 61 of file DisassemblyMove.hh.

Referenced by toString(), and ~DisassemblyMove().


The documentation for this class was generated from the following files:
DisassemblyInstructionSlot::annotationCount
int annotationCount() const
Definition: DisassemblyInstructionSlot.cc:80
DisassemblyGuard::toString
virtual std::string toString() const
Definition: DisassemblyGuard.cc:84
DisassemblyInstructionSlot::annotation
DisassemblyAnnotation & annotation(int index) const
Definition: DisassemblyInstructionSlot.cc:60
DisassemblyMove::destination_
DisassemblyElement * destination_
The destination of the move.
Definition: DisassemblyMove.hh:63
DisassemblyAnnotation::toString
virtual std::string toString() const
Definition: DisassemblyAnnotation.cc:61
DisassemblyMove::guard_
DisassemblyGuard * guard_
Possible guard of the move.
Definition: DisassemblyMove.hh:65
DisassemblyMove::source_
DisassemblyElement * source_
The source of the move.
Definition: DisassemblyMove.hh:61
DisassemblyElement::toString
virtual std::string toString() const =0
DisassemblyInstructionSlot::DisassemblyInstructionSlot
DisassemblyInstructionSlot()
Definition: DisassemblyInstructionSlot.cc:39