当前位置: 首页>>代码示例>>C++>>正文


C++ MacroDefinition::isReadingNet方法代码示例

本文整理汇总了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;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:101,代码来源:MacroParameterNode.C


注:本文中的MacroDefinition::isReadingNet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。