OpenASIP  2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
TTAMachine::NullInstructionTemplate Class Reference

#include <NullInstructionTemplate.hh>

Inheritance diagram for TTAMachine::NullInstructionTemplate:
Inheritance graph
Collaboration diagram for TTAMachine::NullInstructionTemplate:
Collaboration graph

Public Member Functions

virtual TCEString name () const
 
virtual void setName (const std::string &name)
 
virtual void addSlot (const std::string &slotName, int width, ImmediateUnit &dstUnit)
 
virtual void removeSlot (const std::string &slotName)
 
virtual void removeSlots (const ImmediateUnit &dstUnit)
 
virtual int slotCount () const
 
virtual TemplateSlotslot (int index) const
 
virtual bool usesSlot (const std::string &slotName) const
 
virtual bool destinationUsesSlot (const std::string &slotName, const ImmediateUnit &dstUnit) const
 
virtual int numberOfDestinations () const
 
virtual bool isOneOfDestinations (const ImmediateUnit &dstUnit) const
 
virtual ImmediateUnitdestinationOfSlot (const std::string &slotName) const
 
virtual int numberOfSlots (const ImmediateUnit &dstUnit) const
 
virtual std::string slotOfDestination (const ImmediateUnit &dstUnit, int index) const
 
virtual int supportedWidth () const
 
virtual int supportedWidth (const ImmediateUnit &dstUnit) const
 
virtual int supportedWidth (const std::string &slotName) const
 
virtual bool isEmpty () const
 
virtual void setMachine (Machine &machine)
 
virtual void unsetMachine ()
 
virtual Machinemachine () const
 
virtual void ensureRegistration (const Component &component) const
 
virtual bool isRegistered () const
 
virtual ObjectStatesaveState () const
 
virtual void loadState (const ObjectState *state)
 
- Public Member Functions inherited from TTAMachine::InstructionTemplate
 InstructionTemplate (const std::string &name, Machine &owner)
 
 InstructionTemplate (const ObjectState *state, Machine &owner)
 
virtual ~InstructionTemplate ()
 
TemplateSlottemplateSlot (const std::string &slotName) const
 
- Public Member Functions inherited from TTAMachine::Component
virtual ~Component ()
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static NullInstructionTemplateinstance ()
 

Private Member Functions

 NullInstructionTemplate ()
 
virtual ~NullInstructionTemplate ()
 

Static Private Attributes

static NullInstructionTemplate instance_
 The only instance of NullInstructionTemplate. More...
 
static Machine machine_
 Machine to which the null instruction template is registered. More...
 

Additional Inherited Members

- Static Public Attributes inherited from TTAMachine::InstructionTemplate
static const std::string OSNAME_INSTRUCTION_TEMPLATE = "i_template"
 ObjectState name for instruction template. More...
 
- Static Public Attributes inherited from TTAMachine::Component
static const std::string OSNAME_COMPONENT = "component"
 ObjectState name for component. More...
 
static const std::string OSKEY_NAME = "name"
 ObjectState attribute key for the name of the component. More...
 
- Protected Member Functions inherited from TTAMachine::Component
 Component (const std::string &name)
 
 Component (const ObjectState *state)
 
void internalSetMachine (Machine &machine)
 
void internalUnsetMachine ()
 
- Protected Member Functions inherited from TTAMachine::MachinePart
 MachinePart ()
 
virtual ~MachinePart ()
 

Detailed Description

A singleton class which represents a null InstructionTemplate.

All the methods abort the program.

Definition at line 45 of file NullInstructionTemplate.hh.

Constructor & Destructor Documentation

◆ NullInstructionTemplate()

TTAMachine::NullInstructionTemplate::NullInstructionTemplate ( )
private

The constructor.

Definition at line 44 of file NullInstructionTemplate.cc.

44  :
45  InstructionTemplate("NULL", machine_) {
46 }

◆ ~NullInstructionTemplate()

TTAMachine::NullInstructionTemplate::~NullInstructionTemplate ( )
privatevirtual

The destructor.

Definition at line 52 of file NullInstructionTemplate.cc.

52  {
53 }

Member Function Documentation

◆ addSlot()

void TTAMachine::NullInstructionTemplate::addSlot ( const std::string &  slotName,
int  width,
ImmediateUnit dstUnit 
)
virtual

