FieldMap Class Reference

#include <io/fields.h>

Collaboration diagram for FieldMap:

Collaboration graph

List of all members.

Public Types

typedef rutz::fwd_iter< const
 Iterator type.

Public Member Functions

 FieldMap (const Field *begin, const Field *end, const FieldMap *parent=0)
 Construct from a sequence of Field objects.
template<unsigned int N>
 FieldMap (Field const (&array)[N], const FieldMap *parent=0)
 Construct from an array of Field objects.
 ~FieldMap ()
bool hasParent () const throw ()
 Query whether this FieldMap has a parent.
const FieldMapparent () const throw ()
 Get this FieldMap's parent (or null if non-existent).
const Fieldfield (const rutz::fstring &name) const
 Look up the field associated with the given name.
Iterator alphaFields () const
 Get an iterator that runs over the Field's in alphabetical order by name.
Iterator ioFields () const
 Get an iterator that runs over the Field's in their "native" order.

Static Public Member Functions

static const FieldMapemptyFieldMap ()
 Get a pointer to an empty FieldMap.


class  Impl

Detailed Description

FieldMap is an associative container that returns a Field given the correspnding name. We make one statically allocated property map per class. This is a concrete class with no virtual functions.

Definition at line 547 of file fields.h.

Member Function Documentation

const Field & FieldMap::field ( const rutz::fstring name  )  const

Look up the field associated with the given name.

Parent FieldMap objects will be searched recursively. An exception will be thrown if the named field is not found.

Definition at line 133 of file

References rutz::fstring::c_str(), field(), hasParent(), parent(), rutz::sfmt(), and SRC_POS.

Referenced by FieldContainer::field(), and field().

FieldMap::Iterator FieldMap::ioFields (  )  const

Get an iterator that runs over the Field's in their "native" order.

The native order is the order they were listed in the sequence that was passed to the FieldMap constructor.

Definition at line 151 of file

Referenced by FieldContainer::readFieldsFrom(), and FieldContainer::writeFieldsTo().

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

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:54:12 2008 by Doxygen version 1.5.5.