gacodevaluesbuffer.h

来自「遗传算法做的排课系统」· C头文件 代码 · 共 60 行

H
60
字号

#ifndef __GA_CODE_VALUE_BUFFER_H__
#define __GA_CODE_VALUE_BUFFER_H__

#include "..\..\ExportImport.h"
#include "..\..\CallConvention.h"

namespace Chromosome
{
	namespace Representation
	{

		// Buffer for manupulation over parts of chromosom's code
		class GaCodeValuesBuffer
		{

		private:

			// Memory buffer
			void* _buffer;

			// Size of buffer in bytes
			int _size;

			// Current position in buffer
			int _currentPosition;

		public:

			// Allocates memory for the buffer
			DLL_EXPORT
			GaCodeValuesBuffer(int size);

			// Free memory used by buffer
			DLL_EXPORT
			~GaCodeValuesBuffer();

			// Moves current position
			DLL_EXPORT
			void GACALL Move(int delta);

			// Returns pointer to start of the buffer
			DLL_EXPORT
			void* GACALL GetBuffer() const;

			// Return size of the buffer in bytes
			DLL_EXPORT
			int GACALL GetSize() const;

			// Returns current position
			DLL_EXPORT
			int GACALL GetPosition() const;

		};// END CLASS DEFINITION GaCodeValuesBuffer

	} // Representation
} // Chromosome

#endif // __GA_CODE_VALUE_BUFFER_H__

⌨️ 快捷键说明

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