L4Re - L4 Runtime Environment
L4::Server_object Class Referenceabstract

Abstract server object to be used with L4::Server and L4::Basic_registry. More...

+ Inheritance diagram for L4::Server_object:
+ Collaboration diagram for L4::Server_object:

Public Member Functions

virtual int dispatch (unsigned long rights, Ipc::Iostream &ios)=0
 The abstract handler for client requests to the object. More...
 
l4_msgtag_t dispatch (l4_msgtag_t tag, unsigned rights, l4_utcb_t *utcb)
 The abstract handler for client requests to the object. More...
 
- Public Member Functions inherited from L4::Epiface
 Epiface ()
 Make a server object.
 
virtual Demand get_buffer_demand () const =0
 Get the server-side receive buffer demand for this object. More...
 
virtual ~Epiface ()=0
 Destroy the object.
 
Stored_cap obj_cap () const
 Get the capability to the kernel object belonging to this object. More...
 
Server_ifaceserver_iface () const
 Get pointer to server interface at which the object is currently registered. More...
 
int set_server (Server_iface *srv, Cap< void > cap, bool managed=false)
 Set server registration info for the object. More...
 
void set_obj_cap (Cap< void > const &cap)
 Deprecated server registration function.
 

Additional Inherited Members

- Public Types inherited from L4::Epiface
typedef Ipc_svr::Server_iface Server_iface
 Type for abstract server interface.
 
typedef Ipc_svr::Server_iface::Demand Demand
 Type for server-side receive buffer demand.
 

Detailed Description

Abstract server object to be used with L4::Server and L4::Basic_registry.

Note
Usually L4::Server_object_t is used as a base class when writing server objects.

This server object provides an abstract interface that is used by the L4::Registry_dispatcher model. You can derive subclasses from this interface and implement application specific server objects.

Definition at line 49 of file ipc_server.

Member Function Documentation

◆ dispatch() [1/2]

virtual int L4::Server_object::dispatch ( unsigned long  rights,
Ipc::Iostream ios 
)
pure virtual

The abstract handler for client requests to the object.

Parameters
rightsThe rights bits in the invoked capability.
iosThe Ipc::Iostream for reading the request and writing the reply.
Return values
-L4_ENOREPLYInstructs the server loop to not send a reply.
<0Error, reply with error code.
>=0Success, reply with return value.

This function must be implemented by application specific server objects. The implementation must unmarshall data from the stream (ios) and create a reply by marshalling to the stream (ios). For details about the IPC stream see IPC stream operators.

Note
You need to extract the complete message from the ios stream before inserting any reply data or before doing any function call that may use the UTCB. Otherwise, the incoming message may get lost.

Implemented in L4::Server_object_x< Derived, IFACE, BASE >.

Referenced by dispatch().

+ Here is the caller graph for this function:

◆ dispatch() [2/2]

l4_msgtag_t L4::Server_object::dispatch ( l4_msgtag_t  tag,
unsigned  rights,
l4_utcb_t utcb 
)
inlinevirtual

The abstract handler for client requests to the object.

Parameters
tagThe message tag for this invocation.
rightsThe rights bits in the invoked capability.
utcbThe UTCB used for the invocation.
Return values
-L4_ENOREPLYNo reply message is send.
<0Error, reply with error code.
>=0Success, reply with return value.

This function must be implemented by application specific server objects.

Implements L4::Epiface.

Definition at line 71 of file ipc_server.

References L4::cap_cast(), dispatch(), and L4::Epiface::obj_cap().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: