DUDS
Distributed Update of Data from Something
DisplayErrors.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2018 Jeff Jackowski
9  */
10 #ifndef DISPLAYERRORS_HPP
11 #define DISPLAYERRORS_HPP
12 
13 #include <boost/exception/info.hpp>
14 #include <cstdint>
15 
16 namespace duds { namespace hardware { namespace display {
17 
21 struct DisplayError : virtual std::exception, virtual boost::exception { };
43 
50  std::uint8_t col, row;
51  Info_DisplayColRow(unsigned int c, unsigned int r) : col(c), row(r) { }
52  template <class Char, class Traits>
53  friend std::basic_ostream<Char, Traits> &operator << (
54  std::basic_ostream<Char, Traits> &os, const Info_DisplayColRow &idrc
55  ) {
56  return os << '(' << (int)idrc.col << ", " << (int)idrc.row << ')';
57  }
58 };
59 
63 typedef boost::error_info<struct Info_DisplayPosition, Info_DisplayColRow>
68 typedef boost::error_info<struct Info_DisplaySize, Info_DisplayColRow>
73 typedef boost::error_info<struct Info_DisplayGlyph, int> DisplayGlyphIndex;
74 
75 } } }
76 
77 #endif // #ifndef DISPLAYERRORS_HPP
boost::error_info< struct Info_DisplayPosition, Info_DisplayColRow > TextDisplayPositionInfo
Column and row of a display position as part of an error.
An attempt was made to use an uninitialized display object.
The image given for a definable glyph was an unsupported size.
The specified location is beyond the bounds of the display.
Info_DisplayColRow(unsigned int c, unsigned int r)
boost::error_info< struct Info_DisplayGlyph, int > DisplayGlyphIndex
Index used for a definable glyph.
The specified display size is unsupported, or there is a display size mismatch.
Stores column and row data for display errors.
ConversationVector & operator<<(ConversationVector &cv, const Int &i)
Insertion operator to add an integer to a ConversationVector object.
The index given for a definable glyph was outside the allowable range.
Base class for all errors specifically from a TextDisplay.
boost::error_info< struct Info_DisplaySize, Info_DisplayColRow > TextDisplaySizeInfo
Column and row size of a display as part of an error.