[#BloombergLP-balcl-OptionValue] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::OptionValue :relfileprefix: ../../ :mrdocs: This class implements a special‐use value‐semantic variant type used to represent values parsed from process command lines. == Synopsis Declared in `<balcl_optionvalue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class OptionValue; ---- == Description Accordingly, this class can represent values of any of the types defined in `balcl_optiontype`. Furthermore, that value can also be in a null state (defined type but no defined value) to represent allowed options that do not appear among the command‐line arguments (and for which no default value has been configured). == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OptionValue/2constructor-09.adoc[`OptionValue`] [.small]#[constructor]# | Constructors | xref:BloombergLP/balcl/OptionValue/operator_assign.adoc[`operator=`] | Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object. | xref:BloombergLP/balcl/OptionValue/allocator.adoc[`allocator`] | Return the allocator used by this object to supply memory. | xref:BloombergLP/balcl/OptionValue/hasNonVoidType.adoc[`hasNonVoidType`] | Return `true` if this object is in the unset state, and `false` otherwise. Note that if `false == hasNonVoidType()` then `OptionType::e_VOID == type()`. | xref:BloombergLP/balcl/OptionValue/isNull.adoc[`isNull`] | Return `true` if the value of this object (irrespective of non‐`void` type) is null. The behavior is undefined unless `true == hasNonVoidType()`. | xref:BloombergLP/balcl/OptionValue/print.adoc[`print`] | Write the value of this object to the specified output `stream`. | xref:BloombergLP/balcl/OptionValue/reset.adoc[`reset`] | Reset this object to its default constructed (unset) state. The existing value, if any, is destroyed. Note that on return `OptionType::e_VOID == type()`. | xref:BloombergLP/balcl/OptionValue/set.adoc[`set`] | Set the value of this object to the specified `value`. | xref:BloombergLP/balcl/OptionValue/setNull.adoc[`setNull`] | Set the value of this object, irrespective of that value's type, to its null state. | xref:BloombergLP/balcl/OptionValue/setType.adoc[`setType`] | Set the type of this object to the specified `type` and the value to the default value of that type. | xref:BloombergLP/balcl/OptionValue/swap.adoc[`swap`] | Efficiently exchange the value of this object with the value of the specified `other` object. | xref:BloombergLP/balcl/OptionValue/the-06.adoc[`the`] | `the` overloads | xref:BloombergLP/balcl/OptionValue/type.adoc[`type`] | Return the type of this command‐line‐option value. The type `OptionType::e_VOID` represents the unset state. | xref:BloombergLP/balcl/OptionValue/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<OptionValue, HasPrintMethod>`] | Nested trait declaration for `bslma::UsesBslmaAllocator`. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/balcl/swap.adoc[BloombergLP::balcl::swap]` | Swap the value of the specified `a` object with the value of the specified `b` object. | `xref:BloombergLP/balcl/operator_eq-0d.adoc[BloombergLP::balcl::operator==]` | Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/operator_not_eq-001.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#