Add a new attribute to an object¶
ss_attr_new
is a function defined in ssattr.c.
Synopsis:
-
ss_attr_t *
ss_attr_new
(ss_pers_t *owner, const char *name, hid_t type, size_t count, const void *value, unsigned flags, ss_attr_t *buf, ss_prop_t *props)¶
Formal Arguments:
owner
: The object with which the new attribute is associated.name
: The name of the new attribute.type
: The datatype of the attribute.count
: Number of values in the attribute.value
: Optional array ofcount
values each of typetype
. If this array is not supplied then the attribute’s value will be initialized to all zero bytes.flags
: Bit flags, such as SS_ALLSAME.buf
: The optional buffer for the returned attribute link.props
: Attribute properties (none defined yet).
Description: This function adds a new attribute to the owner
object (which must not be an attribute itself). An attribute
can be thought of as a one dimensional array of values all having the same datatype.
Return Value: Returns a non-null attribute link on success; null on failure. If buf
is supplied then it will be the success
return value.
Parallel Notes: Independent. However if all tasks are collectively creating a single attribute and all are passing the same
type
, count
, and value
then they may pass the SS_ALLSAME bit in the flags
argument, thereby allowing a
synchronization to do less work later. When the SS_ALLSAME bit is passed then the call should be collective
across the communicator of the scope containing the owner
object.
See Also:
- Object Attributes: Introduction for current chapter