OpenASIP  2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes | List of all members
TTAProgram::NullProcedure Class Reference

#include <NullProcedure.hh>

Inheritance diagram for TTAProgram::NullProcedure:
Inheritance graph
Collaboration diagram for TTAProgram::NullProcedure:
Collaboration graph

Public Member Functions

virtual ~NullProcedure ()
 
Programparent () const
 
void setParent (Program &prog)
 
bool isInProgram () const
 
std::string name () const
 
int alignment () const
 
Address address (const Instruction &ins) const
 
Address startAddress () const
 
void setStartAddress (Address start)
 
Address endAddress () const
 
int instructionCount () const
 
InstructionfirstInstruction () const
 
InstructioninstructionAt (UIntWord address) const
 
bool hasNextInstruction (const Instruction &ins) const
 
InstructionnextInstruction (const Instruction &ins) const
 
InstructionpreviousInstruction (const Instruction &ins) const
 
InstructionlastInstruction () const
 
void addInstruction (Instruction &ins)
 
void insertInstructionAfter (const Instruction &pos, Instruction *ins)
 
- Public Member Functions inherited from TTAProgram::Procedure
 Procedure (const TCEString &name, const TTAMachine::AddressSpace &space)
 
 Procedure (const TCEString &name, const TTAMachine::AddressSpace &space, UIntWord startLocation)
 
virtual ~Procedure ()
 
TCEString name () const
 
int alignment () const
 
Address address (const Instruction &ins) const
 
void addFront (Instruction *)
 
void add (Instruction *ins)
 
void insertAfter (const Instruction &pos, Instruction *ins)
 
void insertBefore (const Instruction &pos, Instruction *ins)
 
void clear ()
 
void remove (Instruction &ins)
 
CodeSnippetcopy () const
 
virtual void insertAfter (const Instruction &pos, Instruction *ins)
 
virtual void insertAfter (const Instruction &pos, const CodeSnippet &cs)
 
virtual void insertAfter (const Instruction &pos, CodeSnippet *cs)
 
virtual void insertBefore (const Instruction &pos, Instruction *ins)
 
virtual void insertBefore (const Instruction &pos, const CodeSnippet &cs)
 
virtual void insertBefore (const Instruction &pos, CodeSnippet *cs)
 
- Public Member Functions inherited from TTAProgram::CodeSnippet
 CodeSnippet ()
 
 CodeSnippet (const TTAProgram::Address &start)
 
virtual ~CodeSnippet ()
 
virtual void removeLastInstruction ()
 
virtual void setEndAddress (Address end)
 
virtual InstructioninstructionAtIndex (int index) const
 
virtual Instructionoperator[] (size_t index) const
 
virtual void deleteInstructionAt (InstructionAddress address)
 
virtual void prepend (const CodeSnippet &cs)
 
virtual void prepend (CodeSnippet *cs)
 
virtual void append (const CodeSnippet &cs)
 
virtual void append (CodeSnippet *cs)
 
virtual void insertBefore (const Instruction &pos, const CodeSnippet &cs)
 
virtual void insertBefore (const Instruction &pos, CodeSnippet *cs)
 
virtual void insertAfter (const Instruction &pos, const CodeSnippet &cs)
 
virtual void insertAfter (const Instruction &pos, CodeSnippet *cs)
 
bool hasReturn () const
 
virtual std::string disassembly () const
 
virtual std::string toString () const
 

Static Public Member Functions

static NullProcedureinstance ()
 

Protected Member Functions

 NullProcedure ()
 

Private Member Functions

 NullProcedure (const NullProcedure &)
 Copying not allowed. More...
 
NullProcedureoperator= (const NullProcedure &)
 Assignment not allowed. More...
 

Static Private Attributes

static NullProcedure instance_
 Unique instance of NullProcedure. More...
 

Additional Inherited Members

- Protected Types inherited from TTAProgram::CodeSnippet
typedef std::vector< Instruction * > InsList
 List of instructions. More...
 
typedef InsList::iterator InsIter
 Iterator for the instruction list. More...
 
- Protected Attributes inherited from TTAProgram::CodeSnippet
InsList instructions_
 The instructions in this procedure. More...
 
Programparent_
 The parent program of the procedure. More...
 
