Minor improvements.
This commit is contained in:
parent
d4d365d31f
commit
49e840aae5
@ -50,6 +50,7 @@ class ActorId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ActorInfo *get_actor_info() const;
|
ActorInfo *get_actor_info() const;
|
||||||
|
|
||||||
ActorType *get_actor_unsafe() const;
|
ActorType *get_actor_unsafe() const;
|
||||||
|
|
||||||
Slice get_name() const;
|
Slice get_name() const;
|
||||||
@ -63,8 +64,7 @@ class ActorId {
|
|||||||
ObjectPool<ActorInfo>::WeakPtr ptr_;
|
ObjectPool<ActorInfo>::WeakPtr ptr_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// threat ActorId as pointer and ActorOwn as
|
// treat ActorId as pointer and ActorOwn as unique_ptr<ActorId>
|
||||||
// unique_ptr<ActorId>
|
|
||||||
template <class ActorType = Actor>
|
template <class ActorType = Actor>
|
||||||
class ActorOwn {
|
class ActorOwn {
|
||||||
public:
|
public:
|
||||||
|
@ -170,19 +170,24 @@ void ActorShared<ActorType>::reset(ActorId<ActorType> other) {
|
|||||||
template <class T>
|
template <class T>
|
||||||
ActorRef::ActorRef(const ActorId<T> &actor_id) : actor_id_(actor_id) {
|
ActorRef::ActorRef(const ActorId<T> &actor_id) : actor_id_(actor_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
ActorRef::ActorRef(ActorId<T> &&actor_id) : actor_id_(actor_id) {
|
ActorRef::ActorRef(ActorId<T> &&actor_id) : actor_id_(actor_id) {
|
||||||
actor_id.clear();
|
actor_id.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
ActorRef::ActorRef(const ActorShared<T> &actor_id) : actor_id_(actor_id.get()), token_(actor_id.token()) {
|
ActorRef::ActorRef(const ActorShared<T> &actor_id) : actor_id_(actor_id.get()), token_(actor_id.token()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
ActorRef::ActorRef(ActorShared<T> &&actor_id) : actor_id_(actor_id.release()), token_(actor_id.token()) {
|
ActorRef::ActorRef(ActorShared<T> &&actor_id) : actor_id_(actor_id.release()), token_(actor_id.token()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
ActorRef::ActorRef(const ActorOwn<T> &actor_id) : actor_id_(actor_id.get()) {
|
ActorRef::ActorRef(const ActorOwn<T> &actor_id) : actor_id_(actor_id.get()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
ActorRef::ActorRef(ActorOwn<T> &&actor_id) : actor_id_(actor_id.release()) {
|
ActorRef::ActorRef(ActorOwn<T> &&actor_id) : actor_id_(actor_id.release()) {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user