Web Analytics Made Easy - Statcounter
Skip to content

Class SBCClassAttribute#

ClassList > 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 SBCClassAttribute::Access {
    ReadOnly = 0,
    ReadWrite = 1,
    ReadWriteClear = 2
};


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:

  • attributeType The type of the attribute value.
  • access The access mode of the attribute (read-only, read-write, or read-write-clear).
  • type The attribute type (scalar, array, range, etc.).
  • attributeName The name of the attribute.
  • attributeDescription The description of the attribute.
  • attributeGroup The group to which the attribute belongs.
  • staticFlag true if the attribute is static; otherwise false.

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:

  • attributeType The type of the attribute value.
  • access The access mode of the attribute.
  • type The attribute type.
  • attributeName The name of the attribute.
  • attributeDescription The description of the attribute.
  • attributeGroup The group to which the attribute belongs.
  • staticFlag true if the attribute is static; otherwise false.
  • getFunction Function used to retrieve the attribute value.
  • setFunction Function used to set the attribute value.
  • hasFunction Function used to determine if the attribute has a value.
  • clearFunction Function used to clear the attribute value.
  • getSizeFunction Function used to obtain the size of the attribute.
  • getMinimumFunction Function used to obtain the minimum permissible value.
  • getMaximumFunction Function used to obtain the maximum permissible value.
  • getSingleStepFunction Function used to obtain the single step increment value.
  • getSuffixFunction Function used to obtain the suffix string for the attribute.
  • getCountFunction Function used to obtain the number of items for list-type attributes.
  • getCurrentIndexFunction Function used to obtain the current index of a list attribute.
  • setCurrentIndexFunction Function used to set the current index of a list attribute.
  • getItemTextFunction Function used to obtain the text of an item in a list attribute.
  • getDefaultFunction Function used to obtain the default value of the attribute.

function clear#

Clears the value of the attribute when possible.

void SBCClassAttribute::clear (
    const SBValue & object
) const

Clears the attribute value on the given object, if supported.

Parameters:

  • object The object whose attribute should be cleared.

function get#

Gets the attribute from the object .

SBValue SBCClassAttribute::get (
    const SBValue & object
) const

Retrieves the attribute value from an object.

Parameters:

  • object The object from which to get the attribute value.

Returns:

The attribute value as an SBValue.


function getAccess#

Returns the access of the attribute.

SBCClassAttribute::Access SBCClassAttribute::getAccess () const

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.

SBValue SBCClassAttribute::getAttributeType () const

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 .

int SBCClassAttribute::getCount (
    const SBValue & object
) const

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:

  • object The object to query.

Returns:

The count of items.


function getCurrentIndex#

Returns the attribute's current index from the object .

int SBCClassAttribute::getCurrentIndex (
    const SBValue & object
) const

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:

  • object The object to query.

Returns:

The current index.


function getDefault#

Returns the attribute's default value from the object .

SBValue SBCClassAttribute::getDefault (
    const SBValue & object
) const

Retrieves the default value of the attribute for the given object.

Parameters:

  • object The object to query.

Returns:

The default attribute value as an SBValue.


function getDescription#

Returns the description of the attribute.

std::string SBCClassAttribute::getDescription () const

Returns:

The attribute description.


function getEnabledFlag#

Returns true if the attribute should be enabled in theInspector __

bool SBCClassAttribute::getEnabledFlag (
    const SBValue & object
) const

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:

  • object The object to query.

Returns:

true if the attribute should be enabled; otherwise false.


function getGroup#

Returns the group of the attribute.

std::string SBCClassAttribute::getGroup () const

Returns:

The attribute group.


function getItemText#

Returns the attribute's text for the index from theobject .

std::string SBCClassAttribute::getItemText (
    const SBValue & object,
    const int & index
) const

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:

  • object The object to query.
  • index The index of the item.

Returns:

The item text.


function getMaximum#

Returns the attribute's maximum value from the object .

SBValue SBCClassAttribute::getMaximum (
    const SBValue & object
) const

Retrieves the maximum permissible value of the attribute for the given object.

Parameters:

  • object The object to query.

Returns:

The maximum value as an SBValue.


function getMinimum#

Returns the attribute's minimum value from the object .

SBValue SBCClassAttribute::getMinimum (
    const SBValue & object
) const

Retrieves the minimum permissible value of the attribute for the given object.

Parameters:

  • object The object to query.

Returns:

The minimum value as an SBValue.


function getName#

Returns the name of the attribute.

std::string SBCClassAttribute::getName () const

Returns:

The attribute name.


function getSingleStep#

Returns the attribute's single step from the object .

SBValue SBCClassAttribute::getSingleStep (
    const SBValue & object
) const

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:

  • object The 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.

unsigned int SBCClassAttribute::getSize (
    const SBValue & object
) const

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:

  • object The object to query.

Returns:

The size of the attribute as an unsigned integer.


function getStaticFlag#

Returns whether the attribute is static.

bool SBCClassAttribute::getStaticFlag () const

Returns:

true if the attribute is static; otherwise false.


function getSuffix#

Returns the attribute's suffix from the object .

std::string SBCClassAttribute::getSuffix (
    const SBValue & object
) const

Retrieves the suffix string associated with the attribute for the given object.

This function obtains the suffix string used for display purposes.

Parameters:

  • object The object to query.

Returns:

The suffix string.


function getToolTip#

Returns the tool tip of the attribute.

