Field3D
FieldBase Class Referenceabstract

#include <Field.h>

Inheritance diagram for FieldBase:
RefBase FieldRes Field< Data_T > Field< DenseField< Data_T >::value_type > Field< Field_T::value_type > Field< SparseField< Data_T >::value_type > MIPBase< Data_T > ProceduralField< Data_T > WritableField< Data_T > MIPBase< DenseField< Data_T >::value_type > MIPBase< Field_T::value_type > MIPBase< SparseField< Data_T >::value_type > ResizableField< Data_T > MIPField< DenseField< Data_T > > MIPField< Field_T > MIPField< SparseField< Data_T > > DenseField< Data_T > EmptyField< Data_T > MACField< Data_T > SparseField< Data_T > MIPDenseField< Data_T > MIPSparseField< Data_T >

Public Types

typedef FieldBase class_type
 
typedef boost::intrusive_ptr< FieldBasePtr
 
- Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBasePtr
 
typedef boost::weak_ptr< RefBaseWeakPtr
 

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 std::string classType () const =0
 Returns the full class type string. 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...
 
WeakPtr weakPtr () const
 
 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 * staticClassName ()
 
static const char * staticClassType ()
 
- Static Public Member Functions inherited from RefBase
static const char * staticClassType ()
 

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 }
FieldMetadata< FieldBase > m_metadata
metadata
Definition: Field.h:185
RefBase()
Definition: RefCount.h:120
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 }
FieldMetadata< FieldBase > m_metadata
metadata
Definition: Field.h:185
RefBase()
Definition: RefCount.h:120
std::string attribute
Optional name of the attribute the field represents.
Definition: Field.h:178
std::string name
Optional name of the field.
Definition: Field.h:176
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::staticClassType ( )
inlinestatic

Definition at line 123 of file Field.h.

124  {
125  return staticClassName();
126  }
static const char * staticClassName()
Definition: Field.h:118
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 staticClassType() will include the template parameter(s) but className remains just the name of the template itself.
virtual std::string FieldBase::classType ( ) const
pure virtual

Returns the full class type string.

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 >, MIPField< Field_T >, MIPField< SparseField< Data_T > >, MIPField< DenseField< Data_T > >, DenseField< Data_T >, and EmptyField< Data_T >.

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

accessor to the m_metadata class

Definition at line 155 of file Field.h.

Referenced by copyMetadata(), Field3DInputFile::readProxyLayer(), ProceduralField< Data_T >::typedFloatMetadata(), and ProceduralField< Data_T >::typedIntMetadata().

156  { return m_metadata; }
FieldMetadata< FieldBase > m_metadata
metadata
Definition: Field.h:185
const FieldMetadata<FieldBase>& FieldBase::metadata ( ) const
inline

Read only access to the m_metadata class.

Definition at line 159 of file Field.h.

160  { return m_metadata; }
FieldMetadata< FieldBase > m_metadata
metadata
Definition: Field.h:185
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 164 of file Field.h.

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

Copies the metadata from a second field.

Definition at line 168 of file Field.h.

References metadata().

169  { m_metadata = field.metadata(); }
FieldMetadata< FieldBase > m_metadata
metadata
Definition: Field.h:185
FieldMetadata< FieldBase > & metadata()
accessor to the m_metadata class
Definition: Field.h:155

Member Data Documentation

std::string FieldBase::attribute

Optional name of the attribute the field represents.

Definition at line 178 of file Field.h.

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

FieldMetadata<FieldBase> FieldBase::m_metadata
private

metadata

Definition at line 185 of file Field.h.

Referenced by FieldBase().


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