Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JNullStreamBuffer.hh
Go to the documentation of this file.
1#ifndef __JLANG__JNULLSTREAMBUFFER__
2#define __JLANG__JNULLSTREAMBUFFER__
3
4#include <stdio.h>
5#include <streambuf>
6
7
8/**
9 * \author mdejong
10 */
11
12namespace JLANG {}
13namespace JPP { using namespace JLANG; }
14
15namespace JLANG {
16
17
18 /**
19 * Null stream buffer.
20 */
22 public virtual std::streambuf
23 {
24 public:
25
26
27 typedef std::streambuf::traits_type traits;
28 typedef traits::int_type int_type;
29 typedef std::streamsize streamsize;
30
31
32 /**
33 * Default constructor.
34 */
37
38
39 /**
40 * Get reference to unique instance of this class object.
41 *
42 * \return reference to this class object
43 */
45 {
46 static const JNullStreamBuffer null;
47
48 return null;
49 }
50
51
52 /**
53 * Check underflow.
54 * This method reads nothing.
55 *
56 * \return 0
57 */
59 {
60 return EOF;
61 }
62
63
64 /**
65 * Check overflow.
66 * This method writes nothing.
67 *
68 * \param c character
69 * \return c
70 */
72 {
73 return c;
74 }
75 };
76}
77
78#endif
virtual int_type overflow(int_type c)
Check overflow.
virtual int_type underflow()
Check underflow.
static const JNullStreamBuffer & getInstance()
Get reference to unique instance of this class object.
std::streambuf::traits_type traits
JNullStreamBuffer()
Default constructor.
Auxiliary classes and methods for language specific functionality.
static JNullStream null
Null I/O stream.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).