您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ HASH_FIND_INT函数代码示例

51自学网 2021-06-01 21:22:26
  C++
这篇教程C++ HASH_FIND_INT函数代码示例写得很实用,希望能帮到您。

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

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

示例1: HASH_FIND_INT

inline js_type_class_t *js_get_type_from_native(T* native_obj) {    js_type_class_t *typeProxy;    long typeId = cocos2d::getHashCodeByString(typeid(*native_obj).name());    HASH_FIND_INT(_js_global_type_ht, &typeId, typeProxy);    if (!typeProxy) {        cocos2d::TypeInfo *typeInfo = dynamic_cast<cocos2d::TypeInfo *>(native_obj);        if (typeInfo) {            typeId = typeInfo->getClassTypeInfo();        } else {            typeId = cocos2d::getHashCodeByString(typeid(T).name());        }        HASH_FIND_INT(_js_global_type_ht, &typeId, typeProxy);    }    return typeProxy;}
开发者ID:Seif178,项目名称:pairjs,代码行数:15,


示例2: HASH_FIND_INT

page_node *add_page(stored_object *object, uint32_t page_id){    page_node *curr,*page;    HASH_FIND_INT(global_page_table,&page_id,page);    if(page)    {        printf("ERROR[add_page] Object %lu already contains page %d/n",page->object_id,page_id);        return NULL;    }    object->size += PAGE_SIZE;    if(object->pages == NULL)    {        page = allocate_new_page(object->id,page_id);        HASH_ADD_INT(global_page_table, page_id, page);         object->pages = page;        return object->pages;    }    for(curr=page=object->pages; page && page->page_id != page_id; curr=page,page=page->next)        ;    if(page)    {        printf("ERROR[add_page] Object %lu already contains page %d/n",page->object_id,page_id);        return NULL;    }    page = allocate_new_page(object->id,page_id);    HASH_ADD_INT(global_page_table, page_id, page);     curr->next = page;    return curr->next;}
开发者ID:bkreitch,项目名称:simulator,代码行数:32,


示例3: HASH_FIND_INT

void CCActionManager::removeAllActionsFromTarget(CAObject *pTarget){    // explicit null handling    if (pTarget == NULL)    {        return;    }    tHashElement *pElement = NULL;    HASH_FIND_INT(m_pTargets, &pTarget, pElement);    if (pElement)    {        if (ccArrayContainsObject(pElement->actions, pElement->currentAction) && (! pElement->currentActionSalvaged))        {            pElement->currentAction->retain();            pElement->currentActionSalvaged = true;        }        ccArrayRemoveAllObjects(pElement->actions);        if (m_pCurrentTarget == pElement)        {            m_bCurrentTargetSalvaged = true;        }        else        {            deleteHashElement(pElement);        }    }    else    {//        CCLOG("CrossApp: removeAllActionsFromTarget: Target not found");    }}
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:33,


示例4: HASH_FIND_INT

struct mystruct *find_key(off_t st_size){	struct mystruct *s;	HASH_FIND_INT(myfiles, &st_size, s);	return s;}
开发者ID:EmisFR,项目名称:burp,代码行数:7,


示例5: farray_create

/** * Return an array of prototypes labeled with cluster numbers * @param c cluster structure * @param a assignment of prototypes * @param p prototypes * @return rejected feature vectors */farray_t *cluster_get_prototypes(cluster_t *c, assign_t *a, farray_t *p){    int i;    farray_t *n = farray_create("prototypes");    count_t *hash = NULL, *entry;    for (i = 0; i < a->len; i++) {        /* Skip rejected clusters */        if (!c->cluster[i])            continue;        /* Check if prototype has been added */        int j = a->proto[i];        HASH_FIND_INT(hash, &j, entry);        if (entry)            continue;        /* Add new prototype */        entry = malloc(sizeof(count_t));        entry->label = j;        HASH_ADD_INT(hash, label, entry);        /* Add prototype */        farray_add(n, fvec_clone(p->x[j]), cluster_get_name(c, i));    }    /* Delete hash table */    while (hash) {        entry = hash;        HASH_DEL(hash, entry);        free(entry);    }    return n;}
开发者ID:JaonLin,项目名称:malheur,代码行数:42,


示例6: erl_element

ETERM *space_delete(ETERM *fromp, ETERM *argp) {    // get the args    ETERM *space_refp = erl_element(1, argp);    erlmunk_space *s;    int space_id = ERL_REF_NUMBER(space_refp);    HASH_FIND_INT(erlmunk_spaces, &space_id, s);    // remove all subscribers    for(erlmunk_subscriber *subscriber = s->subscribers; subscriber != NULL;        subscriber = subscriber->hh.next) {        space_remove_subscriber(s, subscriber);    }    // remove all bodies    for(erlmunk_body *b = s->bodies; b != NULL;        b = b->hh.next) {        erlmunk_body_data *data = cpBodyGetUserData(b->body);        if (data->term != NULL)            erl_free_compound(data->term);        free(data);        cpSpaceRemoveBody(s->space, b->body);        cpBodyDestroy(b->body);        cpBodyFree(b->body);        space_remove_body_hash(s, b);    }    return NULL;}
开发者ID:lrascao,项目名称:erlmunk,代码行数:30,


示例7: consolidate_gpos_single

bool consolidate_gpos_single(otfcc_Font *font, table_OTL *table, otl_Subtable *_subtable,                             const otfcc_Options *options) {	subtable_gpos_single *subtable = &(_subtable->gpos_single);	gpos_single_hash *h = NULL;	for (glyphid_t k = 0; k < subtable->length; k++) {		if (!GlyphOrder.consolidateHandle(font->glyph_order, &subtable->items[k].target)) {			logWarning("[Consolidate] Ignored missing glyph /%s./n", subtable->items[k].target.name);			continue;		}		gpos_single_hash *s;		int fromid = subtable->items[k].target.index;		HASH_FIND_INT(h, &fromid, s);		if (s) {			logWarning("[Consolidate] Detected glyph double-mapping about /%s./n", subtable->items[k].target.name);		} else {			NEW(s);			s->fromid = subtable->items[k].target.index;			s->fromname = sdsdup(subtable->items[k].target.name);			s->v = subtable->items[k].value;			HASH_ADD_INT(h, fromid, s);		}	}	HASH_SORT(h, gpos_by_from_id);	iSubtable_gpos_single.clear(subtable);	gpos_single_hash *s, *tmp;	HASH_ITER(hh, h, s, tmp) {		iSubtable_gpos_single.push(subtable,		                           ((otl_GposSingleEntry){		                               .target = Handle.fromConsolidated(s->fromid, s->fromname), .value = s->v,		                           }));
开发者ID:anthrotype,项目名称:otfcc,代码行数:32,


示例8: del_giga_fi

void del_giga_fi(int fd){    giga_file_info_t *info;    HASH_FIND_INT(_open_files, &fd, info);    if(info != NULL)        HASH_DEL(_open_files, info);}
开发者ID:linpawslitap,项目名称:mds_scaling,代码行数:7,


示例9: HASH_FIND_INT

struct fl_url_filter *find_filter(int url_id) {    struct fl_url_filter *s;    HASH_FIND_INT(filters, &url_id, s);  /* s: output pointer */    return s;}
开发者ID:sanyaade-g2g-repos,项目名称:fineline-computer-forensics-timeline-tools,代码行数:7,


示例10: allocate_file_descriptor_table

struct file_descriptor_table * allocate_file_descriptor_table(int pid) {	struct file_descriptor_table * result_table;	HASH_FIND_INT(file_descriptor_tables, &pid, result_table);        if (result_table == NULL) {    	int i;    	struct file_descriptor_table * table = (struct file_descriptor_table *) malloc(sizeof(struct file_descriptor_table));    	table->pid = pid;    	table->entries = (struct file_descriptor_entry *) malloc(8 * sizeof(struct file_descriptor_entry));    	table->total_descriptors = 8;    	table->used_descriptors = 3;    	table->entries[0].fd = 0;    	table->entries[1].fd = 1;    	table->entries[2].fd = 2;    	for (i = 3; i < table->total_descriptors; i++) {    		table->entries[i].fd = FD_NOT_USED;    	}    	    	HASH_ADD_INT(file_descriptor_tables, pid, table);    	return table;    }    return NULL;}
开发者ID:gitanuj,项目名称:fstr,代码行数:28,


示例11: sec_exists_entry

bool sec_exists_entry(uint32_t secid) {  struct secentry *se=NULL;  HASH_FIND_INT(hash, &secid, se);  if(!se)    return false;  return true;}
开发者ID:CamFlow,项目名称:camflow-provenance-lib,代码行数:7,


示例12: adtn_socket_base

static int adtn_socket_base(const char *data_path){	static int UID = 1;	int sock_id = -1;	int len;	bunsock_s *identifier;	++UID;	HASH_FIND_INT( sockStore, &sock_id, identifier);	if (identifier == NULL) {		sock_id = UID;		identifier = (bunsock_s *)calloc(1, sizeof(bunsock_s));		identifier->id = sock_id;		identifier->sopt.proc_flags = H_DESS | H_NOTF;		identifier->sopt.block_flags = B_DEL_NP;		identifier->sopt.lifetime = 100000; //this time is in seconds		len = strlen(data_path) + 1;		identifier->data_path = (char *)calloc(len, sizeof(char));		strncpy(identifier->data_path, data_path, len);		identifier->bdata = NULL;		HASH_ADD_INT( sockStore, id, identifier);	} else {		errno = EBUSY;	}	return sock_id;}
开发者ID:SeNDA-UAB,项目名称:aDTN-platform,代码行数:28,


示例13: adtn_setcodopt_base

int adtn_setcodopt_base(int fd, code_type_e option, const char *code, int from_file, int replace){	int ret = -1;	bunsock_s *identifier;	HASH_FIND_INT(sockStore, &fd, identifier);	if (!identifier) {		errno = ENOTSOCK;		goto end;	}	if (code == NULL || strcmp(code, "") == 0 || from_file < 0 || from_file > 1) {		errno = EINVAL;		goto end;	}	switch (option) {	case ROUTING_CODE:		if (identifier->opt.rcode) {			if (replace) {				free(identifier->opt.rcode);			} else {				errno = EOPNOTSUPP;				goto end;			}		}		identifier->opt.rcode = strdup(code);		identifier->opt.r_fromfile = from_file;		break;	case LIFE_CODE:		if (identifier->opt.lcode) {			if (replace) {				free(identifier->opt.lcode);			} else {				errno = EOPNOTSUPP;				goto end;			}		}		identifier->opt.lcode = strdup(code);		identifier->opt.l_fromfile = from_file;		break;	case PRIO_CODE:		if (identifier->opt.pcode) {			if (replace) {				free(identifier->opt.pcode);			} else {				errno = EOPNOTSUPP;				goto end;			}		}		identifier->opt.pcode = strdup(code);		identifier->opt.p_fromfile = from_file;		break;	default:		errno = EINVAL;		goto end;	}	ret = 0;end:	return ret;}
开发者ID:SeNDA-UAB,项目名称:aDTN-platform,代码行数:60,


示例14: swDataBuffer_clear

int swDataBuffer_clear(swDataBuffer *data_buffer, int fd){	swDataBuffer_item *item = NULL;	HASH_FIND_INT(data_buffer->ht, &fd, item);	if (item == NULL)	{		swTrace("buffer item not found/n");		return SW_ERR;	}	else	{		swDataBuffer_trunk *trunk = item->first;		swDataBuffer_trunk *will_free_trunk; //保存trunk的指针,用于释放内存		while (trunk != NULL)		{			sw_free(trunk->data);			will_free_trunk = trunk;			trunk = trunk->next;			sw_free(will_free_trunk);		}		HASH_DEL(data_buffer->ht, item);		sw_free(item);	}	return SW_OK;}
开发者ID:899,项目名称:swoole,代码行数:25,


示例15: assert

CCAction* CCActionManager::getActionByTag(int tag, NSObject *pTarget){	assert(tag != kCCActionTagInvalid);	tHashElement *pElement = NULL;	HASH_FIND_INT(m_pTargets, &pTarget, pElement);	if (pElement)	{		if (pElement->actions != NULL)		{			unsigned int limit = pElement->actions->num;			for (unsigned int i = 0; i < limit; ++i)			{				CCAction *pAction = (CCAction*)pElement->actions->arr[i];				if (pAction->getTag() == tag)				{					return pAction;				}			}		}		CCLOG("cocos2d : getActionByTag: Action not found");	}	else	{        CCLOG("cocos2d : getActionByTag: Target not found");	}	return NULL;}
开发者ID:charlesa101,项目名称:cocos2d-x,代码行数:31,


示例16: h3m_object_add_by_def

int h3m_object_add_by_def(h3mlib_ctx_t ctx, const char *def, int x, int y,    int z, int *od_index){    struct META_OA_HASH_ENTRY *oa_hash_entry = NULL;    int oa_index = 0;    int oa_body_index = 0;    // Currently oa_body_index is used as key in the    // oa hash... The current code is a bit unoptimal as if this function    // ends up calling h3m_add_oa_by_def below, an additional    // hash lookup for this hash inside that function will be performed.    if (NULL == h3m_get_def_body(def, &oa_body_index)) {        return 1;    }    // if oa for this object has not yet been added to map, add it,    // otherwise use the existing oa_index for the oa    HASH_FIND_INT(ctx->meta.oa_hash, &oa_body_index, oa_hash_entry);    if (NULL == oa_hash_entry) {        h3m_add_oa_by_def(ctx, def, &oa_index);    } else {        oa_index = oa_hash_entry->oa_index;    }    return h3m_add_od(ctx, oa_index, x, y, z, od_index);}
开发者ID:Dergash,项目名称:homm3tools,代码行数:25,


示例17: read_memory_16

// Read a value from an 16-bit area of memoryuint16_t read_memory_16(gb_mem16_t* hash, int addr){	gb_mem16_t *s;			HASH_FIND_INT(hash, &addr, s);	return s->value;}
开发者ID:jamie124,项目名称:gbemulator,代码行数:8,


示例18: CCASSERT

void ActionManager::addAction(Action *pAction, Node *target, bool paused){    CCASSERT(pAction != NULL, "");    CCASSERT(target != NULL, "");    tHashElement *pElement = NULL;    // we should convert it to Object*, because we save it as Object*    Object *tmp = target;    HASH_FIND_INT(_targets, &tmp, pElement);    if (! pElement)    {        pElement = (tHashElement*)calloc(sizeof(*pElement), 1);        pElement->paused = paused;        target->retain();        pElement->target = target;        HASH_ADD_INT(_targets, target, pElement);    }     actionAllocWithHashElement(pElement);      CCASSERT(! ccArrayContainsObject(pElement->actions, pAction), "");     ccArrayAppendObject(pElement->actions, pAction);      pAction->startWithTarget(target);}
开发者ID:KIngpon,项目名称:HXGame,代码行数:25,


示例19: js_cocos2dx_GLNode_constructor

JSBool js_cocos2dx_GLNode_constructor(JSContext *cx, uint32_t argc, jsval *vp){      if (argc == 0) {    GLNode* cobj = new GLNode();#ifdef COCOS2D_JAVASCRIPT    cocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);    if (_ccobj) {      _ccobj->autorelease();    }#endif    TypeTest<GLNode> t;    js_type_class_t *typeClass;    uint32_t typeId = t.s_id();    HASH_FIND_INT(_js_global_type_ht, &typeId, typeClass);    assert(typeClass);    JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);    JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));    // link the native object with the javascript object    js_proxy_t *p = jsb_new_proxy(cobj, obj);#ifdef COCOS2D_JAVASCRIPT    JS_AddNamedObjectRoot(cx, &p->obj, "cocos2d::GLNode");#endif    return JS_TRUE;  }  JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 0);  return JS_FALSE;}
开发者ID:0x0c,项目名称:cocos2d-x,代码行数:28,


示例20: HASH_FIND_INT

tEffectElement* SoundDataManager::getSoundData(int nSoundID){    tEffectElement* pElement = NULL;    HASH_FIND_INT(m_pEffects, &nSoundID, pElement);    return pElement;}
开发者ID:charlesa101,项目名称:cocos2d-x,代码行数:7,


示例21: HASH_FIND_INT

void CCActionManager::removeAction(CCAction *pAction){    // explicit null handling    // 确定处理, null    if (pAction == NULL)    {        return;    }    tHashElement *pElement = NULL;    CCObject *pTarget = pAction->getOriginalTarget();    HASH_FIND_INT(m_pTargets, &pTarget, pElement);    if (pElement)    {        unsigned int i = ccArrayGetIndexOfObject(pElement->actions, pAction);        if (UINT_MAX != i)        {            removeActionAtIndex(i, pElement);        }    }    else    {        CCLOG("cocos2d: removeAction: Target not found");    }}
开发者ID:LaughingYan,项目名称:cocos2d-x,代码行数:25,


示例22: main

int main(int argc,char *argv[]) {    int i;    example_user_t *user, *tmp, *users=NULL;    /* create elements */    for(i=0;i<10;i++) {        if ( (user = (example_user_t*)malloc(sizeof(example_user_t))) == NULL)           exit(-1);        user->id = i;        user->cookie = i*i;        HASH_ADD_INT(users,id,user);    }    /* delete each even ID */    for(i=0;i<10;i+=2) {        HASH_FIND_INT(users,&i,tmp);        if (tmp) {            HASH_DEL(users,tmp);            free(tmp);        } else printf("user id %d not found/n", i);    }    /* show the hash */    for(user=users; user != NULL; user=(example_user_t*)(user->hh.next)) {        printf("user %d, cookie %d/n", user->id, user->cookie);    }   return 0;}
开发者ID:AndreaCampagner,项目名称:2014-15,代码行数:28,


示例23: strcpy

hash_token_t *uq_tokenize_to_hash(const char *str, const char *delimiters) {	unsigned int hash;	hash_token_t *s, *table = NULL;	char *tok;	char tmp[strlen(str) + 1];	strcpy(tmp, str);	tok = strtok(tmp, delimiters);	while(tok != NULL) {		hash = str_hash(tok);		HASH_FIND_INT(table, &hash, s);		if(s == NULL) {			s = malloc(sizeof(hash_token_t));			s->key = str_hash(tok);			s->value = strdup(tok);			HASH_ADD_INT(table, key, s);		}		tok = strtok(NULL, delimiters);	}	return (table);}
开发者ID:aperi2007,项目名称:libsimmetrics,代码行数:32,


示例24: CCAssert

void CCActionManager::addAction(CCAction *pAction, CAView *pTarget, bool paused){    CCAssert(pAction != NULL, "");    CCAssert(pTarget != NULL, "");    tHashElement *pElement = NULL;    // we should convert it to CAObject*, because we save it as CAObject*    CAObject *tmp = pTarget;    HASH_FIND_INT(m_pTargets, &tmp, pElement);    if (! pElement)    {        pElement = (tHashElement*)calloc(sizeof(*pElement), 1);        pElement->paused = paused;        pTarget->retain();        pElement->target = pTarget;        HASH_ADD_INT(m_pTargets, target, pElement);    }     actionAllocWithHashElement(pElement);      CCAssert(! ccArrayContainsObject(pElement->actions, pAction), "");     ccArrayAppendObject(pElement->actions, pAction);      pAction->startWithTarget(pTarget);}
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:25,


示例25: bufnew

caryll_buffer *caryll_write_gsub_ligature_subtable(otl_subtable *_subtable) {	caryll_buffer *buf = bufnew();	subtable_gsub_ligature *subtable = &(_subtable->gsub_ligature);	ligature_aggerator *h = NULL, *s, *tmp;	uint16_t nLigatures = subtable->to->numGlyphs;	for (uint16_t j = 0; j < nLigatures; j++) {		int sgid = subtable->from[j]->glyphs[0].gid;		HASH_FIND_INT(h, &sgid, s);		if (!s) {			NEW(s);			s->gid = sgid;			s->ligid = HASH_COUNT(h);			HASH_ADD_INT(h, gid, s);		}	}	HASH_SORT(h, by_gid);	otl_coverage *startCoverage;	NEW(startCoverage);	startCoverage->numGlyphs = HASH_COUNT(h);	NEW_N(startCoverage->glyphs, startCoverage->numGlyphs);	uint16_t jj = 0;	foreach_hash(s, h) {		s->ligid = jj;		startCoverage->glyphs[jj].gid = s->gid;		startCoverage->glyphs[jj].name = NULL;		jj++;	}
开发者ID:jojoblack,项目名称:otfcc,代码行数:29,


示例26: js_cocos2dx_extension_HttpRequest_constructor

JSBool js_cocos2dx_extension_HttpRequest_constructor(JSContext *cx, uint32_t argc, jsval *vp){	if(argc == 0){		HttpRequest* cobj = new HttpRequest(); 		cocos2d::CCObject *_ccobj = dynamic_cast<cocos2d::CCObject *>(cobj);		if (_ccobj) {			_ccobj->autorelease();		}		TypeTest<cocos2d::extension::CCHttpRequest> t;		js_type_class_t *typeClass;		uint32_t typeId = t.s_id();		HASH_FIND_INT(_js_global_type_ht, &typeId, typeClass);		assert(typeClass);		JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);		JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));		// link the native object with the javascript object		js_proxy_t *p;		JS_NEW_PROXY(p, cobj, obj);		JS_AddNamedObjectRoot(cx, &p->obj, "HttpRequest");		return JS_TRUE;	}	JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 0);	return JS_FALSE;}
开发者ID:akira-cn,项目名称:cocos2dx-cqwrap,代码行数:26,



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


C++ HASH_FIND_PTR函数代码示例
C++ HASH_FIND函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。