SASC
DVBSoftCAM

SI::TypeLoop< T > Class Template Reference

#include <si.h>

Inheritance diagram for SI::TypeLoop< T >:

List of all members.

Public Member Functions

int getCount ()
T operator[] (const int index) const
T getNext (Iterator &it) const
bool hasNext (Iterator &it)

Detailed Description

template<typename T>
class SI::TypeLoop< T >

Definition at line 387 of file si.h.


Member Function Documentation

template<typename T>
int SI::TypeLoop< T >::getCount ( ) [inline]

Definition at line 389 of file si.h.

{ return getLength()/sizeof(T); }
template<typename T>
T SI::TypeLoop< T >::getNext ( Iterator &  it) const [inline]

Definition at line 404 of file si.h.

      {
         T ret=operator[](it.i);
         it.i+=sizeof(T);
         return ret;
      }
template<typename T>
bool SI::TypeLoop< T >::hasNext ( Iterator &  it) [inline]

Definition at line 410 of file si.h.

{ return isValid() && (getLength() > it.i); }
template<typename T>
T SI::TypeLoop< T >::operator[] ( const int  index) const [inline]

Definition at line 390 of file si.h.

Referenced by SI::TypeLoop< SixteenBit >::getNext().

      {
         switch (sizeof(T)) {
         case 1:
            return data[index];
         case 2:
            return data.TwoBytes(index);
         case 4:
            return data.FourBytes(index);
         case 8:
            return (SixtyFourBit(data.FourBytes(index)) << 32) | data.FourBytes(index+4);
         }
         return 0; // just to avoid a compiler warning
      }

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