00001 /* 00002 00003 MegaPlusPlus a C++ implementation for the MegaSquirt-II 00004 Copyright (C) 2006 Keith Ballantyne 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 version 2 as published by the Free Software Foundation. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 00019 */ 00020 00032 #ifndef SYSTEMMESSAGEPROIVDER_H 00033 #define SYSTEMMESSAGEPROVIDER_H 00034 00035 class SystemMessageProvider { 00036 public: 00037 enum MessageType { 00039 AD_CHANGE, 00041 TIMER_CHANGE 00042 }; 00043 00044 enum Status { 00046 OK, 00048 FAILED 00049 }; 00050 00056 inline MessageType getType() { return type; } 00057 00063 inline char getChannel() { return channel; } 00064 00070 virtual int getPayloadLength()=0; 00079 virtual Status getPayloadBytes(char *buffer)=0; 00080 00081 virtual ~SystemMessageProvider() {} 00082 protected: 00089 SystemMessageProvider(MessageType t, char ch):type(t),channel(ch) { 00090 } 00091 00095 const MessageType type; 00096 00100 const char channel; 00101 }; 00102 00103 #endif