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

#include <NullProgram.hh>

Inheritance diagram for TTAProgram::NullProgram:
Inheritance graph
Collaboration diagram for TTAProgram::NullProgram:
Collaboration graph

Public Member Functions

virtual ~NullProgram ()
 
GlobalScopeglobalScope ()
 
const GlobalScopeglobalScopeConst () const
 
TTAMachine::MachinetargetProcessor () const
 
Address startAddress () const
 
Address entryAddress () const
 
void setEntryAddress (Address address)
 
void addProcedure (Procedure &proc)
 
void addInstruction (Instruction &ins)
 
void relocate (const Procedure &proc, UIntWord howMuch)
 
ProcedurefirstProcedure () const
 
ProcedurelastProcedure () const
 
ProcedurenextProcedure (const Procedure &proc) const
 
int procedureCount () const
 
Procedureprocedure (int index) const
 
Procedureprocedure (const std::string &name) const
 
InstructionfirstInstruction () const
 
const InstructioninstructionAt (UIntWord address) const
 
const InstructionnextInstruction (const Instruction &) const
 
InstructionlastInstruction () const
 
InstructionReferenceManagerinstructionReferenceManager ()
 
- Public Member Functions inherited from TTAProgram::Program
 Program (const TTAMachine::AddressSpace &space)
 
 Program (const TTAMachine::AddressSpace &space, Address start)
 
 Program (const TTAMachine::AddressSpace &space, Address start, Address entry)
 
virtual ~Program ()
 
GlobalScopeglobalScope ()
 
const GlobalScopeglobalScopeConst () const
 
TTAMachine::MachinetargetProcessor () const
 
UniversalMachineuniversalMachine () const
 
void setUniversalMachine (UniversalMachine *umach)
 
Address startAddress () const
 
void setStartAddress (Address start)
 
Address entryAddress () const
 
void setEntryAddress (Address address)
 
void addProcedure (Procedure *proc)
 
void addInstruction (Instruction *ins)
 
void moveProcedure (Procedure &proc, int howMuch)
 
ProcedurefirstProcedure () const
 
ProcedurelastProcedure () const
 
ProcedurenextProcedure (const Procedure &proc) const
 
int procedureCount () const
 
Procedureprocedure (int index) const
 
Procedureoperator[] (size_t index)
 
Procedureprocedure (const std::string &name) const
 
bool hasProcedure (const std::string &name) const
 
InstructionfirstInstruction () const
 
InstructioninstructionAt (InstructionAddress address) const
 
int instructionCount () const
 
const MovemoveAt (int number) const
 
int moveCount () const
 
const ProcedureprocedureAtIndex (int index) const
 
InstructionnextInstruction (const Instruction &) const
 
InstructionlastInstruction () const
 
InstructionReferenceManagerinstructionReferenceManager () const
 
Programoperator= (const Program &old)
 
Programcopy () const
 
void removeProcedure (Procedure &proc)
 
int dataMemoryCount () const
 
DataMemorydataMemory (int index) const
 
DataMemorydataMemory (const std::string &aSpaceName) const
 
void addDataMemory (DataMemory *dataMem)
 
void replaceUniversalAddressSpaces (const TTAMachine::AddressSpace &space)
 
InstructionVector instructionVector () const
 
void link (const TTAProgram::Program &other)
 
void convertSymbolRefsToInsRefs (bool ignoreUnfoundSymbols=false)
 
void fixInstructionReferences ()
 
TCEString toString () const
 
void finalize ()
 
bool isFinalized () const
 
bool isInstructionPerAddress () const
 

Static Public Member Functions

static NullPrograminstance ()
 
- Static Public Member Functions inherited from TTAProgram::Program
static ProgramloadFromUnscheduledTPEF (const std::string &tpefFileName, const TTAMachine::Machine &theMachine)
 
static ProgramloadFromTPEF (const std::string &tpefFileName, const TTAMachine::Machine &theMachine)
 
static ProgramloadFromUnscheduledTPEF (const std::string &tpefFileName)
 
static void writeToTPEF (const TTAProgram::Program &program, const std::string &tpefFileName)
 

Protected Member Functions

 NullProgram ()
 

Private Member Functions

 NullProgram (const NullProgram &)
 Copying not allowed. More...
 
NullProgramoperator= (const NullProgram &)
 Assignment not allowed. More...
 

Static Private Attributes

static NullProgram instance_
 Unique instance of NullProgram. More...
 

Additional Inherited Members

- Public Types inherited from TTAProgram::Program
typedef std::vector< Instruction * > InstructionVector
 Vector for instructions. More...
 

Detailed Description

A singleton class that represents a null program.

Calling any method causes the program to abort.

Definition at line 45 of file NullProgram.hh.

Constructor & Destructor Documentation

◆ ~NullProgram()

TTAProgram::NullProgram::~NullProgram ( )
virtual

The destructor.

Definition at line 63 of file NullProgram.cc.

63  {
64 }

◆ NullProgram() [1/2]

TTAProgram::NullProgram::NullProgram ( )
protected

The constructor.

Definition at line 55 of file NullProgram.cc.

55  :
56  Program(
57  NullAddressSpace::instance(), NullAddress::instance()) {
58 }

◆ NullProgram() [2/2]

TTAProgram::NullProgram::NullProgram ( const NullProgram )
private

Copying not allowed.

Member Function Documentation

◆ addInstruction()

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

Aborts program with error log message.

Exceptions
IllegalRegistrationnever.

Definition at line 150 of file NullProgram.cc.

150  {
151  abortWithError("addInstruction()");
152 }

References abortWithError.

◆ addProcedure()

void TTAProgram::NullProgram::addProcedure ( Procedure proc)

Aborts program with error log message.

Exceptions
IllegalRegistrationnever.

Definition at line 140 of file NullProgram.cc.

140  {
141  abortWithError("addProcedure()");
142 }

References abortWithError.

◆ entryAddress()

Address TTAProgram::NullProgram::entryAddress ( ) const

Aborts program with error log message.

Returns
A null address.

Definition at line 121 of file NullProgram.cc.

121  {
122  abortWithError("entryAddress()");
123  return NullAddress::instance();
124 }

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

Here is the call graph for this function:

◆ firstInstruction()

Instruction & TTAProgram::NullProgram::firstInstruction ( ) const

Aborts program with error log message.

Exceptions
InstanceNotFoundnever.
Returns
Nothing.

Definition at line 239 of file NullProgram.cc.

239  {
240  abortWithError("firstInstruction()");
241  return NullInstruction::instance();
242 }

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

Here is the call graph for this function:

◆ firstProcedure()

Procedure & TTAProgram::NullProgram::firstProcedure ( ) const

Aborts program with error log message.

Exceptions
InstanceNotFoundnever.
Returns
Nothing.

Definition at line 169 of file NullProgram.cc.

169  {
170  abortWithError("firstProcedure()");
171  return NullProcedure::instance();
172 }

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

Here is the call graph for this function:

◆ globalScope()

GlobalScope & TTAProgram::NullProgram::globalScope ( )

Aborts program with error log message.

Returns
Nothing.

Definition at line 82 of file NullProgram.cc.

82  {
83  abortWithError("globalScope()");
85 }

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

Here is the call graph for this function:

◆ globalScopeConst()

const GlobalScope & TTAProgram::NullProgram::globalScopeConst ( ) const

Definition at line 88 of file NullProgram.cc.

88  {
89  abortWithError("globalScopeConst()");
91 }

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

Here is the call graph for this function:

◆ instance()

NullProgram & TTAProgram::NullProgram::instance ( )
static

Returns an instance of NullProgram class (singleton).

Returns
Singleton instance of NullProgram class.

Definition at line 72 of file NullProgram.cc.

72  {
73  return instance_;
74 }

References instance_.

Referenced by ProgramGraph::generateProgram(), TTAProgram::CodeSnippet::isInProgram(), loadInputs(), TTAProgram::NullProcedure::parent(), ProximToolbox::program(), TTAProgram::Program::removeProcedure(), and TTAProgram::CodeSnippet::setParent().

◆ instructionAt()

const Instruction & TTAProgram::NullProgram::instructionAt ( UIntWord  address) const

Aborts program with error log message.

Returns
A null instruction.
Exceptions
KeyNotFoundnever.

Definition at line 251 of file NullProgram.cc.

251  {
252  abortWithError("instructionAt()");
253  return NullInstruction::instance();
254 }

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

Here is the call graph for this function:

◆ instructionReferenceManager()

InstructionReferenceManager & TTAProgram::NullProgram::instructionReferenceManager ( )

Aborts program with error log message.

Returns
Nothing.

Definition at line 285 of file NullProgram.cc.

285  {
286  abortWithError("instructionReferenceManager()");
288 }

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

Here is the call graph for this function:

◆ lastInstruction()

Instruction & TTAProgram::NullProgram::lastInstruction ( ) const

Aborts program with error log message.

Exceptions
InstanceNotFoundnever.
Returns
Nothing.

Definition at line 274 of file NullProgram.cc.

274  {
275  abortWithError("lastInstruction()");
276  return NullInstruction::instance();
277 }

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

