]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4sys/include/vcon
update
[l4.git] / l4 / pkg / l4sys / include / vcon
1 // vi:ft=cpp
2 /**
3  * \file
4  * \brief Virtual console interface.
5  */
6 /*
7  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8  *               Alexander Warg <warg@os.inf.tu-dresden.de>,
9  *               Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
10  *     economic rights: Technische Universität Dresden (Germany)
11  *
12  * This file is part of TUD:OS and distributed under the terms of the
13  * GNU General Public License 2.
14  * Please see the COPYING-GPL-2 file for details.
15  *
16  * As a special exception, you may use this file as part of a free software
17  * library without restriction.  Specifically, if other files instantiate
18  * templates or use macros or inline functions from this file, or you compile
19  * this file and link it with other files to produce an executable, this
20  * file does not by itself cause the resulting executable to be covered by
21  * the GNU General Public License.  This exception does not however
22  * invalidate any other reasons why the executable file might be covered by
23  * the GNU General Public License.
24  */
25 #pragma once
26
27 #include <l4/sys/icu>
28 #include <l4/sys/vcon.h>
29 #include <l4/sys/capability>
30
31 namespace L4 {
32
33 /**
34  * \brief C++ L4 Vcon.
35  * \ingroup l4_vcon_api
36  *
37  * <c>\#include <l4/sys/vcon></c>
38  *
39  * \see \ref l4_vcon_api for an overview and C bindings.
40  */
41 class Vcon :
42   public Kobject_t<Vcon, Icu, L4_PROTO_LOG>
43 {
44   L4_KOBJECT(Vcon)
45
46 public:
47   /**
48    * \copydoc l4_vcon_send()
49    * \note \a vcon is the implicit \a this pointer.
50    */
51   l4_msgtag_t
52   send(char const *buf, int size, l4_utcb_t *utcb = l4_utcb()) const throw()
53   { return l4_vcon_send_u(cap(), buf, size, utcb); }
54
55   /**
56    * \copydoc l4_vcon_write()
57    * \note \a vcon is the implicit \a this pointer.
58    */
59   long
60   write(char const *buf, int size, l4_utcb_t *utcb = l4_utcb()) const throw()
61   { return l4_vcon_write_u(cap(), buf, size, utcb); }
62
63   /**
64    * \copydoc l4_vcon_read()
65    * \note \a vcon is the implicit \a this pointer.
66    */
67   int
68   read(char *buf, int size, l4_utcb_t *utcb = l4_utcb()) const throw()
69   { return l4_vcon_read_u(cap(), buf, size, utcb); }
70
71   /**
72    * \copydoc l4_vcon_set_attr()
73    * \note \a vcon is the implicit \a this pointer.
74    */
75   l4_msgtag_t
76   set_attr(l4_vcon_attr_t const *attr, l4_utcb_t *utcb = l4_utcb()) const throw()
77   { return l4_vcon_set_attr_u(cap(), attr, utcb); }
78
79   /**
80    * \copydoc l4_vcon_get_attr()
81    * \note \a vcon is the implicit \a this pointer.
82    */
83   l4_msgtag_t
84   get_attr(l4_vcon_attr_t *attr, l4_utcb_t *utcb = l4_utcb()) const throw()
85   { return l4_vcon_get_attr_u(cap(), attr, utcb); }
86 };
87
88 }