⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samplecoder.hpp

📁 Octane v1.01.20 The Open Compression Toolkit for C++ . The Open Compression Toolkit is a set of mo
💻 HPP
字号:
/// @file samplecoder.hpp
/// Sample Coder useful as a skeleton for writing new coders
///
/// @note This coder ignores any statistics that the modeler may provide
/// @author mouser
/// @date   2003.07.29
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// recursive header protection
#ifndef SampleCoderH
#define SampleCoderH
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// application includes
#include "../coder.hpp"
#include "../../modelers/modeler.hpp"
// system includes
//---------------------------------------------------------------------------




//---------------------------------------------------------------------------
/// The Sample Coder is useful only as an example of how coders work.
/// It simply outputs the symbol number as the binary contents of a c int type (4 byes),
/// ignoring any information about modeler probabilities.
///
/// @ingroup Coders
///
class SampleCoder : public OctaneCoder
{
public:
	/// constructor
	SampleCoder() {;}
	/// destructor
	virtual ~SampleCoder() {;}
public:
	//---------------------------------------------------------------------------
	// OCTANE PUBLIC API - RTTI FUNCTIONS - these are supported by all derived classes
	virtual std::string GetName() {return "SampleCoder";}
	virtual std::string GetDescription() {return "Sample Coder";}
	virtual std::string GetHelpInformation() { return ""; }
	//---------------------------------------------------------------------------
public:
	//---------------------------------------------------------------------------
	// OCTANE PUBLIC API - AUXILIARY FUNCTIONS - these are supported by all derived classes
	virtual void ShowDebuggingInfo() {;};
	virtual unsigned int GetMemoryUsed() {return (unsigned int)(sizeof(this));};
	//---------------------------------------------------------------------------
public:
	//---------------------------------------------------------------------------
	// CODER PUBLIC API - PARSING FUNCTIONS
	virtual bool WriteSymbolBits(int symbolnum,bitwriter &bw);
	virtual bool DecodeSymbolFromInput(int &symbolnum, bitreader &br);
	//---------------------------------------------------------------------------
public:
	//---------------------------------------------------------------------------
	// CODER PUBLIC API - STATE PREPARATION
	virtual bool IsReadyToCode() {return true;};
	//---------------------------------------------------------------------------
public:
	//---------------------------------------------------------------------------
	// CODER PUBLIC API - MODEL CHANGE NOTIFICATION
	virtual void ReceiveNotification_ModelChange_AllSymbolWeights(OctaneModeler *modelerp) {;};
	//---------------------------------------------------------------------------
};
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -