Minsky
minsky::PortExclude Struct Referenceabstract

components of Port excluded from reflection More...

#include <port.h>

Collaboration diagram for minsky::PortExclude:
Collaboration graph

Public Member Functions

 PortExclude (const Item &item)
 
virtual ~PortExclude ()=default
 
void setVariableValue (const std::shared_ptr< VariableValue > &v)
 sets the VariableValue associated with this port. Only for output ports More...
 
std::shared_ptr< VariableValuegetVariableValue () const
 returns the variableValue associated with this port. May be null if not applicable More...
 
virtual bool input () const =0
 
GroupPtr group () const
 

Protected Attributes

Itemm_item
 
std::weak_ptr< VariableValuevariableValue
 
std::vector< Wire * > m_wires
 

Detailed Description

components of Port excluded from reflection

Definition at line 36 of file port.h.

Constructor & Destructor Documentation

◆ PortExclude()

minsky::PortExclude::PortExclude ( const Item item)
inline

Definition at line 39 of file port.h.

39 : m_item(const_cast<Item&>(item)) {}
Item & m_item
Definition: port.h:48

◆ ~PortExclude()

virtual minsky::PortExclude::~PortExclude ( )
virtualdefault

Member Function Documentation

◆ getVariableValue()

shared_ptr< VariableValue > minsky::PortExclude::getVariableValue ( ) const

returns the variableValue associated with this port. May be null if not applicable

Definition at line 114 of file port.cc.

114  {
115  if (input() && !m_wires.empty())
116  return m_wires[0]->from()->getVariableValue();
117  return variableValue.lock();
118  }
virtual bool input() const =0
std::vector< Wire * > m_wires
Definition: port.h:50
std::weak_ptr< VariableValue > variableValue
Definition: port.h:49

◆ group()

GroupPtr minsky::PortExclude::group ( ) const

Definition at line 55 of file port.cc.

56  {
57  return m_item.group.lock();
58  }
Item & m_item
Definition: port.h:48

◆ input()

virtual bool minsky::PortExclude::input ( ) const
pure virtual

◆ setVariableValue()

void minsky::PortExclude::setVariableValue ( const std::shared_ptr< VariableValue > &  v)

sets the VariableValue associated with this port. Only for output ports

sets the VariableValue associated with this port

Definition at line 86 of file port.cc.

86  {
87  if (!input())
88  variableValue=v;
89  }
virtual bool input() const =0
std::weak_ptr< VariableValue > variableValue
Definition: port.h:49

Member Data Documentation

◆ m_item

Item& minsky::PortExclude::m_item
protected

Definition at line 48 of file port.h.

◆ m_wires

std::vector<Wire*> minsky::PortExclude::m_wires
protected

Definition at line 50 of file port.h.

◆ variableValue

std::weak_ptr<VariableValue> minsky::PortExclude::variableValue
protected

Definition at line 49 of file port.h.


The documentation for this struct was generated from the following files: