MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / remove

Method remove

tests/DCPS/FooTest3_2/InstanceDataMap.cpp:32–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32int
33InstanceDataMap::remove (::DDS::InstanceHandle_t handle, ::Xyz::Foo& sample)
34{
35 ACE_GUARD_RETURN (ACE_Thread_Mutex,
36 guard,
37 this->lock_,
38 -1);
39
40 DataMap::iterator it = map_.find (handle);
41 if (it == map_.end ())
42 {
43 return -1;
44 }
45
46 size_t size = it->second.erase (sample);
47 if (size != 1)
48 {
49 return -1;
50 }
51
52 if (it->second.size () == 0)
53 {
54 map_.erase (handle);
55 }
56 return 0;
57}
58
59ssize_t
60InstanceDataMap::num_instances()

Callers 5

ACE_TMAINFunction · 0.45
ACE_TMAINFunction · 0.45
start_common_progMethod · 0.45
callbackMethod · 0.45
callbackMethod · 0.45

Calls 4

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
sizeMethod · 0.45

Tested by 4

ACE_TMAINFunction · 0.36
start_common_progMethod · 0.36
callbackMethod · 0.36
callbackMethod · 0.36