Browse Source

Add doc comments to ModuleWidget and Module.

tags/v2.2.3
Andrew Belt 1 year ago
parent
commit
680b806750
2 changed files with 14 additions and 6 deletions
  1. +5
    -3
      include/app/ModuleWidget.hpp
  2. +9
    -3
      include/engine/Module.hpp

+ 5
- 3
include/app/ModuleWidget.hpp View File

@@ -18,6 +18,7 @@ struct ModuleWidget : widget::OpaqueWidget {
struct Internal; struct Internal;
Internal* internal; Internal* internal;


/** Not owned */
plugin::Model* model = NULL; plugin::Model* model = NULL;
/** Owned */ /** Owned */
engine::Module* module = NULL; engine::Module* module = NULL;
@@ -28,18 +29,19 @@ struct ModuleWidget : widget::OpaqueWidget {
} }
~ModuleWidget(); ~ModuleWidget();


/** Returns the Model instance of this ModuleWidget. */
plugin::Model* getModel(); plugin::Model* getModel();
void setModel(plugin::Model* model); void setModel(plugin::Model* model);


/** Returns the attached Module. */
/** Returns Module attached to this ModuleWidget. */
engine::Module* getModule(); engine::Module* getModule();
/** Returns the attached Module, casted to the given Module type. */
/** Returns Module attached to this ModuleWidget, casted to the given Module type. */
template <class TModule> template <class TModule>
TModule* getModule() { TModule* getModule() {
return dynamic_cast<TModule*>(getModule()); return dynamic_cast<TModule*>(getModule());
} }
/** Associates this ModuleWidget with the Module. /** Associates this ModuleWidget with the Module.
Transfers ownership.
Transfers ownership to `this`.
*/ */
void setModule(engine::Module* module); void setModule(engine::Module* module);




+ 9
- 3
include/engine/Module.hpp View File

@@ -30,15 +30,19 @@ struct Module {
struct Internal; struct Internal;
Internal* internal; Internal* internal;


/** Not owned. */
plugin::Model* model = NULL; plugin::Model* model = NULL;

/** Unique ID for referring to the module in the engine. /** Unique ID for referring to the module in the engine.
Between 0 and 2^53 since this is serialized with JSON.
Between 0 and 2^53-1 since the number is serialized with JSON.
Assigned when added to the engine. Assigned when added to the engine.
*/ */
int64_t id = -1; int64_t id = -1;


/** Arrays of components. /** Arrays of components.
Initialized with config().
Initialized using config().

It is recommended to call getParam(), getInput(), etc. instead of accessing these directly.
*/ */
std::vector<Param> params; std::vector<Param> params;
std::vector<Input> inputs; std::vector<Input> inputs;
@@ -46,8 +50,10 @@ struct Module {
std::vector<Light> lights; std::vector<Light> lights;


/** Arrays of component metadata. /** Arrays of component metadata.
Initialized with configParam(), configInput(), configOutput(), and configLight().
Initialized using configParam(), configInput(), configOutput(), and configLight().
LightInfos are initialized to null unless configLight() is called. LightInfos are initialized to null unless configLight() is called.

It is recommended to call getParamQuantity(), getInputInfo(), etc. instead of accessing these directly.
*/ */
std::vector<ParamQuantity*> paramQuantities; std::vector<ParamQuantity*> paramQuantities;
std::vector<PortInfo*> inputInfos; std::vector<PortInfo*> inputInfos;


Loading…
Cancel
Save