Field3D
FieldBase Class Reference

#include <Field.h>

Inheritance diagram for FieldBase:
RefBase RefBase FieldRes FieldRes Field< Data_T > Field< Data_T > Field< Data_T > Field< Data_T > ProceduralField< Data_T > ProceduralField< Data_T > WritableField< Data_T > WritableField< Data_T > ProceduralField< Data_T > ProceduralField< Data_T > WritableField< Data_T > WritableField< Data_T > ProceduralField< Data_T > ProceduralField< Data_T > WritableField< Data_T > WritableField< Data_T > ProceduralField< Data_T > ProceduralField< Data_T > WritableField< Data_T > WritableField< Data_T >

List of all members.

Public Types

typedef FieldBase class_type
typedef FieldBase class_type
typedef boost::intrusive_ptr
< FieldBase
Ptr
typedef boost::intrusive_ptr
< FieldBase
Ptr

Public Member Functions

Constructors, destructors, copying
 FieldBase ()
 Constructor.
 FieldBase (const FieldBase &)
 Copy Constructor.
virtual ~FieldBase ()
 Destructor.
 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.
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.
RTTI replacement
Note:
A note on why the RTTI replacement is needed: RTTI calls fail once the object crosses the dso boundary. We revert to using simple string checks which is more expensive but at least works once the dso is used in Houdini, etc. Use field_dynamic_cast<> for any FieldBase subclass instead of dynamic_cast<>.
virtual bool checkRTTI (const std::string &typenameStr)=0
 This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.
bool matchRTTI (const std::string &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.
virtual bool checkRTTI (const std::string &typenameStr)=0
 This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.
bool matchRTTI (const std::string &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.
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.
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.

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 132 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
}
FieldBase::FieldBase ( )

Constructor.

FieldBase::FieldBase ( const FieldBase )

Copy Constructor.

virtual FieldBase::~FieldBase ( ) [virtual]

Destructor.


Member Function Documentation

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.

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

Referenced by printFieldInfo().

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

virtual bool FieldBase::checkRTTI ( const std::string &  typenameStr) [pure virtual]

This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.

bool FieldBase::matchRTTI ( const std::string &  typenameStr) [inline]

Performs a check to see if the given typename string matches this class' This needs to be implemented in -all- subclasses, even abstract ones.

Definition at line 191 of file Field.h.

  { return typenameStr == typeid(*this).name(); }
FieldMetadata<FieldBase>& FieldBase::metadata ( ) [inline]

accessor to the m_metadata class

Definition at line 202 of file Field.h.

References m_metadata.

Referenced by copyMetadata(), main(), and printFieldInfo().

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

Read only access to the m_metadata class.

Definition at line 206 of file Field.h.

References m_metadata.

  { 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 211 of file Field.h.

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

Copies the metadata from a second field.

Definition at line 215 of file Field.h.

References m_metadata, and metadata().

  { m_metadata = field.metadata(); }
virtual std::string FieldBase::className ( ) const [pure virtual]
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 >, SparseField< Data_T >, DenseField< Data_T >, EmptyField< Data_T >, MACField< Data_T >, and SparseField< Data_T >.

virtual bool FieldBase::checkRTTI ( const std::string &  typenameStr) [pure virtual]

This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.

bool FieldBase::matchRTTI ( const std::string &  typenameStr) [inline]

Performs a check to see if the given typename string matches this class' This needs to be implemented in -all- subclasses, even abstract ones.

Definition at line 191 of file Field.h.

  { return typenameStr == typeid(*this).name(); }
FieldMetadata<FieldBase>& FieldBase::metadata ( ) [inline]

accessor to the m_metadata class

Definition at line 202 of file Field.h.

References m_metadata.

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

Read only access to the m_metadata class.

Definition at line 206 of file Field.h.

References m_metadata.

  { 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 211 of file Field.h.

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

Copies the metadata from a second field.

Definition at line 215 of file Field.h.

References m_metadata, and metadata().

  { m_metadata = field.metadata(); }

Member Data Documentation

std::string FieldBase::attribute

Optional name of the attribute the field represents.

Definition at line 225 of file Field.h.

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

metadata

Definition at line 232 of file Field.h.

Referenced by copyMetadata(), FieldBase(), and metadata().


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