Version: 9.16.0
_pyStringFamily Class Reference

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

#include <SMESH_2smeshpy.hxx>

Public Member Functions

bool Add (const char *str)
 
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 grouped 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

◆ Add()

bool _pyStringFamily::Add ( const char *  str)

Referenced by _pyGen::KeepAgrCmds().

◆ isIn()

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().

◆ IsInArgs()

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().

Referenced by Handle().

◆ Print()

void _pyStringFamily::Print ( int  level = 0)

DEBUG.

References _prefix, _strings, and _subFams.

Field Documentation

◆ _prefix

_AString _pyStringFamily::_prefix
private

Referenced by Print().

◆ _strings

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

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

◆ _subFams

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

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