Phalanx  Development
 All Classes Functions Variables Typedefs Enumerations Friends Pages
Public Types | Public Member Functions | List of all members
PHX::DimTag Class Referenceabstract

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

#include <Phalanx_DimTag.hpp>

Public Types

typedef PHX::index_size_type size_type
 

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 (size_type dimension, size_type index) const
 Given a dimension and index produce a string for output. More...
 
virtual size_type to_index (size_type dimension, const std::string &label) const
 Given a dimension and input strige produce an index. More...
 

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 PHX::DimTag {
  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 ; }

Member Function Documentation

DimTag::size_type PHX::DimTag::to_index ( DimTag::size_type  dimension,
const std::string &  label 
) const
virtual

Given a dimension and input strige produce an index.

Default to converting label to an integer.

std::string PHX::DimTag::to_string ( DimTag::size_type  dimension,
DimTag::size_type  i 
) const
virtual

Given a dimension and index produce a string for output.

Default to converting index to a string.


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