This commit is contained in:
Thomas Krijnen
2024-08-16 09:25:16 +02:00
parent debb0f5e59
commit 9c323f91dd
6 changed files with 105 additions and 285 deletions
+2 -2
View File
@@ -147,8 +147,8 @@ void Logger::SetOutput(std::wostream* stream1, std::wostream* stream2) {
}
void Logger::Message(Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) {
static std::mutex mtx;
std::lock_guard<std::mutex> lock(mtx);
// static std::mutex mtx;
// std::lock_guard<std::mutex> lock(mtx);
if (type == LOG_PERF) {
if (!first_timepoint_) {
+2 -1
View File
@@ -2569,8 +2569,9 @@ void IfcUtil::IfcBaseClass::toString(std::ostream& out, bool upper) const
{
auto ent = declaration().as_entity();
if (ent) {
out << "#" << as<IfcUtil::IfcBaseEntity>()->id();
out << "#" << as<IfcUtil::IfcBaseEntity>()->id() << "=";
}
out << declaration().name_uc();
data().toString(out, upper, ent);
}
+2 -8
View File
@@ -283,17 +283,11 @@ private:
return apply_visitor_impl(std::forward<Visitor>(visitor), idx, std::integral_constant<std::size_t, Index - 1>{});
}
template<typename, typename = std::void_t<>>
struct has_result_type : std::false_type {};
template<typename T>
struct has_result_type<T, std::void_t<typename T::result_type>> : std::true_type {};
template<typename Visitor>
auto apply_visitor_impl(Visitor&&, std::size_t, std::integral_constant<std::size_t, 0>) const {
throw std::runtime_error("Invalid variant index");
// This raises a warning but is neccessary (?) for the auto return type inference?
if constexpr (has_result_type<Visitor>::value) {
return typename Visitor::result_type{};
if constexpr (!std::is_void_v<decltype(std::declval<Visitor>()(std::declval<typename std::tuple_element_t<0, impl::MapTypes_t<Types...>> &>()))>) {
return decltype(std::declval<Visitor>()(std::declval<typename std::tuple_element_t<0, impl::MapTypes_t<Types...>> &>())){};
}
}
};