cgma
CardRef< T > Class Template Reference
Inheritance diagram for CardRef< T >:
DataRef< T >

List of all members.

Public Member Functions

 CardRef (InputDeck &deck_p, DataCard::kind kind, int ident)
virtual const T & getData () const
virtual CardRef< T > * clone ()
const DataCard::id_tgetKey () const

Protected Attributes

InputDeckdeck
DataCard::id_t key

Detailed Description

template<class T>
class CardRef< T >

Definition at line 16 of file MCNPInput.cpp.


Constructor & Destructor Documentation

template<class T>
CardRef< T >::CardRef ( InputDeck deck_p,
DataCard::kind  kind,
int  ident 
) [inline]

Definition at line 23 of file MCNPInput.cpp.

                                                             : 
    DataRef<T>(), deck(deck_p), key( std::make_pair( kind, ident ) )
  {}

Member Function Documentation

template<class T>
virtual CardRef<T>* CardRef< T >::clone ( ) [inline, virtual]

Implements DataRef< T >.

Definition at line 33 of file MCNPInput.cpp.

                              {
    return new CardRef<T>( *this );
  }
template<class T>
virtual const T& CardRef< T >::getData ( ) const [inline, virtual]

Implements DataRef< T >.

Definition at line 27 of file MCNPInput.cpp.

                                   {
    DataCard* c = deck.lookup_data_card( key );
    const T& ref = dynamic_cast< DataRef<T>* >(c)->getData();
    return ref;
  }
template<class T>
const DataCard::id_t& CardRef< T >::getKey ( ) const [inline]

Definition at line 37 of file MCNPInput.cpp.

{ return key; } 

Member Data Documentation

template<class T>
InputDeck& CardRef< T >::deck [protected]

Definition at line 19 of file MCNPInput.cpp.

template<class T>
DataCard::id_t CardRef< T >::key [protected]

Definition at line 20 of file MCNPInput.cpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines