LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
LMCAS::query_detail 命名空间参考

函数

template<typename T, typename Query>
Result< T > checked_expression_result (const SymbolicExpr &expr, const std::string &operation, Query &&query)
template<typename Query>
auto checked_expression_result (const SymbolicExpr &expr, const std::string &operation, Query &&query) -> decltype(std::forward< Query >(query)())

函数说明

◆ checked_expression_result() [1/2]

template<typename T, typename Query>
Result< T > LMCAS::query_detail::checked_expression_result ( const SymbolicExpr & expr,
const std::string & operation,
Query && query )

在文件 query_support.hpp 第 12 行定义.

15 {
16 if (!LMCAS::detail::node(expr)) {
17 return Result<T>::failure(
18 CasErrc::InvalidArgument, "query expression must not be null", operation);
19 }
20 try {
21 return Result<T>::success(std::forward<Query>(query)());
22 } catch (const std::bad_alloc&) {
23 return Result<T>::failure(
24 CasErrc::ResourceLimit, "query allocation failed", operation);
25 } catch (const std::exception& ex) {
26 return Result<T>::failure(CasErrc::InternalInvariant, ex.what(), operation);
27 }
28}
static Result failure(CasErrc code, std::string message, std::string operation={})
static Result success(T value)
const SymbolicNodePtr & node(const ::LMCAS::SymbolicExpr &expression) noexcept

引用了 checked_expression_result(), LMCAS::Result< T >::failure(), LMCAS::InternalInvariant, LMCAS::InvalidArgument, LMCAS::detail::node(), LMCAS::ResourceLimit , 以及 LMCAS::Result< T >::success().

被这些函数引用 checked_expression_result() , 以及 checked_expression_result().

函数调用图:
这是这个函数的调用关系图:

◆ checked_expression_result() [2/2]

template<typename Query>
auto LMCAS::query_detail::checked_expression_result ( const SymbolicExpr & expr,
const std::string & operation,
Query && query ) -> decltype(std::forward< Query >(query)())

在文件 query_support.hpp 第 31 行定义.

34 {
35 using ResultType = decltype(std::forward<Query>(query)());
36 if (!LMCAS::detail::node(expr)) {
37 return ResultType::failure(
38 CasErrc::InvalidArgument, "query expression must not be null", operation);
39 }
40 try {
41 return std::forward<Query>(query)();
42 } catch (const std::bad_alloc&) {
43 return ResultType::failure(
44 CasErrc::ResourceLimit, "query allocation failed", operation);
45 } catch (const std::exception& ex) {
46 return ResultType::failure(
47 CasErrc::InternalInvariant, ex.what(), operation);
48 }
49}

引用了 checked_expression_result(), LMCAS::InternalInvariant, LMCAS::InvalidArgument, LMCAS::detail::node() , 以及 LMCAS::ResourceLimit.

函数调用图: