qb::ServiceActor< Tag > Class Template Reference

SingletonActor base class. More...

#include <qb/actor.h>

Inheritance diagram for qb::ServiceActor< Tag >:
qb::Service qb::Actor qb::nocopy qb::ActorId

Additional Inherited Members

- Public Member Functions inherited from qb::Actor
void kill () const
 
ActorId id () const
 
uint16_t getIndex () const
 
uint64_t time () const
 Get current time. More...
 
bool isAlive () const
 Check if Actor is alive. More...
 
template<typename _Actor >
void registerCallback (_Actor &actor) const
 Register a looped callback. More...
 
template<typename _Actor >
void unregisterCallback (_Actor &actor) const
 Unregister actor callback. More...
 
template<typename _Event , typename _Actor >
void registerEvent (_Actor &actor)
 Actor will listen on new _Event. More...
 
template<typename _Event , typename _Actor >
void unregisterEvent (_Actor &actor)
 Actor will stop listening _Event. More...
 
EventBuilder to (ActorId const dest) const
 Get EventBuilder for ActorId destination. More...
 
template<typename _Event , typename ... _Args>
_Event & push (ActorId const &dest, _Args &&...args) const
 Send a new ordered event. More...
 
template<typename _Event , typename ... _Args>
void send (ActorId const &dest, _Args &&...args) const
 Send a new unordered event. More...
 
void reply (Event &event) const
 Reply an event. More...
 
void forward (ActorId const dest, Event &event) const
 Forward an event. More...
 
ProxyPipe getPipe (ActorId const dest) const
 Get access to unidirectional out events pipe. More...
 
template<typename _Actor , typename ... _Args>
_Actor * addRefActor (_Args &&...args) const
 Create new referenced _Actor. More...
 
- Protected Member Functions inherited from qb::Actor
void on (KillEvent const &event)
 Receiving this event will kill the Actor. More...
 
 Actor ()=default
 
virtual ~Actor ()=default
 
virtual bool onInit ()=0
 DerivedActor should implement this method. More...
 

Detailed Description

template<typename Tag>
class qb::ServiceActor< Tag >

SingletonActor base class.

Template Parameters
Tagis a uniq struct Tag

ServiceActor is a special actor where DerivedActor must define a unique service index by Tag.
Inherited Service Actors are unique per VirtualCore.