Vuo
2.3.2
compiler
VuoCompilerEventPortClass.cc
Go to the documentation of this file.
1
10
#include "
VuoCompilerEventPortClass.hh
"
11
#include "
VuoCompiler.hh
"
12
#include "
VuoCompilerDataClass.hh
"
13
17
VuoCompilerEventPortClass::VuoCompilerEventPortClass
(
string
name) :
18
VuoCompilerPortClass
(name,
VuoPortClass
::eventOnlyPort)
19
{
20
dataClass
= NULL;
21
}
22
26
VuoCompilerEventPortClass::~VuoCompilerEventPortClass
(
void
)
27
{
28
delete
dataClass
;
29
}
30
34
VuoCompilerDataClass
*
VuoCompilerEventPortClass::getDataClass
(
void
)
35
{
36
return
dataClass
;
37
}
38
42
void
VuoCompilerEventPortClass::setDataClass
(
VuoCompilerDataClass
*dataClass)
43
{
44
this->dataClass =
dataClass
;
45
46
VuoPortClass
* newBase =
new
VuoPortClass
(
getBase
()->getName(),
dataClass
?
VuoPortClass::dataAndEventPort
:
VuoPortClass::eventOnlyPort
);
47
newBase->
setCompiler
(
this
);
48
delete
getBase
();
49
setBase
(newBase);
50
}
51
55
VuoType
*
VuoCompilerEventPortClass::getDataVuoType
(
void
)
56
{
57
return
(
dataClass
?
dataClass
->
getVuoType
() : NULL);
58
}
59
65
void
VuoCompilerEventPortClass::setDataVuoType
(
VuoType
*type)
66
{
67
dataClass
->
setVuoType
(type);
68
}
69
73
string
VuoCompilerEventPortClass::getDisplayName
(
void
)
74
{
75
// First, look for a name stored within the details of the port's data class, if applicable.
76
if
(
getDataVuoType
())
77
{
78
json_object
*
details
=
getDataClass
()->
getDetails
();
79
json_object
*nameValue = NULL;
80
81
if
(
details
&& json_object_object_get_ex(
details
,
"name"
, &nameValue))
82
return
json_object_get_string(nameValue);
83
}
84
85
// Failing that, look for a name associated with the port class rather than the data class.
86
return
VuoCompilerPortClass::getDisplayName
();
87
}
Generated on Sat Jun 19 2021 10:17:41 for Vuo by
1.9.1