Aborts the program with error message.

Exceptions
InstanceNotFoundNever thrown.
ComponentAlreadyExistsNever thrown.
OutOfRangeNever thrown.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 98 of file NullInstructionTemplate.cc.

98  {
99  abortWithError("addSlot()");
100 }

References abortWithError.

◆ destinationOfSlot()

ImmediateUnit * TTAMachine::NullInstructionTemplate::destinationOfSlot ( const std::string &  slotName) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 201 of file NullInstructionTemplate.cc.

201  {
202  abortWithError("destinationOfSlot()");
203  return NULL;
204 }

References abortWithError.

◆ destinationUsesSlot()

bool TTAMachine::NullInstructionTemplate::destinationUsesSlot ( const std::string &  slotName,
const ImmediateUnit dstUnit 
) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 162 of file NullInstructionTemplate.cc.

164  {
165 
166  abortWithError("destinationUsesSlot()");
167  return false;
168 }

References abortWithError.

◆ ensureRegistration()

void TTAMachine::NullInstructionTemplate::ensureRegistration ( const Component component) const
virtual

Aborts the program with error message.

Exceptions
IllegalRegistrationNever thrown.

Reimplemented from TTAMachine::Component.

Definition at line 314 of file NullInstructionTemplate.cc.

314  {
315  abortWithError("ensureRegistration()");
316 }

References abortWithError.

◆ instance()

NullInstructionTemplate & TTAMachine::NullInstructionTemplate::instance ( )
static

◆ isEmpty()

bool TTAMachine::NullInstructionTemplate::isEmpty ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 271 of file NullInstructionTemplate.cc.

271  {
272  abortWithError("isEmpty()");
273  return false;
274 }

References abortWithError.

◆ isOneOfDestinations()

bool TTAMachine::NullInstructionTemplate::isOneOfDestinations ( const ImmediateUnit dstUnit) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 189 of file NullInstructionTemplate.cc.

189  {
190  abortWithError("isOneOfDestinations()");
191  return false;
192 }

References abortWithError.

◆ isRegistered()

bool TTAMachine::NullInstructionTemplate::isRegistered ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Component.

Definition at line 324 of file NullInstructionTemplate.cc.

324  {
325  abortWithError("isRegistered()");
326  return false;
327 }

References abortWithError.

◆ loadState()

void TTAMachine::NullInstructionTemplate::loadState ( const ObjectState state)
virtual

Aborts the program with error message.

Exceptions
ObjectStateLoadingExceptionNever thrown.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 347 of file NullInstructionTemplate.cc.

347  {
348  abortWithError("loadState()");
349 }

References abortWithError.

◆ machine()

Machine * TTAMachine::NullInstructionTemplate::machine ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Component.

Definition at line 302 of file NullInstructionTemplate.cc.

302  {
303  abortWithError("machine()");
304  return NULL;
305 }

References abortWithError.

◆ name()

TCEString TTAMachine::NullInstructionTemplate::name ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Component.

Definition at line 73 of file NullInstructionTemplate.cc.

73  {
74  abortWithError("name()");
75  return "";
76 }

References abortWithError.

◆ numberOfDestinations()

int TTAMachine::NullInstructionTemplate::numberOfDestinations ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 177 of file NullInstructionTemplate.cc.

177  {
178  abortWithError("numberOfDestinations()");
179  return 0;
180 }

References abortWithError.

◆ numberOfSlots()

int TTAMachine::NullInstructionTemplate::numberOfSlots ( const ImmediateUnit dstUnit) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 212 of file NullInstructionTemplate.cc.

212  {
213  abortWithError("numberOfSlots()");
214  return 0;
215 }

References abortWithError.

◆ removeSlot()

void TTAMachine::NullInstructionTemplate::removeSlot ( const std::string &  slotName)
virtual

Aborts the program with error message.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 106 of file NullInstructionTemplate.cc.

106  {
107  abortWithError("removeSlot()");
108 }

References abortWithError.

◆ removeSlots()

void TTAMachine::NullInstructionTemplate::removeSlots ( const ImmediateUnit dstUnit)
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 117 of file NullInstructionTemplate.cc.

117  {
118  abortWithError("removeSlots()");
119 }

References abortWithError.

◆ saveState()

ObjectState * TTAMachine::NullInstructionTemplate::saveState ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 335 of file NullInstructionTemplate.cc.

335  {
336  abortWithError("saveState()");
337  return NULL;
338 }

References abortWithError.

◆ setMachine()

void TTAMachine::NullInstructionTemplate::setMachine ( Machine machine)
virtual

Aborts the program with error message.

Exceptions
ComponentAlreadyExistsNever thrown.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 283 of file NullInstructionTemplate.cc.

283  {
284  abortWithError("setMachine()");
285 }

References abortWithError.

◆ setName()

void TTAMachine::NullInstructionTemplate::setName ( const std::string &  name)
virtual

Aborts the program with error message.

Exceptions
ComponentAlreadyExistsNever thrown.
InvalidNameNever thrown.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 86 of file NullInstructionTemplate.cc.

86  {
87  abortWithError("setName()");
88 }

References abortWithError.

◆ slot()

TemplateSlot * TTAMachine::NullInstructionTemplate::slot ( int  index) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 138 of file NullInstructionTemplate.cc.

138  {
139  abortWithError("slot()");
140  return NULL;
141 }

References abortWithError.

◆ slotCount()

int TTAMachine::NullInstructionTemplate::slotCount ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 127 of file NullInstructionTemplate.cc.

127  {
128  abortWithError("slotCount()");
129  return -1;
130 }

References abortWithError.

◆ slotOfDestination()

std::string TTAMachine::NullInstructionTemplate::slotOfDestination ( const ImmediateUnit dstUnit,
int  index 
) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 224 of file NullInstructionTemplate.cc.

224  {
225  abortWithError("slotOfDestination()");
226  return NULL;
227 }

References abortWithError.

◆ supportedWidth() [1/3]

int TTAMachine::NullInstructionTemplate::supportedWidth ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 235 of file NullInstructionTemplate.cc.

235  {
236  abortWithError("supportedWidth()");
237  return 0;
238 }

References abortWithError.

◆ supportedWidth() [2/3]

int TTAMachine::NullInstructionTemplate::supportedWidth ( const ImmediateUnit dstUnit) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 247 of file NullInstructionTemplate.cc.

247  {
248  abortWithError("supportedWidth()");
249  return 0;
250 }

References abortWithError.

◆ supportedWidth() [3/3]

int TTAMachine::NullInstructionTemplate::supportedWidth ( const std::string &  slotName) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 259 of file NullInstructionTemplate.cc.

259  {
260  abortWithError("supportedWidth()");
261  return 0;
262 }

References abortWithError.

◆ unsetMachine()

void TTAMachine::NullInstructionTemplate::unsetMachine ( )
virtual

Aborts the program with error message.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 291 of file NullInstructionTemplate.cc.

291  {
292  abortWithError("unsetMachine()");
293 }

References abortWithError.

◆ usesSlot()

bool TTAMachine::NullInstructionTemplate::usesSlot ( const std::string &  slotName) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::InstructionTemplate.

Definition at line 150 of file NullInstructionTemplate.cc.

150  {
151  abortWithError("usesSlot()");
152  return false;
153 }

References abortWithError.

Member Data Documentation

◆ instance_

NullInstructionTemplate TTAMachine::NullInstructionTemplate::instance_
staticprivate

The only instance of NullInstructionTemplate.

Definition at line 93 of file NullInstructionTemplate.hh.

Referenced by instance().

◆ machine_

Machine TTAMachine::NullInstructionTemplate::machine_
staticprivate

Machine to which the null instruction template is registered.

Definition at line 95 of file NullInstructionTemplate.hh.


The documentation for this class was generated from the following files:
TTAMachine::NullInstructionTemplate::instance_
static NullInstructionTemplate instance_
The only instance of NullInstructionTemplate.
Definition: NullInstructionTemplate.hh:93
TTAMachine::InstructionTemplate::InstructionTemplate
InstructionTemplate(const std::string &name, Machine &owner)
Definition: InstructionTemplate.cc:69
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
TTAMachine::NullInstructionTemplate::machine_
static Machine machine_
Machine to which the null instruction template is registered.
Definition: NullInstructionTemplate.hh:95