MOAB: Mesh Oriented datABase  (version 5.5.0)
Lasso Class Reference

#include <Lasso.hpp>

Public Member Functions

 Lasso ()
 
virtual ~Lasso ()
 
AssocPairfind_pair (void *iface0, void *iface1, bool *switched=NULL)
 
AssocPairfind_pair (iRel_IfaceType type1, iRel_IfaceType type2, bool *switched=NULL)
 find a pair with the right types More...
 
void find_pairs (void *iface, std::vector< AssocPair * > &iface_pairs)
 
int insert_pair (AssocPair *this_pair)
 
int erase_pair (AssocPair *this_pair)
 
int set_last_error (int, const char *)
 

Public Attributes

int lastErrorType
 
char lastErrorDescription [120]
 

Private Attributes

std::set< AssocPair * > assocPairs
 

Detailed Description

Definition at line 12 of file Lasso.hpp.

Constructor & Destructor Documentation

◆ Lasso()

Lasso::Lasso ( )
inline

Definition at line 15 of file Lasso.hpp.

16  {
17  lastErrorDescription[0] = '\0';
18  }

References lastErrorDescription.

◆ ~Lasso()

Lasso::~Lasso ( )
virtual

Definition at line 4 of file Lasso.cpp.

5 {
6  for( std::set< AssocPair* >::iterator i = assocPairs.begin(); i != assocPairs.end(); ++i )
7  delete *i;
8 }

References assocPairs.

Member Function Documentation

◆ erase_pair()

int Lasso::erase_pair ( AssocPair this_pair)

Definition at line 47 of file Lasso.cpp.

48 {
49  if( assocPairs.erase( this_pair ) == 0 ) return iBase_FAILURE;
50 
51  // If the pair was removed, then delete it too
52  delete this_pair;
53  return iBase_SUCCESS;
54 }

References assocPairs, iBase_FAILURE, and iBase_SUCCESS.

◆ find_pair() [1/2]

AssocPair * Lasso::find_pair ( iRel_IfaceType  type1,
iRel_IfaceType  type2,
bool *  switched = NULL 
)

find a pair with the right types

Definition at line 23 of file Lasso.cpp.

24 {
25  for( std::set< AssocPair* >::iterator i = assocPairs.begin(); i != assocPairs.end(); ++i )
26  {
27  if( ( *i )->equivalent( type1, type2, switched ) ) return *i;
28  }
29 
30  return NULL;
31 }

References assocPairs.

◆ find_pair() [2/2]

AssocPair * Lasso::find_pair ( void *  iface0,
void *  iface1,
bool *  switched = NULL 
)

find a pair equivalent to these ifaces, passed as pointer to SIDL interface or interface instance

Definition at line 12 of file Lasso.cpp.

13 {
14  for( std::set< AssocPair* >::iterator i = assocPairs.begin(); i != assocPairs.end(); ++i )
15  {
16  if( ( *i )->equivalent( iface0, iface1, switched ) ) return *i;
17  }
18 
19  return NULL;
20 }

References assocPairs.

◆ find_pairs()

void Lasso::find_pairs ( void *  iface,
std::vector< AssocPair * > &  iface_pairs 
)

Definition at line 33 of file Lasso.cpp.

34 {
35  for( std::set< AssocPair* >::iterator i = assocPairs.begin(); i != assocPairs.end(); ++i )
36  {
37  if( ( *i )->contains( iface ) ) iface_pairs.push_back( *i );
38  }
39 }

References assocPairs, and iface.

◆ insert_pair()

int Lasso::insert_pair ( AssocPair this_pair)

Definition at line 41 of file Lasso.cpp.

42 {
43  assocPairs.insert( this_pair );
44  return iBase_SUCCESS;
45 }

References assocPairs, and iBase_SUCCESS.

◆ set_last_error()

int Lasso::set_last_error ( int  code,
const char *  msg 
)
inline

Definition at line 48 of file Lasso.hpp.

49 {
50  std::strncpy( lastErrorDescription, msg, sizeof( lastErrorDescription ) );
51  lastErrorDescription[sizeof( lastErrorDescription ) - 1] = '\0';
52  return ( lastErrorType = static_cast< iBase_ErrorType >( code ) );
53 }

References lastErrorDescription, and lastErrorType.

Member Data Documentation

◆ assocPairs

std::set< AssocPair* > Lasso::assocPairs
private

Definition at line 39 of file Lasso.hpp.

Referenced by erase_pair(), find_pair(), find_pairs(), insert_pair(), and ~Lasso().

◆ lastErrorDescription

char Lasso::lastErrorDescription[120]

Definition at line 36 of file Lasso.hpp.

Referenced by Lasso(), and set_last_error().

◆ lastErrorType

int Lasso::lastErrorType

Definition at line 35 of file Lasso.hpp.

Referenced by set_last_error().


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