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


C++ NodeBase类代码示例

本文整理汇总了C++中NodeBase的典型用法代码示例。如果您正苦于以下问题:C++ NodeBase类的具体用法?C++ NodeBase怎么用?C++ NodeBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了NodeBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: assert

/*private*/
void
Root::insertContained(Node *tree, const Envelope *itemEnv, void *item)
{
	assert(tree->getEnvelope()->contains(itemEnv));

	/**
	 * Do NOT create a new quad for zero-area envelopes - this would lead
	 * to infinite recursion. Instead, use a heuristic of simply returning
	 * the smallest existing quad containing the query
	 */
	bool isZeroX = IntervalSize::isZeroWidth(itemEnv->getMinX(),
	                                         itemEnv->getMaxX());
	bool isZeroY = IntervalSize::isZeroWidth(itemEnv->getMinY(),
	                                         itemEnv->getMaxY());

	NodeBase *node;

	if (isZeroX || isZeroY)
	{
		node = tree->find(itemEnv);
	}
	else
	{
		node = tree->getNode(itemEnv);
	}

	node->add(item);
}
开发者ID:52North,项目名称:IlwisCore,代码行数:29,代码来源:Root.cpp

示例2: destroyAll

void LinkListBase::destroyAll()
{
	NodeBase* n;
	// Excluding the dummy node mHead and mTail
	while(mTail != (n = mHead->mNext)) {
		n->destroyThis();
	}
}
开发者ID:DrDrake,项目名称:mcore3d,代码行数:8,代码来源:LinkList.cpp

示例3: removeAll

void LinkListBase::removeAll()
{
	NodeBase* n;
	// Excluding the dummy node mHead and mTail
	while(mTail != (n = mHead->mNext)) {
		n->removeThis();
	}
}
开发者ID:DrDrake,项目名称:mcore3d,代码行数:8,代码来源:LinkList.cpp

示例4: while

void Control_::destroy()
  { 
    object_ = 0;
    manage_ = 0;
    NodeBase* n = dep_;
    while (n)
      {
        NodeBase* next = n->link()->next_;
        n->notify(false);
        n = next;
      }
    dep_ = 0;
    cunref(); 
  }
开发者ID:KAMI911,项目名称:openmortal,代码行数:14,代码来源:object.cpp

示例5: on_node_com_status_changed

// _____________________________________________________________________
// Méthode appelée à chaque fois qu'un noeud change de status de communication
// (passe de OK à KO ou l'inverse)
void CXbeeNetworkMessenger::on_node_com_status_changed()
{
    NodeBase **node_list = m_xbee_messenger.m_database.getNodesList();
    for (int i=0; i<m_xbee_messenger.m_database.getNodeCount(); i++) {
        NodeBase *node = node_list[i];
        if (node) {
            QString led_name= "led_XbeeMsngNodePresent." + QString(node->getName());
            QLed *led = m_ihm.findChild<QLed *>(led_name);  // recherche l'objet LED par son nom
            if (led) {
                led->setValue(node->isPresent());
            }
        }
    }
}
开发者ID:CRLG,项目名称:LABOTBOX,代码行数:17,代码来源:CXbeeNetworkMessenger.cpp

示例6:

