36 #include <IceUtil/UUID.h>
38 #include <ArmarXCore/interface/core/RemoteReferenceCount.h>
46 class RemoteReferenceCountControlBlockManager;
57 countingActivated_ =
true;
61 return countingActivated_;
65 return countReachedZero_;
77 friend class ::armarx::RemoteReferenceCountControlBlockManager;
98 std::atomic_bool countingActivated_ {
false};
99 std::atomic_bool countReachedZero_ {
false};
108 :
virtual public RemoteReferenceCountControlBlockInterface,
115 void heartbeat(
const std::string& counterId,
const Ice::Current& = Ice::emptyCurrent)
final override;
116 void addCounter(
const std::string& counterId,
const Ice::Current& = Ice::emptyCurrent)
final override;
117 void removeCounter(
const std::string& counterId,
const Ice::Current& = Ice::emptyCurrent)
final override;
129 const
long heartBeatMs;
137 :
virtual public SimpleRemoteReferenceCountControlBlockInterface,
144 void addCounter(
const std::string& counterId,
const Ice::Current&)
final override;
145 void removeCounter(
const std::string& counterId,
const Ice::Current&)
final override;
161 template<
class FunctionType = std::function<
void(
void)>,
class DataType =
void>
165 const ArmarXManagerPtr& manager,
const std::string&
id, FunctionType f, DataType d,
171 function {std::move(f)}
175 FunctionType
function;
183 template<
class FunctionType>
192 function {std::move(f)}
194 FunctionType
function;
203 template<
class FunctionType,
class DataType =
void>
209 template<
class FunctionType = std::function<
void(
void)>,
class DataType =
void>
216 data {std::move(d)},
function {std::move(f)}
219 FunctionType
function;
227 template<
class FunctionType>
235 FunctionType
function;
244 template<
class FunctionType,
class DataType =
void>
268 using PqEntry = std::pair<IceUtil::Time, detail::RemoteReferenceCountControlBlockManagementInterfacePtr>;
269 struct PqEntryCompare
271 bool operator()(
const PqEntry& lhs,
const PqEntry& rhs)
const
273 return std::make_pair(lhs.first, lhs.second.get()) > std::make_pair(rhs.first, rhs.second.get());
282 return lhs.get() < rhs.get();
285 std::mutex stateMutex;
286 std::set<detail::RemoteReferenceCountControlBlockManagementInterfacePtr, RRCBMIPtr> pendingForActivation;
287 std::priority_queue<PqEntry, std::vector<PqEntry>, PqEntryCompare> rrccbs;
289 std::atomic_bool shutdown {
false};