PortId Class Reference

#include <corenodes_helpers.h>

Inheritance diagram for PortId:

详细描述

A PortId identifies a port of a core node or micro node (see CoreNodeBaseInterface ). It can be given either by a port name or by a port index. The subclasses InPortId and OutPortId have to be used unless the code shall be generic in the port direction.

公共成员函数

Bool   IsIndex () const
Bool   IsName () const
Bool   IsPopulated () const
Bool   IsEmpty () const
Int   GetIndex () const
const Id GetName () const
PORT_DIR   GetDirection () const
  PortId ( PORT_DIR dir, const Id &name)
  PortId ( PORT_DIR dir, Int index)
  PortId ( PORT_DIR dir)
String   ToString (const FormatStatement *fs=nullptr) const

Protected Attributes

Int   _indexDir
Id   _name

构造函数 & 析构函数文档编制

◆  PortId() [1/3]

PortId ( PORT_DIR   dir ,
const Id name  
)

Constructs a new PortId given by a port name.

参数
[in] dir The port direction.
[in] name The port name to use for the PortId .

◆  PortId() [2/3]

PortId ( PORT_DIR   dir ,
Int   index  
)

Constructs a new PortId given by a port index.

参数
[in] dir The port direction.
[in] index The port index to use for the PortId .

◆  PortId() [3/3]

PortId ( PORT_DIR   dir )
explicit

Constructs an empty PortId of the given direction.

参数
[in] dir The port direction.

成员函数文档编制

◆  IsIndex()

Bool IsIndex ( ) const

Checks if this PortId is given by an Int index.

返回
True if this PortId is given by an index, false otherwise.

◆  IsName()

Bool IsName ( ) const

Checks if this PortId is given by a name.

返回
True if this PortId is given by a name, false otherwise.

◆  IsPopulated()

Bool IsPopulated ( ) const

Checks if this PortId has a name or an index. Note that in the case of a name it doesn't check if the name itself is non-empty.

返回
True if this PortId has a name or an index, false otherwise.

◆  IsEmpty()

Bool IsEmpty ( ) const

Checks if this PortId has neither a name nor an index.

返回
True if this PortId has neither a name nor an index, false otherwise.

◆  GetIndex()

Int GetIndex ( ) const

Returns the port index. This function must not be called if this PortId is given by a name.

返回
The port index stored in this PortId .

◆  GetName()

const Id & GetName ( ) const

Returns the port name. This function must not be called if this PortId is given by an index.

返回
The port name stored in this PortId .

◆  GetDirection()

PORT_DIR GetDirection ( ) const

Returns the direction of this PortId . PORT_DIR::INPUT stands for input ports, PORT_DIR::OUTPUT for output ports.

返回
The port direction.

◆  ToString()

String ToString ( const FormatStatement fs = nullptr ) const

Returns a String representation of this @CLASS.

参数
[in] formatStatement Nullptr or additional formatting instruction.
返回
String representation of this @CLASS.

Member Data Documentation

◆  _indexDir

Int _indexDir
protected

◆  _name

Id _name
protected