[#BloombergLP-baljsn-EncoderOptions-accessAttribute-02] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/EncoderOptions.adoc[EncoderOptions]::accessAttribute :relfileprefix: ../../../ :mrdocs: `accessAttribute` overloads == Synopses Declared in `<baljsn_encoderoptions.h>` Invoke `accessor` on the non‐modifiable attribute indicated by `id`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ACCESSOR> int xref:BloombergLP/baljsn/EncoderOptions/accessAttribute-04.adoc[accessAttribute]( ACCESSOR& accessor, int id) const; ---- [.small]#xref:BloombergLP/baljsn/EncoderOptions/accessAttribute-04.adoc[_» more..._]# Invoke `accessor` on the non‐modifiable attribute indicated by name. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ACCESSOR> int xref:BloombergLP/baljsn/EncoderOptions/accessAttribute-0d.adoc[accessAttribute]( ACCESSOR& accessor, char const* name, int nameLength) const; ---- [.small]#xref:BloombergLP/baljsn/EncoderOptions/accessAttribute-0d.adoc[_» more..._]# == Return Value * value returned by `accessor`, or ‐1 if `id` is not found * value returned by `accessor`, or ‐1 if `name` is not found == Parameters [cols="1,4"] |=== | Name| Description | *accessor* | functor invoked on the matching attribute | *id* | attribute id | *name* | attribute name | *nameLength* | length of `name` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#