MOAB: Mesh Oriented datABase  (version 5.1.1)
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
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 ( ) [inline]

Definition at line 15 of file Lasso.hpp.

References lastErrorDescription.

Lasso::~Lasso ( ) [virtual]

Definition at line 4 of file Lasso.cpp.

References assocPairs.

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

Member Function Documentation

int Lasso::erase_pair ( AssocPair this_pair)

Definition at line 49 of file Lasso.cpp.

References assocPairs, iBase_FAILURE, and iBase_SUCCESS.

{
  if (assocPairs.erase(this_pair) == 0)
    return iBase_FAILURE;

  // If the pair was removed, then delete it too
  delete this_pair;
  return iBase_SUCCESS;
}
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 13 of file Lasso.cpp.

References assocPairs.

{
  for (std::set<AssocPair*>::iterator i = assocPairs.begin();
       i != assocPairs.end(); ++i) {
    if ((*i)->equivalent(iface0, iface1, switched)) return *i;
  }

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

find a pair with the right types

Definition at line 24 of file Lasso.cpp.

References assocPairs.

{
  for (std::set<AssocPair*>::iterator i = assocPairs.begin();
       i != assocPairs.end(); ++i) {
    if ((*i)->equivalent(type1, type2, switched)) return *i;
  }

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

Definition at line 35 of file Lasso.cpp.

References assocPairs.

{
  for (std::set<AssocPair*>::iterator i = assocPairs.begin();
       i != assocPairs.end(); ++i) {
    if ((*i)->contains(iface)) iface_pairs.push_back(*i);
  }
}
int Lasso::insert_pair ( AssocPair this_pair)

Definition at line 43 of file Lasso.cpp.

References assocPairs, and iBase_SUCCESS.

{
  assocPairs.insert(this_pair);
  return iBase_SUCCESS;
}
int Lasso::set_last_error ( int  code,
const char *  msg 
) [inline]

Definition at line 49 of file Lasso.hpp.

References lastErrorDescription, and lastErrorType.

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

Member Data Documentation

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

Definition at line 40 of file Lasso.hpp.

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

Definition at line 38 of file Lasso.hpp.

Referenced by Lasso(), and set_last_error().

Definition at line 37 of file Lasso.hpp.

Referenced by set_last_error().

List of all members.


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