这篇教程C++ FUNC_ENTER_NOAPI函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FUNC_ENTER_NOAPI函数的典型用法代码示例。如果您正苦于以下问题:C++ FUNC_ENTER_NOAPI函数的具体用法?C++ FUNC_ENTER_NOAPI怎么用?C++ FUNC_ENTER_NOAPI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FUNC_ENTER_NOAPI函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: H5I_search/*------------------------------------------------------------------------- * Function: H5I_search * * Purpose: Apply function FUNC to each member of group GRP and return a * pointer to the first object for which FUNC returns non-zero. * The FUNC should take a pointer to the object and the KEY as * arguments and return non-zero to terminate the search (zero * to continue). * * Limitation: Currently there is no way to start searching from where a * previous search left off. * * Return: Success: The first object in the group for which FUNC * returns non-zero. NULL if FUNC returned zero * for every object in the group. * * Failure: NULL * * Programmer: Robb Matzke * Friday, February 19, 1999 * * Modifications: * *------------------------------------------------------------------------- */void *H5I_search(H5I_type_t grp, H5I_search_func_t func, void *key){ H5I_id_group_t *grp_ptr = NULL; /*ptr to the group */ H5I_id_info_t *id_ptr = NULL; /*ptr to the new ID */ H5I_id_info_t *next_id = NULL; /*ptr to the next ID */ unsigned i; /*counter */ void *ret_value = NULL; /*return value */ FUNC_ENTER_NOAPI(H5I_search, NULL); /* Check arguments */ if (grp <= H5I_BADID || grp >= H5I_NGROUPS) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid group number"); grp_ptr = H5I_id_group_list_g[grp]; if (grp_ptr == NULL || grp_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid group"); /* Only iterate through hash table if there are IDs in group */ if(grp_ptr->ids > 0) { /* Start at the beginning of the array */ for (i=0; i<grp_ptr->hash_size; i++) { id_ptr = grp_ptr->id_list[i]; while (id_ptr) { next_id= id_ptr->next; /* Protect against ID being deleted in callback */ if ((*func)(id_ptr->obj_ptr, id_ptr->id, key)) HGOTO_DONE(id_ptr->obj_ptr); /*found the item*/ id_ptr = next_id; } /* end while */ } /* end for */ } /* end if */done: FUNC_LEAVE_NOAPI(ret_value);} /* end H5I_search() */
开发者ID:gang-liu,项目名称:paraview,代码行数:60,
示例2: H5I_get_ref/*------------------------------------------------------------------------- * Function: H5I_get_ref * * Purpose: Retrieve the reference count for an object. * * Return: Success: The reference count. * * Failure: Negative * * Programmer: Quincey Koziol * Saturday, Decemeber 6, 2003 * * Modifications: * *------------------------------------------------------------------------- */intH5I_get_ref(hid_t id){ H5I_type_t grp; /*group the object is in*/ H5I_id_group_t *grp_ptr; /*ptr to the group */ H5I_id_info_t *id_ptr; /*ptr to the ID */ int ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5I_get_ref, FAIL); /* Sanity check */ assert(id>=0); /* Check arguments */ grp = H5I_GROUP(id); if (grp <= H5I_BADID || grp >= H5I_NGROUPS) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); grp_ptr = H5I_id_group_list_g[grp]; if (!grp_ptr || grp_ptr->count<=0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid group"); /* General lookup of the ID */ if (NULL==(id_ptr=H5I_find_id(id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID"); /* Set return value */ ret_value=id_ptr->count;done: FUNC_LEAVE_NOAPI(ret_value);} /* end H5I_get_ref() */
开发者ID:gang-liu,项目名称:paraview,代码行数:47,
示例3: H5MF_realloc/*------------------------------------------------------------------------- * Function: H5MF_realloc * * Purpose: Changes the size of an allocated chunk, possibly moving it to * a new address. The chunk to change is at address OLD_ADDR * and is exactly OLD_SIZE bytes (if these are H5F_ADDR_UNDEF * and zero then this function acts like H5MF_alloc). The new * size will be NEW_SIZE and its address is the return value (if * NEW_SIZE is zero then this function acts like H5MF_free and * an undefined address is returned). * * If the new size is less than the old size then the new * address will be the same as the old address (except for the * special case where the new size is zero). * * If the new size is more than the old size then most likely a * new address will be returned. However, under certain * circumstances the library may return the same address. * * Return: Success: The relative file address of the new block. * * Failure: HADDR_UNDEF * * Programmer: Robb Matzke * Thursday, April 16, 1998 * * Modifications: * Robb Matzke, 1999-07-28 * The ORIG_ADDR is passed by value. The name of NEW_ADDR has * been changed to NEW_ADDR_P * * Robb Matzke, 1999-08-04 * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */haddr_tH5MF_realloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsize_t old_size, hsize_t new_size){ haddr_t ret_value; FUNC_ENTER_NOAPI(H5MF_realloc, HADDR_UNDEF); /* Convert old relative address to absolute address */ old_addr += f->shared->base_addr; /* Check that the file can address the new space. */ /* In the worst case, this means adding new_size bytes to the end of the file. */ if( H5MF_alloc_overflow(f, new_size) ) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "not enough address space in file"); /* Reallocate memory from the virtual file layer */ ret_value = H5FD_realloc(f->shared->lf, type, dxpl_id, old_addr, old_size, new_size); if (HADDR_UNDEF==ret_value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "unable to allocate new file memory"); /* Convert return value to relative address */ assert(ret_value>=f->shared->base_addr); /* Set return value */ ret_value -= f->shared->base_addr;done: FUNC_LEAVE_NOAPI(ret_value);}
开发者ID:MattNapsAlot,项目名称:rHDF5,代码行数:66,
示例4: H5HL_dblk_dest/*------------------------------------------------------------------------- * Function: H5HL_dblk_dest * * Purpose: Destroy a local heap data block object * * Return: Success: Non-negative * Failure: Negative * * Programmer: Quincey Koziol * [email C++ FUNC_EXIT_RC函数代码示例 C++ FUNC_ENTER_API函数代码示例
|