BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balcl::TypeInfo Class Reference

#include <balcl_typeinfo.h>

Public Types

enum  ParseInputSource { e_COMMAND_LINE , e_ENVIRONMENT_VARIABLE }
 

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 ()
 Destroy this object.
 
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
 

Public Attributes

OptionType::Enum d_elemType
 
void * d_linkedVariable_p
 
bool d_isOptionalLinkedVariable
 
bsl::shared_ptr< TypeInfoConstraint > d_constraint_p
 
bslma::Allocatord_allocator_p
 

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 balcl_typeinfo

Member Enumeration Documentation

◆ ParseInputSource

This enumeration differentiates the source of input when parsing an option type. 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 balcl_commandline ).

Enumerator
e_COMMAND_LINE 
e_ENVIRONMENT_VARIABLE 

Constructor & Destructor Documentation

◆ TypeInfo() [1/52]

balcl::TypeInfo::TypeInfo ( )
inline

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.

◆ TypeInfo() [2/52]

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.

◆ TypeInfo() [3/52]

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.

◆ TypeInfo() [4/52]

balcl::TypeInfo::TypeInfo ( char *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [5/52]

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.

◆ TypeInfo() [6/52]

balcl::TypeInfo::TypeInfo ( int *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [7/52]

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.

◆ TypeInfo() [8/52]

balcl::TypeInfo::TypeInfo ( bsls::Types::Int64 variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [9/52]

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.

◆ TypeInfo() [10/52]

balcl::TypeInfo::TypeInfo ( double *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [11/52]

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.

◆ TypeInfo() [12/52]

balcl::TypeInfo::TypeInfo ( bsl::string variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [13/52]

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.

◆ TypeInfo() [14/52]

balcl::TypeInfo::TypeInfo ( bdlt::Datetime variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [15/52]

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.

◆ TypeInfo() [16/52]

balcl::TypeInfo::TypeInfo ( bdlt::Date variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [17/52]

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.

◆ TypeInfo() [18/52]

balcl::TypeInfo::TypeInfo ( bdlt::Time variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [19/52]

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.

◆ TypeInfo() [20/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< char > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [21/52]

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.

◆ TypeInfo() [22/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< int > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [23/52]

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.

◆ TypeInfo() [24/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< bsls::Types::Int64 > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [25/52]

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.

◆ TypeInfo() [26/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< double > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [27/52]

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.

◆ TypeInfo() [28/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< bsl::string > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [29/52]

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.

◆ TypeInfo() [30/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Datetime > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [31/52]

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.

◆ TypeInfo() [32/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Date > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [33/52]

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.

◆ TypeInfo() [34/52]

balcl::TypeInfo::TypeInfo ( bsl::vector< bdlt::Time > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [35/52]

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.

◆ TypeInfo() [36/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< char > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [37/52]

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.

◆ TypeInfo() [38/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< int > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [39/52]

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.

◆ TypeInfo() [40/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< bsls::Types::Int64 > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [41/52]

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.

◆ TypeInfo() [42/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< double > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [43/52]

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.

◆ TypeInfo() [44/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< bsl::string > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [45/52]

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.

◆ TypeInfo() [46/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Datetime > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [47/52]

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.

◆ TypeInfo() [48/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Date > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [49/52]

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.

◆ TypeInfo() [50/52]

balcl::TypeInfo::TypeInfo ( bsl::optional< bdlt::Time > *  variable,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TypeInfo() [51/52]

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.

◆ TypeInfo() [52/52]

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.

◆ ~TypeInfo()

balcl::TypeInfo::~TypeInfo ( )

Member Function Documentation

◆ allocator()

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.

◆ BSLMF_NESTED_TRAIT_DECLARATION() [1/2]

balcl::TypeInfo::BSLMF_NESTED_TRAIT_DECLARATION ( TypeInfo  ,
bdlb::HasPrintMethod   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION() [2/2]

balcl::TypeInfo::BSLMF_NESTED_TRAIT_DECLARATION ( TypeInfo  ,
bslma::UsesBslmaAllocator   
)

◆ constraint()

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.

◆ isOptionalLinkedVariable()

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.

◆ linkedVariable()

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

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

◆ operator=()

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.

◆ print()

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.

◆ resetConstraint()

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.

◆ resetLinkedVariableAndConstraint()

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.

◆ setConstraint() [1/9]

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.

◆ setConstraint() [2/9]

void balcl::TypeInfo::setConstraint ( const Constraint::CharConstraint constraint)

◆ setConstraint() [3/9]

void balcl::TypeInfo::setConstraint ( const Constraint::DateConstraint constraint)

◆ setConstraint() [4/9]

void balcl::TypeInfo::setConstraint ( const Constraint::DatetimeConstraint constraint)

◆ setConstraint() [5/9]

void balcl::TypeInfo::setConstraint ( const Constraint::DoubleConstraint constraint)

◆ setConstraint() [6/9]

void balcl::TypeInfo::setConstraint ( const Constraint::Int64Constraint constraint)

◆ setConstraint() [7/9]

void balcl::TypeInfo::setConstraint ( const Constraint::IntConstraint constraint)

◆ setConstraint() [8/9]

void balcl::TypeInfo::setConstraint ( const Constraint::StringConstraint constraint)

◆ setConstraint() [9/9]

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());

◆ setLinkedVariable() [1/25]

void balcl::TypeInfo::setLinkedVariable ( bdlt::Date variable)

◆ setLinkedVariable() [2/25]

void balcl::TypeInfo::setLinkedVariable ( bdlt::Datetime variable)

◆ setLinkedVariable() [3/25]

void balcl::TypeInfo::setLinkedVariable ( bdlt::Time variable)

◆ setLinkedVariable() [4/25]

void balcl::TypeInfo::setLinkedVariable ( bool *  variable)

◆ setLinkedVariable() [5/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bdlt::Date > *  variable)

◆ setLinkedVariable() [6/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bdlt::Datetime > *  variable)

◆ setLinkedVariable() [7/25]

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.

◆ setLinkedVariable() [8/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bsl::string > *  variable)

◆ setLinkedVariable() [9/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::optional< bsls::Types::Int64 > *  variable)

◆ setLinkedVariable() [10/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::optional< char > *  variable)

◆ setLinkedVariable() [11/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::optional< double > *  variable)

◆ setLinkedVariable() [12/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::optional< int > *  variable)

◆ setLinkedVariable() [13/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::string variable)

◆ setLinkedVariable() [14/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bdlt::Date > *  variable)

◆ setLinkedVariable() [15/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bdlt::Datetime > *  variable)

◆ setLinkedVariable() [16/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bdlt::Time > *  variable)

◆ setLinkedVariable() [17/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bsl::string > *  variable)

◆ setLinkedVariable() [18/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< bsls::Types::Int64 > *  variable)

◆ setLinkedVariable() [19/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< char > *  variable)

◆ setLinkedVariable() [20/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< double > *  variable)

◆ setLinkedVariable() [21/25]

void balcl::TypeInfo::setLinkedVariable ( bsl::vector< int > *  variable)

◆ setLinkedVariable() [22/25]

void balcl::TypeInfo::setLinkedVariable ( bsls::Types::Int64 variable)

◆ setLinkedVariable() [23/25]

void balcl::TypeInfo::setLinkedVariable ( char *  variable)

◆ setLinkedVariable() [24/25]

void balcl::TypeInfo::setLinkedVariable ( double *  variable)

◆ setLinkedVariable() [25/25]

void balcl::TypeInfo::setLinkedVariable ( int *  variable)

◆ type()

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.

Member Data Documentation

◆ d_allocator_p

bslma::Allocator* balcl::TypeInfo::d_allocator_p

◆ d_constraint_p

bsl::shared_ptr<TypeInfoConstraint> balcl::TypeInfo::d_constraint_p

◆ d_elemType

OptionType::Enum balcl::TypeInfo::d_elemType

◆ d_isOptionalLinkedVariable

bool balcl::TypeInfo::d_isOptionalLinkedVariable

◆ d_linkedVariable_p

void* balcl::TypeInfo::d_linkedVariable_p

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