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


C++ delete_object函数代码示例

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


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

示例1: FILE_LOG

void ColaTopologyAddon::handleResizes(const cola::Resizes& resizeList,
        unsigned n, std::valarray<double>& X, std::valarray<double>& Y, 
        cola::CompoundConstraints& ccs, vpsc::Rectangles& boundingBoxes,
        cola::RootCluster* clusterHierarchy)
{
    FILE_LOG(cola::logDEBUG) << "ColaTopologyAddon::handleResizes()...";
    if(topologyNodes.empty()) {
        COLA_ASSERT(topologyRoutes.empty());
        return;
    }
    // all shapes to be resized are wrapped in a ResizeInfo and
    // placed in a lookup table, resizes, indexed by id
    ResizeMap resizes;
    for(cola::Resizes::const_iterator r=resizeList.begin();r!=resizeList.end();++r) {
        topology::ResizeInfo ri(topologyNodes[r->getID()],r->getTarget());
        resizes.insert(std::make_pair(r->getID(),ri));
    }
    vpsc::Variables xvs, yvs;
    vpsc::Constraints xcs, ycs;
    cola::setupVarsAndConstraints(n, ccs, vpsc::HORIZONTAL, boundingBoxes,
            clusterHierarchy, xvs, xcs, X);
    cola::setupVarsAndConstraints(n, ccs, vpsc::VERTICAL, boundingBoxes,
            clusterHierarchy, yvs, ycs, Y);
    topology::applyResizes(topologyNodes, topologyRoutes, clusterHierarchy,
            resizes, xvs, xcs, yvs, ycs);
    for_each(xvs.begin(), xvs.end(), delete_object());
    for_each(yvs.begin(), yvs.end(), delete_object());
    for_each(xcs.begin(), xcs.end(), delete_object());
    for_each(ycs.begin(), ycs.end(), delete_object());
    FILE_LOG(cola::logDEBUG) << "ColaTopologyAddon::handleResizes()... done.";
}
开发者ID:atis--,项目名称:adaptagrams,代码行数:31,代码来源:cola_topology_addon.cpp

示例2: guard

void comm_server::delete_unused_objects(std::vector<size_t> object_ids, 
                                        bool active_list) {

  std::sort(object_ids.begin(), object_ids.end());
  if (active_list) {
    // Get vector of IDs that are not used anymore on the client
    std::vector<std::pair<size_t, std::shared_ptr<void>> > v;
    {
      boost::lock_guard<boost::mutex> guard(registered_object_lock);
      // delete everything not in the active list
      std::set_difference(registered_objects.cbegin(), registered_objects.cend(),
                          object_ids.cbegin(), object_ids.cend(),
                          std::inserter(v, v.begin()), object_map_key_cmp());
    }

    // Actually delete objects
    for(auto i : v) {
      if(i.first != 0) {
        delete_object(i.first);
      }
    }
  } else {
    // delete everything in the active list
    for(auto i : object_ids) {
      boost::unique_lock<boost::mutex> guard(registered_object_lock);
      if (registered_objects.count(i)) {
        // delete object has its own lock
        guard.unlock();
        delete_object(i);
      }
    }
  }
}
开发者ID:GYGit,项目名称:SFrame,代码行数:33,代码来源:comm_server.cpp

示例3: TEST_COPY_OBJECT_WITH_DIFF_BUCKET

void TEST_COPY_OBJECT_WITH_DIFF_BUCKET() {
    int error;
    buffer* resp = NULL;

    const char* src_obj_key = "unit_test_dir/src_object1";

    resp = delete_object(host, src_bucket, src_obj_key, ak, sk, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(204 == resp->status_code || 404 == resp->status_code);
    buffer_free(resp);

    // upload first
    const char* filename = "./lib/libcunit.a";
    resp = upload_file_object(host, src_bucket, src_obj_key, filename,
            ak, sk, NULL, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(200 == resp->status_code);
    if (resp->status_code != 200) {
        printf("status code = %ld\n", resp->status_code);
        printf("status msg = %s\n", resp->status_msg);
        printf("error msg = %s\n", resp->body);
    }
    buffer_free(resp);

    // copy obj
    const char* dst_obj_key = src_obj_key;

    resp = delete_object(host, dst_bucket, dst_obj_key, ak, sk, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(204 == resp->status_code || 404 == resp->status_code);
    buffer_free(resp);

    resp = copy_object(host, src_bucket, src_obj_key,
            dst_bucket, dst_obj_key, ak, sk, NULL, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(200 == resp->status_code);
    if (200 != resp->status_code) {
        printf("status code = %ld\n", resp->status_code);
        printf("status msg = %s\n", resp->status_msg);
        printf("error msg = %s\n", resp->body);
    }
    buffer_free(resp);

    // delete src and dst obj
    resp = delete_object(host, src_bucket, src_obj_key, ak, sk, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(204 == resp->status_code);
    buffer_free(resp);

    resp = delete_object(host, dst_bucket, dst_obj_key, ak, sk, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(204 == resp->status_code);
    buffer_free(resp);
}
开发者ID:ks3sdk,项目名称:ks3-c-sdk,代码行数:54,代码来源:copy_object.c

示例4: build_quest_stairs

/**
 * Creates magical stairs after finishing a quest monster.
 */
static void build_quest_stairs(int y, int x)
{
	int ny, nx;

	/* Stagger around */
	while (!cave_valid_bold(y, x)) {
		int d = 1;

		/* Pick a location */
		scatter(&ny, &nx, y, x, d, FALSE);

		/* Stagger */
		y = ny; x = nx;
	}

	/* Destroy any objects */
	delete_object(y, x);

	/* Explain the staircase */
	msg("A magical staircase appears...");

	/* Create stairs down */
	/* XXX: fake depth = 0 to always produce downstairs */
	cave_add_stairs(cave, y, x, 0);

	/* Update the visuals */
	p_ptr->update |= (PU_UPDATE_VIEW | PU_MONSTERS);

	/* Fully update the flow */
	p_ptr->update |= (PU_FORGET_FLOW | PU_UPDATE_FLOW);
}
开发者ID:seebs,项目名称:angband,代码行数:34,代码来源:mon-make.c

示例5: delete_object

bool cps_db::delete_object(cps_db::connection &conn,cps_api_object_t obj) {
    std::vector<char> key;
    if (cps_db::dbkey_from_instance_key(key,obj)) {
        return delete_object(conn,key);
    }
    return false;
}
开发者ID:Azure,项目名称:sonic-object-library,代码行数:7,代码来源:cps_redis.cpp

示例6: TEST_COPY_OBJECT_WITH_SRC_OBJECT_NOT_EXIST

void TEST_COPY_OBJECT_WITH_SRC_OBJECT_NOT_EXIST() {
    int error;
    buffer* resp = NULL;

    const char* src_obj_key = "src_object_not_exist";

    // delete src object 
    resp = delete_object(host, src_bucket, src_obj_key, ak, sk, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(204 == resp->status_code || 404 == resp->status_code);
    buffer_free(resp);

    // copy obj
    const char* dst_obj_key = src_obj_key;
    resp = copy_object(host, src_bucket, src_obj_key,
            dst_bucket, dst_obj_key, ak, sk, NULL, NULL, &error);
    CU_ASSERT(0 == error);
    CU_ASSERT(404 == resp->status_code);
    if (404 != resp->status_code) {
        printf("status code = %ld\n", resp->status_code);
        printf("status msg = %s\n", resp->status_msg);
        printf("error msg = %s\n", resp->body);
    }
    buffer_free(resp);
}
开发者ID:ks3sdk,项目名称:ks3-c-sdk,代码行数:25,代码来源:copy_object.c

示例7: build_quest_stairs

/*
 * Create magical stairs after finishing a quest monster.
 */
static void build_quest_stairs(int y, int x)
{
	int ny, nx;

	/* Stagger around */
	while (!cave_clean_bold(y, x))
	{

		/* Pick a location */
		scatter(&ny, &nx, y, x, 5, 1);

		/* Stagger */
		y = ny; x = nx;
	}

	/* Destroy any objects */
	delete_object(y, x);

	/* Explain the staircase */
	msg_print("A magical staircase appears...");

	/* Create stairs down */
	cave_set_feat(y, x, FEAT_MORE);

	light_spot(y, x);

	/* Update the visuals */
	p_ptr->update |= (PU_UPDATE_VIEW | PU_MONSTERS);

}
开发者ID:antoine-from-rgrd,项目名称:Minimal,代码行数:33,代码来源:xtra2.c

示例8: delete_object

static_mem_pool_set::~static_mem_pool_set()
{
    std::for_each(_M_memory_pool_set.rbegin(),
                  _M_memory_pool_set.rend(),
                  delete_object());
    _STATIC_MEM_POOL_TRACE(false, "The static_mem_pool_set is destroyed");
}
开发者ID:flair2005,项目名称:VirtualRoom,代码行数:7,代码来源:static_mem_pool.cpp

示例9: for_each

bool GSDevice::Reset(int w, int h)
{
	for_each(m_pool.begin(), m_pool.end(), delete_object());

	m_pool.clear();

	delete m_backbuffer;
	delete m_merge;
	delete m_weavebob;
	delete m_blend;
	delete m_shaderfx;
	delete m_fxaa;
	delete m_shadeboost;
	delete m_1x1;

	m_backbuffer = NULL;
	m_merge = NULL;
	m_weavebob = NULL;
	m_blend = NULL;
	m_shaderfx = NULL;
	m_fxaa = NULL;
	m_shadeboost = NULL;
	m_1x1 = NULL;

	m_current = NULL; // current is special, points to other textures, no need to delete

	return m_wnd != NULL;
}
开发者ID:Coderx7,项目名称:pcsx2,代码行数:28,代码来源:GSDevice.cpp

示例10: drop_object

inline static void
drop_object(struct aoi_space * space, struct object *obj) {
	--obj->ref;
	if (obj->ref <=0) {
		map_drop(space->object, obj->id);
		delete_object(space, obj);
	}
}
开发者ID:ChowZenki,项目名称:aoi,代码行数:8,代码来源:aoi.c

示例11: foo

void foo()
{
        CValue *v;
        jmp_buf b;

  (void) setjmp(b);
        delete_object(v); // Move this above the setjmp and it works!!!
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:8,代码来源:diag0292.c

示例12: cfs_unlink

static int cfs_unlink(const char *path)
{
  if (delete_object(path))
  {
    dir_decache(path);
    return 0;
  }
  return -ENOENT;
}
开发者ID:cwedgwood,项目名称:cloudfuse,代码行数:9,代码来源:cloudfuse.c

示例13: place_object

/*
 * Attempt to place an object (normal or good/great) at the given location.
 *
 * This routine plays nasty games to generate the "special artifacts".
 *
 * This routine uses "object_level" for the "generation level".
 *
 * This routine requires a clean floor grid destination.
 */
void place_object(s32b y, s32b x, bool good, bool great, s32b where)
{
	object_type *q_ptr;


	/* Paranoia -- check bounds */
	if (!in_bounds(y, x)) return;

	/* Require clean floor space */
	if (!cave_clean_bold(y, x)) return;


	/* Get local object */
	q_ptr = make_object(good, great, NULL);

	/* Make an object (if possible) */
	if (q_ptr == NULL)
		return;

	if (where == OBJ_FOUND_VAULT)
	{
		q_ptr->found = OBJ_FOUND_VAULT;
		q_ptr->found_aux1 = dungeon_type;
		q_ptr->found_aux2 = level_or_feat(dungeon_type, dun_level);
	}
	else if (where == OBJ_FOUND_FLOOR)
	{
		q_ptr->found = OBJ_FOUND_FLOOR;
		q_ptr->found_aux1 = dungeon_type;
		q_ptr->found_aux2 = level_or_feat(dungeon_type, dun_level);
	}
	else if (where == OBJ_FOUND_SPECIAL)
	{
		q_ptr->found = OBJ_FOUND_SPECIAL;
	}
	else if (where == OBJ_FOUND_RUBBLE)
	{
		q_ptr->found = OBJ_FOUND_RUBBLE;
	}

	/* Object array overflow */
	if (!floor_carry(y, x, q_ptr))
	{
		/* Hack -- Preserve artifacts */
		if (q_ptr->artifact_id)
		{
			a_info[q_ptr->artifact_id].cur_num = 0;
		}
		else if (has_flag(&k_info[q_ptr->k_idx], FLAG_NORM_ART))
		{
			k_info[q_ptr->k_idx].artifact = 0;
		}

		delete_object(q_ptr);
	}
}
开发者ID:jcubic,项目名称:ToME,代码行数:65,代码来源:object2.c

示例14: func_4

void func_4()
{
	if (ENTITY::DOES_ENTITY_EXIST(iLocal_3))
	{
		delete_object(&iLocal_3);
	}
	set_model_as_no_longer_needed(joaat("p_abat_roller_1_col"));
	func_5("ob_abatdoor Terminated >>>>>>>>>>>>>>>>>\n");
	terminate_this_thread();
}
开发者ID:Xaymar,项目名称:Grand-Theft-Auto-5,代码行数:10,代码来源:ob_abatdoor.c

示例15: reset

//-----------------------------------------------------------------------
PagingLandScapePageManager::~PagingLandScapePageManager()
{
  reset();
  // could save a delete if texture type is the same... ?
  if (!mPagePool.empty()) {
    std::for_each(mPagePool.begin(), mPagePool.end(), delete_object());
    mPagePool.clear();
    mFreePages.clear();
  }
}
开发者ID:junrw,项目名称:ember-gsoc2012,代码行数:11,代码来源:OgrePagingLandScapePageManager.cpp


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