BloombergLP::balcl::TypeInfo

This class describes an option's type, linked variable, and constraint.

Synopsis

Declared in <balcl_typeinfo.h>

class TypeInfo;

Description

This is an attribute class that describes the type, the variable to be linked, and the constraint on an option. 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).

Enums

NameDescription
ParseInputSource Enumerate the sources of input when parsing an option type.

Member Functions

NameDescription
TypeInfo [constructor]Constructors
~TypeInfo [destructor]Destroy this object.
operator= Assign to this object the value of the specified rhs object and return a reference providing modifiable access to this object.
allocator Return the allocator used by this object to supply memory.
constraint Return a shared pointer to the constraint associated with the described option.
isOptionalLinkedVariable Return true if the described option has a linked variable and that variable is a bsl::optional object, and false otherwise.
linkedVariable Return the address of the modifiable variable linked to the described option, or 0 if no variable is linked.
print Format this object to the specified output stream and return a reference to stream.
resetConstraint Reset this object so that it no longer has a constraint.
resetLinkedVariableAndConstraint Reset this object so that it has neither a linked variable nor a constraint.
setConstraint setConstraint overloads
setLinkedVariable setLinkedVariable overloads
type Return the type of the described option. Note that the option is a flag if it is of type OptionType::e_BOOL.
operator BloombergLP::bslmf::NestedTraitDeclaration<TypeInfo, HasPrintMethod> Nested trait declaration for bslma::UsesBslmaAllocator.

Data Members

NameDescription
d_allocator_p memory allocator (held)
d_constraint_p constraint on the option value
d_elemType type of the option value
d_isOptionalLinkedVariable true if the linked variable is a bsl::optional object
d_linkedVariable_p Address of the variable linked to this option value (held, not owned).

Non-Member Functions

NameDescription
operator!=Return true if the specified lhs and rhs do not have the same value.
operator==Return true if the specified lhs and rhs have the same value.