halapi hierarchichalalignmentformatapi

- Main Page
- Namespaces
- Classes
- Files

- File List

hdf5_impl/hdf5TopSegmentType.h

    00001 /*
    00002  * Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
    00003  *
    00004  * Released under the MIT license, see LICENSE.txt
    00005  */
    00006
    00007 #ifndef _HDF5TOPSEGMENTTYPE_H
    00008 #define _HDF5TOPSEGMENTTYPE_H
    00009
    00010 #include "topSegmentType.h"
    00011 #includeo "rawH5ExternalArray.h"
    00012
    00013 namespace hal {
    00014
    00018 struct TopSegmentType<RawH5ExternalArray>
    00019 {
    00020    typedef ArrayTraits<RawH5ExternalArray>::size_type size_type;
    00021    typedef ArrayTraits<RawH5ExternalArray>::index_type index_type;
    00022    typedef ArrayTraits<RawH5ExternalArray>::bool_type bool_type;
    00023    typedef ArrayTraits<RawH5ExternalArray>::h5index_type h5index_type;
    00024    typedef ArrayTraits<RawH5ExternalArray>::h5bool_type h5bool_type;
    00025
    00028    static H5::CompType getTypeInfo(H5::hbool_t isRoot);
    00029
    00030    static size_type getGenomeIndexOffset();
    00031    static size_type getLengthOffset();
    00032    static size_type getBottomIndexOffset();
    00033    static size_type getBottomOffsetOffset();
    00034    static size_type getParentIndexOffset(size_type i);
    00035    static size_type getParentInverseOffset(size_type i);
    00036 };
    00037
    00038 // INLINE MEMBERS
    00039
    00040 inline size_type BottomSegmentType<RawH5ExternalArray>::getGenomeIndexOffset()
    00041 {
    00042   return 0;
    00043 }
    00044
    00045 inline size_type BottomSegmentType<RawH5ExternalArray>::getLengthOffset()
    00046 {
    00047   return sizeof(index_type);
    00048 }
    00049
    00050 inline size_type BottomSegmentType<RawH5ExternalArray>::getBottomIndexOffset()
    00051 {
    00052   return 2 * sizeof(index_type);
    00053 }
    00054
    00055 inline size_type BottomSegmentType<RawH5ExternalArray>::getBottomOffsetOffset()
    00056 {
    00057   return 3 * sizeof(index_type);
    00058 }
    00059
    00060 inline size_type BottomSegmentType<RawH5ExternalArray>::
    00061 getParentIndexOffset(size_type i)
    00062 {
    00063   return 4 * sizeof(index_type);
    00064 }
    00065
    00066 inline size_type BottomSegmentType<RawH5ExternalArray>::
    00067 getParentInverseOffset(size_type i)
    00068 {
    00069   return getParentIndexOffset() + sizeof(bool_type);
    00070 }
    00071
    00072 inline H5::CompType TopSegmentType<RawH5ExternalArray>::getTypeInfo(
    00073   hsize_t numChildren)
    00074 {
    00075   H5::CompType dataType;
    00076   dataType.insertMember("genomeIdx", getGenomeIndexOffset(), h5index_type);
    00077   dataType.insertMember("length", getLengthOffset(), h5index_type);
    00078   dataType.insertMember("bottomIdx", getBottomIndexOffset(), h5index_type);
    00079   dataType.insertMember("bottomOffset", getBottomOffsetOffset(), h5index_type);
    00080   if (isRoot == false)
    00081   {
    00082     dataType.insertMember("parentIdx", getParentIndexOffset(), h5index_type);
    00083     dataType.insertMember("reverseFlag", getParentInverseOffset(), h5bool_type);
    00084   }
    00085
    00086   return dataType;
    00087 }
    00088
    00089 }
    00090 #endif

All Classes Namespaces Functions Variables Typedefs Friends