Field3D
FieldBase Class Referenceabstract

#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 >

Public Types

typedef FieldBase class_type
 
typedef boost::intrusive_ptr
< FieldBase
Ptr
 
- Public Types inherited from RefBase
typedef boost::intrusive_ptr
< RefBase
Ptr
 

Public Member Functions

Constructors, destructors, copying
 FieldBase ()
 Constructor. More...
 
 FieldBase (const FieldBase &)
 Copy Constructor. More...
 
virtual ~FieldBase ()
 Destructor. More...
 
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. More...
 
virtual Ptr clone () const =0
 Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it. More...
 
Metadata
FieldMetadata< FieldBase > & metadata ()
 accessor to the m_metadata class More...
 
const FieldMetadata< FieldBase > & metadata () const
 Read only access to the m_metadata class. More...
 
virtual void metadataHasChanged (const std::string &)
 This function should implemented by concrete classes to get the callback when metadata changes. More...
 
void copyMetadata (const FieldBase &field)
 Copies the metadata from a second field. More...
 
- Public Member Functions inherited from RefBase
void ref () const
 Used by boost::intrusive_pointer. More...
 
size_t refcnt ()
 Used by boost::intrusive_pointer. More...
 
void unref () const
 Used by boost::intrusive_pointer. More...
 
 RefBase ()
 
 RefBase (const RefBase &)
 Copy constructor. More...
 
RefBaseoperator= (const RefBase &)
 Assignment operator. More...
 
virtual ~RefBase ()
 Destructor. More...
 
virtual bool checkRTTI (const char *typenameStr)=0
 This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();. More...
 
bool matchRTTI (const char *typenameStr)
 Performs a check to see if the given typename string matches this class' This needs to be implemented in -all- subclasses, even abstract ones. More...
 

Static Public Member Functions

static const char * classType ()
 
static const char * staticClassName ()
 
- Static Public Member Functions inherited from RefBase
static const char * classType ()
 

Public Attributes

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

Private Attributes

FieldMetadata< FieldBasem_metadata
 metadata More...
 

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

typedef boost::intrusive_ptr<FieldBase> FieldBase::Ptr

Definition at line 97 of file Field.h.

Definition at line 98 of file Field.h.

Constructor & Destructor Documentation

FIELD3D_NAMESPACE_OPEN FieldBase::FieldBase ( )

Constructor.

Definition at line 54 of file Field.cpp.

55  : RefBase(),
56  m_metadata(this)
57 {
58  // Empty
59 }
FieldBase::FieldBase ( const FieldBase other)

Copy Constructor.

Definition at line 61 of file Field.cpp.

References m_metadata.

62  : RefBase(),
63  name(other.name),
64  attribute(other.attribute),
65  m_metadata(this)
66 {
67  m_metadata = other.m_metadata;
68 }
FieldBase::~FieldBase ( )
virtual

Destructor.

Definition at line 73 of file Field.cpp.

74 {
75  // Empty
76 }

Member Function Documentation

static const char* FieldBase::staticClassName ( )
inlinestatic

Definition at line 118 of file Field.h.

119  {
120  return "FieldBase";
121  }
static const char* FieldBase::classType ( )
inlinestatic

Definition at line 123 of file Field.h.

124  {
125  return staticClassName();
126  }
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 SparseField< Data_T >, MACField< Data_T >, DenseField< Data_T >, ProceduralField< Data_T >, and EmptyField< 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 SparseField< Data_T >, MACField< Data_T >, DenseField< Data_T >, and EmptyField< Data_T >.

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

accessor to the m_metadata class

Definition at line 152 of file Field.h.

Referenced by copyMetadata().

153  { 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.

157  { return m_metadata; }
virtual void FieldBase::metadataHasChanged ( const std::string &  )
inlinevirtual

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

Definition at line 161 of file Field.h.

162  { /* 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().

166  { 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().

FieldMetadata<FieldBase> FieldBase::m_metadata
private

metadata

Definition at line 182 of file Field.h.

Referenced by FieldBase().


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