RobWorkProject  24.8.23-
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
ProximitySetupRule Class Reference

Rule specifying include/exclude of frame pairs. More...

#include <ProximitySetupRule.hpp>

Public Types

enum  RuleType { INCLUDE_RULE = 1 , EXCLUDE_RULE }
 Include and Exclude identifiers.
 

Public Member Functions

 ProximitySetupRule ()
 Constructs empty exclude rule (only for SWIG internal use).
 
 ProximitySetupRule (const std::string &patternA, const std::string &patternB, RuleType type)
 Constructs rule with patternA and patternB and type. More...
 
std::pair< std::string, std::string > getPatterns () const
 Returns the string patterns used to match.
 
RuleType type () const
 Returns the type of rule.
 
bool match (const std::string &str1, const std::string &str2) const
 Check whether str1 and str2 matches the pattern. More...
 
bool match (std::pair< std::string, std::string > &pair) const
 Check whether pair matches the patterns. More...
 
bool matchOne (const std::string &name) const
 Check whether name matches one of the patterns.
 
bool matchPatternA (const std::string &str) const
 Check whether str matches pattern A.
 
bool matchPatternB (const std::string &str) const
 Check whether name matches pattern B.
 
bool operator== (const rw::proximity::ProximitySetupRule &p) const
 Compares if two rules are the same.
 

Static Public Member Functions

static ProximitySetupRule makeExclude (const std::pair< std::string, std::string > &patterns)
 Make an exclude rule for the patterns.
 
static rw::proximity::ProximitySetupRule makeExclude (const std::string &patternA, const std::string &patternB)
 Make an exclude rule for the patterns.
 
static ProximitySetupRule makeInclude (const std::pair< std::string, std::string > &patterns)
 Make an include rule for the patterns.
 
static rw::proximity::ProximitySetupRule makeInclude (const std::string &patternA, const std::string &patternB)
 Make an include rule for the patterns.
 

Friends

std::ostream & operator<< (std::ostream &s, const rw::proximity::ProximitySetupRule &r)
 ostream operator formatting the rule for easy reading
 

Detailed Description

Rule specifying include/exclude of frame pairs.

The rule has two patterns, pattern A and pattern B, to which frames can be matched. A pattern could contain a fully specified frame name such as "Table". It can also include wild card characters such a "Robot.*" or regular expressions.

Constructor & Destructor Documentation

◆ ProximitySetupRule()

ProximitySetupRule ( const std::string &  patternA,
const std::string &  patternB,
RuleType  type 
)

Constructs rule with patternA and patternB and type.

Parameters
patternA[in] Pattern identifying first frame in rule
patternB[in] Pattern identifying second frame in rule
typedocumentation missing !

Member Function Documentation

◆ match() [1/2]

bool match ( const std::string &  str1,
const std::string &  str2 
) const
inline

Check whether str1 and str2 matches the pattern.

Success is defined if the first pattern matches str1 and the second matches str2 or the first matches str2 and the second str1.

◆ match() [2/2]

bool match ( std::pair< std::string, std::string > &  pair) const
inline

Check whether pair matches the patterns.

Success is defined if the first pattern matches pair.first and the second matches pair.second or the first matches pair.second and the second pair.first.


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