MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / AbstractState_backend_name

Function AbstractState_backend_name

src/CoolPropLib.cpp:1058–1075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1056}
1057
1058EXPORT_CODE void CONVENTION AbstractState_backend_name(const long handle, char* backend, long* errcode, char* message_buffer,
1059 const long buffer_length) {
1060 *errcode = 0;
1061 fpu_reset_guard guard;
1062
1063 try {
1064 shared_ptr<CoolProp::AbstractState>& AS = handle_manager.get(handle);
1065 std::string backendstring = AS->backend_name();
1066 if (backendstring.size() < static_cast<std::size_t>(buffer_length)) {
1067 std::memcpy(backend, backendstring.c_str(), backendstring.size() + 1); // guarded above: size + null fits
1068 } else {
1069 throw CoolProp::ValueError(format("Length of string [%d] is greater than allocated buffer length [%d]", backendstring.size(),
1070 static_cast<std::size_t>(buffer_length)));
1071 }
1072 } catch (...) {
1073 HandleException(errcode, message_buffer, buffer_length);
1074 }
1075}
1076
1077EXPORT_CODE int CONVENTION AbstractState_phase(const long handle, long* errcode, char* message_buffer, const long buffer_length) {
1078 *errcode = 0;

Callers

nothing calls this directly

Calls 5

HandleExceptionFunction · 0.85
formatFunction · 0.70
getMethod · 0.45
backend_nameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected