Field3D

#include <FieldMappingIO.h>

Inheritance diagram for NullFieldMappingIO:
FieldMappingIO RefBase

Public Types

typedef NullFieldMappingIO class_type
 
typedef boost::intrusive_ptr< NullFieldMappingIOPtr
 
- Public Types inherited from FieldMappingIO
typedef FieldMappingIO class_type
 
typedef boost::intrusive_ptr< FieldMappingIOPtr
 
- Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBasePtr
 
typedef boost::weak_ptr< RefBaseWeakPtr
 

Public Member Functions

virtual std::string className () const
 Returns the class name. More...
 
 NullFieldMappingIO ()
 Ctor. More...
 
virtual FieldMapping::Ptr read (hid_t mappingGroup)
 Reads the field mapping and tries to create a NullFieldMapping object from it. More...
 
virtual bool write (hid_t mappingGroup, FieldMapping::Ptr mapping)
 Writes the given field mapping to disk. More...
 
- Public Member Functions inherited from FieldMappingIO
 FieldMappingIO ()
 Ctor. More...
 
virtual ~FieldMappingIO ()
 Dtor. 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 FieldMappingIO::Ptr create ()
 
static const char * staticClassType ()
 
- Static Public Member Functions inherited from FieldMappingIO
static const char * staticClassType ()
 RTTI replacement. More...
 
- Static Public Member Functions inherited from RefBase
static const char * staticClassType ()
 

Public Attributes

 DEFINE_FIELD_RTTI_CONCRETE_CLASS
 
- Public Attributes inherited from FieldMappingIO
 DEFINE_FIELD_RTTI_ABSTRACT_CLASS
 

Private Types

typedef FieldMappingIO base
 Convenience typedef for referring to base class. More...
 

Detailed Description

Handles IO for a NullFieldMapping object

Definition at line 128 of file FieldMappingIO.h.

Member Typedef Documentation

typedef boost::intrusive_ptr<NullFieldMappingIO> NullFieldMappingIO::Ptr

Definition at line 135 of file FieldMappingIO.h.

Convenience typedef for referring to base class.

Definition at line 176 of file FieldMappingIO.h.

Constructor & Destructor Documentation

NullFieldMappingIO::NullFieldMappingIO ( )
inline

Ctor.

Definition at line 150 of file FieldMappingIO.h.

151  : FieldMappingIO()
152  { }
FieldMappingIO()
Ctor.

Member Function Documentation

static const char* NullFieldMappingIO::staticClassType ( )
inlinestatic

Definition at line 142 of file FieldMappingIO.h.

143  {
144  return "NullFieldMappingIO";
145  }
static FieldMappingIO::Ptr NullFieldMappingIO::create ( )
inlinestatic

Definition at line 154 of file FieldMappingIO.h.

References FieldMappingIO::className(), FieldMappingIO::read(), and FieldMappingIO::write().

Referenced by initIO().

155  { return Ptr(new NullFieldMappingIO); }
boost::intrusive_ptr< NullFieldMappingIO > Ptr
FieldMapping::Ptr NullFieldMappingIO::read ( hid_t  mappingGroup)
virtual

Reads the field mapping and tries to create a NullFieldMapping object from it.

Returns
Null if no object was read

Implements FieldMappingIO.

Definition at line 87 of file FieldMappingIO.cpp.

References Msg::print(), Hdf5Util::readAttribute(), and Msg::SevWarning.

88 {
89  string nfmData;
90  if (!readAttribute(mappingGroup, k_nullMappingDataName, nfmData)) {
91  Msg::print(Msg::SevWarning, "Couldn't read attribute " + k_nullMappingDataName);
92  return NullFieldMapping::Ptr();
93  }
95 }
Trivial class, world space is equal to local space, i.e. the field is contained in the unit cube [0...
Definition: FieldMapping.h:229
FIELD3D_API bool readAttribute(hid_t location, const std::string &attrName, std::string &value)
Reads a string attribute.
FIELD3D_API void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity. ...
Definition: Log.cpp:66
boost::intrusive_ptr< NullFieldMapping > Ptr
Convenience typedef.
Definition: FieldMapping.h:236
bool NullFieldMappingIO::write ( hid_t  mappingGroup,
FieldMapping::Ptr  mapping 
)
virtual

Writes the given field mapping to disk.

Returns
true if successful, otherwise false

Implements FieldMappingIO.

Definition at line 100 of file FieldMappingIO.cpp.

References Msg::print(), Msg::SevWarning, and Hdf5Util::writeAttribute().

101 {
102  string nfmAttrData("NullFieldMapping has no data");
103  if (!writeAttribute(mappingGroup, k_nullMappingDataName, nfmAttrData)) {
104  Msg::print(Msg::SevWarning, "Couldn't add attribute " + k_nullMappingDataName);
105  return false;
106  }
107  return true;
108 }
FIELD3D_API bool writeAttribute(hid_t location, const std::string &attrName, const std::string &value)
Writes a string attribute.
FIELD3D_API void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity. ...
Definition: Log.cpp:66
std::string NullFieldMappingIO::className ( ) const
virtual

Returns the class name.

Implements FieldMappingIO.

Definition at line 112 of file FieldMappingIO.cpp.

References FIELD3D_NAMESPACE_OPEN::k_nullMappingName().

113 {
114  return k_nullMappingName;
115 }
const string k_nullMappingName("NullFieldMapping")

Member Data Documentation

NullFieldMappingIO::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 140 of file FieldMappingIO.h.


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