Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::TagVarBytesLess Class Reference

#include <TagCompare.hpp>

Public Member Functions

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

Private Attributes

const void * value
 
int size
 

Detailed Description

Test if variable-length opaque tag values are less than a value

Definition at line 61 of file TagCompare.hpp.

Constructor & Destructor Documentation

◆ TagVarBytesLess()

moab::TagVarBytesLess::TagVarBytesLess ( const void *  v,
int  s 
)
inline

Definition at line 68 of file TagCompare.hpp.

68 : value( v ), size( s ) {}

Member Function Documentation

◆ operator()() [1/2]

bool moab::TagVarBytesLess::operator() ( const VarLenTag vdata) const
inline

Definition at line 77 of file TagCompare.hpp.

78  {
79  if( (int)vdata.size() < size )
80  return 0 <= memcmp( vdata.data(), value, vdata.size() );
81  else
82  return 0 < memcmp( vdata.data(), value, size );
83  }

References moab::VarLenTag::data(), size, moab::VarLenTag::size(), and value.

◆ operator()() [2/2]

bool moab::TagVarBytesLess::operator() ( const void *  data) const
inline

Definition at line 69 of file TagCompare.hpp.

70  {
71  const VarLenTag* vdata = reinterpret_cast< const VarLenTag* >( data );
72  if( (int)vdata->size() < size )
73  return 0 <= memcmp( vdata->data(), value, vdata->size() );
74  else
75  return 0 < memcmp( vdata->data(), value, size );
76  }

References moab::VarLenTag::data(), size, moab::VarLenTag::size(), and value.

Member Data Documentation

◆ size

int moab::TagVarBytesLess::size
private

Definition at line 65 of file TagCompare.hpp.

Referenced by operator()().

◆ value

const void* moab::TagVarBytesLess::value
private

Definition at line 64 of file TagCompare.hpp.

Referenced by operator()().


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