WriteBufferOperation *OutputSocket::findAttachedWriteBufferOperation() const
{
	unsigned int index;
	for (index = 0; index < this->m_connections.size(); index++) {
		SocketConnection *connection = this->m_connections[index];
		NodeBase *node = connection->getToNode();
		if (node->isOperation()) {
			NodeOperation *operation = (NodeOperation *)node;
			if (operation->isWriteBufferOperation()) {
				return (WriteBufferOperation *)operation;
			}
		}
	}
	return NULL;
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:15,代码来源:COM_OutputSocket.cpp

示例7: determineResolution

void OutputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
	NodeBase *node = this->getNode();
	if (node->isOperation()) {
		NodeOperation *operation = (NodeOperation *)node;
		if (operation->isResolutionSet()) {
			resolution[0] = operation->getWidth();
			resolution[1] = operation->getHeight();
		}
		else {
			operation->determineResolution(resolution, preferredResolution);
			operation->setResolution(resolution);
		}
	}
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:15,代码来源:COM_OutputSocket.cpp

示例8: MCD_ASSERT

void LinkListBase::insertBefore(NodeBase& newNode, const NodeBase& beforeThis)
{
	MCD_ASSERT(!newNode.isInList());
	MCD_ASSERT("Parameter 'beforeThis' should be in this list" &&
		beforeThis.mNext == nullptr || beforeThis.getList() == this
	);

	beforeThis.mPrev->mNext = &newNode;
	newNode.mPrev = beforeThis.mPrev;

	const_cast<NodeBase&>(beforeThis).mPrev = &newNode;
	newNode.mNext = const_cast<NodeBase*>(&beforeThis);

	newNode.mList = this;
	++mCount;
}
开发者ID:DrDrake,项目名称:mcore3d,代码行数:16,代码来源:LinkList.cpp

示例9:

NodeIterator::NodeIterator(NodeBase &start, const char *name)
{
    _stack.push_back(start.getNode());
    
    _type = OSG::FieldContainerFactory::the()->findType(name);
    
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:7,代码来源:Nodes.cpp

示例10: assert

void
Root::insertContained(Node *tree, Interval *itemInterval, void* item)
{
	using geos::index::quadtree::IntervalSize;  

	assert(tree->getInterval()->contains(itemInterval));

	/**
	 * Do NOT create a new node for zero-area intervals - this would lead
	 * to infinite recursion. Instead, use a heuristic of simply returning
	 * the smallest existing node containing the query
	 */
	bool isZeroArea=IntervalSize::isZeroWidth(itemInterval->getMin(),
			itemInterval->getMax());
	NodeBase *node;
	if (isZeroArea)
		node=tree->find(itemInterval);
	else
		node=tree->getNode(itemInterval);
	node->add(item);
}
开发者ID:h4ck3rm1k3,项目名称:geos,代码行数:21,代码来源:Root.cpp

示例11: initDiagPresencePage

// _____________________________________________________________________
// Construit automatiquement la page de diagnostique de présenc
// en fonction des informations renseignées sur les nodes dans la database
void CXbeeNetworkMessenger::initDiagPresencePage()
{
    int ligne=0;
    NodeBase **node_list = m_xbee_messenger.m_database.getNodesList();
    for (int i=0; i<m_xbee_messenger.m_database.getNodeCount(); i++)
    {
        NodeBase *node = node_list[i];
        if (node) {
            QString data_name= "XbeeMsngNodePresent." + QString(node->getName());
            m_application->m_data_center->write(data_name, QVariant(node->isPresent()));
            CData *data = m_application->m_data_center->getData(data_name);
            if (data) {
                connect(data, SIGNAL(valueChanged(QVariant)), this, SLOT(on_node_com_status_changed()));
            }

            QLed *led;
            led = new QLed(m_ihm.ui.tab_diag);
            led->setObjectName("led_" + data_name);
            led->setMaximumSize(QSize(30, 30));
            led->setMinimumSize(QSize(20, 20));
            led->setValue(node->isPresent());
            led->setOnColor(QLed::Green);
            led->setOffColor(QLed::Grey);
            led->setShape(QLed::Circle);
            led->setToolTip(data_name);
            m_ihm.ui.layout_led_presence->addWidget(led, ligne, 0, 1, 1);

            QLabel *label = new QLabel(m_ihm.ui.tab_diag);
            label->setObjectName("lbl_" + data_name);
            label->setText(node->getName());
            label->setToolTip("Node ID=" + QString::number(node->getID()));
            m_ihm.ui.layout_led_presence->addWidget(label, ligne, 1, 1, 1);

            ligne++;
        }
    }
}
开发者ID:CRLG,项目名称:LABOTBOX,代码行数:40,代码来源:CXbeeNetworkMessenger.cpp

示例12: Evaluate

void Runtime::Evaluate(NodeBase* node,WQState* state)
{
	if (node->GetType() == NT_EXPRESSION)
	{
		ExpressionNode* expnode = (ExpressionNode*)node;
		Evaluate(expnode->Expression, state);
	}
	else if (node->GetType() == NT_ASSIGNMENT)
	{
		AssignmentNode* assignment = (AssignmentNode*)node; 
		//Evaluate the right side
		Evaluate((NodeBase*)assignment->RightSide, state);
		CurrentLineNumber = assignment->GetLineNumber();
		
		if (assignment->TargetType == AT_VARIABLE)
		{
			VariableNode* var = assignment->LeftSideVariable;
			Evaluate(var, state);
			WQObject* left =state->GetReturnObject();
			Evaluate(assignment->RightSide, state);
			PerformAssignment(left, assignment->AssignmentOperator, state->GetReturnObject());
			environment->SetVariable(*var->Value,left );

		}
		else if (assignment->TargetType == AT_ELEMENT)
		{
			ElementNode* ele = assignment->LeftSideElement;
			Evaluate(ele->Variable, state);
			WQObject* lsobj = state->GetReturnObject();
			if (lsobj->Type == DT_LIST)
			{
				Evaluate(ele->key, state);
				//get the index
				long index = state->GetReturnObject()->GetIntValue();

				WQObject *left = lsobj->GetListElement(index);
				Evaluate(assignment->RightSide, state);
				PerformAssignment(left, assignment->AssignmentOperator, state->GetReturnObject());
				lsobj->SetListElement(index,*left);
			}
			else if (lsobj->Type == DT_DICTIONARY)
			{

				Evaluate(ele->key, state);
				//get the index
				string key = state->GetReturnObject()->ToString();

				WQObject *left = lsobj->GetDictionaryElement(key);
				Evaluate(assignment->RightSide, state);
				PerformAssignment(left, assignment->AssignmentOperator, state->GetReturnObject());
				
			}
			//environment->GetVariable()

		}
	}
	else if (node->GetType() == NT_VARIABLE)
	{
		VariableNode* varnode = (VariableNode*)node;
		//
		//printf(varnode->Value->c_str());
		WQObject* obj=environment->GetVariable(*varnode->Value);
		if (obj == NULL)
		{
			state->ReturnReference(environment->CreateVariable(*(varnode->Value)));
		}
		else
		{
			state->ReturnReference(obj);
		}
	}
	//else if (node->GetType() == NT_ELEMENT)
	//{
	//	ElementNode* elenode = (ElementNode*)node;
	//	Evaluate(elenode->key, state);
	//	int index = state->GetReturnObject()->GetIntValue();
	//	WQObject* obj = environment->GetVariable(*elenode->Variable->Value)->GetListElement(index);
	//	state->ReturnReference(obj);
	//}
	else if (node->GetType() == NT_STRING)
	{
		StringNode* strnode = (StringNode*)node;
		state->GetReturnObject()->SetStringValue( *strnode->Value);

	}
	else if (node->GetType() == NT_BOOLEAN)
	{
		BooleanNode * boolnode = (BooleanNode*)node;
		state->GetReturnObject()->SetBoolValue(boolnode->Value);

	}
	else if (node->GetType() == NT_OPERATION)
	{
		
		OperationNode* opnode = (OperationNode*)node;
		//
		list<ExpressionNode*>::iterator expit = opnode->Terms->begin();
		list<string*>::iterator opit = opnode->Operators->begin();
		stack<string*> lowops;
		stack<WQObject*> lowexps;
//.........这里部分代码省略.........
开发者ID:gavinz0228,项目名称:WebQuest-Interpreter,代码行数:101,代码来源:Runtime.cpp

示例13: new

NodeBase* node_factory::create_node(const uint32_t id,
                                    const string& name, const string& type,
                                    const string& desc, const key_map_t& keymap) {
    NodeBase* node = NULL;

    if (strcasecmp(type.c_str(), NODE_ANSWER) == 0) {
        node = new(std::nothrow) NodeAnswer(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_HANGUP) == 0) {
        node = new(std::nothrow) NodeHangup(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_PLAY) == 0) {
        node = new(std::nothrow) NodePlay(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_RECORD) == 0) {
        node = new(std::nothrow) NodeRecord(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_DIGIT) == 0) {
        node = new(std::nothrow) NodeGetDigits(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_DIAL) == 0) {
        node = new(std::nothrow) NodeDial(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_BRIDGE) == 0) {
        node = new(std::nothrow) NodeBridge(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_ASSIGN) == 0) {
        node = new(std::nothrow) NodeAssign(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_COMP) == 0) {
        node = new(std::nothrow) NodeCompare(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_DB) == 0) {
        node = new(std::nothrow) NodeDB(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_HTTP) == 0) {
        node = new(std::nothrow) NodeHttp(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_INI) == 0) {
        node = new(std::nothrow) NodeReadIni(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_BRIDGEEX) == 0) {
        node = new(std::nothrow) node_bridgeex_t(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_JSONGET) == 0) {
        node = new(std::nothrow) NodeJsonGet(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_PLAYNUM) == 0) {
        node = new(std::nothrow) NodePlayNum(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_WAITEVENT) == 0) {
        node = new(std::nothrow) NodeWaitEvent(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_REGTIMER) == 0) {
        node = new(std::nothrow) NodeRegTimer(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_STOPTIMER) == 0) {
        node = new(std::nothrow) NodeStopTimer(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_WRITELOG) == 0) {
        node = new(std::nothrow) NodeWriteLog(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_STOPMEDIA) == 0) {
        node = new(std::nothrow) NodeStopMedia(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_STOPRECORD) == 0) {
        node = new(std::nothrow) NodeStopRecord(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_JSONGET_ARRAY) == 0) {
        node = new(std::nothrow) NodeJsonGetArray(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_JSONGET_ARRAYLEN) == 0) {
        node = new(std::nothrow) NodeJsonGetArrayLen(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_REQUEST_AGENT) == 0) {
        node = new(std::nothrow) NodeRequestAgent(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_TRANS_AGENT) == 0) {
        node = new(std::nothrow) NodeTransAgent(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_CANCEL_AGENT) == 0) {
        node = new(std::nothrow) NodeCancelAgent(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_SET_ASSOCIATEDATA) == 0) {
        node = new(std::nothrow) NodeSetAssociateData(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_GET_ASSOCIATEDATA) == 0) {
        node = new(std::nothrow) NodeGetAssociateData(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_REQUEST_RESULT) == 0) {
        node = new(std::nothrow) NodeRequestResponseCompare(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_WHATWEEKDAY) == 0) {
        node = new(std::nothrow) NodeWhatWeekday(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), NODE_MAKECALL) == 0) {
        node = new(std::nothrow) NodeMakeCall(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), _s_node_broadcast) == 0) {
        node = new(std::nothrow) ivr::NodeBroadcast(id, name, type, desc, keymap);
    } else if (strcasecmp(type.c_str(), _s_node_broadcast_num) == 0) {
        node = new(std::nothrow) ivr::NodeBroadcastNum(id, name, type, desc, keymap);
    }else if (strcasecmp(type.c_str(), _s_node_base64_encode) == 0) {
        node = new(std::nothrow) NodeBase64Encode(id, name, type, desc, keymap);
    }else if (strcasecmp(type.c_str(), _s_node_base64_decode) == 0) {
        node = new(std::nothrow) NodeBase64Decode(id, name, type, desc, keymap);
    }else if (strcasecmp(type.c_str(), _s_node_set_appdata) == 0) {
        node = new(std::nothrow) NodeSetAppData(id, name, type, desc, keymap);
    }

    if (node && (!node->load_other())) {
        delete node;
        node = NULL;
    }

    return node;
}
开发者ID:alei76,项目名称:CC,代码行数:86,代码来源:node_factory.cpp

示例14: traverseSeq

void traverseSeq(OSG::GraphOpSeq& g, NodeBase& b) 
{
    OSG::NodePtr p = b.getNode();
    g.run(p);
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:5,代码来源:python_wrapper.cpp

示例15: traverse

void traverse(OSG::GraphOp& g, NodeBase& b) 
{
    OSG::NodePtr p = b.getNode();
    g.traverse(p);
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:5,代码来源:python_wrapper.cpp


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