moab
moab::TagVarTypeEqual< T > Class Template Reference

#include <TagCompare.hpp>

List of all members.

Public Member Functions

 TagVarTypeEqual (const void *v, int s)
bool operator() (const void *data) const
bool operator() (const VarLenTag &vdata) const

Private Attributes

const Tvalue
int size

Detailed Description

template<typename T>
class moab::TagVarTypeEqual< T >

Compare variable-length tags containing a known data type

Definition at line 155 of file TagCompare.hpp.


Constructor & Destructor Documentation

template<typename T >
moab::TagVarTypeEqual< T >::TagVarTypeEqual ( const void *  v,
int  s 
) [inline]

Definition at line 161 of file TagCompare.hpp.

      : value(reinterpret_cast<const T*>(v)), 
        size(s/sizeof(T)) 
        {}

Member Function Documentation

template<typename T >
bool moab::TagVarTypeEqual< T >::operator() ( const void *  data) const [inline]

Definition at line 166 of file TagCompare.hpp.

                                              {
      const VarLenTag* vdata = reinterpret_cast<const VarLenTag*>(data);
      if (vdata->size() != size * sizeof(T))
        return false;
      const T* ddata = reinterpret_cast<const T*>(vdata->data());
      for (int i = 0; i < size; ++i)
        if (value[i] != ddata[i])
          return false;
      return true;
    }
template<typename T >
bool moab::TagVarTypeEqual< T >::operator() ( const VarLenTag vdata) const [inline]

Definition at line 177 of file TagCompare.hpp.

                                                    {
      if (vdata.size() != size * sizeof(T))
        return false;
      const T* ddata = reinterpret_cast<const T*>(vdata.data());
      for (int i = 0; i < size; ++i)
        if (value[i] != ddata[i])
          return false;
      return true;
    }

Member Data Documentation

template<typename T >
int moab::TagVarTypeEqual< T >::size [private]

Definition at line 159 of file TagCompare.hpp.

template<typename T >
const T* moab::TagVarTypeEqual< T >::value [private]

Definition at line 158 of file TagCompare.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines