work fine

Dependencies:   mbed

Committer:
lixianyu
Date:
Tue May 31 15:32:03 2016 +0000
Revision:
0:5ca227682ee7
???????(Pass compile!)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lixianyu 0:5ca227682ee7 1 /*
lixianyu 0:5ca227682ee7 2 Printable.h - Interface class that allows printing of complex types
lixianyu 0:5ca227682ee7 3 Copyright (c) 2011 Adrian McEwen. All right reserved.
lixianyu 0:5ca227682ee7 4
lixianyu 0:5ca227682ee7 5 This library is free software; you can redistribute it and/or
lixianyu 0:5ca227682ee7 6 modify it under the terms of the GNU Lesser General Public
lixianyu 0:5ca227682ee7 7 License as published by the Free Software Foundation; either
lixianyu 0:5ca227682ee7 8 version 2.1 of the License, or (at your option) any later version.
lixianyu 0:5ca227682ee7 9
lixianyu 0:5ca227682ee7 10 This library is distributed in the hope that it will be useful,
lixianyu 0:5ca227682ee7 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
lixianyu 0:5ca227682ee7 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
lixianyu 0:5ca227682ee7 13 Lesser General Public License for more details.
lixianyu 0:5ca227682ee7 14
lixianyu 0:5ca227682ee7 15 You should have received a copy of the GNU Lesser General Public
lixianyu 0:5ca227682ee7 16 License along with this library; if not, write to the Free Software
lixianyu 0:5ca227682ee7 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
lixianyu 0:5ca227682ee7 18 */
lixianyu 0:5ca227682ee7 19
lixianyu 0:5ca227682ee7 20 #ifndef Printable_h
lixianyu 0:5ca227682ee7 21 #define Printable_h
lixianyu 0:5ca227682ee7 22
lixianyu 0:5ca227682ee7 23 #include <stdlib.h>
lixianyu 0:5ca227682ee7 24
lixianyu 0:5ca227682ee7 25 class Print;
lixianyu 0:5ca227682ee7 26
lixianyu 0:5ca227682ee7 27 /** The Printable class provides a way for new classes to allow themselves to be printed.
lixianyu 0:5ca227682ee7 28 By deriving from Printable and implementing the printTo method, it will then be possible
lixianyu 0:5ca227682ee7 29 for users to print out instances of this class by passing them into the usual
lixianyu 0:5ca227682ee7 30 Print::print and Print::println methods.
lixianyu 0:5ca227682ee7 31 */
lixianyu 0:5ca227682ee7 32
lixianyu 0:5ca227682ee7 33 class Printable
lixianyu 0:5ca227682ee7 34 {
lixianyu 0:5ca227682ee7 35 public:
lixianyu 0:5ca227682ee7 36 virtual size_t printTo(Print& p) const = 0;
lixianyu 0:5ca227682ee7 37 };
lixianyu 0:5ca227682ee7 38
lixianyu 0:5ca227682ee7 39 #endif
lixianyu 0:5ca227682ee7 40
lixianyu 0:5ca227682ee7 41