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

📄 hnblockfile.hh

📁 SR-tree is an index structure for high-dimensional nearest neighbor queries
💻 HH
字号:
/*
 * HnBlockFile.hh
 *
 * DO NOT EDIT THIS FILE!
 *
 * This file is automatically generated by obj2ptr.
 * 2002/09/13 12:41:10
 */

#ifndef _HnBlockFile_hh
#define _HnBlockFile_hh

#ifndef _HNSRTIMP
#ifdef _MSC_VER
#define _HNSRTIMP _declspec(dllimport)
#else
#define _HNSRTIMP
#endif
#endif

#include "HnSRTree/HnPointer.hh"

#ifdef _MSC_VER
#include <sys/types.h>
#else
#include <unistd.h>
#endif
#include "HnSRTree/HnBlockStream.hh"

/*
 * HnBlockFile
 */

class _HNSRTIMP HnBlockFile: public HnPointer {
private:
    friend class HnBlockFileObj;
    HnBlockFile(const HnBlockFileObj *ptr) {
	HnPointer::assign((HnObject *)ptr);
    }
    HnBlockFileObj *getObject(void) const {
	return (HnBlockFileObj *)HnPointer::getObject();
    }
public:
    static const HnBlockFile null;
    HnBlockFile(void) {}
public:
    _HNSRTIMP friend HnBlockFile
    new_HnBlockFile(const char *fileName, int blockSize);
    _HNSRTIMP friend HnBlockFile
    new_HnBlockFile(const char *fileName, const char *mode);
    _HNSRTIMP friend HnBlockFile
    new_HnBlockFile(int blockSize);

    int getBlockSize(void);
    off_t getFileSize(void);

    /* super block (the first block is reserved for the super block) */
    int getSuperBlockCapacity(void) const;
    void readSuperBlock(HnBlockStream &blockStream);
    void writeSuperBlock(const HnBlockStream &blockStream);

    /* regular blocks */
    void readBlock(off_t offset, HnBlockStream &blockStream);
    void writeBlock(off_t offset, const HnBlockStream &blockStream);

    void close(void);

    HnBool dumpToFile(const char *fileName);
    HnBool dumpToFileStream(FILE *fp);
};

#include "HnSRTree/HnString.hh"

#define HnClass HnBlockFile
#include "HnSRTree/HnClassArray.hh"

#include "HnSRTree/HnBlockFileObj.hh"

inline int
HnBlockFile::getBlockSize(void)
{
    return getObject()->getBlockSize();
}

inline off_t
HnBlockFile::getFileSize(void)
{
    return getObject()->getFileSize();
}

inline int
HnBlockFile::getSuperBlockCapacity(void) const
{
    return getObject()->getSuperBlockCapacity();
}

inline void
HnBlockFile::readSuperBlock(HnBlockStream &blockStream)
{
    getObject()->readSuperBlock(blockStream);
}

inline void
HnBlockFile::writeSuperBlock(const HnBlockStream &blockStream)
{
    getObject()->writeSuperBlock(blockStream);
}

inline void
HnBlockFile::readBlock(off_t offset, HnBlockStream &blockStream)
{
    getObject()->readBlock(offset, blockStream);
}

inline void
HnBlockFile::writeBlock(off_t offset, const HnBlockStream &blockStream)
{
    getObject()->writeBlock(offset, blockStream);
}

inline void
HnBlockFile::close(void)
{
    getObject()->close();
}

inline HnBool
HnBlockFile::dumpToFile(const char *fileName)
{
    return getObject()->dumpToFile(fileName);
}

inline HnBool
HnBlockFile::dumpToFileStream(FILE *fp)
{
    return getObject()->dumpToFileStream(fp);
}


#endif /* _HnBlockFile_hh */

⌨️ 快捷键说明

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