Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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/*---------------------------------------------------------------
15 Class
16 ---------------------------------------------------------------*/
17namespace mrpt
18{
19namespace utils
20{
21 /** This CStdOutStream derived class allow printing to standard out, normally
22 * the console text output. Please notice CStdOutStream's are binary streams,
23 * so "char *" data types only should be used if textual outputs are
24 * desired.
25 *
26 * \sa CStream
27 * \ingroup mrpt_base_grp
28 */
30 {
31 protected:
32 /** Method responsible for reading from the stream. in this class it has no effect */
33 size_t Read(void *Buffer, size_t Count) MRPT_OVERRIDE {
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 number of bytes actually written. */
39 size_t Write(const void *Buffer,size_t Count) MRPT_OVERRIDE;
40 public:
42 virtual ~CStdOutStream() { }
43 /** It has no efect in this class */
44 uint64_t Seek(uint64_t Offset, CStdOutStream::TSeekOrigin Origin = sFromBeginning) MRPT_OVERRIDE { MRPT_UNUSED_PARAM(Offset); MRPT_UNUSED_PARAM(Origin); THROW_EXCEPTION("Invalid operation for this kind of stream"); }
45 /** It has no efect in this class */
46 uint64_t getTotalBytesCount() MRPT_OVERRIDE { THROW_EXCEPTION("Invalid operation for this kind of stream"); }
47 /** It has no efect in this class */
48 uint64_t getPosition() MRPT_OVERRIDE { THROW_EXCEPTION("Invalid operation for this kind of stream"); }
49 }; // End of class def.
50} // End of namespace
51} // End of namespace
52#endif
This CStdOutStream derived class allow printing to standard out, normally the console text output.
Definition: CStdOutStream.h:30
uint64_t getTotalBytesCount() MRPT_OVERRIDE
It has no efect in this class.
Definition: CStdOutStream.h:46
size_t Write(const void *Buffer, size_t Count) MRPT_OVERRIDE
Method responsible for writing to the stream.
uint64_t Seek(uint64_t Offset, CStdOutStream::TSeekOrigin Origin=sFromBeginning) MRPT_OVERRIDE
It has no efect in this class.
Definition: CStdOutStream.h:44
size_t Read(void *Buffer, size_t Count) MRPT_OVERRIDE
Method responsible for reading from the stream.
Definition: CStdOutStream.h:33
uint64_t getPosition() MRPT_OVERRIDE
It has no efect in this class.
Definition: CStdOutStream.h:48
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:39
TSeekOrigin
Used in CStream::Seek.
Definition: CStream.h:43
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28
#define THROW_EXCEPTION(msg)
Definition: mrpt_macros.h:110
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
Definition: mrpt_macros.h:290
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.5 for MRPT 1.4.0 SVN: at Mon Dec 26 04:51:47 UTC 2022