L4Re - L4 Runtime Environment
l4iostream
Go to the documentation of this file.
1 /**
2  * \file
3  * \brief L4 IO stream
4  */
5 /*
6  * (c) 2004-2009 Alexander Warg <warg@os.inf.tu-dresden.de>
7  * economic rights: Technische Universit├Ąt Dresden (Germany)
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 #ifndef L4_L4IOSTREAM_H__
24 #define L4_L4IOSTREAM_H__
25 
26 #include <l4/cxx/basic_ostream>
27 #include <l4/sys/types.h>
28 #include <l4/sys/capability>
29 
30 inline
31 L4::BasicOStream &operator << (L4::BasicOStream &o, l4_msgtag_t const &tag)
32 {
33  L4::IOBackend::Mode m = o.be_mode();
34  o << "[l=" << L4::dec << tag.label() << "; w=" << tag.words() << "; i="
35  << tag.items() << "]";
36  o.be_mode(m);
37  return o;
38 }
39 
40 template<typename T>
41 inline
42 L4::BasicOStream &operator << (L4::BasicOStream &o, L4::Cap<T> const &cap)
43 {
44  o << "[C:" << L4::n_hex(cap.cap()) << "]";
45  return o;
46 }
47 
48 
49 #endif