|
L4Re Operating System Framework
Interface and Usage Documentation
|
C++ interface for capabilities. More...
#include <capability.h>
Public Member Functions | |
| template<typename O> | |
| Cap (Cap< O > const &o) noexcept | |
| Create a copy from o, supporting implicit type casting. | |
| Cap (Cap_type cap) noexcept | |
| Constructor to create an invalid capability selector. | |
| Cap (l4_default_caps_t cap) noexcept | |
| Initialize capability with one of the default capability selectors. | |
| Cap (l4_cap_idx_t idx=L4_INVALID_CAP) noexcept | |
| Initialize capability, defaults to the invalid capability selector. | |
| Cap (No_init_type) noexcept | |
| Create an uninitialized cap selector. | |
| bool | move (Cap const &src) const noexcept |
| Replace this capability with the contents of src. | |
| bool | copy (Cap const &src) const noexcept |
| Copy a capability. | |
| bool | is_equal (Cap const &other) const noexcept |
| Test whether this capability points to the same object with the same permissions as other. | |
| T * | operator-> () const noexcept |
| Member access of a T. | |
| Public Member Functions inherited from L4::Cap_base | |
| l4_cap_idx_t | cap () const noexcept |
| Return capability selector. | |
| bool | is_valid () const noexcept |
| Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP). | |
| int | invalid_cap_error () const noexcept |
| Return the transported error code in an invalid capability index. | |
| l4_fpage_t | fpage (unsigned rights=L4_CAP_FPAGE_RWS) const noexcept |
| Return flexpage for the capability. | |
| l4_umword_t | snd_base (unsigned grant=L4_MAP_ITEM_MAP, l4_cap_idx_t base=L4_INVALID_CAP) const noexcept |
| Return send base. | |
| bool | operator== (Cap_base const &o) const noexcept |
| Test if two capabilities are equal. | |
| bool | operator!= (Cap_base const &o) const noexcept |
| Test if two capabilities are not equal. | |
| l4_msgtag_t | validate (l4_utcb_t *u=l4_utcb()) const noexcept |
| Check whether a capability is present (refers to an object). | |
| l4_msgtag_t | validate (Cap< Task > task, l4_utcb_t *u=l4_utcb()) const noexcept |
| Check whether a capability is present (refers to an object). | |
| void | invalidate () noexcept |
| Set this capability to invalid (L4_INVALID_CAP). | |
Static Public Member Functions | |
| template<typename From> | |
| static void | check_convertible_from () noexcept |
| Perform the type conversion that needs to compile in order for a capability of type From to be convertible to one of type T. | |
| template<typename From> | |
| static void | check_castable_from () noexcept |
| Perform the type conversion that needs to compile in order for a capability of type From te be castable (via the correct cap_cast) to one of type T. | |
Friends | |
| class | L4::Kobject |
Additional Inherited Members | |
| Public Types inherited from L4::Cap_base | |
| enum | No_init_type { No_init } |
| Special value for uninitialized capability objects. More... | |
| enum | Cap_type { Invalid = L4_INVALID_CAP } |
| Invalid capability type. More... | |
| Protected Member Functions inherited from L4::Cap_base | |
| Cap_base (l4_cap_idx_t c) noexcept | |
| Generate a capability from its C representation. | |
| Cap_base (Cap_type cap) noexcept | |
| Constructor to create an invalid capability. | |
| Cap_base (l4_default_caps_t cap) noexcept | |
| Initialize capability with one of the default capabilities. | |
| Cap_base () noexcept | |
| Create an uninitialized instance. | |
| bool | move (Cap_base const &src) const noexcept |
| Replace this capability with the contents of src. | |
| bool | copy (Cap_base const &src) const noexcept |
| Copy a capability. | |
| bool | is_equal (Cap_base const &other) const noexcept |
| Test whether this capability points to the same object with the same permissions as other. | |
| Protected Attributes inherited from L4::Cap_base | |
| l4_cap_idx_t | _c |
| The C representation of a capability selector. | |
C++ interface for capabilities.
| T | Type of the object the capability points to. |
The C++ version of a capability is comparable to a pointer, in fact it is a kind of smart pointer for our kernel objects and the objects derived from the kernel objects (L4::Kobject).
Add
#include <l4/sys/capability>
to your code to use the capability interface.
Definition at line 248 of file capability.h.
Create a copy from o, supporting implicit type casting.
| o | The source selector that shall be copied (and casted). |
Definition at line 300 of file capability.h.
Constructor to create an invalid capability selector.
| cap | Capability selector. |
Definition at line 307 of file capability.h.
|
inlinenoexcept |
Initialize capability with one of the default capability selectors.
| cap | Capability selector. |
Definition at line 313 of file capability.h.
|
inlineexplicitnoexcept |
Initialize capability, defaults to the invalid capability selector.
| idx | Capability selector. |
Definition at line 319 of file capability.h.
|
inlinestaticnoexcept |
Perform the type conversion that needs to compile in order for a capability of type From te be castable (via the correct cap_cast) to one of type T.
| From | Type to convert from |
Definition at line 289 of file capability.h.
|
inlinestaticnoexcept |
Perform the type conversion that needs to compile in order for a capability of type From to be convertible to one of type T.
| From | Type to convert from |
Definition at line 276 of file capability.h.
|
inlinenoexcept |
Copy a capability.
| src | the source capability. |
After this operation this capability refers to the same object as src.
Definition at line 335 of file capability.h.
|
inlinenoexcept |
Test whether this capability points to the same object with the same permissions as other.
As an extension, invalid capabilities are considered equal by this function. See l4_task_cap_equal() for further details.
| other | The capability to comapre to. |
Definition at line 341 of file capability.h.
|
inlinenoexcept |
Replace this capability with the contents of src.
| src | the source capability. |
After the operation this capability refers to the object formerly referred to by the source capability src, and the source capability no longer refers to an object.
Definition at line 329 of file capability.h.