BloombergLP::baljsn::EncodeImplUtil::validateChoice

Determine whether the choice value has a defined selection.

Synopsis

Declared in <baljsn_encodeimplutil.h>

template<class TYPE>
static
int
validateChoice(
    std::ostream* logStream,
    TYPE const& value);

Description

Determine if the specified value satisfies the requirements for encoding using this component. If the value meets the encoding requirements, return 0, otherwise load an unspecified, human-readable description of the requirements that are not satisfied by the value to the specified logStream and return a non-zero value. The value is required to not have an undefined selectionId.

Return Value

0 if valid, and a non-zero value otherwise

Parameters

NameDescription
logStreamstream for human-readable error descriptions
valuechoice value to validate