Invoke an accessor on a sequence attribute identified by name.

Synopsis

Declared in <bdlat_sequencefunctions.h>

template<
    class TYPE,
    class ACCESSOR>
int
accessAttribute(
    TYPE const& object,
    ACCESSOR& accessor,
    char const* attributeName,
    int attributeNameLength);

Description

Invoke the specified accessor on the (non‐modifiable) attribute of the specified object indicated by the specified attributeName and attributeNameLength, supplying accessor with the corresponding attribute information structure. The supplied accessor must be a callable type that can be called as if it had the following signature: ` template <class t_INFO> int accessor(const ATTRIBUTE_TYPE& attribute, const t_INFO& info); ` Return non‐zero value if the attribute is not found, and the value returned from the invocation of accessor otherwise.

Return Value

non‐zero if the attribute is not found, and the value from accessor otherwise

Parameters

Name

Description

object

sequence whose attribute is accessed

accessor

callable invoked with the attribute and its info

attributeName

name of the attribute to access

attributeNameLength

length of attributeName

Created with MrDocs