SHAPER  9.12.0
InitializationPlugin_PyInterp Class Reference

Helper class for using Python interpreter. More...

Inheritance diagram for InitializationPlugin_PyInterp:
Inheritance graph

Public Member Functions

std::list< std::pair< int, int > > positions (const std::wstring &theExpression, const std::wstring &theName)
 Returns a list of positions for theName in theExpression. More...
 
std::list< std::wstring > compile (const std::wstring &theExpression)
 Compiles theExpression and returns a list of parameters used in theExpression. More...
 
void extendLocalContext (const std::list< std::wstring > &theParameters)
 Extends local context with the list of parameters. More...
 
void clearLocalContext ()
 Clears local context. More...
 
double evaluate (const std::wstring &theExpression, std::string &theError)
 Evaluates theExpression and returns its value. More...
 
bool runString (std::string theString)
 Runs the string command in the python interpreter. Returns true if no error is in result. More...
 

Protected Member Functions

std::string errorMessage ()
 Returns error message. More...
 
virtual bool initContext ()
 Overrides PyInterp_Interp. More...
 
virtual void closeContext ()
 Reimplemented from PyInterp_Interp::closeContext(). More...
 

Detailed Description

Helper class for using Python interpreter.

Member Function Documentation

◆ positions()

std::list< std::pair< int, int > > InitializationPlugin_PyInterp::positions ( const std::wstring &  theExpression,
const std::wstring &  theName 
)

Returns a list of positions for theName in theExpression.

◆ compile()

std::list< std::wstring > InitializationPlugin_PyInterp::compile ( const std::wstring &  theExpression)

Compiles theExpression and returns a list of parameters used in theExpression.

◆ extendLocalContext()

void InitializationPlugin_PyInterp::extendLocalContext ( const std::list< std::wstring > &  theParameters)

Extends local context with the list of parameters.

◆ clearLocalContext()

void InitializationPlugin_PyInterp::clearLocalContext ( )

Clears local context.

◆ evaluate()

double InitializationPlugin_PyInterp::evaluate ( const std::wstring &  theExpression,
std::string &  theError 
)

Evaluates theExpression and returns its value.

◆ runString()

bool InitializationPlugin_PyInterp::runString ( std::string  theString)

Runs the string command in the python interpreter. Returns true if no error is in result.

◆ errorMessage()

std::string InitializationPlugin_PyInterp::errorMessage ( )
protected

Returns error message.

◆ initContext()

bool InitializationPlugin_PyInterp::initContext ( )
protectedvirtual

Overrides PyInterp_Interp.

◆ closeContext()

void InitializationPlugin_PyInterp::closeContext ( )
protectedvirtual

Reimplemented from PyInterp_Interp::closeContext().