Here is the call graph for this function:

◆ lastProcedure()

Procedure & TTAProgram::NullProgram::lastProcedure ( ) const

Aborts program with error log message.

Exceptions
InstanceNotFoundnever.
Returns
Nothing.

Definition at line 181 of file NullProgram.cc.

181  {
182  abortWithError("lastProcedure()");
183  return NullProcedure::instance();
184 }

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

Here is the call graph for this function:

◆ nextInstruction()

const Instruction & TTAProgram::NullProgram::nextInstruction ( const Instruction ) const

Aborts program with error log message.

Returns
A null instruction.

Definition at line 262 of file NullProgram.cc.

262  {
263  abortWithError("nextInstruction()");
264  return NullInstruction::instance();
265 }

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

Here is the call graph for this function:

◆ nextProcedure()

Procedure & TTAProgram::NullProgram::nextProcedure ( const Procedure proc) const

Aborts program with error log message.

Returns
Nothing.

Definition at line 192 of file NullProgram.cc.

192  {
193  abortWithError("nextProcedure()");
194  return NullProcedure::instance();
195 }

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

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.

◆ procedure() [1/2]

Procedure & TTAProgram::NullProgram::procedure ( const std::string &  name) const

Aborts program with error log message.

Exceptions
KeyNotFoundnever.
Returns
Nothing.

Definition at line 227 of file NullProgram.cc.

227  {
228  abortWithError("procedure()");
229  return NullProcedure::instance();
230 }

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

Here is the call graph for this function:

◆ procedure() [2/2]

Procedure & TTAProgram::NullProgram::procedure ( int  index) const

Aborts program with error log message.

Returns
a null procedure.
Exceptions
OutOfRangenever.

Definition at line 215 of file NullProgram.cc.

215  {
216  abortWithError("addInstruction()");
217  return NullProcedure::instance();
218 }

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

Here is the call graph for this function:

◆ procedureCount()

int TTAProgram::NullProgram::procedureCount ( ) const

Aborts program with error log message.

Returns
-1.

Definition at line 203 of file NullProgram.cc.

203  {
204  abortWithError("addInstruction()");
205  return -1;
206 }

References abortWithError.

◆ relocate()

void TTAProgram::NullProgram::relocate ( const Procedure proc,
UIntWord  howMuch 
)

Aborts program with error log message.

Definition at line 158 of file NullProgram.cc.

158  {
159  abortWithError("relocate()");
160 }

References abortWithError.

◆ setEntryAddress()

void TTAProgram::NullProgram::setEntryAddress ( Address  address)

Aborts program with error log message.

Definition at line 130 of file NullProgram.cc.

130  {
131  abortWithError("setEntryAddress()");
132 }

References abortWithError.

◆ startAddress()

Address TTAProgram::NullProgram::startAddress ( ) const

Aborts program with error log message.

Returns
A null address.

Definition at line 110 of file NullProgram.cc.

110  {
111  abortWithError("startAddress()");
112  return NullAddress::instance();
113 }

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

Here is the call graph for this function:

◆ targetProcessor()

TTAMachine::Machine & TTAProgram::NullProgram::targetProcessor ( ) const

Aborts program with error log message.

Returns
Nothing

Definition at line 100 of file NullProgram.cc.

100  {
101  abortWithError("targetProcessor()");
103 }

References abortWithError, and TTAMachine::NullMachine::instance().

Here is the call graph for this function:

Member Data Documentation

◆ instance_

NullProgram TTAProgram::NullProgram::instance_
staticprivate

Unique instance of NullProgram.

Definition at line 88 of file NullProgram.hh.

Referenced by instance().


The documentation for this class was generated from the following files:
TTAProgram::NullProgram::instance_
static NullProgram instance_
Unique instance of NullProgram.
Definition: NullProgram.hh:88
TTAProgram::NullProcedure::instance
static NullProcedure & instance()
Definition: NullProcedure.cc:68
TTAProgram::NullGlobalScope::instance
static NullGlobalScope & instance()
Definition: NullGlobalScope.cc:64
TTAProgram::NullAddress::instance
static NullAddress & instance()
Definition: NullAddress.cc:65
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
TTAProgram::NullInstructionReferenceManager::instance
static NullInstructionReferenceManager & instance()
Definition: NullInstructionReferenceManager.cc:63
TTAProgram::NullInstruction::instance
static NullInstruction & instance()
Definition: NullInstruction.cc:66
TTAProgram::Program::Program
Program(const TTAMachine::AddressSpace &space)
Definition: Program.cc:91
TTAMachine::NullMachine::instance
static NullMachine & instance()
Definition: NullMachine.cc:60