Add PrimitiveWrapper<T> response logging

This commit is contained in:
Robbert van der Helm
2020-12-14 18:05:37 +01:00
parent e282f8c572
commit bb110e8cbb
3 changed files with 8 additions and 6 deletions
-4
View File
@@ -207,10 +207,6 @@ void Vst3Logger::log_request(bool is_host_vst, const WantsConfiguration&) {
});
}
void Vst3Logger::log_response(bool is_host_vst, const uint32& value) {
log_response_base(is_host_vst, [&](auto& message) { message << value; });
}
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
log_response_base(is_host_vst, [&](auto& message) { message << "ACK"; });
}
+7 -1
View File
@@ -77,7 +77,6 @@ class Vst3Logger {
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
void log_request(bool is_host_vst, const WantsConfiguration&);
void log_response(bool is_host_vst, const uint32&);
void log_response(bool is_host_vst, const Ack&);
void log_response(
bool is_host_vst,
@@ -91,6 +90,13 @@ class Vst3Logger {
void log_response(bool is_host_vst, const YaPluginFactory::ConstructArgs&);
void log_response(bool is_host_vst, const Configuration&);
template <typename T>
void log_response(bool is_host_vst, const PrimitiveWrapper<T>& value) {
// For logging all primitive return values other than `tresult`
log_response_base(is_host_vst,
[&](auto& message) { message << value; });
}
Logger& logger;
private:
+1 -1
View File
@@ -71,7 +71,7 @@ class PrimitiveWrapper {
PrimitiveWrapper() {}
PrimitiveWrapper(T value) : value(value) {}
operator T() { return value; }
operator T() const { return value; }
template <typename S>
void serialize(S& s) {