/[debian]/mimetic/trunk/mimetic/codec/codec_base.h
ViewVC logotype

Contents of /mimetic/trunk/mimetic/codec/codec_base.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 197 - (show annotations)
Sun Apr 16 12:21:05 2006 UTC (15 years, 3 months ago) by gregoa
File MIME type: text/plain
File size: 1756 byte(s)
New upstream release.

1 /***************************************************************************
2 copyright : (C) 2002-2005 by Stefano Barbato
3 email : stefano@codesink.org
4
5 $Id: codec_base.h,v 1.12 2006/03/12 12:04:36 tat Exp $
6 ***************************************************************************/
7
8 /***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16 #ifndef _MIMETIC_CODEC_CODECBASE_H_
17 #define _MIMETIC_CODEC_CODECBASE_H_
18 namespace mimetic
19 {
20
21
22 struct buffered_codec_type_tag
23 {
24 };
25
26 struct unbuffered_codec_type_tag
27 {
28 };
29
30
31 /// Codecs base class
32 struct codec
33 {
34 typedef unsigned char char_type;
35 virtual ~codec() {}
36 virtual const char* name() const = 0;
37
38 /*! return the multiplier of the required (max) size of the output buffer
39 * when encoding */
40 virtual double codeSizeMultiplier() const { return 1.0; }
41 };
42
43
44
45 /// Base class for unbuffered codecs
46 struct unbuffered_codec: public codec
47 {
48 typedef unbuffered_codec_type_tag codec_type;
49 template<typename OutIt>
50 void flush(OutIt&)
51 {
52 }
53 };
54
55 /// Base class for buffered codecs
56 struct buffered_codec: public codec
57 {
58 typedef buffered_codec_type_tag codec_type;
59 };
60
61
62 }
63
64 #endif
65

  ViewVC Help
Powered by ViewVC 1.1.26