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

#include <NullInstructionField.hh>

Inheritance diagram for NullInstructionField:
Inheritance graph
Collaboration diagram for NullInstructionField:
Collaboration graph

Public Member Functions

virtual int childFieldCount () const
 
virtual InstructionFieldchildField (int position) const
 
virtual int width () const
 
- Public Member Functions inherited from InstructionField
virtual ~InstructionField ()
 
InstructionFieldparent () const
 
int bitPosition () const
 
int relativePosition () const
 
virtual void setRelativePosition (int position)
 
void setExtraBits (int bits)
 
int extraBits () const
 
virtual void loadState (const ObjectState *state)
 
virtual ObjectStatesaveState () const
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static NullInstructionFieldinstance ()
 

Private Member Functions

 NullInstructionField ()
 
virtual ~NullInstructionField ()
 

Static Private Attributes

static NullInstructionField instance_
 The only instance. More...
 

Additional Inherited Members

- Static Public Attributes inherited from InstructionField
static const std::string OSNAME_INSTRUCTION_FIELD = "instr_field"
 ObjectState name for instruction field. More...
 
static const std::string OSKEY_EXTRA_BITS = "extra_bits"
 ObjectState attribute key for the number of extra bits. More...
 
static const std::string OSKEY_POSITION = "position"
 ObjectState attribute key for the relative position of the field. More...
 
- Protected Member Functions inherited from InstructionField
 InstructionField (InstructionField *parent)
 
 InstructionField (const ObjectState *state, InstructionField *parent)
 
void setParent (InstructionField *parent)
 
- Static Protected Member Functions inherited from InstructionField
static void reorderSubfields (ObjectState *state)
 

Detailed Description

A null version of instruction field.

Definition at line 41 of file NullInstructionField.hh.

Constructor & Destructor Documentation

◆ NullInstructionField()

NullInstructionField::NullInstructionField ( )
private

The constructor.

Definition at line 45 of file NullInstructionField.cc.

45  : InstructionField(NULL) {
46 }

◆ ~NullInstructionField()

NullInstructionField::~NullInstructionField ( )
privatevirtual

The destructor.

Definition at line 52 of file NullInstructionField.cc.

52  {
53 }

Member Function Documentation

◆ childField()

InstructionField & NullInstructionField::childField ( int  position) const
virtual

Always throws OutOfRange exception.

Returns
Never returns.
Exceptions
OutOfRangeAlways thrown.

Reimplemented from InstructionField.

Definition at line 85 of file NullInstructionField.cc.

85  {
86  const string procName = "NullInstructionField::childField";
87  throw OutOfRange(__FILE__, __LINE__, procName);
88 }

◆ childFieldCount()

int NullInstructionField::childFieldCount ( ) const
virtual

Always returns 0.

Returns
0.

Implements InstructionField.

Definition at line 73 of file NullInstructionField.cc.

73  {
74  return 0;
75 }

◆ instance()

NullInstructionField & NullInstructionField::instance ( )
static

Returns the only instance of NullInstructionField.

Returns
The only instance of NullInstructionField.

Definition at line 62 of file NullInstructionField.cc.

62  {
63  return instance_;
64 }

References instance_.

Referenced by InstructionField::childField(), MoveSlot::childField(), BinaryEncoding::childField(), and InstructionField::setRelativePosition().

◆ width()

int NullInstructionField::width ( ) const
virtual

Always returns 0.

Returns
0.

Implements InstructionField.

Definition at line 96 of file NullInstructionField.cc.

96  {
97  return 0;
98 }

Member Data Documentation

◆ instance_

NullInstructionField NullInstructionField::instance_
staticprivate

The only instance.

Definition at line 54 of file NullInstructionField.hh.

Referenced by instance().


The documentation for this class was generated from the following files:
OutOfRange
Definition: Exception.hh:320
NullInstructionField::instance_
static NullInstructionField instance_
The only instance.
Definition: NullInstructionField.hh:54
InstructionField::InstructionField
InstructionField(InstructionField *parent)
Definition: InstructionField.cc:56