Main MRPT website > C++ reference
MRPT logo
CStdOutStream.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef CSTDOUTSTREAM_H
29 #define CSTDOUTSTREAM_H
30 
31 #include <mrpt/utils/CStream.h>
32 
33 /*---------------------------------------------------------------
34  Class
35  ---------------------------------------------------------------*/
36 namespace mrpt
37 {
38 namespace utils
39 {
40  /** This CStdOutStream derived class allow printing to standard out, normally
41  * the console text output. Please notice CStdOutStream's are binary streams,
42  * so "char *" data types only should be used if textual outputs are
43  * desired.
44  *
45  * \sa CStream
46  * \ingroup mrpt_base_grp
47  */
49  {
50  protected:
51  /** Method responsible for reading from the stream:
52  * In this class it has no effect.
53  */
54  size_t Read(void *Buffer, size_t Count) { THROW_EXCEPTION("Read-only stream"); }
55 
56  /** Method responsible for writing to the stream.
57  * Write attempts to write up to Count bytes to Buffer, and returns the number of bytes actually written.
58  */
59  size_t Write(const void *Buffer,size_t Count);
60 
61  public:
62  /** Constructor
63  */
65 
66  /** Destructor
67  */
68  virtual ~CStdOutStream() { }
69 
70  /** It has no efect in this class.
71  */
72  uint64_t Seek(long Offset, CStdOutStream::TSeekOrigin Origin = sFromBeginning)
73  { THROW_EXCEPTION("Invalid operation for this kind of stream"); }
74 
75  /** It has no efect in this class.
76  */
77  uint64_t getTotalBytesCount()
78  { THROW_EXCEPTION("Invalid operation for this kind of stream"); }
79 
80  /** It has no efect in this class.
81  */
82  uint64_t getPosition()
83  { THROW_EXCEPTION("Invalid operation for this kind of stream"); }
84 
85  }; // End of class def.
86 
87 } // End of namespace
88 } // End of namespace
89 
90 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013