Vuo
2.4.4
Loading...
Searching...
No Matches
base
VuoPort.cc
Go to the documentation of this file.
1
10
#include "
VuoPort.hh
"
11
#include "
VuoCable.hh
"
12
13
#include <stdio.h>
14
15
19
VuoPort::VuoPort
(
VuoPortClass
*portClass)
20
:
VuoBase
<
VuoCompilerNodeArgument
,
VuoRendererPort
>(
"VuoPort"
)
21
{
22
this->portClass = portClass;
23
this->eventThrottling =
getClass
()->
getDefaultEventThrottling
();
24
}
25
26
VuoPort::~VuoPort
(
void
)
27
{
28
}
29
33
VuoPortClass
*
VuoPort::getClass
(
void
)
34
{
35
return
portClass;
36
}
37
44
vector<VuoCable *>
VuoPort::getConnectedCables
(
bool
includePublishedCables)
45
{
46
if
(includePublishedCables)
47
return
connectedCables;
48
49
vector<VuoCable *> targetCables;
50
for
(vector<VuoCable *>::iterator cable = connectedCables.begin(); cable != connectedCables.end(); ++cable)
51
{
52
if
(! (*cable)->isPublished())
53
targetCables.push_back(*cable);
54
}
55
56
return
targetCables;
57
}
58
63
VuoCable
*
VuoPort::getCableConnecting
(
VuoPort
*otherPort)
64
{
65
for
(vector<VuoCable *>::iterator cable = connectedCables.begin(); cable != connectedCables.end(); ++cable)
66
{
67
if
(((*cable)->getFromPort() == otherPort) || ((*cable)->getToPort() == otherPort))
68
return
(*cable);
69
}
70
71
return
NULL;
72
}
73
80
void
VuoPort::addConnectedCable
(
VuoCable
*cable)
81
{
82
connectedCables.push_back(cable);
83
}
84
90
void
VuoPort::removeConnectedCable
(
VuoCable
*cable)
91
{
92
connectedCables.erase(std::remove(connectedCables.begin(), connectedCables.end(), cable), connectedCables.end());
93
}
94
98
VuoPortClass::EventThrottling
VuoPort::getEventThrottling
(
void
)
99
{
100
return
eventThrottling;
101
}
102
106
void
VuoPort::setEventThrottling
(
VuoPortClass::EventThrottling
eventThrottling)
107
{
108
this->eventThrottling = eventThrottling;
109
}
110
114
void
VuoPort::setRawInitialValue
(
const
string
&rawInitialValue)
115
{
116
this->rawInitialValue = rawInitialValue;
117
}
118
125
string
VuoPort::getRawInitialValue
(
void
)
126
{
127
return
rawInitialValue;
128
}
129
133
void
VuoPort::print
(
void
)
134
{
135
printf(
"VuoPort(%p,\"%s\")"
,
this
,portClass->
getName
().c_str());
136
if
(
hasCompiler
())
137
printf(
" VuoCompilerPort(%p)"
,
getCompiler
());
138
if
(
hasRenderer
())
139
printf(
" VuoRendererPort(%p)"
,
getRenderer
());
140
printf(
"\n"
);
141
}
Generated on Thu Nov 9 2023 16:59:28 for Vuo by
1.9.8