STE-Industries: utilities testing
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE > Class Template Reference

#include "EnumeratedParameterDescriptor.h"

Inheritance diagram for GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >:
Inheritance graph
Collaboration diagram for GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >:
Collaboration graph

Public Member Functions

 EnumeratedParameterDescriptor (const char *thisName, ENUMERATED_TYPE Bitmap::CorrectionParameters::*thisParameterPointer, EnumeratedExceptionType thisException) noexcept
 
virtual ~EnumeratedParameterDescriptor (void) noexcept=default
 
void Assign (const char *String, Bitmap::CorrectionParameters &Parameters) const noexcept(false) override
 
void PrintUsage (const Bitmap::CorrectionParameters &DefaultParameters) const noexcept(false) override
 
- Public Member Functions inherited from GraphicSpace::ParameterDescriptor
const char * GetName (void) const noexcept
 

Private Member Functions

 EnumeratedParameterDescriptor (const EnumeratedParameterDescriptor &Descriptor) noexcept=delete
 
 EnumeratedParameterDescriptor (EnumeratedParameterDescriptor &&Descriptor) noexcept=delete
 
unsigned int GetNumberOfValues (void) const noexcept
 
unsigned int GetNumberOfValues (void) const noexcept
 
unsigned int GetNumberOfValues (void) const noexcept
 
void operator= (const EnumeratedParameterDescriptor &Descriptor) noexcept=delete
 
void operator= (EnumeratedParameterDescriptor &&Descriptor) noexcept=delete
 
const char *const ValueString []
 Template specialization valid when ENUMERATED_TYPE is ChoiceType. More...
 
const char *const ValueString []
 Template specialization valid when ENUMERATED_TYPE is bool. More...
 

Private Attributes

EnumeratedExceptionType ExceptionKind
 
ENUMERATED_TYPE Bitmap::CorrectionParameters::* ParameterPointer
 

Static Private Attributes

static constexpr char SEPARATOR_CHARACTER
 
static constexpr const char * UsageFormatHead
 
static constexpr const char * UsageFormatString
 
static constexpr const char * UsageFormatTail
 
static const char *const ValueString []
 

Additional Inherited Members

- Static Public Attributes inherited from GraphicSpace::ParameterDescriptor
static constexpr char EQUAL_CHARACTER = '='
 
- Protected Member Functions inherited from GraphicSpace::ParameterDescriptor
 ParameterDescriptor (const char *thisName) noexcept
 
virtual ~ParameterDescriptor (void) noexcept
 

Detailed Description

template<typename ENUMERATED_TYPE>
class GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >

The EnumeratedParameterDescriptor class template represents the descriptor of a command line parameter with enumerated value.

Template Parameters
ENUMERATED_TYPEThe type of the parameter; it must be an enumerated type.

Definition at line 37 of file EnumeratedParameterDescriptor.h.

Constructor & Destructor Documentation

◆ EnumeratedParameterDescriptor() [1/3]

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::EnumeratedParameterDescriptor ( const EnumeratedParameterDescriptor< ENUMERATED_TYPE > &  Descriptor)
privatedeletenoexcept

◆ EnumeratedParameterDescriptor() [2/3]

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::EnumeratedParameterDescriptor ( EnumeratedParameterDescriptor< ENUMERATED_TYPE > &&  Descriptor)
privatedeletenoexcept

◆ EnumeratedParameterDescriptor() [3/3]

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::EnumeratedParameterDescriptor ( const char *  thisName,
ENUMERATED_TYPE Bitmap::CorrectionParameters::*  thisParameterPointer,
EnumeratedExceptionType  thisException 
)
inlinenoexcept
Description:
Constructor.
Parameters
thisNamePointer to the string containing the name of the parameter.
thisParameterPointerMember pointer to the parameter within the CorrectionParameter struct.
thisExceptionThe kind of exception that is generated if an enumerated command line parameter is not correct.
Exceptions
None.
Returns
Not applicable.
Note
if thisName is not a valid pointer to a properly terminated string, the behavior is undefined.

Definition at line 41 of file EnumeratedParameterDescriptor.tpl.

◆ ~EnumeratedParameterDescriptor()

template<typename ENUMERATED_TYPE >
virtual GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::~EnumeratedParameterDescriptor ( void  )
virtualdefaultnoexcept

Member Function Documentation

◆ Assign()

template<typename ENUMERATED_TYPE >
void GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::Assign ( const char *  String,
Bitmap::CorrectionParameters Parameters 
) const
overridevirtualnoexcept
Description:
Assign an enumerated value to a parameter.
Parameters
StringPointer to the string containing the value of the parameter.
ParametersReference to the CorrectionParameter struct to modify with the new value.
Exceptions
ExceptionKindIf String does not begin with an equal sign or String does not correspond to a enumerated value.
Returns
None.
Note
if String is not a valid pointer to a properly terminated string, the behavior is undefined.
See also
EQUAL_CHARACTER
END_STRING

