Rename Create/Destroy to Construct/Destruct

This is less likely to clash with names used by interfaces and it's a
bit clearer what's going on (since they are basically proxies for
constructors and destructors).
This commit is contained in:
Robbert van der Helm
2020-12-12 16:16:18 +01:00
parent 1088483f15
commit f637e6ad18
9 changed files with 33 additions and 33 deletions
+4 -4
View File
@@ -22,7 +22,7 @@
Vst3Logger::Vst3Logger(Logger& generic_logger) : logger(generic_logger) {}
void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Create&) {
void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Construct&) {
log_request_base(is_host_vst, [](auto& message) {
// TODO: Log the cid in some readable way, if possible
message << "IPluginFactory::createComponent(cid, IComponent::iid, "
@@ -31,7 +31,7 @@ void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Create&) {
}
void Vst3Logger::log_request(bool is_host_vst,
const YaComponent::Destroy& request) {
const YaComponent::Destruct& request) {
log_request_base(is_host_vst, [&](auto& message) {
message << "<IComponent* #" << request.instance_id
<< ">::~IComponent()";
@@ -63,9 +63,9 @@ void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
void Vst3Logger::log_response(
bool is_host_vst,
const std::variant<YaComponent::CreateArgs, UniversalTResult>& result) {
const std::variant<YaComponent::ConstructArgs, UniversalTResult>& result) {
log_response_base(is_host_vst, [&](auto& message) {
std::visit(overload{[&](const YaComponent::CreateArgs& args) {
std::visit(overload{[&](const YaComponent::ConstructArgs& args) {
message << "<IComponent* #" << args.instance_id
<< ">";
},
+3 -3
View File
@@ -47,8 +47,8 @@ class Vst3Logger {
// flag here indicates whether the request was initiated on the host side
// (what we'll call a control message).
void log_request(bool is_host_vst, const YaComponent::Create&);
void log_request(bool is_host_vst, const YaComponent::Destroy&);
void log_request(bool is_host_vst, const YaComponent::Construct&);
void log_request(bool is_host_vst, const YaComponent::Destruct&);
void log_request(bool is_host_vst, const YaComponent::Terminate&);
void log_request(bool is_host_vst, const WantsConfiguration&);
void log_request(bool is_host_vst, const WantsPluginFactory&);
@@ -56,7 +56,7 @@ class Vst3Logger {
void log_response(bool is_host_vst, const Ack&);
void log_response(
bool is_host_vst,
const std::variant<YaComponent::CreateArgs, UniversalTResult>&);
const std::variant<YaComponent::ConstructArgs, UniversalTResult>&);
void log_response(bool is_host_vst, const Configuration&);
void log_response(bool is_host_vst, const YaPluginFactory&);
+2 -2
View File
@@ -68,8 +68,8 @@ struct WantsPluginFactory {
* encodes the information we request or the operation we want to perform. A
* request of type `ControlRequest(T)` should send back a `T::Response`.
*/
using ControlRequest = std::variant<YaComponent::Create,
YaComponent::Destroy,
using ControlRequest = std::variant<YaComponent::Construct,
YaComponent::Destruct,
YaComponent::Terminate,
WantsPluginFactory>;
+3 -3
View File
@@ -16,9 +16,9 @@
#include "component.h"
YaComponent::CreateArgs::CreateArgs() {}
YaComponent::ConstructArgs::ConstructArgs() {}
YaComponent::CreateArgs::CreateArgs(
YaComponent::ConstructArgs::ConstructArgs(
Steinberg::IPtr<Steinberg::Vst::IComponent> component,
size_t instance_id)
: instance_id(instance_id) {
@@ -29,7 +29,7 @@ YaComponent::CreateArgs::CreateArgs(
}
}
YaComponent::YaComponent(const CreateArgs&& args) : arguments(std::move(args)) {
YaComponent::YaComponent(const ConstructArgs&& args) : arguments(std::move(args)) {
FUNKNOWN_CTOR
// Everything else is handled directly through callbacks to minimize the
+10 -10
View File
@@ -49,14 +49,14 @@ class YaComponent : public Steinberg::Vst::IComponent {
/**
* These are the arguments for creating a `YaComponentPluginImpl`.
*/
struct CreateArgs {
CreateArgs();
struct ConstructArgs {
ConstructArgs();
/**
* Read arguments from an existing implementation.
*/
CreateArgs(Steinberg::IPtr<Steinberg::Vst::IComponent> component,
size_t isntance_id);
ConstructArgs(Steinberg::IPtr<Steinberg::Vst::IComponent> component,
size_t isntance_id);
/**
* The unique identifier for this specific instance.
@@ -83,8 +83,8 @@ class YaComponent : public Steinberg::Vst::IComponent {
* IComponent::iid,
* ...)`.
*/
struct Create {
using Response = std::variant<CreateArgs, UniversalTResult>;
struct Construct {
using Response = std::variant<ConstructArgs, UniversalTResult>;
ArrayUID cid;
@@ -98,14 +98,14 @@ class YaComponent : public Steinberg::Vst::IComponent {
* Instantiate this instance with arguments read from another interface
* implementation.
*/
YaComponent(const CreateArgs&& args);
YaComponent(const ConstructArgs&& args);
/**
* Message to request the Wine plugin host to destroy the IComponent
* instance with the given instance ID. Sent from the destructor of
* `YaComponentPluginImpl`.
*/
struct Destroy {
struct Destruct {
using Response = Ack;
native_size_t instance_id;
@@ -170,7 +170,7 @@ class YaComponent : public Steinberg::Vst::IComponent {
getState(Steinberg::IBStream* state) override = 0;
protected:
CreateArgs arguments;
ConstructArgs arguments;
};
#pragma GCC diagnostic pop
@@ -178,6 +178,6 @@ class YaComponent : public Steinberg::Vst::IComponent {
template <typename S>
void serialize(
S& s,
std::variant<YaComponent::CreateArgs, UniversalTResult>& result) {
std::variant<YaComponent::ConstructArgs, UniversalTResult>& result) {
s.ext(result, bitsery::ext::StdVariant{});
}