#include <variable.h>
Definition at line 314 of file variable.h.
◆ PtrBase
◆ VariablePtr() [1/5]
Definition at line 320 of file variable.h.
static VariableBase * create(Type type)
classdesc::shared_ptr< VariableBase > PtrBase
◆ ~VariablePtr()
virtual minsky::VariablePtr::~VariablePtr |
( |
| ) |
|
|
inlinevirtual |
◆ VariablePtr() [2/5]
template<class P >
minsky::VariablePtr::VariablePtr |
( |
P * |
var | ) |
|
|
inline |
Definition at line 325 of file variable.h.
References minsky::var.
328 assert(!
var || *
this);
classdesc::shared_ptr< VariableBase > PtrBase
◆ VariablePtr() [3/5]
minsky::VariablePtr::VariablePtr |
( |
const classdesc::shared_ptr< VariableBase > & |
x | ) |
|
|
inline |
Definition at line 330 of file variable.h.
classdesc::shared_ptr< VariableBase > PtrBase
◆ VariablePtr() [4/5]
Definition at line 331 of file variable.h.
classdesc::shared_ptr< VariableBase > PtrBase
◆ VariablePtr() [5/5]
minsky::VariablePtr::VariablePtr |
( |
const ItemPtr & |
x | ) |
|
|
inline |
Definition at line 334 of file variable.h.
335 PtrBase(std::dynamic_pointer_cast<VariableBase>(x)) {}
classdesc::shared_ptr< VariableBase > PtrBase
◆ id()
virtual int minsky::VariablePtr::id |
( |
| ) |
const |
|
inlinevirtual |
◆ makeConsistentWithValue()
void VariablePtr::makeConsistentWithValue |
( |
| ) |
|
make variable's type consistent with the type of the valueId
Definition at line 883 of file variable.cc.
References minsky::cminsky(), retype(), and minsky::valueId().
void retype(VariableBase::Type type)
changes type of variable to type
string valueId(const string &name)
construct a valueId from fully qualified name @ name should not be canonicalised
const Minsky & cminsky()
const version to help in const correctness
◆ retype()
changes type of variable to type
Definition at line 516 of file variable.cc.
References minsky::VariableBase::create(), and reset().
Referenced by makeConsistentWithValue(), and minsky::VariableBase::retype().
519 if (tmp && tmp->type()!=type)
523 for (
size_t i=0; i<
get()->portsSize() && i< tmp->portsSize(); ++i)
524 for (
auto w: tmp->ports(i).lock()->wires())
526 if (
get()->ports(i).lock()->input())
527 w->moveToPorts(
w->from(),
get()->ports(i).lock());
529 w->moveToPorts(
get()->ports(i).lock(),
w->to());
531 get()->ensureValueExists(
nullptr,
"");
static VariableBase * create(Type type)
The documentation for this class was generated from the following files: