List< T, l > Class Template Reference

#include <List.h>

List of all members.


Detailed Description

template<class T, int l>
class List< T, l >

Fixed size simple list. Initialized at compile time... usually used for slice definition and ranges.

Definition at line 76 of file List.h.

Public Member Functions

 List (void)
 List (T e,...)
 ~List (void)
const T * DataPtr ()
T * Data ()
int Length ()
T & operator[] (const int i)

Protected Attributes

data [l]
int length

Friends

ostream & operator<< (ostream &output, List< T, l > &m)


Constructor & Destructor Documentation

template<class T, int l>
List< T, l >::List void   )  [inline]
 

Definition at line 84 of file List.h.

00085     {
00086         length = l;
00087     }

template<class T, int l>
List< T, l >::List e,
  ...
[inline]
 

Definition at line 89 of file List.h.

00090     {
00091         length = l;
00092         data[0] = e;
00093         
00094         va_list argptr;
00095         va_start(argptr, e);
00096         for(int i=1; i<length; i++)
00097         {
00098             data[i] = va_arg(argptr, T);
00099         }
00100         va_end(argptr);
00101     }

template<class T, int l>
List< T, l >::~List void   )  [inline]
 

Definition at line 104 of file List.h.

00105     {
00106     }


Member Function Documentation

template<class T, int l>
T* List< T, l >::Data  )  [inline]
 

Definition at line 114 of file List.h.

00115     {
00116         return data;
00117     }

template<class T, int l>
const T* List< T, l >::DataPtr  )  [inline]
 

Definition at line 109 of file List.h.

00110     {
00111         return data;
00112     }

template<class T, int l>
int List< T, l >::Length  )  [inline]
 

Definition at line 119 of file List.h.

00120     {
00121         return length;
00122     }

template<class T, int l>
T& List< T, l >::operator[] const int  i  )  [inline]
 

Definition at line 124 of file List.h.

00125     {
00126         return data[i];
00127     }


Friends And Related Function Documentation

template<class T, int l>
ostream& operator<< ostream &  output,
List< T, l > &  m
[friend]
 

Definition at line 129 of file List.h.

00130     {
00131         output << "(";
00132         for(int i=0; i<l-1; i++)
00133         {
00134             output << m.data[i] << ",";
00135         }
00136         output << m.data[l-1] << ")";
00137         return output;
00138     }


Member Data Documentation

template<class T, int l>
T List< T, l >::data[l] [protected]
 

Definition at line 79 of file List.h.

template<class T, int l>
int List< T, l >::length [protected]
 

Definition at line 80 of file List.h.


The documentation for this class was generated from the following file:
CIMPL 0.1 Code Reference. Copyright © 2004, Baris Sumengen. All rights reserved.