Field3D
FieldBase Class Reference

#include <Field.h>

Inheritance diagram for FieldBase:
RefBase FieldRes Field< Data_T > ProceduralField< Data_T > WritableField< Data_T > ResizableField< Data_T > DenseField< Data_T > EmptyField< Data_T > MACField< Data_T > SparseField< Data_T >

List of all members.

Public Types

typedef FieldBase class_type
typedef boost::intrusive_ptr
< FieldBase
Ptr

Public Member Functions

Constructors, destructors, copying
 FieldBase ()
 Constructor.
 FieldBase (const FieldBase &)
 Copy Constructor.
virtual ~FieldBase ()
 Destructor.
To be implemented by subclasses
virtual std::string className () const =0
 Returns the class name of the object. Used by the class pool and when writing the data to disk.
virtual Ptr clone () const =0
 Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it.
Metadata
FieldMetadata< FieldBase > & metadata ()
 accessor to the m_metadata class
const FieldMetadata< FieldBase > & metadata () const
 Read only access to the m_metadata class.
virtual void metadataHasChanged (const std::string &)
 This function should implemented by concrete classes to get the callback when metadata changes.
void copyMetadata (const FieldBase &field)
 Copies the metadata from a second field.

Static Public Member Functions

static const char * classType ()
static const char * staticClassName ()

Public Attributes

std::string attribute
 Optional name of the attribute the field represents.
std::string name
 Optional name of the field.

Private Attributes

FieldMetadata< FieldBasem_metadata
 metadata

Detailed Description

This class provides a common base for all Field objects. It serves the purpose of providing the className() virtual function and as a container for the metadata map

Definition at line 91 of file Field.h.


Member Typedef Documentation


Constructor & Destructor Documentation

FIELD3D_NAMESPACE_OPEN FieldBase::FieldBase ( )

Constructor.

Definition at line 54 of file Field.cpp.

  : RefBase(),
    m_metadata(this)
{ 
  // Empty
}
FieldBase::FieldBase ( const FieldBase other)

Copy Constructor.

Definition at line 61 of file Field.cpp.

References m_metadata.

  : RefBase(),
    name(other.name),
    attribute(other.attribute),
    m_metadata(this)
{ 
  m_metadata = other.m_metadata;  
}
FieldBase::~FieldBase ( ) [virtual]

Destructor.

Definition at line 73 of file Field.cpp.

{ 
  // Empty
}

Member Function Documentation

static const char* FieldBase::staticClassName ( ) [inline, static]
static const char* FieldBase::classType ( ) [inline, static]
virtual std::string FieldBase::className ( ) const [pure virtual]

Returns the class name of the object. Used by the class pool and when writing the data to disk.

Note:
This is different from classType for any templated class, as classType() will include the template parameter(s) but className remains just the name of the template itself.

Implemented in DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, ProceduralField< Data_T >, and SparseField< Data_T >.

virtual Ptr FieldBase::clone ( ) const [pure virtual]

Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it.

Implemented in DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, and SparseField< Data_T >.

FieldMetadata<FieldBase>& FieldBase::metadata ( ) [inline]

accessor to the m_metadata class

Definition at line 152 of file Field.h.

Referenced by copyMetadata().

  { return m_metadata; }
const FieldMetadata<FieldBase>& FieldBase::metadata ( ) const [inline]

Read only access to the m_metadata class.

Definition at line 156 of file Field.h.

  { return m_metadata; }
virtual void FieldBase::metadataHasChanged ( const std::string &  ) [inline, virtual]

This function should implemented by concrete classes to get the callback when metadata changes.

Definition at line 161 of file Field.h.

  { /* Empty */ }
void FieldBase::copyMetadata ( const FieldBase field) [inline]

Copies the metadata from a second field.

Definition at line 165 of file Field.h.

References metadata().

  { m_metadata = field.metadata(); }

Member Data Documentation

std::string FieldBase::attribute

Optional name of the attribute the field represents.

Definition at line 175 of file Field.h.

Referenced by Field3DInputFile::readProxyLayer(), and Field3DOutputFile::writeScalarLayer().

metadata

Definition at line 182 of file Field.h.

Referenced by FieldBase().


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