NcapVector< T > Class Template Reference

#include <NcapVector.hh>

List of all members.

Public Member Functions

void push (const T &x)
pop ()
find (const char *nm)
find (std::string snm)
operator[] (long idx) const
T * ptr (long idx)
long size ()

Protected Attributes

std::vector< T > t_vector


Detailed Description

template<class T>
class NcapVector< T >

Definition at line 5 of file NcapVector.hh.


Member Function Documentation

template<class T>
T NcapVector< T >::find std::string  snm  )  [inline]
 

Definition at line 36 of file NcapVector.hh.

00036                         {
00037     return find(snm.c_str());
00038   }

template<class T>
T NcapVector< T >::find const char *  nm  )  [inline]
 

Definition at line 25 of file NcapVector.hh.

Referenced by NcapVector< sym_sct * >::find(), main(), ncap_mk_cst(), and ncap_var_init().

00025                           {
00026     int idx;
00027     int sz=t_vector.size();
00028     for(idx=0 ; idx < sz; idx++)
00029       if(!strcmp(nm, t_vector[idx]->nm)) break;
00030     if(idx < sz) 
00031         return t_vector[idx]; 
00032     else
00033          return NULL;
00034   }

template<class T>
T NcapVector< T >::operator[] long  idx  )  const [inline]
 

Definition at line 39 of file NcapVector.hh.

00039                                 {
00040     return t_vector[idx];
00041   }

template<class T>
T NcapVector< T >::pop  )  [inline]
 

Definition at line 14 of file NcapVector.hh.

00014           {
00015     T tret(0);
00016     if(t_vector.size() > 0 ) {
00017       tret=t_vector.back();
00018       t_vector.pop_back();
00019       return tret;
00020     }else{
00021       return NULL;
00022     }
00023   }

template<class T>
T* NcapVector< T >::ptr long  idx  )  [inline]
 

Definition at line 42 of file NcapVector.hh.

Referenced by main(), and ncap_var_init().

00042                    {
00043     return &t_vector[idx];
00044   }

template<class T>
void NcapVector< T >::push const T &  x  )  [inline]
 

Definition at line 11 of file NcapVector.hh.

Referenced by main(), ncap_mk_cst(), and ncap_var_init().

00011                         {
00012     t_vector.push_back(x);
00013   }

template<class T>
long NcapVector< T >::size  )  [inline]
 

Definition at line 46 of file NcapVector.hh.

Referenced by main(), and ncap_var_init().

00046              {
00047     return t_vector.size();
00048   }


Member Data Documentation

template<class T>
std::vector<T> NcapVector< T >::t_vector [protected]
 

Definition at line 8 of file NcapVector.hh.

Referenced by NcapVector< sym_sct * >::find(), NcapVector< sym_sct * >::operator[](), NcapVector< sym_sct * >::pop(), NcapVector< sym_sct * >::ptr(), NcapVector< sym_sct * >::push(), and NcapVector< sym_sct * >::size().


The documentation for this class was generated from the following file:
Generated on Thu Mar 16 18:17:38 2006 for nco by  doxygen 1.4.4