Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

NRSimpleAttributeFactory< T > Class Template Reference

#include <nr.hh>

Inheritance diagram for NRSimpleAttributeFactory< T >:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NRSimpleAttributeFactory (int key, int type)
NRSimpleAttribute< T > * make (int op, T val, int size=-1)
NRSimpleAttribute< T > * find (NRAttrVec *attrs, NRAttrVec::iterator *place=NULL)
NRSimpleAttribute< T > * find_from (NRAttrVec *attrs, NRAttrVec::iterator start, NRAttrVec::iterator *place=NULL)
int getKey ()
int getType ()

Static Protected Member Functions

void verify_unique (NRAttributeFactory *baby)

Protected Attributes

int16_t key_
int8_t type_
NRAttributeFactorynext_

Static Protected Attributes

NRAttributeFactoryfirst_ = NULL

template<class T>
class NRSimpleAttributeFactory< T >


Constructor & Destructor Documentation

template<class T>
NRSimpleAttributeFactory< T >::NRSimpleAttributeFactory int  key,
int  type
[inline]
 

Definition at line 264 of file nr.hh.

References NRAttributeFactory::verify_unique().

00264                                               : NRAttributeFactory(key, type) {
00265     verify_unique(this);
00266   }

Here is the call graph for this function:


Member Function Documentation

template<class T>
NRSimpleAttribute<T>* NRSimpleAttributeFactory< T >::find NRAttrVec attrs,
NRAttrVec::iterator *  place = NULL
[inline]
 

Definition at line 270 of file nr.hh.

References NRAttribute::find_key_from(), and NRAttributeFactory::key_.

00271                                                               {
00272     return (NRSimpleAttribute<T>*)NRAttribute::find_key_from(key_, attrs, attrs->begin(), place);
00273   };

Here is the call graph for this function:

template<class T>
NRSimpleAttribute<T>* NRSimpleAttributeFactory< T >::find_from NRAttrVec attrs,
NRAttrVec::iterator  start,
NRAttrVec::iterator *  place = NULL
[inline]
 

Definition at line 275 of file nr.hh.

References NRAttribute::find_key_from(), and NRAttributeFactory::key_.

00277                                                                    {
00278     return (NRSimpleAttribute<T>*)NRAttribute::find_key_from(key_, attrs, start, place);
00279   };

Here is the call graph for this function:

template<class T>
int NRSimpleAttributeFactory< T >::getKey  )  [inline]
 

Definition at line 280 of file nr.hh.

References NRAttributeFactory::key_.

00280 { return key_; };

template<class T>
int NRSimpleAttributeFactory< T >::getType  )  [inline]
 

Definition at line 281 of file nr.hh.

References NRAttributeFactory::type_.

00281 { return type_; };

template<class T>
NRSimpleAttribute<T>* NRSimpleAttributeFactory< T >::make int  op,
val,
int  size = -1
[inline]
 

Definition at line 267 of file nr.hh.

References NRAttributeFactory::key_, and NRAttributeFactory::type_.

00267                                                            {
00268     return new NRSimpleAttribute<T>(key_, type_, op, val, size);
00269   };

void NRAttributeFactory::verify_unique NRAttributeFactory baby  )  [static, protected, inherited]
 

Definition at line 238 of file nr.cc.

References NRAttributeFactory::first_, NRAttributeFactory::key_, NRAttributeFactory::next_, and NRAttributeFactory::type_.

Referenced by NRSimpleAttributeFactory< T >::NRSimpleAttributeFactory().

00238                                                                {
00239    
00240    NRAttributeFactory *i = first_, *last = NULL;
00241    while (i) {
00242       if (baby->key_ == i->key_) {
00243          // identical factories are ok
00244          assert(baby->type_ == i->type_);
00245          return;  // don't enlist duplictates
00246       }
00247       last = i;
00248       i = i->next_;
00249    }
00250    // must not exist, add it
00251    if (last)
00252       last->next_ = first_;
00253    first_ = baby;
00254 }


Member Data Documentation

NRAttributeFactory * NRAttributeFactory::first_ = NULL [static, protected, inherited]
 

Definition at line 36 of file nr.cc.

Referenced by NRAttributeFactory::verify_unique().

int16_t NRAttributeFactory::key_ [protected, inherited]
 

Definition at line 246 of file nr.hh.

Referenced by NRSimpleAttributeFactory< T >::find(), NRSimpleAttributeFactory< T >::find_from(), NRSimpleAttributeFactory< T >::getKey(), NRSimpleAttributeFactory< T >::make(), NRAttributeFactory::NRAttributeFactory(), and NRAttributeFactory::verify_unique().

NRAttributeFactory* NRAttributeFactory::next_ [protected, inherited]
 

Definition at line 249 of file nr.hh.

Referenced by NRAttributeFactory::NRAttributeFactory(), and NRAttributeFactory::verify_unique().

int8_t NRAttributeFactory::type_ [protected, inherited]
 

Definition at line 247 of file nr.hh.

Referenced by NRSimpleAttributeFactory< T >::getType(), NRSimpleAttributeFactory< T >::make(), NRAttributeFactory::NRAttributeFactory(), and NRAttributeFactory::verify_unique().


The documentation for this class was generated from the following file:
Generated on Tue Apr 20 13:06:04 2004 for NS2.26SourcesOriginal by doxygen 1.3.3