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

#include <DisassemblyGuard.hh>

Inheritance diagram for DisassemblyGuard:
Inheritance graph
Collaboration diagram for DisassemblyGuard:
Collaboration graph

Public Member Functions

 DisassemblyGuard (DisassemblyElement *guarded, bool inverted)
 
virtual ~DisassemblyGuard ()
 
const DisassemblyElementguardedElement () const
 
bool inverted () const
 
virtual std::string toString () const
 

Protected Attributes

bool inverted_
 True, if the guard is inverted. More...
 

Private Attributes

DisassemblyElementguardedElement_
 The element which is guarded. More...
 

Detailed Description

Represents a guard for the Disassembler.

Definition at line 41 of file DisassemblyGuard.hh.

Constructor & Destructor Documentation

◆ DisassemblyGuard()

DisassemblyGuard::DisassemblyGuard ( DisassemblyElement guardedElement,
bool  inverted 
)

The constructor.

Parameters
guardedElementThe element which the guard refers to.
invertedDefines if the guard is inverted or not.

Definition at line 41 of file DisassemblyGuard.cc.

42  :
45 }

◆ ~DisassemblyGuard()

DisassemblyGuard::~DisassemblyGuard ( )
virtual

The destructor.

Definition at line 51 of file DisassemblyGuard.cc.

51  {
52  delete guardedElement_;
53 }

References guardedElement_.

Member Function Documentation

◆ guardedElement()

const DisassemblyElement & DisassemblyGuard::guardedElement ( ) const

Returns the element which the guard refers to.

Returns
Guarded element.

Definition at line 73 of file DisassemblyGuard.cc.

73  {
74  return *guardedElement_;
75 }

References guardedElement_.

◆ inverted()

bool DisassemblyGuard::inverted ( ) const

True, if the guard is inverted.

Returns
True if the guard is inverted, false if not.

Definition at line 62 of file DisassemblyGuard.cc.

62  {
63  return inverted_;
64 }

References inverted_.

◆ toString()

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

Returns disassembly of the guard.

Returns
Disassembly of the guard as a string.

Reimplemented in DisassemblySequentialGuard.

Definition at line 84 of file DisassemblyGuard.cc.

84  {
85  std::string disassembly;
86  if (inverted_) {
87  disassembly = "!";
88  } else {
89  disassembly = "?";
90  }
91 
92  disassembly = disassembly + guardedElement_->toString() + " ";
93  return disassembly;
94 }

References guardedElement_, inverted_, and DisassemblyElement::toString().

Referenced by DisassemblyMove::toString().

Here is the call graph for this function:

Member Data Documentation

◆ guardedElement_

DisassemblyElement* DisassemblyGuard::guardedElement_
private

The element which is guarded.

Definition at line 54 of file DisassemblyGuard.hh.

Referenced by guardedElement(), toString(), and ~DisassemblyGuard().

◆ inverted_

bool DisassemblyGuard::inverted_
protected

True, if the guard is inverted.

Definition at line 51 of file DisassemblyGuard.hh.

Referenced by inverted(), DisassemblySequentialGuard::toString(), and toString().


The documentation for this class was generated from the following files:
DisassemblyGuard::inverted_
bool inverted_
True, if the guard is inverted.
Definition: DisassemblyGuard.hh:51
DisassemblyGuard::guardedElement
const DisassemblyElement & guardedElement() const
Definition: DisassemblyGuard.cc:73
DisassemblyGuard::guardedElement_
DisassemblyElement * guardedElement_
The element which is guarded.
Definition: DisassemblyGuard.hh:54
DisassemblyElement::toString
virtual std::string toString() const =0
DisassemblyGuard::inverted
bool inverted() const
Definition: DisassemblyGuard.cc:62