LMCAS
Lamina Computer Algebra System
Toggle main menu visibility
载入中...
搜索中...
未找到
property_store_support.hpp
浏览该文件的文档.
1
#pragma once
2
3
#include "
property_store.hpp
"
4
5
namespace
LMCAS::property_detail
{
6
7
std::string
domain_str
(
Domain
domain
);
8
PropertyStoreResult
invalid_empty_symbol
(
const
std::string& operation);
9
10
template
<
typename
F>
11
PropertyStoreResult
checked_property_update
(PropertyStore& store,
12
const
std::string& symbol,
13
const
std::string& operation,
14
F&& update) {
15
if
(symbol.empty()) {
16
return
invalid_empty_symbol
(operation);
17
}
18
try
{
19
PropertyStore candidate = store;
20
update(candidate);
21
store = std::move(candidate);
22
}
catch
(
const
std::bad_alloc&) {
23
return
PropertyStoreResult::failure
(
24
CasErrc::ResourceLimit
,
"property-store allocation failed"
, operation);
25
}
catch
(
const
std::invalid_argument& ex) {
26
return
PropertyStoreResult::failure
(
CasErrc::InvalidArgument
, ex.what(), operation);
27
}
catch
(
const
std::exception& ex) {
28
return
PropertyStoreResult::failure
(
CasErrc::InternalInvariant
, ex.what(), operation);
29
}
30
return
PropertyStoreResult::success
();
31
}
32
33
}
LMCAS::Result< void >::failure
static Result failure(CasErrc code, std::string message, std::string operation={})
定义
result.hpp:99
LMCAS::Result< void >::success
static Result success()
定义
result.hpp:97
LMCAS::property_detail
定义
property_store_support.hpp:5
LMCAS::property_detail::checked_property_update
PropertyStoreResult checked_property_update(PropertyStore &store, const std::string &symbol, const std::string &operation, F &&update)
定义
property_store_support.hpp:11
LMCAS::property_detail::domain_str
std::string domain_str(Domain domain)
定义
property_store_support.cpp:5
LMCAS::property_detail::invalid_empty_symbol
PropertyStoreResult invalid_empty_symbol(const std::string &operation)
定义
property_store_support.cpp:20
LMCAS::PropertyStoreResult
Result< void > PropertyStoreResult
定义
property_store.hpp:25
LMCAS::Domain
Domain
Mathematical domain hierarchy (least specific → most specific). Complex ⊃ Real ⊃ Algebraic ⊃ Rational...
定义
assumption.hpp:15
LMCAS::CasErrc::InvalidArgument
@ InvalidArgument
定义
result.hpp:13
LMCAS::CasErrc::InternalInvariant
@ InternalInvariant
定义
result.hpp:28
LMCAS::CasErrc::ResourceLimit
@ ResourceLimit
定义
result.hpp:25
LMCAS::domain
const NumberDomainSet & domain
定义
expr.hpp:378
property_store.hpp
PropertyStore class for mapping symbol names to declared properties.
src
internal
property_store_support.hpp
生成于
, 为 LMCAS使用
1.18.0