Reimplemented from GraphicSpace::ParameterDescriptor.

Definition at line 75 of file EnumeratedParameterDescriptor.tpl.

References END_STRING.

◆ GetNumberOfValues() [1/3]

unsigned int GraphicSpace::EnumeratedParameterDescriptor< Bitmap::ChoiceType >::GetNumberOfValues ( void  ) const
privatenoexcept
Description:
Return the number of strings describing the enumerated parameter.
Template specialization valid when ENUMERATED_TYPE is ChoiceType.
Exceptions
None.
Returns
unsigned int The number of strings describing the enumerated parameter.

Definition at line 41 of file ChoiceParameterDescriptor.cpp.

References NumberOfElements.

◆ GetNumberOfValues() [2/3]

unsigned int GraphicSpace::EnumeratedParameterDescriptor< bool >::GetNumberOfValues ( void  ) const
privatenoexcept
Description:
Return the number of strings describing the enumerated parameter.
Template specialization valid when ENUMERATED_TYPE is bool.
Exceptions
None.
Returns
unsigned int The number of strings describing the enumerated parameter.

Definition at line 40 of file BooleanParameterDescriptor.cpp.

References NumberOfElements.

◆ GetNumberOfValues() [3/3]

template<typename ENUMERATED_TYPE >
unsigned int GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::GetNumberOfValues ( void  ) const
privatenoexcept

◆ operator=() [1/2]

template<typename ENUMERATED_TYPE >
void GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::operator= ( const EnumeratedParameterDescriptor< ENUMERATED_TYPE > &  Descriptor)
privatedeletenoexcept

◆ operator=() [2/2]

template<typename ENUMERATED_TYPE >
void GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::operator= ( EnumeratedParameterDescriptor< ENUMERATED_TYPE > &&  Descriptor)
privatedeletenoexcept

◆ PrintUsage()

template<typename ENUMERATED_TYPE >
void GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::PrintUsage ( const Bitmap::CorrectionParameters DefaultParameters) const
overridevirtualnoexcept
Description:
Write on standard output a string describing a command line parameter of an enumerated type.
Parameters
DefaultParametersReference to the CorrectionParameter struct which contains the default parameters.
Exceptions
FileExceptionType::FILE_WRITE_ERRORIf an error occurs while writing the string.
Returns
None.
See also
STANDARD_OUTPUT
EQUAL_CHARACTER
SEPARATOR_CHARACTER

Reimplemented from GraphicSpace::ParameterDescriptor.

Definition at line 117 of file EnumeratedParameterDescriptor.tpl.

References DefaultParameters, GraphicSpace::FILE_WRITE_ERROR, and STANDARD_OUTPUT.

◆ ValueString() [1/2]

const char *const GraphicSpace::EnumeratedParameterDescriptor< bool >::ValueString
private

Template specialization valid when ENUMERATED_TYPE is bool.

Definition at line 24 of file BooleanParameterDescriptor.cpp.

◆ ValueString() [2/2]

const char *const GraphicSpace::EnumeratedParameterDescriptor< Bitmap::ChoiceType >::ValueString
private

Template specialization valid when ENUMERATED_TYPE is ChoiceType.

Definition at line 24 of file ChoiceParameterDescriptor.cpp.

Member Data Documentation

◆ ExceptionKind

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::ExceptionKind
private

The kind of exception that is generated if an enumerated command line parameter is not correct.

Definition at line 50 of file EnumeratedParameterDescriptor.h.

◆ ParameterPointer

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::ParameterPointer
private

Member pointer to the parameter within the CorrectionParameter struct.

Definition at line 45 of file EnumeratedParameterDescriptor.h.

◆ SEPARATOR_CHARACTER

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::SEPARATOR_CHARACTER
staticconstexprprivate
Initial value:
=
'|'

Character used to separate the possible values of an enumerated parameter.

Definition at line 76 of file EnumeratedParameterDescriptor.h.

◆ UsageFormatHead

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::UsageFormatHead
staticconstexprprivate
Initial value:
=
"\t%s%c<"

Format used to write the first part of the usage message related to an enumerated parameter.

Definition at line 60 of file EnumeratedParameterDescriptor.h.

◆ UsageFormatString

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::UsageFormatString
staticconstexprprivate
Initial value:
=
"%s"

Format used to write a value of an enumerated parameter.

Definition at line 64 of file EnumeratedParameterDescriptor.h.

◆ UsageFormatTail

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::UsageFormatTail
staticconstexprprivate
Initial value:
=
"> (default %s)\n"

Format used to write the first part of the usage message related to an enumerated parameter.

Definition at line 70 of file EnumeratedParameterDescriptor.h.

◆ ValueString

template<typename ENUMERATED_TYPE >
GraphicSpace::EnumeratedParameterDescriptor< ENUMERATED_TYPE >::ValueString
staticprivate

Array of strings used to specify the possible values of an enumerated parameter.

Definition at line 55 of file EnumeratedParameterDescriptor.h.


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