Mbed for ESIMEos / Mbed 2 deprecated FRDM-KL46Z_LCD_I2C_demo

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Printable.h Source File

Printable.h

00001 /*
00002  Printable.h - Interface class that allows printing of complex types
00003  Copyright (c) 2011 Adrian McEwen.  All right reserved.
00004  This library is free software; you can redistribute it and/or
00005  modify it under the terms of the GNU Lesser General Public
00006  License as published by the Free Software Foundation; either
00007  version 2.1 of the License, or (at your option) any later version.
00008  This library is distributed in the hope that it will be useful,
00009  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  Lesser General Public License for more details.
00012  You should have received a copy of the GNU Lesser General Public
00013  License along with this library; if not, write to the Free Software
00014  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00015  */
00016 
00017 #ifndef Printable_h
00018 #define Printable_h
00019 
00020 #include <stdlib.h>
00021 
00022 class Print;
00023 
00024 /** The Printable class provides a way for new classes to allow themselves to be printed.
00025  By deriving from Printable and implementing the printTo method, it will then be possible
00026  for users to print out instances of this class by passing them into the usual
00027  Print::print and Print::println methods.
00028  */
00029 
00030 class Printable {
00031     public:
00032         virtual size_t printTo(Print& p) const = 0;
00033 };
00034 
00035 #endif