Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
moab::TagVarTypeEqual< T > Class Template Reference

#include <TagCompare.hpp>

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 170 of file TagCompare.hpp.

Constructor & Destructor Documentation

◆ TagVarTypeEqual()

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

Definition at line 177 of file TagCompare.hpp.

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

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
bool moab::TagVarTypeEqual< T >::operator() ( const VarLenTag vdata) const
inline

Definition at line 189 of file TagCompare.hpp.

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

References moab::VarLenTag::data(), moab::TagVarTypeEqual< T >::size, moab::VarLenTag::size(), T, and moab::TagVarTypeEqual< T >::value.

◆ operator()() [2/2]

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

Definition at line 179 of file TagCompare.hpp.

180  {
181  const VarLenTag* vdata = reinterpret_cast< const VarLenTag* >( data );
182  if( vdata->size() != size * sizeof( T ) ) return false;
183  const T* ddata = reinterpret_cast< const T* >( vdata->data() );
184  for( int i = 0; i < size; ++i )
185  if( value[i] != ddata[i] ) return false;
186  return true;
187  }

References moab::VarLenTag::data(), moab::TagVarTypeEqual< T >::size, moab::VarLenTag::size(), T, and moab::TagVarTypeEqual< T >::value.

Member Data Documentation

◆ size

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

Definition at line 174 of file TagCompare.hpp.

Referenced by moab::TagVarTypeEqual< T >::operator()().

◆ value

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

Definition at line 173 of file TagCompare.hpp.

Referenced by moab::TagVarTypeEqual< T >::operator()().


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