Field3D
FieldBase Class Referenceabstract

#include <Field.h>

Inheritance diagram for FieldBase:
RefBase MetadataCallback FieldRes Field< Field_T::value_type > Field< Data_T > MIPBase< Field_T::value_type > MIPBase< Data_T > ProceduralField< Data_T > WritableField< Data_T > MIPField< DenseField< Data_T > > MIPField< SparseField< Data_T > > MIPField< Field_T > ResizableField< Data_T > MIPDenseField< Data_T > MIPSparseField< Data_T > DenseField< Data_T > EmptyField< Data_T > MACField< Data_T > SparseField< 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.
 
 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 std::string classType () const =0
 Returns the full class type string.
 
virtual Ptr clone () const =0
 Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it.
 
Metadata
FieldMetadatametadata ()
 accessor to the m_metadata class
 
const FieldMetadatametadata () const
 Read only access to the m_metadata class.
 
void copyMetadata (const FieldBase &field)
 Copies the metadata from a second field.
 
- Public Member Functions inherited from RefBase
void ref () const
 Used by boost::intrusive_pointer.
 
size_t refcnt ()
 Used by boost::intrusive_pointer.
 
void unref () const
 Used by boost::intrusive_pointer.
 
WeakPtr weakPtr () const
 
 RefBase ()
 
 RefBase (const RefBase &)
 Copy constructor.
 
RefBaseoperator= (const RefBase &)
 Assignment operator.
 
virtual ~RefBase ()
 Destructor.
 
virtual bool checkRTTI (const char *typenameStr)=0
 This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.
 
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.
 
- Public Member Functions inherited from MetadataCallback
virtual void metadataHasChanged (const std::string &)
 Alerts the callback holder that the metadata has changed.
 

Static Public Member Functions

static const charstaticClassName ()
 
static const charstaticClassType ()
 
- Static Public Member Functions inherited from RefBase
static const charstaticClassType ()
 

Public Attributes

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

Private Attributes

FieldMetadata m_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

◆ Ptr

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

Definition at line 97 of file Field.h.

◆ class_type

Definition at line 98 of file Field.h.

Constructor & Destructor Documentation

◆ FieldBase() [1/2]

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 m_metadata
metadata
Definition Field.h:180
RefBase()
Definition RefCount.h:120

◆ FieldBase() [2/2]

FieldBase::FieldBase ( const FieldBase & other)

Copy Constructor.

Definition at line 61 of file Field.cpp.

62 : RefBase(),
63 name(other.name),
64 attribute(other.attribute),
65 m_metadata(this)
66{
67 m_metadata = other.m_metadata;
68}
#define FIELD3D_MTX_T
Definition StdMathLib.h:99
std::string attribute
Optional name of the attribute the field represents.
Definition Field.h:173
std::string name
Optional name of the field.
Definition Field.h:171

References FIELD3D_MTX_T, and m_metadata.

◆ ~FieldBase()

FieldBase::~FieldBase ( )
virtual

Destructor.

Definition at line 73 of file Field.cpp.

74{
75 // Empty
76}

Member Function Documentation

◆ staticClassName()

static const char * FieldBase::staticClassName ( )
inlinestatic

Definition at line 118 of file Field.h.

119 {
120 return "FieldBase";
121 }

◆ staticClassType()

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

◆ className()

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.

◆ classType()

virtual std::string FieldBase::classType ( ) const
pure virtual

Returns the full class type string.

◆ clone()

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

Referenced by FieldRes::FieldRes().

◆ metadata() [1/2]

FieldMetadata & FieldBase::metadata ( )
inline

accessor to the m_metadata class

Definition at line 155 of file Field.h.

156 { return m_metadata; }

Referenced by detail::adjustedMIPFieldMapping(), copyMetadata(), Field3DInputFile::readProxyLayer(), and Field3DInputFileHDF5::readProxyLayer().

◆ metadata() [2/2]

const FieldMetadata & FieldBase::metadata ( ) const
inline

Read only access to the m_metadata class.

Definition at line 159 of file Field.h.

160 { return m_metadata; }

◆ copyMetadata()

void FieldBase::copyMetadata ( const FieldBase & field)
inline

Copies the metadata from a second field.

Definition at line 163 of file Field.h.

164 { m_metadata = field.metadata(); }
FieldMetadata & metadata()
accessor to the m_metadata class
Definition Field.h:155

References metadata().

Member Data Documentation

◆ name

◆ attribute

std::string FieldBase::attribute

◆ m_metadata

FieldMetadata FieldBase::m_metadata
private

metadata

Definition at line 180 of file Field.h.

Referenced by FieldBase().


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