remove deprecatedd swap method
This commit is contained in:
parent
3e63b14192
commit
ed215657e6
@ -123,30 +123,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// void Swap(SharedMemory & other) {
|
|
||||||
// SimpleLogger().Write() << "&prev: " << shm.get_shmid();
|
|
||||||
// shm.swap(other.shm);
|
|
||||||
// region.swap(other.region);
|
|
||||||
// boost::interprocess::xsi_key temp_key = other.key;
|
|
||||||
// other.key = key;
|
|
||||||
// key = temp_key;
|
|
||||||
// SimpleLogger().Write() << "&after: " << shm.get_shmid();
|
|
||||||
// }
|
|
||||||
|
|
||||||
void Swap(SharedMemory * other) {
|
|
||||||
SimpleLogger().Write() << "this key: " << key.get_key() << ", other: " << other->key.get_key();
|
|
||||||
SimpleLogger().Write() << "this id: " << shm.get_shmid() << ", other: " << other->shm.get_shmid();
|
|
||||||
shm.swap(other->shm);
|
|
||||||
region.swap(other->region);
|
|
||||||
boost::interprocess::xsi_key temp_key = other->key;
|
|
||||||
other->key = key;
|
|
||||||
key = temp_key;
|
|
||||||
SimpleLogger().Write() << "swap done";
|
|
||||||
SimpleLogger().Write() << "this key: " << key.get_key() << ", other: " << other->key.get_key();
|
|
||||||
SimpleLogger().Write() << "this id: " << shm.get_shmid() << ", other: " << other->shm.get_shmid();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename IdentifierT >
|
template<typename IdentifierT >
|
||||||
static bool RegionExists(
|
static bool RegionExists(
|
||||||
const IdentifierT id
|
const IdentifierT id
|
||||||
@ -212,14 +188,6 @@ template<class LockFileT = OSRMLockFile>
|
|||||||
class SharedMemoryFactory_tmpl : boost::noncopyable {
|
class SharedMemoryFactory_tmpl : boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<typename IdentifierT >
|
|
||||||
static void Swap(const IdentifierT & id1, const IdentifierT & id2) {
|
|
||||||
SharedMemory * memory_1 = Get(id1);
|
|
||||||
SharedMemory * memory_2 = Get(id2);
|
|
||||||
|
|
||||||
memory_1->Swap(memory_2);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename IdentifierT >
|
template<typename IdentifierT >
|
||||||
static SharedMemory * Get(
|
static SharedMemory * Get(
|
||||||
const IdentifierT & id,
|
const IdentifierT & id,
|
||||||
@ -237,7 +205,13 @@ public:
|
|||||||
ofs.close();
|
ofs.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SharedMemory(lock_file(), id, size, read_write, remove_prev);
|
return new SharedMemory(
|
||||||
|
lock_file(),
|
||||||
|
id,
|
||||||
|
size,
|
||||||
|
read_write,
|
||||||
|
remove_prev
|
||||||
|
);
|
||||||
} catch(const boost::interprocess::interprocess_exception &e){
|
} catch(const boost::interprocess::interprocess_exception &e){
|
||||||
SimpleLogger().Write(logWARNING) <<
|
SimpleLogger().Write(logWARNING) <<
|
||||||
"caught exception: " << e.what() <<
|
"caught exception: " << e.what() <<
|
||||||
|
Loading…
Reference in New Issue
Block a user