std::string SBCClassAttribute::getToolTip (
    const SBValue & object
) const

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:

  • object The object to query.

Returns:

The tool tip string.


function getType#

Returns the type of the attribute.

SBCClassAttribute::Type SBCClassAttribute::getType () const

Returns:

The attribute type (scalar, array, range, etc.).


function getVisibilityFlag#

Returns true if the attribute should be visible in theInspector __

bool SBCClassAttribute::getVisibilityFlag (
    const SBValue & object
) const

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:

  • object The 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.

bool SBCClassAttribute::has (
    const SBValue & object
) const

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:

  • object The object to check.

Returns:

true if the attribute has a value; otherwise false.


function hasDefault#

Returns true if the attribute has a default value.

bool SBCClassAttribute::hasDefault () noexcept const

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.

bool SBCClassAttribute::hasMaximum () noexcept const

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.

bool SBCClassAttribute::hasMinimum () noexcept const

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.

bool SBCClassAttribute::hasSingleStep () noexcept const

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:

  • object The object on which to set the attribute.
  • value The new value for the attribute.
  • size Optional size parameter for array attributes; defaults to an empty SBValue.

function setClearFunction#

Sets the clear function.

void SBCClassAttribute::setClearFunction (
    SBFunction * function
) 

Sets the function used to clear the attribute.

Parameters:

  • function Pointer to the SBFunction that clears the attribute.

function setCurrentIndex#

Sets the attribute's current index in the object to a specificindex .

void SBCClassAttribute::setCurrentIndex (
    const SBValue & object,
    const int & index
) const

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:

  • object The object whose attribute index is to be set.
  • index The new current index.

function setGetCountFunction#

Sets the getCount function.

void SBCClassAttribute::setGetCountFunction (
    SBFunction * function
) 

Sets the function used to get the item count of a list-type attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the count.

function setGetCurrentIndexFunction#

Sets the getCurrentIndex function.

void SBCClassAttribute::setGetCurrentIndexFunction (
    SBFunction * function
) 

Sets the function used to get the current index of a list-type attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the current index.

function setGetDefaultFunction#

Sets the getDefault function.

void SBCClassAttribute::setGetDefaultFunction (
    SBFunction * function
) 

Sets the function used to get the default value of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the default value.

function setGetEnabledFlagFunction#

Sets the getEnabledFlag function.

void SBCClassAttribute::setGetEnabledFlagFunction (
    SBFunction * function
) 

Sets the function used to get the enabled flag of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the enabled flag.

function setGetFunction#

Sets the get function.

void SBCClassAttribute::setGetFunction (
    SBFunction * function
) 

Sets the function used to get the attribute value.

Parameters:

  • function Pointer to the SBFunction that retrieves the attribute value.

function setGetItemTextFunction#

Sets the getItemText function.

void SBCClassAttribute::setGetItemTextFunction (
    SBFunction * function
) 

Sets the function used to get the text of an item in a list-type attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the item text.

function setGetMaximumFunction#

Sets the getMaximum function.

void SBCClassAttribute::setGetMaximumFunction (
    SBFunction * function
) 

Sets the function used to get the maximum value of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the maximum value.

function setGetMinimumFunction#

Sets the getMinimum function.

void SBCClassAttribute::setGetMinimumFunction (
    SBFunction * function
) 

Sets the function used to get the minimum value of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the minimum value.

function setGetSingleStepFunction#

Sets the getSingleStep function.

void SBCClassAttribute::setGetSingleStepFunction (
    SBFunction * function
) 

Sets the function used to get the single-step increment value of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the single-step value.

function setGetSizeFunction#

Sets the getSize function.

void SBCClassAttribute::setGetSizeFunction (
    SBFunction * function
) 

Sets the function used to get the size of the attribute.

Parameters:

  • function Pointer to the SBFunction that obtains the attribute size.

function setGetSuffixFunction#

Sets the getSuffix function.

void SBCClassAttribute::setGetSuffixFunction (
    SBFunction * function
) 

Sets the function used to get the suffix string of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the suffix.

function setGetToolTipFunction#

Sets the getToolTip function.

void SBCClassAttribute::setGetToolTipFunction (
    SBFunction * function
) 

Sets the function used to get the tool tip string of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the tool tip.

function setGetVisibilityFlagFunction#

Sets the getVisibilityFlag function.

void SBCClassAttribute::setGetVisibilityFlagFunction (
    SBFunction * function
) 

Sets the function used to get the visibility flag of the attribute.

Parameters:

  • function Pointer to the SBFunction that retrieves the visibility flag.

function setHasFunction#

Sets the has function.

void SBCClassAttribute::setHasFunction (
    SBFunction * function
) 

Sets the function used to determine if the attribute has a value.

Parameters:

  • function Pointer to the SBFunction that checks the attribute existence.

function setSetCurrentIndexFunction#

Sets the setCurrentIndex function.

void SBCClassAttribute::setSetCurrentIndexFunction (
    SBFunction * function
) 

Sets the function used to set the current index of a list-type attribute.

Parameters:

  • function Pointer to the SBFunction that sets the current index.

function setSetFunction#

Sets the set function.

void SBCClassAttribute::setSetFunction (
    SBFunction * function
) 

Sets the function used to set the attribute value.

Parameters:

  • function Pointer to the SBFunction that sets the attribute value.

function ~SBCClassAttribute#

Destructs the class attribute.

SBCClassAttribute::~SBCClassAttribute () 

Destroys the class attribute.