00001 // -*- C++ -*- 00002 00003 // protocol.h - This file defines two classes. Encoder, and Decoder. 00004 // It is expected that protocol definitions will multiply inherit from 00005 // both of these abstract classes, and then define the members to deal 00006 // with the protocol they are to provide support for. It would 00007 // therefore be possible to design a protocol that could only encode 00008 // or decode, by inheriting from only one of the classes defined here, 00009 // which would then cause a compile-time error if that protocol was 00010 // used in the direction it does not support. 00011 00012 // ***** BEGIN LICENSE BLOCK ***** 00013 // Version: MPL 1.1/GPL 2.0/LGPL 2.1 00014 // 00015 // The contents of this file are subject to the Mozilla Public License 00016 // Version 1.1 (the "License"); you may not use this file except in 00017 // compliance with the License. You may obtain a copy of the License at 00018 // http://www.mozilla.org/MPL/ 00019 // 00020 // Software distributed under the License is distributed on an "AS IS" 00021 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00022 // the License for the specific language governing rights and limitations 00023 // under the License. 00024 // 00025 // The Original Code is the consmgr network/serial-line monitoring package. 00026 // 00027 // The Initial Developer of the Original Code is Chris P. Ross. 00028 // Portions created by the Initial Developer are Copyright (C) 2000-2008 00029 // the Initial Developer. All Rights Reserved. 00030 // 00031 // Contributor(s): 00032 // 00033 // Alternatively, the contents of this file may be used under the terms of 00034 // either the GNU General Public License Version 2 or later (the "GPL"), or 00035 // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 00036 // in which case the provisions of the GPL or the LGPL are applicable instead 00037 // of those above. If you wish to allow use of your version of this file only 00038 // under the terms of either the GPL or the LGPL, and not to allow others to 00039 // use your version of this file under the terms of the MPL, indicate your 00040 // decision by deleting the provisions above and replace them with the notice 00041 // and other provisions required by the GPL or the LGPL. If you do not delete 00042 // the provisions above, a recipient may use your version of this file under 00043 // the terms of any one of the MPL, the GPL or the LGPL. 00044 // 00045 // ***** END LICENSE BLOCK ***** 00046 00047 #ifndef __PROTOCOL_H 00048 #define __PROTOCOL_H 00049 00050 class Encoder 00051 { 00052 protected: 00053 // virtual Blob *encode(Blob *) = 0; 00054 }; 00055 00056 class Decoder 00057 { 00058 protected: 00059 // virtual Blob *decode(Blob *) = 0; 00060 }; 00061 00062 #endif /* __PROTOCOL_H */