Class SBCClassAttribute#
This class describes a class attribute in a class proxy.
#include <SBCClassAttribute.hpp>
Public Types#
| Type | Name |
|---|---|
| enum | Access Available attribute accesses. |
| enum | Type Available attribute types. |
Public Functions#
| Type | Name |
|---|---|
| SBCClassAttribute (SBValue attributeType, SBCClassAttribute::Access access, SBCClassAttribute::Type type, const std::string & attributeName, const std::string & attributeDescription, const std::string & attributeGroup, bool staticFlag) Constructs a class attribute. |
|
| SBCClassAttribute (SBValue attributeType, SBCClassAttribute::Access access, SBCClassAttribute::Type type, const std::string & attributeName, const std::string & attributeDescription, const std::string & attributeGroup, bool staticFlag, SBFunction * getFunction, SBFunction * setFunction=nullptr, SBFunction * hasFunction=nullptr, SBFunction * clearFunction=nullptr, SBFunction * getSizeFunction=nullptr, SBFunction * getMinimumFunction=nullptr, SBFunction * getMaximumFunction=nullptr, SBFunction * getSingleStepFunction=nullptr, SBFunction * getSuffixFunction=nullptr, SBFunction * getCountFunction=nullptr, SBFunction * getCurrentIndexFunction=nullptr, SBFunction * setCurrentIndexFunction=nullptr, SBFunction * getItemTextFunction=nullptr, SBFunction * getDefaultFunction=nullptr) Constructs a class attribute. |
|
| void | clear (const SBValue & object) const Clears the value of the attribute when possible. |
| SBValue | get (const SBValue & object) const Gets the attribute from the object . |
| SBCClassAttribute::Access | getAccess () const Returns the access of the attribute. |
| SBValue | getAttributeType () const Returns the type of the attribute value. |
| int | getCount (const SBValue & object) const Returns the number of items of the attribute for the object . |
| int | getCurrentIndex (const SBValue & object) const Returns the attribute's current index from the object . |
| SBValue | getDefault (const SBValue & object) const Returns the attribute's default value from the object . |
| std::string | getDescription () const Returns the description of the attribute. |
| bool | getEnabledFlag (const SBValue & object) const Returns true if the attribute should be enabled in theInspector __ |
| std::string | getGroup () const Returns the group of the attribute. |
| std::string | getItemText (const SBValue & object, const int & index) const Returns the attribute's text for the index from theobject . |
| SBValue | getMaximum (const SBValue & object) const Returns the attribute's maximum value from the object . |
| SBValue | getMinimum (const SBValue & object) const Returns the attribute's minimum value from the object . |
| std::string | getName () const Returns the name of the attribute. |
| SBValue | getSingleStep (const SBValue & object) const Returns the attribute's single step from the object . |
| unsigned int | getSize (const SBValue & object) const Returns the size of the array attribute in the object when relevant. |
| bool | getStaticFlag () const Returns whether the attribute is static. |
| std::string | getSuffix (const SBValue & object) const Returns the attribute's suffix from the object . |
| std::string | getToolTip (const SBValue & object) const Returns the tool tip of the attribute. |
| SBCClassAttribute::Type | getType () const Returns the type of the attribute. |
| bool | getVisibilityFlag (const SBValue & object) const Returns true if the attribute should be visible in theInspector __ |
| bool | has (const SBValue & object) const Returns whether the attribute has a value when the attribute is clearable. |
| bool | hasDefault () noexcept const Returns true if the attribute has a default value. |
| bool | hasMaximum () noexcept const Returns true if the attribute has a maximum value. |
| bool | hasMinimum () noexcept const Returns true if the attribute has a minimum value. |
| bool | hasSingleStep () noexcept const Returns true if the attribute has a single step value. |
| void | set (const SBValue & object, const SBValue & value, const SBValue & size=SBValue()) const Sets the attribute in the object to a specificvalue . |
| void | setClearFunction (SBFunction * function) Sets the clear function. |
| void | setCurrentIndex (const SBValue & object, const int & index) const Sets the attribute's current index in the object to a specificindex . |
| void | setGetCountFunction (SBFunction * function) Sets the getCount function. |
| void | setGetCurrentIndexFunction (SBFunction * function) Sets the getCurrentIndex function. |
| void | setGetDefaultFunction (SBFunction * function) Sets the getDefault function. |
| void | setGetEnabledFlagFunction (SBFunction * function) Sets the getEnabledFlag function. |
| void | setGetFunction (SBFunction * function) Sets the get function. |
| void | setGetItemTextFunction (SBFunction * function) Sets the getItemText function. |
| void | setGetMaximumFunction (SBFunction * function) Sets the getMaximum function. |
| void | setGetMinimumFunction (SBFunction * function) Sets the getMinimum function. |
| void | setGetSingleStepFunction (SBFunction * function) Sets the getSingleStep function. |
| void | setGetSizeFunction (SBFunction * function) Sets the getSize function. |
| void | setGetSuffixFunction (SBFunction * function) Sets the getSuffix function. |
| void | setGetToolTipFunction (SBFunction * function) Sets the getToolTip function. |
| void | setGetVisibilityFlagFunction (SBFunction * function) Sets the getVisibilityFlag function. |
| void | setHasFunction (SBFunction * function) Sets the has function. |
| void | setSetCurrentIndexFunction (SBFunction * function) Sets the setCurrentIndex function. |
| void | setSetFunction (SBFunction * function) Sets the set function. |
| ~SBCClassAttribute () Destructs the class attribute. |
Public Types Documentation#
enum Access#
Available attribute accesses.
enum Type#
Available attribute types.
enum SBCClassAttribute::Type {
Scalar = 0,
Array = 1,
Range = 2,
Slider = 3,
List = 4,
RichText = 5,
PushButton = 6,
ImagePath = 7,
ImageBase64 = 8
};
Public Functions Documentation#
function SBCClassAttribute [1/2]#
Constructs a class attribute.
SBCClassAttribute::SBCClassAttribute (
SBValue attributeType,
SBCClassAttribute::Access access,
SBCClassAttribute::Type type,
const std::string & attributeName,
const std::string & attributeDescription,
const std::string & attributeGroup,
bool staticFlag
)
Creates an attribute with the given type, access level, and metadata.
Parameters:
attributeTypeThe type of the attribute value.accessThe access mode of the attribute (read-only, read-write, or read-write-clear).typeThe attribute type (scalar, array, range, etc.).attributeNameThe name of the attribute.attributeDescriptionThe description of the attribute.attributeGroupThe group to which the attribute belongs.staticFlagtrueif the attribute is static; otherwisefalse.
function SBCClassAttribute [2/2]#
Constructs a class attribute.
SBCClassAttribute::SBCClassAttribute (
SBValue attributeType,
SBCClassAttribute::Access access,
SBCClassAttribute::Type type,
const std::string & attributeName,
const std::string & attributeDescription,
const std::string & attributeGroup,
bool staticFlag,
SBFunction * getFunction,
SBFunction * setFunction=nullptr,
SBFunction * hasFunction=nullptr,
SBFunction * clearFunction=nullptr,
SBFunction * getSizeFunction=nullptr,
SBFunction * getMinimumFunction=nullptr,
SBFunction * getMaximumFunction=nullptr,
SBFunction * getSingleStepFunction=nullptr,
SBFunction * getSuffixFunction=nullptr,
SBFunction * getCountFunction=nullptr,
SBFunction * getCurrentIndexFunction=nullptr,
SBFunction * setCurrentIndexFunction=nullptr,
SBFunction * getItemTextFunction=nullptr,
SBFunction * getDefaultFunction=nullptr
)
Constructs a class attribute with custom accessor functions.
Creates an attribute with the given type, access level, metadata, and optional function pointers for attribute operations.
Parameters:
attributeTypeThe type of the attribute value.accessThe access mode of the attribute.typeThe attribute type.attributeNameThe name of the attribute.attributeDescriptionThe description of the attribute.attributeGroupThe group to which the attribute belongs.staticFlagtrueif the attribute is static; otherwisefalse.getFunctionFunction used to retrieve the attribute value.setFunctionFunction used to set the attribute value.hasFunctionFunction used to determine if the attribute has a value.clearFunctionFunction used to clear the attribute value.getSizeFunctionFunction used to obtain the size of the attribute.getMinimumFunctionFunction used to obtain the minimum permissible value.getMaximumFunctionFunction used to obtain the maximum permissible value.getSingleStepFunctionFunction used to obtain the single step increment value.getSuffixFunctionFunction used to obtain the suffix string for the attribute.getCountFunctionFunction used to obtain the number of items for list-type attributes.getCurrentIndexFunctionFunction used to obtain the current index of a list attribute.setCurrentIndexFunctionFunction used to set the current index of a list attribute.getItemTextFunctionFunction used to obtain the text of an item in a list attribute.getDefaultFunctionFunction used to obtain the default value of the attribute.
function clear#
Clears the value of the attribute when possible.
Clears the attribute value on the given object, if supported.
Parameters:
objectThe object whose attribute should be cleared.
function get#
Gets the attribute from the object .
Retrieves the attribute value from an object.
Parameters:
objectThe object from which to get the attribute value.
Returns:
The attribute value as an SBValue.
function getAccess#
Returns the access of the attribute.
Returns the access level of the attribute.
Returns:
The access mode (read-only, read-write, or read-write-clear).
function getAttributeType#
Returns the type of the attribute value.
Returns the underlying value type of the attribute.
Returns:
The attribute's SBValue type.
function getCount#
Returns the number of items of the attribute for the object .
Retrieves the number of items in a list-type attribute for the given object.
This function returns the total number of items contained in the attribute.
Parameters:
objectThe object to query.
Returns:
The count of items.
function getCurrentIndex#
Returns the attribute's current index from the object .
Retrieves the current index of a list-type attribute for the given object.
This function returns the currently selected index within the attribute's list.
Parameters:
objectThe object to query.
Returns:
The current index.
function getDefault#
Returns the attribute's default value from the object .
Retrieves the default value of the attribute for the given object.
Parameters:
objectThe object to query.
Returns:
The default attribute value as an SBValue.
function getDescription#
Returns the description of the attribute.
Returns:
The attribute description.
function getEnabledFlag#
Returns true if the attribute should be enabled in theInspector __
Determines whether the attribute should be enabled in the inspector for the given object.
This function indicates if the attribute is currently enabled for interaction in the inspector UI.
Parameters:
objectThe object to query.
Returns:
true if the attribute should be enabled; otherwise false.
function getGroup#
Returns the group of the attribute.
Returns:
The attribute group.
function getItemText#
Returns the attribute's text for the index from theobject .
Retrieves the text for a specific item in a list-type attribute.
This function returns the display text associated with the item at the specified index.
Parameters:
objectThe object to query.indexThe index of the item.
Returns:
The item text.
function getMaximum#
Returns the attribute's maximum value from the object .
Retrieves the maximum permissible value of the attribute for the given object.
Parameters:
objectThe object to query.
Returns:
The maximum value as an SBValue.
function getMinimum#
Returns the attribute's minimum value from the object .
Retrieves the minimum permissible value of the attribute for the given object.
Parameters:
objectThe object to query.
Returns:
The minimum value as an SBValue.
function getName#
Returns the name of the attribute.
Returns:
The attribute name.
function getSingleStep#
Returns the attribute's single step from the object .
Retrieves the single-step increment value of the attribute for the given object.
This function returns the increment used for stepping the attribute's numeric value.
Parameters:
objectThe object to query.
Returns:
The single-step value as an SBValue.
function getSize#
Returns the size of the array attribute in the object when relevant.
Retrieves the size of an array attribute for the given object.
Retrieves the size by calling the configured getSizeFunction if present, and returns the result as an unsigned integer.
Parameters:
objectThe object to query.
Returns:
The size of the attribute as an unsigned integer.
function getStaticFlag#
Returns whether the attribute is static.
Returns:
true if the attribute is static; otherwise false.
function getSuffix#
Returns the attribute's suffix from the object .
Retrieves the suffix string associated with the attribute for the given object.
This function obtains the suffix string used for display purposes.
Parameters:
objectThe object to query.
Returns:
The suffix string.
function getToolTip#
Returns the tool tip of the attribute.
Retrieves the tool tip string for the attribute for the given object.
This function returns the tooltip text providing additional information about the attribute.
Parameters:
objectThe object to query.
Returns:
The tool tip string.
function getType#
Returns the type of the attribute.
Returns:
The attribute type (scalar, array, range, etc.).
function getVisibilityFlag#
Returns true if the attribute should be visible in theInspector __
Determines whether the attribute should be visible in the inspector for the given object.
This function indicates if the attribute is currently visible in the inspector UI.
Parameters:
objectThe object to query.
Returns:
true if the attribute should be visible; otherwise false.
function has#
Returns whether the attribute has a value when the attribute is clearable.
Checks whether the attribute has a value for the given object.
Determines the presence of a value by invoking the associated hasFunction, if defined, and returns its boolean result.
Parameters:
objectThe object to check.
Returns:
true if the attribute has a value; otherwise false.
function hasDefault#
Returns true if the attribute has a default value.
Indicates whether the attribute has a default value.
Returns:
true if a default value is defined; otherwise false.
function hasMaximum#
Returns true if the attribute has a maximum value.
Indicates whether the attribute has a maximum value defined.
Returns:
true if a maximum value is defined; otherwise false.
function hasMinimum#
Returns true if the attribute has a minimum value.
Indicates whether the attribute has a minimum value defined.
Returns:
true if a minimum value is defined; otherwise false.
function hasSingleStep#
Returns true if the attribute has a single step value.
Indicates whether the attribute has a single-step value defined.
Returns:
true if a single-step value is defined; otherwise false.
function set#
Sets the attribute in the object to a specificvalue .
void SBCClassAttribute::set (
const SBValue & object,
const SBValue & value,
const SBValue & size=SBValue ()
) const
Sets the attribute value on an object.
Parameters:
objectThe object on which to set the attribute.valueThe new value for the attribute.sizeOptional size parameter for array attributes; defaults to an empty SBValue.
function setClearFunction#
Sets the clear function.
Sets the function used to clear the attribute.
Parameters:
functionPointer to the SBFunction that clears the attribute.
function setCurrentIndex#
Sets the attribute's current index in the object to a specificindex .
Sets the current index of a list-type attribute for the given object.
This function updates the selected index of the attribute's list to the specified value.
Parameters:
objectThe object whose attribute index is to be set.indexThe new current index.
function setGetCountFunction#
Sets the getCount function.
Sets the function used to get the item count of a list-type attribute.
Parameters:
functionPointer to the SBFunction that retrieves the count.
function setGetCurrentIndexFunction#
Sets the getCurrentIndex function.
Sets the function used to get the current index of a list-type attribute.
Parameters:
functionPointer to the SBFunction that retrieves the current index.
function setGetDefaultFunction#
Sets the getDefault function.
Sets the function used to get the default value of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the default value.
function setGetEnabledFlagFunction#
Sets the getEnabledFlag function.
Sets the function used to get the enabled flag of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the enabled flag.
function setGetFunction#
Sets the get function.
Sets the function used to get the attribute value.
Parameters:
functionPointer to the SBFunction that retrieves the attribute value.
function setGetItemTextFunction#
Sets the getItemText function.
Sets the function used to get the text of an item in a list-type attribute.
Parameters:
functionPointer to the SBFunction that retrieves the item text.
function setGetMaximumFunction#
Sets the getMaximum function.
Sets the function used to get the maximum value of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the maximum value.
function setGetMinimumFunction#
Sets the getMinimum function.
Sets the function used to get the minimum value of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the minimum value.
function setGetSingleStepFunction#
Sets the getSingleStep function.
Sets the function used to get the single-step increment value of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the single-step value.
function setGetSizeFunction#
Sets the getSize function.
Sets the function used to get the size of the attribute.
Parameters:
functionPointer to the SBFunction that obtains the attribute size.
function setGetSuffixFunction#
Sets the getSuffix function.
Sets the function used to get the suffix string of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the suffix.
function setGetToolTipFunction#
Sets the getToolTip function.
Sets the function used to get the tool tip string of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the tool tip.
function setGetVisibilityFlagFunction#
Sets the getVisibilityFlag function.
Sets the function used to get the visibility flag of the attribute.
Parameters:
functionPointer to the SBFunction that retrieves the visibility flag.
function setHasFunction#
Sets the has function.
Sets the function used to determine if the attribute has a value.
Parameters:
functionPointer to the SBFunction that checks the attribute existence.
function setSetCurrentIndexFunction#
Sets the setCurrentIndex function.
Sets the function used to set the current index of a list-type attribute.
Parameters:
functionPointer to the SBFunction that sets the current index.
function setSetFunction#
Sets the set function.
Sets the function used to set the attribute value.
Parameters:
functionPointer to the SBFunction that sets the attribute value.
function ~SBCClassAttribute#
Destructs the class attribute.
Destroys the class attribute.