📄 umc_fio_reader.h
字号:
/*//// INTEL CORPORATION PROPRIETARY INFORMATION// This software is supplied under the terms of a license agreement or// nondisclosure agreement with Intel Corporation and may not be copied// or disclosed except in accordance with the terms of that agreement.// Copyright(c) 2003-2005 Intel Corporation. All Rights Reserved.//*/#ifndef __UMC_FIO_READER_H__#define __UMC_FIO_READER_H__#include "umc_defs.h"#if defined (UMC_ENABLE_FIO_READER)#include "umc_file_reader.h"#include <stdio.h>namespace UMC{ class FIOReader : public DataReader { DYNAMIC_CAST_DECL(FIOReader, DataReader); public: ////////////////////////////////////////////////////////////////////////////// // Name: Init // // Purpose: Create and map first portion from file // // Parameters: // InitParams Pointer to the init (for filereader it's vm_char file_name[255] and portion_size // // // Return: // UMC_OK // UMC_FAILED_TO_OPEN_DEVICE file was not open // UMC_FAILED_TO_ALLOCATE_BUFFER mapping was not create // // // Notes: default value of portion_size is 0. After open portion = 1 // //////////////////////////////////////////////////////////////////////////////// virtual Status Init (DataReaderParams *InitParams); ////////////////////////////////////////////////////////////////////////////// // Name: Close // // Purpose: Close file // // Return: // UMC_OK // // Notes: // //////////////////////////////////////////////////////////////////////////////// virtual Status Close (); ////////////////////////////////////////////////////////////////////////////// // Name: Reset // // Purpose: Reset all internal parameters // // Parameters: // // Return: // UMC_OK // UMC_NOT_INITIALIZED - object was not initialize // UMC_FAILED_TO_ALLOCATE_BUFFER - mapping was not create // // Notes: // //////////////////////////////////////////////////////////////////////////////// virtual Status Reset (); ////////////////////////////////////////////////////////////////////////////// // Name: ReadData // // Purpose: Read nsize bytes and copy to data (return number bytes which was copy) // Cache data in case of small nsize // // Parameters: // data pointer to the data where copy nsize byte from stream // nsize integer - number bytes // // // Return: // UMC_OK // UMC_NOT_INITIALIZED - object was not initialize // UMC_END_OF_STREAM - end of stream // // // //////////////////////////////////////////////////////////////////////////////// virtual Status ReadData (void *data,vm_var32 *nsize) ; ////////////////////////////////////////////////////////////////////////////// // Name: MovePosition // // Purpose: Move position on npos bytes // // Parameters: // npos integer (+/-) bytes // // // Return: // UMC_OK // UMC_NOT_INITIALIZED - object was not initialize // UMC_END_OF_STREAM - end of stream // // // Notes: // //////////////////////////////////////////////////////////////////////////////// virtual Status MovePosition (vm_sizet npos) ; virtual Status CacheData (void *data, vm_var32 *nsize, int how_far); ////////////////////////////////////////////////////////////////////////////// // Name: SetPosition // // Purpose: Set position // // Parameters: // pos double (0:1.0) // // Return: // OK // ERR_MAP Error map next portion // // Notes: set position in the stream (file size * pos) // //////////////////////////////////////////////////////////////////////////////// virtual Status SetPosition (double pos); // return position in the stream virtual vm_sizet GetPosition (); // return file_size virtual vm_sizet GetSize (); FIOReader(); virtual ~FIOReader(); protected: FILE* m_pFile; vm_sizet m_stFileSize; // file size vm_sizet m_stPos; // position in current portion of file };}//namespace UMC#endif //(UMC_ENABLE_FILE_READER)#endif /* __UMC_FIO_READER_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -