本文整理汇总了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.";
}
示例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);
}
}
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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");
}
示例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;
}
示例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);
}
}
示例11: foo
void foo()
{
CValue *v;
jmp_buf b;
(void) setjmp(b);
delete_object(v); // Move this above the setjmp and it works!!!
}
示例12: cfs_unlink
static int cfs_unlink(const char *path)
{
if (delete_object(path))
{
dir_decache(path);
return 0;
}
return -ENOENT;
}
示例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);
}
}
示例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();
}
示例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();
}
}