Back to index

texmacs  1.0.7.15
Public Member Functions | Private Attributes | Friends
array_rep< T > Class Template Reference

#include <array.hpp>

Inheritance diagram for array_rep< T >:
Inheritance graph
[legend]
Collaboration diagram for array_rep< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 array_rep ()
 array_rep (int n)
 ~array_rep ()
void resize (int n)

Private Attributes

int n
Ta
int ref_count

Friends

class array< T >
int N LESSGTR (array< T > a)
T *A LESSGTR (array< T > a)
array< T > copy LESSGTR (array< T > a)

Detailed Description

template<class T>
class array_rep< T >

Definition at line 23 of file array.hpp.


Constructor & Destructor Documentation

template<class T >
array_rep< T >::array_rep ( ) [inline]

Definition at line 28 of file array.hpp.

: n(0), a(NULL) {}
template<class T >
array_rep< T >::array_rep ( int  n)

Definition at line 30 of file array.cpp.

                              :
  n(n2), a((n==0)?((T*) NULL):(tm_new_array<T> (round_length(n, sizeof (T))))) {}
template<class T >
array_rep< T >::~array_rep ( ) [inline]

Definition at line 30 of file array.hpp.

{ if (n!=0) tm_delete_array (a); }

Here is the call graph for this function:


Member Function Documentation

template<class T >
void array_rep< T >::resize ( int  n)

Definition at line 34 of file array.cpp.

                                    {
  register int nn= round_length (n, sizeof (T));
  register int mm= round_length (m, sizeof (T));
  if (mm != nn) {
    if (mm != 0) {
      register int i, k= (m<n? m: n);
      T* b= tm_new_array<T> (mm);
      for (i=0; i<k; i++) b[i]= a[i];
      if (nn != 0) tm_delete_array (a);
      a= b;
    }
    else {
      if (nn != 0) tm_delete_array (a);
      a= NULL;
    }
  }
  n= m;
}

Here is the call graph for this function:


Friends And Related Function Documentation

template<class T >
friend class array< T > [friend]

Definition at line 32 of file array.hpp.

template<class T >
int N LESSGTR ( array< T a) [friend]
template<class T >
T* A LESSGTR ( array< T a) [friend]
template<class T >
array<T> copy LESSGTR ( array< T a) [friend]

Member Data Documentation

template<class T >
T* array_rep< T >::a [private]

Definition at line 25 of file array.hpp.

template<class T >
int array_rep< T >::n [private]

Definition at line 24 of file array.hpp.

int concrete_struct::ref_count [inherited]

Definition at line 135 of file basic.hpp.


The documentation for this class was generated from the following files: