Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

balcl::TypeInfo Class Reference

#include <balcl_typeinfo.h>

List of all members.

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (TypeInfo, bslma::UsesBslmaAllocator)
 BSLMF_NESTED_TRAIT_DECLARATION (TypeInfo, bdlb::HasPrintMethod)
 TypeInfo ()
 TypeInfo (bslma::Allocator *basicAllocator)
 TypeInfo (bool *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (char *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (char *variable, const Constraint::CharConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (int *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (int *variable, const Constraint::IntConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsls::Types::Int64 *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsls::Types::Int64 *variable, const Constraint::Int64Constraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (double *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (double *variable, const Constraint::DoubleConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::string *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::string *variable, const Constraint::StringConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bdlt::Datetime *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bdlt::Datetime *variable, const Constraint::DatetimeConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bdlt::Date *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bdlt::Date *variable, const Constraint::DateConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bdlt::Time *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bdlt::Time *variable, const Constraint::TimeConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< char > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< char > *variable, const Constraint::CharConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< int > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< int > *variable, const Constraint::IntConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bsls::Types::Int64 > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bsls::Types::Int64 > *variable, const Constraint::Int64Constraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< double > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< double > *variable, const Constraint::DoubleConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bsl::string > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bsl::string > *variable, const Constraint::StringConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bdlt::Datetime > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bdlt::Datetime > *variable, const Constraint::DatetimeConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bdlt::Date > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bdlt::Date > *variable, const Constraint::DateConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bdlt::Time > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::vector< bdlt::Time > *variable, const Constraint::TimeConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< char > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< char > *variable, const Constraint::CharConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< int > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< int > *variable, const Constraint::IntConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bsls::Types::Int64 > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bsls::Types::Int64 > *variable, const Constraint::Int64Constraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< double > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< double > *variable, const Constraint::DoubleConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bsl::string > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bsl::string > *variable, const Constraint::StringConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bdlt::Datetime > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bdlt::Datetime > *variable, const Constraint::DatetimeConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bdlt::Date > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bdlt::Date > *variable, const Constraint::DateConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bdlt::Time > *variable, bslma::Allocator *basicAllocator=0)
 TypeInfo (bsl::optional< bdlt::Time > *variable, const Constraint::TimeConstraint &constraint, bslma::Allocator *basicAllocator=0)
 TypeInfo (const TypeInfo &original, bslma::Allocator *basicAllocator=0)
 ~TypeInfo ()
TypeInfooperator= (const TypeInfo &rhs)
void resetConstraint ()
void resetLinkedVariableAndConstraint ()
void setConstraint (const Constraint::CharConstraint &constraint)
void setConstraint (const Constraint::IntConstraint &constraint)
void setConstraint (const Constraint::Int64Constraint &constraint)
void setConstraint (const Constraint::DoubleConstraint &constraint)
void setConstraint (const Constraint::StringConstraint &constraint)
void setConstraint (const Constraint::DatetimeConstraint &constraint)
void setConstraint (const Constraint::DateConstraint &constraint)
void setConstraint (const Constraint::TimeConstraint &constraint)
void setConstraint (const bsl::shared_ptr< TypeInfoConstraint > &constraint)
void setLinkedVariable (bool *variable)
void setLinkedVariable (char *variable)
void setLinkedVariable (int *variable)
void setLinkedVariable (bsls::Types::Int64 *variable)
void setLinkedVariable (double *variable)
void setLinkedVariable (bsl::string *variable)
void setLinkedVariable (bdlt::Datetime *variable)
void setLinkedVariable (bdlt::Date *variable)
void setLinkedVariable (bdlt::Time *variable)
void setLinkedVariable (bsl::vector< char > *variable)
void setLinkedVariable (bsl::vector< int > *variable)
void setLinkedVariable (bsl::vector< bsls::Types::Int64 > *variable)
void setLinkedVariable (bsl::vector< double > *variable)
void setLinkedVariable (bsl::vector< bsl::string > *variable)
void setLinkedVariable (bsl::vector< bdlt::Datetime > *variable)
void setLinkedVariable (bsl::vector< bdlt::Date > *variable)
void setLinkedVariable (bsl::vector< bdlt::Time > *variable)
void setLinkedVariable (bsl::optional< char > *variable)
void setLinkedVariable (bsl::optional< int > *variable)
void setLinkedVariable (bsl::optional< bsls::Types::Int64 > *variable)
void setLinkedVariable (bsl::optional< double > *variable)
void setLinkedVariable (bsl::optional< bsl::string > *variable)
void setLinkedVariable (bsl::optional< bdlt::Datetime > *variable)
void setLinkedVariable (bsl::optional< bdlt::Date > *variable)
void setLinkedVariable (bsl::optional< bdlt::Time > *variable)
bsl::shared_ptr
< TypeInfoConstraint > 
constraint () const
void * linkedVariable () const
bool isOptionalLinkedVariable () const
OptionType::Enum type () const
bslma::Allocatorallocator () const
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const

Detailed Description

This class is a 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).

See Component balcl_typeinfo


Constructor & Destructor Documentation

balcl::TypeInfo::TypeInfo (  ) 

Construct an object having string type for the associated option that uses the currently installed default allocator to supply memory. No variable is linked and no constraint is put on the value.

balcl::TypeInfo::TypeInfo ( bslma::Allocator basicAllocator  )  [explicit]

Construct an object having string type for the associated option, and the specified basicAllocator to supply memory. No variable is linked and no constraint is put on the value. Note that, atypically, 0 is disallowed for basicAllocator.

balcl::TypeInfo::TypeInfo ( bool *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]

Construct a flag accepting bool as the type for the associated option (i.e., for the linked variable). If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. No constraint can be put on the option.

balcl::TypeInfo::TypeInfo ( char *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( char *  variable,
const Constraint::CharConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having char type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( int *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( int *  variable,
const Constraint::IntConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having int type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsls::Types::Int64 variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsls::Types::Int64 variable,
const Constraint::Int64Constraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsls::Types::Int64 type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( double *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( double *  variable,
const Constraint::DoubleConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having double type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::string variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::string variable,
const Constraint::StringConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::string type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bdlt::Datetime variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bdlt::Datetime variable,
const Constraint::DatetimeConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bdlt::Datetime type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bdlt::Date variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bdlt::Date variable,
const Constraint::DateConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bdlt::Date type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bdlt::Time variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bdlt::Time variable,
const Constraint::TimeConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bdlt::Time type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< char > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< char > *  variable,
const Constraint::CharConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<char> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< int > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< int > *  variable,
const Constraint::IntConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<int> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< bsls::Types::Int64 > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< bsls::Types::Int64 > *  variable,
const Constraint::Int64Constraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<bsls::Types::Int64> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< double > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< double > *  variable,
const Constraint::DoubleConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<double> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< bsl::string > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< bsl::string > *  variable,
const Constraint::StringConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<bsl::string> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Datetime > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Datetime > *  variable,
const Constraint::DatetimeConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<bdlt::Datetime> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Date > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Date > *  variable,
const Constraint::DateConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<bdlt::Date> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Time > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Time > *  variable,
const Constraint::TimeConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::vector<bdlt::Time> type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< char > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< char > *  variable,
const Constraint::CharConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having char type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< int > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< int > *  variable,
const Constraint::IntConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having int type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< bsls::Types::Int64 > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< bsls::Types::Int64 > *  variable,
const Constraint::Int64Constraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsls::Types::Int64 type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< double > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< double > *  variable,
const Constraint::DoubleConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having double type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< bsl::string > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< bsl::string > *  variable,
const Constraint::StringConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bsl::string type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Datetime > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Datetime > *  variable,
const Constraint::DatetimeConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bdlt::Datetime type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Date > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Date > *  variable,
const Constraint::DateConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bdlt::Date type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Time > *  variable,
bslma::Allocator basicAllocator = 0 
) [explicit]
balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Time > *  variable,
const Constraint::TimeConstraint constraint,
bslma::Allocator basicAllocator = 0 
)

Construct an object having bdlt::Time type for the associated option. If the specified variable is not 0, then link it with the option. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Optionally specify a constraint to put on the option. If constraint is not specified, the option has no constraint.

balcl::TypeInfo::TypeInfo ( const TypeInfo original,
bslma::Allocator basicAllocator = 0 
)

Create an object having the value of the specified original object. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Note that this object shares the same constraint as the original object.

balcl::TypeInfo::~TypeInfo (  ) 

Destroy this object.


Member Function Documentation

balcl::TypeInfo::BSLMF_NESTED_TRAIT_DECLARATION ( TypeInfo  ,
bslma::UsesBslmaAllocator   
)
balcl::TypeInfo::BSLMF_NESTED_TRAIT_DECLARATION ( TypeInfo  ,
bdlb::HasPrintMethod   
)
TypeInfo& balcl::TypeInfo::operator= ( const TypeInfo rhs  ) 

Assign to this object the value of the specified rhs object and return a reference providing modifiable access to this object.

void balcl::TypeInfo::resetConstraint (  ) 

Reset this object so that it no longer has a constraint. This method has no effect if the object has no constraint. Note that neither the type attribute nor the linked variable, if any, are changed.

void balcl::TypeInfo::resetLinkedVariableAndConstraint (  ) 

Reset this object so that it has neither a linked variable nor a constraint. This method has no effect if the object has no linked variable or constraint. Note that the type attribute is not changed.

void balcl::TypeInfo::setConstraint ( const Constraint::CharConstraint constraint  ) 
void balcl::TypeInfo::setConstraint ( const Constraint::IntConstraint constraint  ) 
void balcl::TypeInfo::setConstraint ( const Constraint::Int64Constraint constraint  ) 
void balcl::TypeInfo::setConstraint ( const Constraint::DoubleConstraint constraint  ) 
void balcl::TypeInfo::setConstraint ( const Constraint::StringConstraint constraint  ) 
void balcl::TypeInfo::setConstraint ( const Constraint::DatetimeConstraint constraint  ) 
void balcl::TypeInfo::setConstraint ( const Constraint::DateConstraint constraint  ) 
void balcl::TypeInfo::setConstraint ( const Constraint::TimeConstraint constraint  ) 

Put the specified constraint on the value of the described option, replacing any constraint that had been in effect (if any). The behavior is undefined unless the described option is not a flag and the balcl::OptionValue type of the described option corresponds to the type of constraint. Note that two distinct objects that have the same constraint put on them will compare unequal unless the constraint is shared among them, which can be done by:

          aTypeInfo.setConstraint(anotherTypeInfo.constraint());
void balcl::TypeInfo::setConstraint ( const bsl::shared_ptr< TypeInfoConstraint > &  constraint  ) 

Set the constraint of the described option to the specified constraint. The behavior is undefined unless the option associated with constraint has the same type as the option associated with this object. Note that the linked variable, if any, is unchanged by this method.

void balcl::TypeInfo::setLinkedVariable ( bool *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( char *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( int *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsls::Types::Int64 variable  ) 
void balcl::TypeInfo::setLinkedVariable ( double *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::string variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bdlt::Datetime variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bdlt::Date variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bdlt::Time variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< char > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< int > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bsls::Types::Int64 > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< double > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bsl::string > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bdlt::Datetime > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bdlt::Date > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bdlt::Time > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< char > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< int > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bsls::Types::Int64 > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< double > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bsl::string > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bdlt::Datetime > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bdlt::Date > *  variable  ) 
void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bdlt::Time > *  variable  ) 

Set this object to have the type indicated by the specified variable, and reset this object so that it no longer has a constraint associated with it. If variable is not 0, then link it with the described option. If variable is of type bsl::optional<Type>, then the type of this object is set to Type.

bsl::shared_ptr<TypeInfoConstraint> balcl::TypeInfo::constraint (  )  const

Return a shared pointer to the (opaque) object storing the constraint associated with the described option. If this object has no constraint an empty shared pointer is returned. The lifetime of any shared reference to this object's constraint must not exceed that of this object's allocator.

void* balcl::TypeInfo::linkedVariable (  )  const

Return the address of the modifiable variable linked to the described option, or 0 if no variable is linked.

bool balcl::TypeInfo::isOptionalLinkedVariable (  )  const

Return true if the described option has a linked variable and that variable is a bsl::optional object, and false otherwise.

OptionType::Enum balcl::TypeInfo::type (  )  const

Return the type of the described option. Note that the option is a flag if it is of type OptionType::e_BOOL.

bslma::Allocator* balcl::TypeInfo::allocator (  )  const

Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the currently installed default allocator at construction is used.

bsl::ostream& balcl::TypeInfo::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this object. If level is negative, suppress indentation of the first line. If stream is not valid on entry, this operation has no effect. The behavior is undefined if spacesPerLevel is negative. Note that the precondition on spacesPerLevel is atypical for the print aspect; a negative spacesPerLevel typically indicates that the entire output should be formatted on one line.


The documentation for this class was generated from the following file: