本文整理汇总了C++中MacroDefinition::isReadingNet方法的典型用法代码示例。如果您正苦于以下问题:C++ MacroDefinition::isReadingNet方法的具体用法?C++ MacroDefinition::isReadingNet怎么用?C++ MacroDefinition::isReadingNet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MacroDefinition
的用法示例。
在下文中一共展示了MacroDefinition::isReadingNet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParameterDefinition
boolean
MacroParameterNode::initialize()
{
this->UniqueNameNode::initialize();
Network *net = this->getNetwork();
if (!net->isMacro())
net->makeMacro(TRUE);
MacroDefinition *md = net->getDefinition();
ParameterDefinition *param=NULL;
boolean input = this->isInput();
if (!md->isReadingNet()) {
param = new ParameterDefinition(-1);
param->addType(new DXType(DXType::ObjectType));
}
char s[100];
if (input)
{
if (!md->isReadingNet()) {
int n = md->getFirstAvailableInputPosition();
param->markAsInput();
if (n <= md->getInputCount()) {
ParameterDefinition *dummyPd = md->getInputDefinition(n);
ASSERT(dummyPd->isDummy());
md->replaceInput(param,dummyPd);
} else {
md->addInput(param);
}
this->setIndex(n);
sprintf(s, "input_%d", this->index);
param->setName(s);
param->setDefaultValue("(no default)");
}
//
// The Parameter must have its own ParameterDefinition since
// it may change depending upon what we are connected to.
// FIXME: ParameterDefinition should have a dup() method.
//
Parameter *p = this->getOutputParameter(1);
ParameterDefinition *pd = p->getDefinition();
#if 11
ParameterDefinition *newpd = pd->duplicate();
#else
ParameterDefinition *newpd =
new ParameterDefinition(pd->getNameSymbol());
List *l = pd->getTypes();
DXType *dxt;
for (ListIterator li(*l); dxt = (DXType*)li.getNext();)
newpd->addType(dxt);
newpd->markAsOutput();
newpd->setDefaultVisibility(pd->getDefaultVisibility());
newpd->setViewability(pd->isViewable());
newpd->setDescription(pd->getDescription());
newpd->setWriteableCacheability(pd->hasWriteableCacheability());
newpd->setDefaultCacheability(pd->getDefaultCacheability());
if (pd->isRequired())
newpd->setRequired();
else
newpd->setNotRequired();
if (pd->isDefaultValue())
newpd->setDefaultValue(pd->getDefaultValue());
else
newpd->setDescriptiveValue(pd->getDefaultValue());
#endif
p->setDefinition(newpd);
}
else
{
if (!md->isReadingNet()) {
int n = md->getFirstAvailableOutputPosition();
param->markAsOutput();
if (n <= md->getOutputCount()) {
ParameterDefinition *dummyPd = md->getOutputDefinition(n);
ASSERT(dummyPd->isDummy());
md->replaceOutput(param,dummyPd);
} else {
md->addOutput(param);
}
this->setIndex(n);
sprintf(s, "output_%d", this->index);
param->setName(s);
param->setDefaultValue("(no default)");
}
//
// The Parameter must have its own ParameterDefinition since
// it may change depending upon what we are connected to.
// FIXME: ParameterDefinition should have a dup() method.
//
Parameter *p = this->getInputParameter(1);
ParameterDefinition *pd = p->getDefinition();
#if 11
ParameterDefinition *newpd = pd->duplicate();
#else
ParameterDefinition *newpd =
new ParameterDefinition(pd->getNameSymbol());
List *l = pd->getTypes();
DXType *dxt;
//.........这里部分代码省略.........