PLearn 0.1
Public Types | Public Member Functions | Public Attributes
PLearn::ArrayAllocatorIndex< IndexBase, SizeBits > Class Template Reference

This type represents an index into the allocated memory, as a bit-field parameterized by the template argument SizeBits. More...

#include <ArrayAllocatorIndex.h>

Inheritance diagram for PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >:
Inheritance graph
[legend]
Collaboration diagram for PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef IndexBase index_base
typedef ArrayAllocatorIndex
< IndexBase, SizeBits > 
index_type

Public Member Functions

 ArrayAllocatorIndex (unsigned the_index, unsigned the_size=0)
bool operator== (index_type other) const
bool operator!= (index_type other) const
bool isNull () const
void swap (index_type &other)

Public Attributes

unsigned index: 8*sizeof(IndexBase) - SizeBits
 assume that a char contains 8 bits
unsigned size: SizeBits

Detailed Description

template<class IndexBase, unsigned SizeBits>
class PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >

This type represents an index into the allocated memory, as a bit-field parameterized by the template argument SizeBits.

Definition at line 52 of file ArrayAllocatorIndex.h.


Member Typedef Documentation

template<class IndexBase, unsigned SizeBits>
typedef IndexBase PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::index_base

Definition at line 54 of file ArrayAllocatorIndex.h.

template<class IndexBase, unsigned SizeBits>
typedef ArrayAllocatorIndex<IndexBase,SizeBits> PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::index_type

Definition at line 55 of file ArrayAllocatorIndex.h.


Constructor & Destructor Documentation

template<class IndexBase, unsigned SizeBits>
PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::ArrayAllocatorIndex ( unsigned  the_index,
unsigned  the_size = 0 
) [inline]

Definition at line 61 of file ArrayAllocatorIndex.h.

        : index(the_index), size(the_size) {}

Member Function Documentation

template<class IndexBase, unsigned SizeBits>
bool PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::isNull ( ) const [inline]
template<class IndexBase, unsigned SizeBits>
bool PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::operator!= ( index_type  other) const [inline]

< don't consider block size

Definition at line 67 of file ArrayAllocatorIndex.h.

                                            {
        return index != other.index;     
    }
template<class IndexBase, unsigned SizeBits>
bool PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::operator== ( index_type  other) const [inline]

< don't consider block size

Definition at line 64 of file ArrayAllocatorIndex.h.

                                            {
        return index == other.index;     
    }
template<class IndexBase, unsigned SizeBits>
void PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::swap ( index_type other) [inline]

Definition at line 73 of file ArrayAllocatorIndex.h.

                                 {
        std::swap(index, other.index);
        std::swap(size,  other.size);
    }

Member Data Documentation

template<class IndexBase, unsigned SizeBits>
unsigned PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::index
template<class IndexBase, unsigned SizeBits>
unsigned PLearn::ArrayAllocatorIndex< IndexBase, SizeBits >::size

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines