本文整理匯總了C++中GET_NODE函數的典型用法代碼示例。如果您正苦於以下問題:C++ GET_NODE函數的具體用法?C++ GET_NODE怎麽用?C++ GET_NODE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GET_NODE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: GET_NODE
//show entry index sequences -- for debug purposes.
void XmlSync::check1()
{
QDomElement codeNode_in, codeNode_out;
QDomElement entryNode_in, entryNode_out;
quint32 i, index;
GET_NODE(root_in, "code", codeNode_in);
GET_NODE(root_out, "code", codeNode_out);
GET_FIRST_CHILD_NODE(codeNode_in, entryNode_in);
GET_FIRST_CHILD_NODE(codeNode_out, entryNode_out);
for (i = 0; i < 30; i++)
{
ATTRIBUTE_TO_UINT(entryNode_in, "index", index, quint32);
printf("%d ", index);
entryNode_in = entryNode_in.nextSiblingElement();
}
printf("\n\n");
for (i = 0; i < 30; i++)
{
ATTRIBUTE_TO_UINT(entryNode_out, "index", index, quint32);
printf("%i ", index);
entryNode_out=entryNode_out.nextSiblingElement();
}
printf("\n\n");
}
示例2: ehgraph_transfer_edge
bool ehgraph_transfer_edge(ehgraph_t* dest, enode_t n1, ehgraph_t* src, enode_t n2, size_t link) {
bool bRet = false;
do {
CheckNotNULL(dest);
CheckNotNULL(src);
CheckLessThan(n1, dest->size);
CheckLessThan(n2, src->size);
CheckEqual(src->nLinks, dest->nLinks);
CheckLessThan(link, src->nLinks);
size_t nL = src->nLinks;
enode_info_t* nDst = &GET_NODE(dest, n1);
enode_info_t* nSrc = &GET_NODE(src, n2);
if (link == 0)
nDst->outDoubleLink = nSrc->outDoubleLink;
if (1 == link)
nDst->inDoubleLink = nSrc->inDoubleLink;
nDst->links[link] = nSrc->links[link];
nDst->superEdge[link] = nSrc->superEdge[link];
for (size_t ld = 0; ld < nL; ++ld) {
nDst->isPredicate[link][ld] = nSrc->isPredicate[link][ld];
nDst->predicateTarget[link][ld] = nSrc->predicateTarget[link][ld];
}
bRet = true;
} while(0);
return bRet;
}
示例3: reset_pnodes
int reset_pnodes(int curr, int pnode)
{
struct msm_bus_inode_info *info;
struct msm_bus_fabric_device *fabdev;
int index, next_pnode;
fabdev = msm_bus_get_fabric_device(GET_FABID(curr));
if (!fabdev) {
MSM_BUS_ERR("Fabric not found for: %d\n",
(GET_FABID(curr)));
return -ENXIO;
}
index = GET_INDEX(pnode);
info = fabdev->algo->find_node(fabdev, curr);
if (!info) {
MSM_BUS_ERR("Cannot find node info!\n");
return -ENXIO;
}
MSM_BUS_DBG("Starting the loop--remove\n");
do {
struct msm_bus_inode_info *hop;
fabdev = msm_bus_get_fabric_device(GET_FABID(curr));
if (!fabdev) {
MSM_BUS_ERR("Fabric not found\n");
return -ENXIO;
}
next_pnode = info->pnode[index].next;
info->pnode[index].next = -2;
curr = GET_NODE(next_pnode);
index = GET_INDEX(next_pnode);
if (IS_NODE(curr))
hop = fabdev->algo->find_node(fabdev, curr);
else
hop = fabdev->algo->find_gw_node(fabdev, curr);
if (!hop) {
MSM_BUS_ERR("Null Info found for hop\n");
return -ENXIO;
}
MSM_BUS_DBG("%d[%d] = %d\n", info->node_info->priv_id, index,
info->pnode[index].next);
MSM_BUS_DBG("num_pnodes: %d: %d\n", info->node_info->priv_id,
info->num_pnodes);
info = hop;
} while (GET_NODE(info->pnode[index].next) != info->node_info->priv_id);
info->pnode[index].next = -2;
MSM_BUS_DBG("%d[%d] = %d\n", info->node_info->priv_id, index,
info->pnode[index].next);
MSM_BUS_DBG("num_pnodes: %d: %d\n", info->node_info->priv_id,
info->num_pnodes);
return 0;
}
示例4: ehgraph_set_pred
bool ehgraph_set_pred(ehgraph_t* graph, enode_t node, size_t edge, size_t link, size_t target) {
if (NULL == graph) {
DB_ERROR("null argument");
return false;
}
GET_NODE(graph, node).superEdge[edge] = true;
GET_NODE(graph, node).isPredicate[edge][link] = true;
GET_NODE(graph, node).predicateTarget[edge][link] = target;
return true;
}
示例5: GET_NODE
void AnimationTreePlayer::oneshot_node_set_fadeout_time(const StringName& p_node,float p_time) {
GET_NODE( NODE_ONESHOT, OneShotNode );
n->fade_out=p_time;
}
示例6: while
void XmlSync::processEntryType05(QDomElement &parentNode, QByteArray *data)
{
QDomElement entryNode = parentNode.firstChildElement();
QTextCodec *codec = QTextCodec::codecForName("Shift-JIS");
while(!entryNode.isNull())
{
if(entryNode.tagName() == QString("text"))
{
QDomElement originalNode;
QString originalText;
GET_NODE(entryNode, "original", originalNode);
GET_NODE_TEXT(originalNode, originalText);
data->append(codec->fromUnicode(originalText));
}
else if (entryNode.tagName() == QString("ctrl"))
{
QString ctrlString;
ATTRIBUTE_TO_STRING_NOT_EMPTY(entryNode, "value", ctrlString);
data->append(ctrlString);
}
else
{
fatalExit("Unknown tag (not 'text' or 'ctrl')");
}
entryNode = entryNode.nextSiblingElement();
}
}
示例7: _m_unserialize
/**
* build mtree from serialized mtree data
*
* @params[in] pointer to serialized data
* @returns handle to new mtree
*
*/
H _m_unserialize(void *s) {
M *m = malloc(sizeof(M));
m->magic = ((M *)s)->magic;
m->levels = ((M *)s)->levels;
m->lP = malloc(sizeof(L)*m->levels);
H h = {m,{0,0}};
void *blob = ((S *)s)->blob_offset + (void *)s;
uint32_t s_size = SERIALIZED_HEADER_SIZE(m->levels);
for(h.a.l=0; h.a.l<m->levels; h.a.l++) {
L *sl = (L *) (((void *)s) + s_size + ((S *)s)->level_offsets[h.a.l]);
L *l = GET_LEVEL(h);
l->nodes = sl->nodes;
l->nP = malloc(sizeof(N)*l->nodes);
N *sn = sizeof(Mindex)+(void *)sl;
for(h.a.i=0;h.a.i < l->nodes;h.a.i++) {
N *n = GET_NODE(h,l);
*n = *sn;
void *surface = blob+*(size_t *)&sn->surface;
if (n->flags & TFLAG_ALLOCATED) {
n->surface = malloc(sn->size);
memcpy(n->surface,surface,sn->size);
}
else {
*((int *)&n->surface) = *((int *)&sn->surface);
}
sn = (N *) (SERIALIZED_NODE_SIZE + ((void*)sn));
}
}
h.a.i = h.a.l = 0;
return h;
}
示例8: permute_graph
ehgraph_t* permute_graph(ehgraph_t* graph, int* perm) {
ehgraph_t* ret = NULL, *b = NULL;
do {
CheckNotNULL(graph);
CheckNotNULL(perm);
if (0 != perm[0]) {
DB_ERROR("the null element should remain unchanged in the permutation");
break;
}
b = ehgraph_alloc(NULL, graph->size, graph->ptrdim, graph->nLinks);
if (!b) {
DB_ERROR("allocation failed");
break;
}
b->closed = graph->closed;
for (enode_t i = 0; i < graph->ptrdim; ++i)
VAR2NODE(b, i) = perm[ VAR2NODE(graph, i) ];
for (enode_t i = 0; i < graph->size; ++i) {
GET_NODE(b, perm[i]).inDoubleLink = GET_NODE(graph, i).inDoubleLink;
GET_NODE(b, perm[i]).outDoubleLink = GET_NODE(graph, i).outDoubleLink;
for (size_t l = 0; l < graph->nLinks; ++l) {
GET_LINK(b, perm[i], l) = perm[ GET_LINK(graph, i, l) ];
GET_NODE(b, perm[i]).superEdge[l] = GET_NODE(graph, i).superEdge[l];
for (size_t lp = 0; lp < graph->nLinks; ++lp) {
GET_NODE(b, perm[i]).isPredicate[l][lp] = GET_NODE(graph, i).isPredicate[l][lp];
GET_NODE(b, perm[i]).predicateTarget[l][lp] = perm[ GET_NODE(graph, i).predicateTarget[l][lp] ];
}
}
}
ret = b;
} while(0);
if (!ret)
SafeFree(b);
return ret;
}
示例9: add_path_node
/**
* add_path_node: Adds the path information to the current node
* @info: Internal node info structure
* @next: Combination of the id and index of the next node
* Function returns: Number of pnodes (path_nodes) on success,
* error on failure.
*
* Every node maintains the list of path nodes. A path node is
* reached by finding the node-id and index stored at the current
* node. This makes updating the paths with requested bw and clock
* values efficient, as it avoids lookup for each update-path request.
*/
static int add_path_node(struct msm_bus_inode_info *info, int next)
{
struct path_node *pnode;
int i;
if (ZERO_OR_NULL_PTR(info)) {
MSM_BUS_ERR("Cannot find node info!: id :%d\n",
info->node_info->priv_id);
return -ENXIO;
}
for (i = 0; i <= info->num_pnodes; i++) {
if (info->pnode[i].next == -2) {
MSM_BUS_DBG("Reusing pnode for info: %d at index: %d\n",
info->node_info->priv_id, i);
info->pnode[i].clk[DUAL_CTX] = 0;
info->pnode[i].clk[ACTIVE_CTX] = 0;
info->pnode[i].bw[DUAL_CTX] = 0;
info->pnode[i].bw[ACTIVE_CTX] = 0;
info->pnode[i].next = next;
MSM_BUS_DBG("%d[%d] : (%d, %d)\n",
info->node_info->priv_id, i, GET_NODE(next),
GET_INDEX(next));
return i;
}
}
info->num_pnodes++;
pnode = krealloc(info->pnode,
((info->num_pnodes + 1) * sizeof(struct path_node))
, GFP_KERNEL);
if (ZERO_OR_NULL_PTR(pnode)) {
MSM_BUS_ERR("Error creating path node!\n");
info->num_pnodes--;
return -ENOMEM;
}
info->pnode = pnode;
info->pnode[info->num_pnodes].clk[DUAL_CTX] = 0;
info->pnode[info->num_pnodes].clk[ACTIVE_CTX] = 0;
info->pnode[info->num_pnodes].bw[DUAL_CTX] = 0;
info->pnode[info->num_pnodes].bw[ACTIVE_CTX] = 0;
info->pnode[info->num_pnodes].next = next;
MSM_BUS_DBG("%d[%d] : (%d, %d)\n", info->node_info->priv_id,
info->num_pnodes, GET_NODE(next), GET_INDEX(next));
return info->num_pnodes;
}
示例10: find_preds
sl_iter_t *sl_iter_begin (skiplist_t *sl, map_key_t key) {
sl_iter_t *iter = (sl_iter_t *)nbd_malloc(sizeof(sl_iter_t));
if (key != DOES_NOT_EXIST) {
find_preds(NULL, &iter->next, 1, sl, key, DONT_UNLINK);
} else {
iter->next = GET_NODE(sl->head->next[0]);
}
return iter;
}
示例11: ehgraph_del_pred
bool ehgraph_del_pred(ehgraph_t* graph, enode_t node, size_t edge, size_t link) {
if (NULL == graph) {
DB_ERROR("null argument");
return false;
}
GET_NODE(graph, node).isPredicate[edge][link] = false;
return true;
}
示例12: sl_min_key
map_key_t sl_min_key (skiplist_t *sl) {
node_t *item = GET_NODE(sl->head->next[0]);
while (item != NULL) {
markable_t next = item->next[0];
if (!HAS_MARK(next))
return item->key;
item = STRIP_MARK(next);
}
return DOES_NOT_EXIST;
}
示例13: sl_free
void sl_free (skiplist_t *sl) {
node_t *item = GET_NODE(sl->head->next[0]);
while (item) {
node_t *next = STRIP_MARK(item->next[0]);
if (sl->key_type != NULL) {
nbd_free((void *)item->key);
}
nbd_free(item);
item = next;
}
}
示例14: sl_count
size_t sl_count (skiplist_t *sl) {
size_t count = 0;
node_t *item = GET_NODE(sl->head->next[0]);
while (item) {
if (!HAS_MARK(item->next[0])) {
count++;
}
item = STRIP_MARK(item->next[0]);
}
return count;
}
示例15: Exec
DesignFlowStep_Status HDLFunctionDeclFix::Exec()
{
bool changed_tree = false;
const tree_managerRef TM = AppM->get_tree_manager();
const auto hdl_writer_type = static_cast<HDLWriter_Language>(parameters->getOption<unsigned int>(OPT_writer_language));
const auto hdl_writer = language_writer::create_writer(hdl_writer_type, GetPointer<HLS_manager>(AppM)->get_HLS_target()->get_technology_manager(), parameters);
const auto hdl_reserved_names = hdl_writer->GetHDLReservedNames();
std::remove_const<decltype(hdl_reserved_names)>::type found_names;
if(hdl_writer_type == HDLWriter_Language::VHDL)
{
for(const auto hdl_reserved_name : hdl_reserved_names)
{
found_names.insert(boost::to_upper_copy<std::string>(hdl_reserved_name));
}
}
else
{
found_names = hdl_reserved_names;
}
for(const auto function : TM->GetAllFunctions())
{
auto fd = GetPointer<function_decl>(TM->get_tree_node_const(function));
if(not fd->name)
continue;
auto in = GetPointer<identifier_node>(GET_NODE(fd->name));
const auto identifier = hdl_writer_type == HDLWriter_Language::VHDL ? boost::to_upper_copy<std::string>(in->strg) : in->strg;
if(found_names.find(identifier) != found_names.end())
{
std::map<TreeVocabularyTokenTypes_TokenEnum, std::string> IR_schema;
unsigned int var_decl_name_nid_test;
unsigned var_decl_unique_id=0;
do
{
IR_schema[TOK(TOK_STRG)] = in->strg + STR(var_decl_unique_id++);
var_decl_name_nid_test = TM->find(identifier_node_K, IR_schema);
} while(var_decl_name_nid_test);
found_names.insert(in->strg + STR(var_decl_unique_id - 1));
unsigned int var_decl_name_nid = TM->new_tree_node_id();
TM->create_tree_node(var_decl_name_nid, identifier_node_K, IR_schema);
IR_schema.clear();
tree_nodeRef tr_new_id = TM->GetTreeReindex(var_decl_name_nid);
fd->name = tr_new_id;
}
else
{
found_names.insert(identifier);
}
}
return changed_tree ? DesignFlowStep_Status::SUCCESS : DesignFlowStep_Status::UNCHANGED;
}