L4Re - L4 Runtime Environment
shared_cap
Go to the documentation of this file.
1 // vim:set ft=cpp: -*- Mode: C++ -*-
6 /*
7  * (c) 2018 Alexander Warg <alexander.warg@kernkonzept.com>
8  *
9  * This file is part of TUD:OS and distributed under the terms of the
10  * GNU General Public License 2.
11  * Please see the COPYING-GPL-2 file for details.
12  *
13  * As a special exception, you may use this file as part of a free software
14  * library without restriction. Specifically, if other files instantiate
15  * templates or use macros or inline functions from this file, or you compile
16  * this file and link it with other files to produce an executable, this
17  * file does not by itself cause the resulting executable to be covered by
18  * the GNU General Public License. This exception does not however
19  * invalidate any other reasons why the executable file might be covered by
20  * the GNU General Public License.
21  */
22 
23 #pragma once
24 
25 #include <l4/re/cap_alloc>
27 
28 namespace L4Re {
29 
43 template< typename T >
44 using Shared_cap = L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_ALL_SPACES>>;
46 template< typename T >
47 using shared_cap = L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_ALL_SPACES>>;
48 
58 template< typename T >
61 { return Shared_cap<T>(ca->alloc<T>(), ca); }
62 
79 template< typename T >
80 using Shared_del_cap = L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_DELETE_OBJ>>;
82 template<typename T>
83 using shared_del_cap = L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_DELETE_OBJ>>;
84 
94 template< typename T >
97 { return Shared_del_cap<T>(ca->alloc<T>(), ca); }
98 
99 } // namespace L4Re
L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_DELETE_OBJ > > Shared_del_cap
Shared capability that implements automatic free and unmap+delete of the capability selector...
Definition: shared_cap:80
Abstract capability-allocator interface.
Capability allocator interface.
Definition: cap_alloc:41
virtual L4::Cap< void > alloc() noexcept=0
Allocate a capability.
L4Re C++ Interfaces.
Definition: cmd_control:15
Shared_del_cap< T > make_shared_del_cap(L4Re::Cap_alloc *ca)
Allocate a capability slot and wrap it in a Shared_del_cap.
Definition: shared_cap:96
L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_DELETE_OBJ > > shared_del_cap
Shared capability that implements automatic free and unmap+delete of the capability selector...
Definition: shared_cap:83
L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_ALL_SPACES > > shared_cap
Shared capability that implements automatic free and unmap of the capability selector.
Definition: shared_cap:47
L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_ALL_SPACES > > Shared_cap
Shared capability that implements automatic free and unmap of the capability selector.
Definition: shared_cap:44
Shared_cap< T > make_shared_cap(L4Re::Cap_alloc *ca)
Allocate a capability slot and wrap it in a Shared_cap.
Definition: shared_cap:60