Address startAddr_
 The start (lowest) address of the procedure. More...
 
Address endAddr_
 The highest address of the procedure. More...
 

Detailed Description

A singleton class that represents a null procedure.

Calling any method causes the program to abort.

Definition at line 50 of file NullProcedure.hh.

Constructor & Destructor Documentation

◆ ~NullProcedure()

TTAProgram::NullProcedure::~NullProcedure ( )
virtual

The destructor.

Definition at line 59 of file NullProcedure.cc.

59  {
60 }

◆ NullProcedure() [1/2]

TTAProgram::NullProcedure::NullProcedure ( )
protected

The constructor.

Definition at line 52 of file NullProcedure.cc.

52  :
53  Procedure("NULL", NullAddressSpace::instance()) {
54 }

◆ NullProcedure() [2/2]

TTAProgram::NullProcedure::NullProcedure ( const NullProcedure )
private

Copying not allowed.

Member Function Documentation

◆ addInstruction()

void TTAProgram::NullProcedure::addInstruction ( Instruction ins)

Aborts program with error log message.

Exceptions
IllegalRegistrationnever.

Definition at line 240 of file NullProcedure.cc.

240  {
241  abortWithError("addInstruction()");
242 }

References abortWithError.

◆ address()

Address TTAProgram::NullProcedure::address ( const Instruction ins) const
virtual

Aborts program with error log message.

Returns
A null address.
Exceptions
IllegalRegistrationnever.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 122 of file NullProcedure.cc.

122  {
123  abortWithError("address()");
124  return NullAddress::instance();
125 }

References abortWithError, and TTAProgram::NullAddress::instance().

Here is the call graph for this function:

◆ alignment()

int TTAProgram::NullProcedure::alignment ( ) const

Definition at line 110 of file NullProcedure.cc.

110  {
111  abortWithError("alignment()");
112  return -1;
113 }

References abortWithError.

◆ endAddress()

Address TTAProgram::NullProcedure::endAddress ( ) const
virtual

Aborts program with error log message.

Returns
A null address.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 152 of file NullProcedure.cc.

152  {
153  abortWithError("endAddress()");
154  return NullAddress::instance();
155 }

References abortWithError, and TTAProgram::NullAddress::instance().

Here is the call graph for this function:

◆ firstInstruction()

Instruction & TTAProgram::NullProcedure::firstInstruction ( ) const
virtual

Returns the first instruction in the code snippet.

Returns
The first instruction in the code snippet.
Exceptions
InstanceNotFoundif there are no instructions in the code snippet.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 169 of file NullProcedure.cc.

169  {
170  abortWithError("firstInstruction()");
171  return NullInstruction::instance();
172 }

References abortWithError, and TTAProgram::NullInstruction::instance().

Here is the call graph for this function:

◆ hasNextInstruction()

bool TTAProgram::NullProcedure::hasNextInstruction ( const Instruction ins) const
virtual

Aborts program with error log message.

Returns
False.
Exceptions
IllegalRegistrationnever.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 193 of file NullProcedure.cc.

193  {
194  abortWithError("hasNextInstruction()");
195  return false;
196 }

References abortWithError.

◆ insertInstructionAfter()

void TTAProgram::NullProcedure::insertInstructionAfter ( const Instruction pos,
Instruction ins 
)

Aborts program with error log message.

Exceptions
IllegalRegistrationnever.

Definition at line 250 of file NullProcedure.cc.

250  {
251  abortWithError("insertInstructionAfter()");
252 }

References abortWithError.

◆ instance()

NullProcedure & TTAProgram::NullProcedure::instance ( )
static

◆ instructionAt()

Instruction & TTAProgram::NullProcedure::instructionAt ( UIntWord  address) const
virtual

Aborts program with error log message.

Returns
A null instruction.
Exceptions
KeyNotFoundnever.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 181 of file NullProcedure.cc.

181  {
182  abortWithError("instructionAt()");
183  return NullInstruction::instance();
184 }

References abortWithError, and TTAProgram::NullInstruction::instance().

Here is the call graph for this function:

◆ instructionCount()

int TTAProgram::NullProcedure::instructionCount ( ) const
virtual

Aborts program with error log message.

Returns
-1.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 163 of file NullProcedure.cc.

163  {
164  abortWithError("instructionCount()");
165  return -1;
166 }

References abortWithError.

◆ isInProgram()

bool TTAProgram::NullProcedure::isInProgram ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 98 of file NullProcedure.cc.

98  {
99  abortWithError("isInProgram()");
100  return false;
101 }

References abortWithError.

◆ lastInstruction()

Instruction & TTAProgram::NullProcedure::lastInstruction ( ) const
virtual

Aborts program with error log message.

Returns
A null instruction.
Exceptions
IllegalRegistrationnever.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 229 of file NullProcedure.cc.

229  {
230  abortWithError("lastInstruction()");
231  return NullInstruction::instance();
232 }

References abortWithError, and TTAProgram::NullInstruction::instance().

Here is the call graph for this function:

◆ name()

std::string TTAProgram::NullProcedure::name ( ) const

Definition at line 104 of file NullProcedure.cc.

104  {
105  abortWithError("name()");
106  return "";
107 }

References abortWithError.

◆ nextInstruction()

Instruction & TTAProgram::NullProcedure::nextInstruction ( const Instruction ins) const
virtual

Aborts program with error log message.

Returns
A null instruction.
Exceptions
IllegalRegistrationnever.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 205 of file NullProcedure.cc.

205  {
206  abortWithError("nextInstruction()");
207  return NullInstruction::instance();
208 }

References abortWithError, and TTAProgram::NullInstruction::instance().

Here is the call graph for this function:

◆ operator=()

NullProcedure& TTAProgram::NullProcedure::operator= ( const NullProcedure )
private

Assignment not allowed.

◆ parent()

Program & TTAProgram::NullProcedure::parent ( ) const
virtual

Aborts program with error log message.

Returns
A null program.
Exceptions
IllegalRegistrationnever.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 79 of file NullProcedure.cc.

79  {
80  abortWithError("parent()");
81  return NullProgram::instance();
82 }

References abortWithError, and TTAProgram::NullProgram::instance().

Here is the call graph for this function:

◆ previousInstruction()

Instruction & TTAProgram::NullProcedure::previousInstruction ( const Instruction ins) const
virtual

Aborts program with error log message.

Returns
A null instruction.
Exceptions
IllegalRegistrationnever.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 217 of file NullProcedure.cc.

217  {
218  abortWithError("previousInstruction()");
219  return NullInstruction::instance();
220 }

References abortWithError, and TTAProgram::NullInstruction::instance().

Here is the call graph for this function:

◆ setParent()

void TTAProgram::NullProcedure::setParent ( Program prog)
virtual

Aborts program with error log message.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 88 of file NullProcedure.cc.

88  {
89  abortWithError("setParent()");
90 }

References abortWithError.

◆ setStartAddress()

void TTAProgram::NullProcedure::setStartAddress ( Address  start)
virtual

Aborts program with error log message.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 142 of file NullProcedure.cc.

142  {
143  abortWithError("setStartAddress()");
144 }

References abortWithError.

◆ startAddress()

Address TTAProgram::NullProcedure::startAddress ( ) const
virtual

Aborts program with error log message.

Returns
A null address.

Reimplemented from TTAProgram::CodeSnippet.

Definition at line 133 of file NullProcedure.cc.

133  {
134  abortWithError("startAddress()");
135  return NullAddress::instance();
136 }

References abortWithError, and TTAProgram::NullAddress::instance().

Here is the call graph for this function:

Member Data Documentation

◆ instance_

NullProcedure TTAProgram::NullProcedure::instance_
staticprivate

Unique instance of NullProcedure.

Definition at line 88 of file NullProcedure.hh.

Referenced by instance().


The documentation for this class was generated from the following files:
TTAProgram::NullAddress::instance
static NullAddress & instance()
Definition: NullAddress.cc:65
TTAProgram::NullProgram::instance
static NullProgram & instance()
Definition: NullProgram.cc:72
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
TTAProgram::NullInstruction::instance
static NullInstruction & instance()
Definition: NullInstruction.cc:66
TTAProgram::NullProcedure::instance_
static NullProcedure instance_
Unique instance of NullProcedure.
Definition: NullProcedure.hh:88
TTAProgram::Procedure::Procedure
Procedure(const TCEString &name, const TTAMachine::AddressSpace &space)
Definition: Procedure.cc:59