/*
 * HnSRTreeBlock.hh
 *
 * DO NOT EDIT THIS FILE!
 *
 * This file is automatically generated by obj2ptr.
 * 2006/08/03 17:37:44
 */

#ifndef _HnSRTreeBlock_hh
#define _HnSRTreeBlock_hh

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

#include "HnSRTree/HnPointer.hh"

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

/*
 * HnSRTreeBlock
 */

class HnSRTreeBlockObj;

class _HNSRTIMP HnSRTreeBlock: public HnPointer {
private:
    friend class HnSRTreeBlockObj;
    HnSRTreeBlock(const HnSRTreeBlockObj *ptr) {
	HnPointer::assign((HnObject *)ptr);
    }
    HnSRTreeBlockObj *getObject(void) const {
	return (HnSRTreeBlockObj *)HnPointer::getObject();
    }
public:
    static const HnSRTreeBlock null;
    HnSRTreeBlock(void) {}
public:
    typedef enum { NODE, LEAF, FREE } Type;

    _HNSRTIMP friend HnSRTreeBlock
    new_HnSRTreeBlock(long offset, int size, HnSRTreeBlock::Type type);
    _HNSRTIMP friend HnSRTreeBlock
    new_HnSRTreeBlock(long offset, HnBlockStream &blockStream);

    /* attributes */
    long getOffset(void) const;
    int getSize(void) const;
    HnSRTreeBlock::Type getType(void) const;
    const HnBlockStream &getBlockStream(void) const;

    HnBlockStream getBody(void) const;

    HnBool isNode(void) const;
    HnBool isLeaf(void) const;
    HnBool isFree(void) const;

    static int getBodyCapacity(const HnSRTreeInfo &info);
};

    _HNSRTIMP HnSRTreeBlock
    new_HnSRTreeBlock(long offset, int size, HnSRTreeBlock::Type type);
    _HNSRTIMP HnSRTreeBlock
    new_HnSRTreeBlock(long offset, HnBlockStream &blockStream);

#include "HnSRTree/HnString.hh"

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

#include "HnSRTree/HnSRTreeBlockObj.hh"

inline long
HnSRTreeBlock::getOffset(void) const
{
    return getObject()->getOffset();
}

inline int
HnSRTreeBlock::getSize(void) const
{
    return getObject()->getSize();
}

inline HnSRTreeBlock::Type
HnSRTreeBlock::getType(void) const
{
    return getObject()->getType();
}

inline const HnBlockStream &
HnSRTreeBlock::getBlockStream(void) const
{
    return getObject()->getBlockStream();
}

inline HnBlockStream
HnSRTreeBlock::getBody(void) const
{
    return getObject()->getBody();
}

inline HnBool
HnSRTreeBlock::isNode(void) const
{
    return getObject()->isNode();
}

inline HnBool
HnSRTreeBlock::isLeaf(void) const
{
    return getObject()->isLeaf();
}

inline HnBool
HnSRTreeBlock::isFree(void) const
{
    return getObject()->isFree();
}

inline int
HnSRTreeBlock::getBodyCapacity(const HnSRTreeInfo &info)
{
    return HnSRTreeBlockObj::getBodyCapacity(info);
}


#endif /* _HnSRTreeBlock_hh */
