mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-15 21:15:51 +02:00
Move PrimitiveWrapper to serialization common
This commit is contained in:
@@ -142,28 +142,6 @@ class NativeUID {
|
||||
ArrayUID uid_;
|
||||
};
|
||||
|
||||
/**
|
||||
* A simple wrapper around primitive values for serialization purposes. Bitsery
|
||||
* doesn't seem to like serializing plain primitives using `s.object()` even if
|
||||
* you define a serialization function.
|
||||
*/
|
||||
template <typename T>
|
||||
class PrimitiveWrapper {
|
||||
public:
|
||||
PrimitiveWrapper() noexcept {}
|
||||
PrimitiveWrapper(T value) noexcept : value_(value) {}
|
||||
|
||||
operator T() const noexcept { return value_; }
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.template value<sizeof(T)>(value_);
|
||||
}
|
||||
|
||||
private:
|
||||
T value_;
|
||||
};
|
||||
|
||||
/**
|
||||
* A wrapper around `Steinberg::tresult` that we can safely share between the
|
||||
* native plugin and the Wine process. Depending on the platform and on whether
|
||||
|
||||
Reference in New Issue
Block a user