API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

ITRIGMLEXTENSION_GETATTRIBUTEDEFAULT()

Brew Release
Brew MP 1.0.2
Description
Returns the default value for a given attribute.
Params
po
[]:
A pointer to an ITrigmlExtension object.
node
[]:
A pointer to the element from which to get the default value
classId
[]:
The class ID of the attribute. This should be a KTrigml*ExtensionClassId constant from an extension metadata header.
id
[]:
The attribute ID of the attribute. This should be a KTrigml*Attr* constant from an extension metadata header.
ppValue
[]:
[out] A pointer to receive the address of the default value. The memory pointed to is owned by the extension; do not free it. ppValue is set to NULL if there is no default value.
Interface
  • ITRIGMLEXTENSION
Prototype
  •    int ITRIGMLEXTENSION_GetAttributeDefault(ITrigmlExtension* po, ITrigmlElement* node, AEECLSID classId, uint16 id, const TrigmlValue ** value)
    
Return
  •    A BREW error code. A non-SUCCESS return code should be set when the default
       is requested from element/attribute unknown to the extension; in contrast
       when the element/attribute is known but no default is defined, *value should
       be set to NULL and SUCCESS returned.
    
Side Effect
  • None
Comments
It is recommended, where possible, that the extension writer statically allocate the memory for default values and return that memory when a default of the same value is requested. The practice of allocating memory on each element for each default value that is requested is discouraged; this type of behavior could be viewed as a leak.