[#BloombergLP-balcl-TypeInfo]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::TypeInfo
:relfileprefix: ../../
:mrdocs:

This `class` is a attribute class that describes the type, the variable to be linked, and the constraint on an option&period; Note that the constraint type is opaque, but it is possible to apply the constraint to an element of the same type as the option and see whether it is valid (using the `satisfiesConstraint` methods of `TypeInfoUtil`)&period;

== Synopsis

Declared in `&lt;balcl&lowbar;typeinfo&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class TypeInfo;
----

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/TypeInfo/ParseInputSource.adoc[`ParseInputSource`] 
| This enumeration differentiates the source of input when parsing an option type&period; Note that boolean options, in particular, are treated differently when supplied on the command line from how they are treated when supplied by an environment variable (see &apos;balcl&lowbar;commandline&apos;)&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/TypeInfo/2constructor-0e4d.adoc[`TypeInfo`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/balcl/TypeInfo/2destructor.adoc[`&#126;TypeInfo`] [.small]#[destructor]#
| Destroy this object&period;
| xref:BloombergLP/balcl/TypeInfo/operator_assign.adoc[`operator&equals;`] 
| Assign to this object the value of the specified `rhs` object and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/balcl/TypeInfo/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period; Note that if no allocator was supplied at construction the currently installed default allocator at construction is used&period;
| xref:BloombergLP/balcl/TypeInfo/constraint.adoc[`constraint`] 
| Return a shared pointer to the (opaque) object storing the constraint associated with the described option&period; If this object has no constraint an empty shared pointer is returned&period; The lifetime of any shared reference to this object&apos;s constraint must not exceed that of this object&apos;s allocator&period;
| xref:BloombergLP/balcl/TypeInfo/isOptionalLinkedVariable.adoc[`isOptionalLinkedVariable`] 
| Return `true` if the described option has a linked variable and that variable is a `bsl&colon;&colon;optional` object, and `false` otherwise&period;
| xref:BloombergLP/balcl/TypeInfo/linkedVariable.adoc[`linkedVariable`] 
| Return the address of the modifiable variable linked to the described option, or 0 if no variable is linked&period;
| xref:BloombergLP/balcl/TypeInfo/print.adoc[`print`] 
| Format this object to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`&period; If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this object&period; If `level` is negative, suppress indentation of the first line&period; If `stream` is not valid on entry, this operation has no effect&period; The behavior is undefined if `spacesPerLevel` is negative&period; Note that the precondition on `spacesPerLevel` is atypical for the `print` aspect&semi; a negative `spacesPerLevel` typically indicates that the entire output should be formatted on one line&period;
| xref:BloombergLP/balcl/TypeInfo/resetConstraint.adoc[`resetConstraint`] 
| Reset this object so that it no longer has a constraint&period; This method has no effect if the object has no constraint&period; Note that neither the type attribute nor the linked variable, if any, are changed&period;
| xref:BloombergLP/balcl/TypeInfo/resetLinkedVariableAndConstraint.adoc[`resetLinkedVariableAndConstraint`] 
| Reset this object so that it has neither a linked variable nor a constraint&period; This method has no effect if the object has no linked variable or constraint&period; Note that the type attribute is not changed&period;
| xref:BloombergLP/balcl/TypeInfo/setConstraint-02.adoc[`setConstraint`] 
| `setConstraint` overloads
| xref:BloombergLP/balcl/TypeInfo/setLinkedVariable-012.adoc[`setLinkedVariable`] 
| `setLinkedVariable` overloads
| xref:BloombergLP/balcl/TypeInfo/type.adoc[`type`] 
| Return the type of the described option&period; Note that the option is a flag if it is of type `OptionType&colon;&colon;e&lowbar;BOOL`&period;
| xref:BloombergLP/balcl/TypeInfo/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;TypeInfo, HasPrintMethod&gt;`] 
| Nested trait declaration for `bslma&colon;&colon;UsesBslmaAllocator`&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/TypeInfo/d_allocator_p.adoc[`d&lowbar;allocator&lowbar;p`] 
| memory allocator (held)
| xref:BloombergLP/balcl/TypeInfo/d_constraint_p.adoc[`d&lowbar;constraint&lowbar;p`] 
| constraint on the option value
| xref:BloombergLP/balcl/TypeInfo/d_elemType.adoc[`d&lowbar;elemType`] 
| type of the option value
| xref:BloombergLP/balcl/TypeInfo/d_isOptionalLinkedVariable.adoc[`d&lowbar;isOptionalLinkedVariable`] 
| `true` if the linked variable is a `bsl&colon;&colon;optional` object
| xref:BloombergLP/balcl/TypeInfo/d_linkedVariable_p.adoc[`d&lowbar;linkedVariable&lowbar;p`] 
| Address of the variable linked to this option value (held, not owned)&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/operator_not_eq-04.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` command&hyphen;line option info has a different value from the specified `rhs` command&hyphen;line option info, and `false` otherwise&period; Two `TypeInfo` objects do not have the same value if the associated options have different types, or one object has a linked variable and the other either does not or refers to a different variable, and one has a constraint and the other either does not or refers to a different constraint&period; Note that two objects constructed from copies of the same constraint will _not_ be identical&period; (Use `constraint`&sol;`setConstraint` to ensure that both constraints are the same&period;)
| xref:BloombergLP/balcl/operator_eq-07.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` have the same value, and `false` otherwise&period; Two `TypeInfo` objects have the same value if their associated options have the same type, both objects do not have a linked variable or both refer to the same variable, and both do not have a constraint or both refer to the same constraint&period; Note that two objects constructed from copies of the same constraint will _not_ be identical&period; (Use `constraint`&sol;`setConstraint` to ensure that both constraints are the same&period;)
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
