Skip to content

Commit

Permalink
add minor modification to ExpressionParser class
Browse files Browse the repository at this point in the history
issue #27
  • Loading branch information
Valentin Noel committed Sep 4, 2013
1 parent f6c2ff7 commit 786aad5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions libraries/basicElement/src/Tools/ExpressionParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class ExpressionParser
template< typename NumberType >
void setVariables( const std::map < std::string, NumberType >& varMap );

template< typename Type >
Type getExpressionResult( const std::string& expression );
template< typename ResultType >
ResultType getExpressionResult( const std::string& expression );

void addPythonHeader( const std::string& pythonString );

Expand Down
8 changes: 4 additions & 4 deletions libraries/basicElement/src/Tools/ExpressionParser.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ void ExpressionParser::setVariables( const std::map < std::string, NumberType >&
}
}

template< typename Type >
Type ExpressionParser::getExpressionResult( const std::string& expression )
template< typename ResultType >
ResultType ExpressionParser::getExpressionResult( const std::string& expression )
{
Type result = 0;
ResultType result = 0;
try
{
LOG_TRACE( _contextString.c_str() );
LOG_TRACE( expression );
bpy::exec( _contextString.c_str(), _mainNamespace );
bpy::object returnText = bpy::eval( expression.c_str(), _mainNamespace );
result = bpy::extract< Type >( returnText );
result = bpy::extract< ResultType >( returnText );
}
catch( const bpy::error_already_set& error )
{
Expand Down

0 comments on commit 786aad5

Please sign in to comment.