class
LightLayoutAttributesManager
Base classes
-
template<class T, ManagedObjectAccess Access>class AttributesManager<attributes::LightLayoutAttributes, ManagedObjectAccess::Copy>
- Class template defining responsibilities and functionality for managing esp::
metadata:: attributes:: AbstractAttributes constructs.
Constructors, destructors, conversion operators
Public functions
-
auto createObject(const std::
string& lightConfigName, bool registerTemplate = false) -> attributes::LightLayoutAttributes::ptr override - Creates one or more instances of LightLayoutAttributes based on the whether
lightConfigName
is a file or a not. If it is a file it will consider the contents of that file a layout and will use the file name as the layout name and load all the attributes described and assign them to that layout. File-based loads will automatically register, regardless of whatregisterTemplate
is. - void setValsFromJSONDoc(attributes::LightLayoutAttributes::ptr lightAttribs, const io::JsonGenericValue& jsonConfig) override
- Function to take an existing LightLayoutAttributes and set its values from passed json config file.
- void setLightInstanceValsFromJSONDoc(const attributes::LightInstanceAttributes::ptr& lightInstAttribs, const io::JsonGenericValue& jsonConfig)
- Function to take an existing LightInstanceAttributes and set its values from passed json config file.
-
auto createLightSetupFromAttributes(const std::
string& lightConfigName) -> gfx:: LightSetup - This will create a gfx::
LightSetup object based on the LightLayoutAttributes referenced by the passed name.
Protected functions
-
auto initNewObjectInternal(const std::
string& handleName, bool builtFromConfig) -> attributes::LightLayoutAttributes::ptr override - Used Internally. Create and configure newly-created attributes with any default values, before any specific values are set.
-
void deleteObjectInternalFinalize(int templateID,
const std::
string& templateHandle) override - This method will perform any necessary updating that is attributesManager-specific upon template removal. This should only be called from esp::
core:: managedContainers:: ManagedContainerBase. -
auto registerObjectFinalize(attributes::LightLayoutAttributes::ptr LightLayoutAttributesTemplate,
const std::
string& LightLayoutAttributesHandle, bool forceRegistration) -> int override - Add a copy of the esp::
metadata:: attributes:: LightLayoutAttributes shared_ptr object to the objectLibrary_ . - void resetFinalize() override
- Any lights-attributes-specific resetting that needs to happen on reset.
Function documentation
attributes::LightLayoutAttributes::ptr esp:: metadata:: managers:: LightLayoutAttributesManager:: createObject(const std:: string& lightConfigName,
bool registerTemplate = false) override
Creates one or more instances of LightLayoutAttributes based on the whether lightConfigName
is a file or a not. If it is a file it will consider the contents of that file a layout and will use the file name as the layout name and load all the attributes described and assign them to that layout. File-based loads will automatically register, regardless of what registerTemplate
is.
Parameters | |
---|---|
lightConfigName | The configuration file to parse, or the name of the single light's attributes to create. |
registerTemplate | whether to add this template to the library. Defaults to false - overridden if lightConfigName is a JSON file. |
Returns | a reference to the created light attributes. |
If a template/layout exists with this handle, this existing template/layout will be overwritten with the newly created one if registerTemplate is true.
void esp:: metadata:: managers:: LightLayoutAttributesManager:: setValsFromJSONDoc(attributes::LightLayoutAttributes::ptr lightAttribs,
const io::JsonGenericValue& jsonConfig) override
Function to take an existing LightLayoutAttributes and set its values from passed json config file.
Parameters | |
---|---|
lightAttribs | (out) an existing attributes to be modified. |
jsonConfig | json document to parse |
void esp:: metadata:: managers:: LightLayoutAttributesManager:: setLightInstanceValsFromJSONDoc(const attributes::LightInstanceAttributes::ptr& lightInstAttribs,
const io::JsonGenericValue& jsonConfig)
Function to take an existing LightInstanceAttributes and set its values from passed json config file.
Parameters | |
---|---|
lightInstAttribs | (out) an existing attributes to be modified. |
jsonConfig | json document to parse |
gfx:: LightSetup esp:: metadata:: managers:: LightLayoutAttributesManager:: createLightSetupFromAttributes(const std:: string& lightConfigName)
This will create a gfx::
Parameters | |
---|---|
lightConfigName | the name of the LightLayoutAttributes to be used to create the LightSetup. |
Returns | The lightSetup defined by the attributes, or an empty LightSetup. |
attributes::LightLayoutAttributes::ptr esp:: metadata:: managers:: LightLayoutAttributesManager:: initNewObjectInternal(const std:: string& handleName,
bool builtFromConfig) override protected
Used Internally. Create and configure newly-created attributes with any default values, before any specific values are set.
Parameters | |
---|---|
handleName | handle name to be assigned to attributes\ |
builtFromConfig | whether this LightLayoutAttributes is being built from a config file, or from some other source (i.e. handleName contains config file name) |
Returns | Newly created but unregistered LightLayoutAttributes pointer, with only default values set. |
void esp:: metadata:: managers:: LightLayoutAttributesManager:: deleteObjectInternalFinalize(int templateID,
const std:: string& templateHandle) override protected
This method will perform any necessary updating that is attributesManager-specific upon template removal. This should only be called from esp::
Parameters | |
---|---|
templateID | the ID of the template to remove |
templateHandle | the string key of the attributes desired. |
int esp:: metadata:: managers:: LightLayoutAttributesManager:: registerObjectFinalize(attributes::LightLayoutAttributes::ptr LightLayoutAttributesTemplate,
const std:: string& LightLayoutAttributesHandle,
bool forceRegistration) override protected
Add a copy of the esp::
Parameters | |
---|---|
LightLayoutAttributesTemplate | The attributes template. |
LightLayoutAttributesHandle | The key for referencing the template in the objectLibrary_ |
forceRegistration | |
Returns | The index in the objectLibrary_ |