Version: 8.3.0
_pyStringFamily Class Reference

A container of strings groupped by prefix. More...

#include <SMESH_2smeshpy.hxx>

Public Member Functions

bool Add (const char *str)
 Adds an object ID to some family of IDs with a common prefix. More...
 
bool IsInArgs (Handle(_pyCommand)&cmd, std::list< _AString > &subStr)
 Finds an object ID in the command. More...
 
void Print (int level=0)
 DEBUG. More...
 

Private Member Functions

int isIn (const char *str)
 Return remainder length of the object ID after my _prefix. More...
 

Private Attributes

_AString _prefix
 
std::list< _pyStringFamily_subFams
 
std::list< _AString_strings
 

Detailed Description

A container of strings groupped by prefix.

It is used for a faster search of objects requiring to KeepAgrCmds() in commands. A speed up is gained because only a common prefix (e.g. "aArea") of many object IDs is searched in a command and not every object ID

Member Function Documentation

bool _pyStringFamily::Add ( const char *  str)

Adds an object ID to some family of IDs with a common prefix.

Parameters
[in]str- the object ID
Returns
bool - false if str does not have the same prefix as this family (for internal usage)

References _prefix, _strings, and _subFams.

Referenced by _pyGen::KeepAgrCmds().

int _pyStringFamily::isIn ( const char *  str)
private

Return remainder length of the object ID after my _prefix.

Parameters
[in]str- remainder of the command after my _prefix
Returns
int - length of the object ID or -1 if not found

References _strings, _subFams, and _pyCommand::IsIDChar().

bool _pyStringFamily::IsInArgs ( Handle(_pyCommand)&  cmd,
std::list< _AString > &  subStr 
)

Finds an object ID in the command.

Parameters
[in]longStr- the command string
[out]subStr- the found object ID
Returns
bool - true if the object ID found

References _strings, _subFams, _pyCommand::GetArgBeginning(), _pyCommand::GetString(), and _pyCommand::IsIDChar().

void _pyStringFamily::Print ( int  level = 0)

DEBUG.

References _prefix, _strings, and _subFams.

Field Documentation

_AString _pyStringFamily::_prefix
private

Referenced by Add(), and Print().

std::list< _AString > _pyStringFamily::_strings
private

Referenced by Add(), isIn(), IsInArgs(), and Print().

std::list< _pyStringFamily > _pyStringFamily::_subFams
private

Referenced by Add(), isIn(), IsInArgs(), and Print().