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

#include <ConstantNode.hh>

Inheritance diagram for ConstantNode:
Inheritance graph
Collaboration diagram for ConstantNode:
Collaboration graph

Public Member Functions

 ConstantNode (long value)
 
 ConstantNode (const ConstantNode &other)
 
virtual ~ConstantNode ()
 
virtual GraphNodeclone () const
 
virtual long value () const
 
virtual std::string toString () const
 
- Public Member Functions inherited from OperationDAGNode
virtual ~OperationDAGNode ()
 
- Public Member Functions inherited from GraphNode
 GraphNode (int nodeID)
 
 GraphNode ()
 
virtual ~GraphNode ()
 
int nodeID () const
 
virtual std::string dotString () const
 

Private Attributes

long value_
 

Detailed Description

Constant input (not listed in IOs) node of the operation DAG.

Definition at line 43 of file ConstantNode.hh.

Constructor & Destructor Documentation

◆ ConstantNode() [1/2]

ConstantNode::ConstantNode ( long  value)

Constructor.

Definition at line 39 of file ConstantNode.cc.

39  :

Referenced by clone().

◆ ConstantNode() [2/2]

ConstantNode::ConstantNode ( const ConstantNode other)

Cpoy constructor.

Definition at line 45 of file ConstantNode.cc.

45  :
46  OperationDAGNode(), value_(other.value()) {}

◆ ~ConstantNode()

virtual ConstantNode::~ConstantNode ( )
inlinevirtual

Definition at line 50 of file ConstantNode.hh.

50 {}

Member Function Documentation

◆ clone()

GraphNode * ConstantNode::clone ( ) const
virtual

Clones node. Needed for dynamic binding, when copying instances through the base class.

Returns
Dynamically allocated copy of the node.

Reimplemented from GraphNode.

Definition at line 55 of file ConstantNode.cc.

55  {
56  return new ConstantNode(*this);
57 }

References ConstantNode().

Here is the call graph for this function:

◆ toString()

std::string ConstantNode::toString ( ) const
virtual

Returns a node description as a string.

Used for printing graph into .dot file. This is used for a label in the default dotString() implementation.

Returns
The node ID as a string.

Reimplemented from GraphNode.

Definition at line 65 of file ConstantNode.cc.

65  {
66  return "(" + Conversion::toString(value_) + ")";
67 }

References Conversion::toString(), and value_.

Referenced by OperationDAGConverter::writeNode().

Here is the call graph for this function:

◆ value()

long ConstantNode::value ( ) const
virtual

Definition at line 60 of file ConstantNode.cc.

60  {
61  return value_;
62 }

References value_.

Referenced by FUGen::constantName(), TDGen::constantNodeString(), and OperationDAGBehavior::OperationDAGBehavior().

Member Data Documentation

◆ value_

long ConstantNode::value_
private

Definition at line 59 of file ConstantNode.hh.

Referenced by toString(), and value().


The documentation for this class was generated from the following files:
Conversion::toString
static std::string toString(const T &source)
OperationDAGNode
Definition: OperationDAGNode.hh:45
ConstantNode::ConstantNode
ConstantNode(long value)
Definition: ConstantNode.cc:39
ConstantNode::value
virtual long value() const
Definition: ConstantNode.cc:60
ConstantNode::value_
long value_
Definition: ConstantNode.hh:59