Classes | Functions

/Users/garethloy/Musimathics/Musimat1.2/include/List.h File Reference

The basic List class template. More...

#include <assert.h>
#include <memory.h>
#include <iostream>

Go to the source code of this file.

Classes

class  List< Type >
 The List class template is used to construct lists of all types, Integer, Real, Complex, Pitch, Rhythm, etc. More...

Functions

template<class Type >
Integer Length (Type &L)
 Return the length of a list.
template<class Type >
Type Join (Type &L1, Type &L2)
 Join 2 Lists.
template<class Type >
Type Join (Type &L1, Type &L2, Type &L3)
 Join 3 Lists.
template<class Type >
Type Join (Type &L1, Type &L2, Type &L3, Type &L4)
 Join 4 Lists.
template<class Type >
Type Join (Type &L1, Type &L2, Type &L3, Type &L4, Type &L5)
 Join 5 Lists.
template<class Type >
Type Join (Type &L1, Type &L2, Type &L3, Type &L4, Type &L5, Type &L6)
 Join 6 Lists.
template<class Type >
Type Join (Type &L1, Type &L2, Type &L3, Type &L4, Type &L5, Type &L6, Type &L7)
 Join 7 Lists.
template<class TargetListType , class ElementType , class ListType >
TargetListType Map (ListType L, ElementType(*fn)(ElementType))
 Map -- Apply function to all elements of a list.

Detailed Description

The basic List class template.

Definition in file List.h.


Function Documentation

template<class Type >
Integer Length ( Type &  L ) [inline]

Return the length of a list.

Definition at line 563 of file List.h.

References Return.

{ Return( L.length() ); }
template<class TargetListType , class ElementType , class ListType >
TargetListType Map ( ListType  L,
ElementType(*)(ElementType)  fn 
)

Map -- Apply function to all elements of a list.

Definition at line 592 of file List.h.

References For, Length(), and Return.

{
        For( Integer i = 0; i < Length( L ); i++ )
                L[i] = fn( L[i] );
        Return( L );
}