phdmesh::ArrayDimTag Class Reference
[Mdarray_module]

#include <Array.hpp>

Inheritance diagram for phdmesh::ArrayDimTag:

phdmesh::ArrayDimension List of all members.

Detailed Description

Abstract base class for array dimension tags supplied to the Array template class.

See also:
Array
A derived array dimension tag class must provide the name method and tag singleton method as in the following example.
  struct MyTag : public phdmesh::ArrayDimTag {
    const char * name() const ;
    static const MyTag & tag();
  };
  
An example implementation of these methods is as follows.
  const char * MyTag::name() const
  { static const char my_name[] = "MyTag" ; return my_name ; }

  const MyTag & MyTag::tag()
  { static const MyTag my_tag ; return my_tag ; }
  

Definition at line 160 of file Array.hpp.

Public Member Functions

virtual const char * name () const =0
 Name of the tag, typically the name of the derived class.
virtual std::string to_string (unsigned dimension, unsigned index) const
 Given a dimension and index produce a string for output. Default to converting index to a string.
virtual unsigned to_index (unsigned dimension, const std::string &label) const
 Given a dimension and input strige produce an index. Default to converting label to an integer.

Protected Member Functions

 ArrayDimTag ()


The documentation for this class was generated from the following file:
Generated on Tue Jul 13 09:22:43 2010 for phdMesh by  doxygen 1.4.7