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

#include <Operand.hh>

Inheritance diagram for NullOperand:
Inheritance graph
Collaboration diagram for NullOperand:
Collaboration graph

Public Member Functions

virtual ~NullOperand ()
 
virtual int index () const
 
virtual bool isInput () const
 
virtual bool isOutput () const
 
virtual bool isAddress () const
 
virtual bool isMemoryData () const
 
virtual bool canSwap (const Operand &op) const
 
virtual const std::set< int > & swap () const
 
virtual bool isNull () const
 
- Public Member Functions inherited from Operand
 Operand (bool isInput)
 
 Operand (bool isInput, int index, OperandType type)
 
 Operand (const Operand &op)
 
virtual ~Operand ()
 
virtual OperandType type () const
 
virtual void setType (OperandType type)
 
virtual const std::string & typeString () const
 
virtual TCEString CTypeString () const
 
virtual bool isVector () const
 
virtual int elementWidth () const
 
virtual void setElementWidth (int elementWidth)
 
virtual int elementCount () const
 
virtual void setElementCount (int elementCount)
 
virtual int width () const
 
virtual int memoryUnits () const
 
virtual void loadState (const ObjectState *state)
 
virtual ObjectStatesaveState () const
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static NullOperandinstance ()
 
- Static Public Member Functions inherited from Operand
static int defaultElementWidth (OperandType type)
 

Private Member Functions

 NullOperand ()
 
NullOperandoperator= (const NullOperand &)
 Assignment not allowed. More...
 

Private Attributes

std::set< int > swap_
 Needed for one method, always empty. More...
 

Static Private Attributes

static NullOperandinstance_ = NULL
 Unique instance. More...
 

Additional Inherited Members

- Public Types inherited from Operand
enum  OperandType {
  SINT_WORD, UINT_WORD, FLOAT_WORD, DOUBLE_WORD,
  HALF_FLOAT_WORD, BOOL, RAW_DATA, SLONG_WORD,
  ULONG_WORD
}
 
- Static Public Attributes inherited from Operand
static const std::string SLONG_WORD_STRING = "SLongWord"
 
static const std::string ULONG_WORD_STRING = "ULongWord"
 
static const std::string SINT_WORD_STRING = "SIntWord"
 
static const std::string UINT_WORD_STRING = "UIntWord"
 
static const std::string HALF_FLOAT_WORD_STRING = "HalfFloatWord"
 
static const std::string FLOAT_WORD_STRING = "FloatWord"
 
static const std::string DOUBLE_WORD_STRING = "DoubleWord"
 
static const std::string BOOL_STRING = "Bool"
 
static const std::string RAW_DATA_STRING = "RawData"
 
static const std::string UNKNOWN_TYPE_STRING = "InvalidValue"
 
static const std::string OPRND_ID = "id"
 Object state name for operand id. More...
 
static const std::string OPRND_TYPE = "type"
 Object state name for operand type. More...
 
static const std::string OPRND_MEM_ADDRESS = "mem-address"
 Object state name for memory address. More...
 
static const std::string OPRND_MEM_UNITS = "mem-units"
 Object state name for memory unit count. More...
 
static const std::string OPRND_MEM_DATA = "mem-data"
 Object state name for memory data. More...
 
static const std::string OPRND_CAN_SWAP = "can-swap"
 Object state name for can swap. More...
 
static const std::string OPRND_IN = "in"
 Object state name for input operand. More...
 
static const std::string OPRND_OUT = "out"
 Object state name for output operand. More...
 
static const std::string OPRND_ELEM_WIDTH = "element-width"
 Object state name for element width. More...
 
static const std::string OPRND_ELEM_COUNT = "element-count"
 Object state name for element count. More...
 

Detailed Description

Singleton class that is used to represent a null operand.

All methods cause program abort with an error log message.

Definition at line 170 of file Operand.hh.

Constructor & Destructor Documentation

◆ ~NullOperand()

NullOperand::~NullOperand ( )
virtual

Destructor.

Definition at line 584 of file Operand.cc.

584  {
585 }

◆ NullOperand()

NullOperand::NullOperand ( )
private

Constructor.

Definition at line 578 of file Operand.cc.

578  : Operand(false) {
579 }

Member Function Documentation

◆ canSwap()

bool NullOperand::canSwap ( const Operand op) const
virtual

Aborts the program with error message.

Returns
false.

Reimplemented from Operand.

Definition at line 659 of file Operand.cc.

659  {
660  abortWithError("canSwap()");
661  return false;
662 }

References abortWithError.

◆ index()

int NullOperand::index ( ) const
virtual

Aborts program with error log message.

Returns
0.

Reimplemented from Operand.

Definition at line 593 of file Operand.cc.

593  {
594  abortWithError("index()");
595  return 0;
596 }

References abortWithError.

◆ instance()

static NullOperand& NullOperand::instance ( )
static

◆ isAddress()

bool NullOperand::isAddress ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operand.

Definition at line 626 of file Operand.cc.

626  {
627  abortWithError("isAddress()");
628  return false;
629 }

References abortWithError.

◆ isInput()

bool NullOperand::isInput ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operand.

Definition at line 604 of file Operand.cc.

604  {
605  abortWithError("isInput()");
606  return 0;
607 }

References abortWithError.

◆ isMemoryData()

bool NullOperand::isMemoryData ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operand.

Definition at line 637 of file Operand.cc.

637  {
638  abortWithError("isMemoryData()");
639  return false;
640 }

References abortWithError.

◆ isNull()

virtual bool NullOperand::isNull ( ) const
inlinevirtual

Reimplemented from Operand.

Definition at line 183 of file Operand.hh.

183 { return true; }

◆ isOutput()

bool NullOperand::isOutput ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operand.

Definition at line 615 of file Operand.cc.

615  {
616  abortWithError("isOutput()");
617  return 0;
618 }

References abortWithError.

◆ operator=()

NullOperand& NullOperand::operator= ( const NullOperand )
private

Assignment not allowed.

◆ swap()

const set< int > & NullOperand::swap ( ) const
virtual

Aborts program with error log message.

Returns
An empty vector.

Reimplemented from Operand.

Definition at line 648 of file Operand.cc.

648  {
649  abortWithError("swap()");
650  return swap_;
651 }

References abortWithError, and swap_.

Member Data Documentation

◆ instance_

NullOperand * NullOperand::instance_ = NULL
staticprivate

Unique instance.

Definition at line 191 of file Operand.hh.

◆ swap_

std::set<int> NullOperand::swap_
private

Needed for one method, always empty.

Definition at line 194 of file Operand.hh.

Referenced by swap().


The documentation for this class was generated from the following files:
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
Operand::Operand
Operand(bool isInput)
Definition: Operand.cc:75
NullOperand::swap_
std::set< int > swap_
Needed for one method, always empty.
Definition: Operand.hh:194