Main MRPT website > C++ reference for MRPT 1.9.9
CStdOutStream.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef CSTDOUTSTREAM_H
10 #define CSTDOUTSTREAM_H
11 
12 #include <mrpt/utils/CStream.h>
13 
14 namespace mrpt
15 {
16 namespace utils
17 {
18 /** This CStdOutStream derived class allow printing to standard out, normally
19  * the console text output. Please notice CStdOutStream's are binary streams,
20  * so "char *" data types only should be used if textual outputs are
21  * desired.
22  *
23  * \sa CStream
24  * \ingroup mrpt_base_grp
25  */
26 class CStdOutStream : public CStream
27 {
28  protected:
29  /** Method responsible for reading from the stream. in this class it has no
30  * effect */
31  size_t Read(void* Buffer, size_t Count) override
32  {
33  MRPT_UNUSED_PARAM(Buffer);
34  MRPT_UNUSED_PARAM(Count);
35  THROW_EXCEPTION("Read-only stream");
36  }
37  /** Method responsible for writing to the stream.
38  * Write attempts to write up to Count bytes to Buffer, and returns the
39  * number of bytes actually written. */
40  size_t Write(const void* Buffer, size_t Count) override;
41 
42  public:
44  virtual ~CStdOutStream() {}
45  /** It has no efect in this class */
47  uint64_t Offset,
49  {
50  MRPT_UNUSED_PARAM(Offset);
51  MRPT_UNUSED_PARAM(Origin);
52  THROW_EXCEPTION("Invalid operation for this kind of stream");
53  }
54  /** It has no efect in this class */
56  {
57  THROW_EXCEPTION("Invalid operation for this kind of stream");
58  }
59  /** It has no efect in this class */
60  uint64_t getPosition() override
61  {
62  THROW_EXCEPTION("Invalid operation for this kind of stream");
63  }
64 }; // End of class def.
65 } // End of namespace
66 } // End of namespace
67 #endif
TSeekOrigin
Used in CStream::Seek.
Definition: CStream.h:45
size_t Write(const void *Buffer, size_t Count) override
Method responsible for writing to the stream.
#define THROW_EXCEPTION(msg)
This CStdOutStream derived class allow printing to standard out, normally the console text output...
Definition: CStdOutStream.h:26
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
size_t Read(void *Buffer, size_t Count) override
Method responsible for reading from the stream.
Definition: CStdOutStream.h:31
uint64_t getPosition() override
It has no efect in this class.
Definition: CStdOutStream.h:60
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
unsigned __int64 uint64_t
Definition: rptypes.h:50
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
uint64_t Seek(uint64_t Offset, CStdOutStream::TSeekOrigin Origin=sFromBeginning) override
It has no efect in this class.
Definition: CStdOutStream.h:46
uint64_t getTotalBytesCount() override
It has no efect in this class.
Definition: CStdOutStream.h:55



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019