C12Adapter Opensource C++ Interface
MENumberOutOfRange Class Reference

Exception, number is out of range. More...

Inheritance diagram for MENumberOutOfRange:

Public Member Functions

 MENumberOutOfRange (double lo, double hi, double val, MConstChars itemName=NULL)
 Constructor that takes all properties as parameters. More...
 
 MENumberOutOfRange (const MENumberOutOfRange &ex)
 Copy constructor. More...
 
virtual ~MENumberOutOfRange ()
 Destructor.
 
MENumberOutOfRangeoperator= (const MENumberOutOfRange &ex)
 Assignment operator. More...
 
virtual MExceptionNewClone () const
 Clone the exception, so the new exception has the same final type. More...
 
virtual M_NORETURN_FUNC void Rethrow ()
 Rethrows this exception. More...
 
double GetRangeMax () const
 
void SetRangeMax (double hi)
 
double GetRangeMin () const
 
void SetRangeMin (double lo)
 
double GetValue () const
 
void SetValue (double value)
 
const MStdStringGetName () const
 
void SetName (const MStdString &name)
 
- Public Member Functions inherited from MException
 MException ()
 Object constructor. More...
 
 MException (const MStdString &message, MErrorEnum::Type code=MErrorEnum::ClientApplicationError, KindType kind=MException::ErrorUser)
 Object constructor with code, kind and variable number of parameters. More...
 
 MException (const MException &ex)
 Object copy constructor. More...
 
virtual ~MException ()
 Object destructor.
 
void InitAll (MException::KindType kind, MErrorEnum::Type code, const MStdString &message)
 Initialize all exception fields with the exact given data.
 
MExceptionoperator= (const MException &ex)
 Assignment operator. More...
 
virtual MStdString AsSimplifiedString () const
 Return a possibly simplified string that specifies information about exception. More...
 
virtual MStdString AsString () const
 Return the string that specifies extended information about exception. More...
 
MStdString GetMessageString () const
 Returns the message that is stored in this exception object. More...
 
void SetMessageString (const MStdString &msg)
 Sets the new message to exception. More...
 
MStdString GetKindAsString () const
 Return a string that represents the exception error kind. More...
 
MStdString GetFileName () const
 Get the file name where the error took place, if this information is available.
 
unsigned GetFileLineNumber () const
 Get the line number within file where the error took place.
 
void UpdateFileNameAndLineNumber (MFileNameAndLineNumber fl)
 Set file name and line number where the compile error took place, if the exception does not have this information already.
 
void UpdateFileAndLine (const MStdString &file, unsigned line)
 If not set already, set file name and line number associated with this exception. More...
 
void AddFileAndLineToStack (const MStdString &file, unsigned line)
 Add file name and line number context associated with this exception into stack. More...
 
void AddFileNameAndLineNumberToStack (MFileNameAndLineNumber fl)
 Add file name and line number context associated with this exception into stack. More...
 
const MFileNameAndLineNumber::VectorTypeGetStack () const
 Get the stack of file names and line numbers.
 
MStdStringVector GetCallStack () const
 Get the stack of file names and line numbers as collection of strings.
 
void Append (const MStdString &)
 Append the specified string to the end of the exception string. More...
 
void Prepend (const MStdString &)
 Prepend the specified string before the beginning of the exception string. More...
 
MErrorEnum::Type GetCode () const
 
void SetCode (MErrorEnum::Type code)
 
KindType GetKind () const
 
void SetKind (KindType kind)
 
void Init (KindType kind, MErrorEnum::Type code, MConstLocalChars str,...)
 Initialize the exception with the given message code and kind from which the message string is fetched from the resource. More...
 
void Init (KindType kind, MErrorEnum::Type code, const char *str,...)
 Initialize the exception with the given message code and kind from which the message string is fetched from the resource. More...
 
void Init (MErrorEnum::Type code, MConstLocalChars str,...)
 Initialize the exception with the given message code and kind from which the message string is fetched from the resource. More...
 
void Init (MErrorEnum::Type code, const char *str,...)
 Initialize the exception with the given message code and kind from which the message string is fetched from the resource. More...
 
void InitVA (KindType kind, MErrorEnum::Type code, MConstLocalChars str, va_list va)
 Initialize the exception with the given message code from the VA list argument. More...
 
void InitVA (KindType kind, MErrorEnum::Type code, const char *str, va_list va)
 Initialize the exception with the given message code from the VA list argument. More...
 
void InitVA (MErrorEnum::Type code, MConstLocalChars str, va_list va)
 Initialize the exception with the given message code from the VA list argument. More...
 
void InitVA (MErrorEnum::Type code, const char *str, va_list va)
 Initialize the exception with the given message code from the VA list argument. More...
 
MFileNameAndLineNumber GetFileNameAndLineNumber () const
 
void SetFileNameAndLineNumber (MFileNameAndLineNumber fl)
 
void AppendToString (MConstLocalChars str,...)
 
void AppendToString (const char *str,...)
 
void PrependBeforeString (MConstLocalChars str,...)
 
void PrependBeforeString (const char *str,...)
 
- Public Member Functions inherited from MObject
virtual ~MObject ()
 Object destructor.
 
virtual const MClassGetClass () const =0
 Get the final class of the object. More...
 
virtual unsigned GetEmbeddedSizeof () const
 For embedded object types, return the size of the class. More...
 
bool IsEmbeddedObject () const
 Tell if the object is of embedded kind. More...
 
SHOW_INTERNAL MVariant Call (const MStdString &name, const MVariant &params)
 Call the object service with parameters, given as variant. More...
 
MVariant Call0 (const MStdString &name)
 Call the object service with no parameters. More...
 
MVariant Call1 (const MStdString &name, const MVariant &p1)
 Call the object service with one parameter. More...
 
MVariant Call2 (const MStdString &name, const MVariant &p1, const MVariant &p2)
 Call the object service with two parameter. More...
 
MVariant Call3 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3)
 Call the object service with three parameter. More...
 
MVariant Call4 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4)
 Call the object service with four parameter. More...
 
MVariant Call5 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5)
 Call the object service with five parameter. More...
 
MVariant Call6 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5, const MVariant &p6)
 Call the object service with six parameter. More...
 
virtual MVariant CallV (const MStdString &name, const MVariant::VariantVector &params)
 Call the object service with parameters, given as variant vector. More...
 
virtual bool IsPropertyPresent (const MStdString &name) const
 Tell if the property with the given name exists.
 
virtual bool IsServicePresent (const MStdString &name) const
 Tell if the service with the given name exists.
 
virtual MVariant GetProperty (const MStdString &name) const
 Get the property value using name of the property. More...
 
virtual void SetProperty (const MStdString &name, const MVariant &value)
 Set the property using name of the property, and value. More...
 
virtual MStdStringVector GetAllPropertyNames () const
 Return the list of publicly available properties, persistent or not. More...
 
virtual MStdStringVector GetAllPersistentPropertyNames () const
 Return the list of persistent properties. More...
 
virtual void SetPersistentPropertiesToDefault ()
 Set the persistent properties of the object to their default values. More...
 
virtual MVariant GetPersistentPropertyDefaultValue (const MStdString &name) const
 Get the default value of persistent property with the name given. More...
 
virtual void SetPersistentPropertyToDefault (const MStdString &name)
 Set the persistent property with the name given to default value. More...
 
virtual const char * GetType () const
 Get the name of the type for the object (could be the same as class name).
 
virtual void SetType (const MStdString &)
 Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name. More...
 
virtual void Validate ()
 Validate internal structures of the object. More...
 

Static Public Member Functions

static void CheckUnsignedRange (unsigned lo, unsigned hi, unsigned val)
 Checks whether the unsigned integer value is in the given range, and throws an error if it is not. More...
 
static void CheckNamedUnsignedRange (unsigned lo, unsigned hi, unsigned val, MConstChars itemName)
 Checks whether the named unsigned integer value is in the given range, and throws an error if it is not. More...
 
static void CheckNamedUInt64Range (Muint64 lo, Muint64 hi, Muint64 val, MConstChars itemName=NULL)
 Checks whether the named unsigned 64-bit integer value is in the given range, and throws an error if it is not. More...
 
static void CheckNamedUnsignedLongRange (unsigned long lo, unsigned long hi, unsigned long val, MConstChars itemName=NULL)
 Checks whether the named unsigned long integer value is in the given range, and throws an error if it is not. More...
 
static MENumberOutOfRangeNew ()
 Create a new exception of this type, all parameters are clear.
 
static M_NORETURN_FUNC void ThrowValue (double val)
 
static M_NORETURN_FUNC void Throw (double val)
 
static M_NORETURN_FUNC void ThrowNamedValue (double val, MConstChars itemName)
 
static M_NORETURN_FUNC void Throw (double val, MConstChars itemName)
 
static M_NORETURN_FUNC void ThrowRange (double lo, double hi, double val)
 
static M_NORETURN_FUNC void Throw (double lo, double hi, double val)
 
static M_NORETURN_FUNC void ThrowNamedRange (double lo, double hi, double val, MConstChars itemName)
 
static M_NORETURN_FUNC void Throw (double lo, double hi, double val, MConstChars itemName)
 
static void CheckRange (double lo, double hi, double val)
 
static void Check (double lo, double hi, double val)
 
static void CheckNamedRange (double lo, double hi, double val, MConstChars itemName)
 
static void Check (double lo, double hi, double val, MConstChars itemName)
 
static void CheckIntegerRange (int lo, int hi, int val)
 
static void CheckInteger (int lo, int hi, int val)
 
static void CheckNamedIntegerRange (int lo, int hi, int val, MConstChars itemName)
 
static void CheckInteger (int lo, int hi, int val, MConstChars itemName)
 
- Static Public Member Functions inherited from MException
static MExceptionNew ()
 Create a new exception of this type, all parameters are clear.
 
static M_NORETURN_FUNC void ThrowUnknownError ()
 Throws this exception as unknown error. More...
 
static M_NORETURN_FUNC void ThrowCannotIndexItem (MConstChars itemName=NULL)
 Throws this exception as error that signifies the item cannot be indexed.
 
static M_NORETURN_FUNC void ThrowNotSupportedForThisType ()
 Throws this exception as error that signifies the operation is not supported for such type.
 
static M_NORETURN_FUNC void ThrowNoValue ()
 Throws this exception as error that signifies the value is absent.
 
static M_NORETURN_FUNC void ThrowNoValue (MFileNameAndLineNumber fl)
 Throws this exception as error that signifies the value given in file and line is absent.
 
static M_NORETURN_FUNC void ThrowBadTimeValue (MConstChars str=NULL)
 Throws this exception as error that signifies the time value is bad.
 
static M_NORETURN_FUNC void ThrowDivisionByZero ()
 Throws this exception as division by zero.
 
static M_NORETURN_FUNC void ThrowCallOutOfSequence ()
 Throws an error that the call is made out of sequence.
 
static M_NORETURN_FUNC void ThrowBadFileFormat (const MStdString &fileName)
 Throws file has bad format.
 
static M_NORETURN_FUNC void ThrowUnexpectedChar (int ch)
 Throws an exception that complains about an unexpected character. More...
 
static M_NORETURN_FUNC void ThrowStringTooLong (int stringLength, int maximumPossibleLength)
 Throws an exception that tells that the string is bigger than the maximum length. More...
 
static M_NORETURN_FUNC void ThrowUnsupportedType (int typetag)
 Throws an error that the given variant type is not supported.
 
static M_NORETURN_FUNC void Throw (const MStdString &message, MErrorEnum::Type code=MErrorEnum::ClientApplicationError)
 Throw this exception with the user message given as parameter. More...
 
static MStdString SimplifyMessageString (const MStdString &message)
 Attempt to simplify the error message string given. More...
 
static MStdString GetKindAsStringStatic (KindType kind)
 Return a string that represents the exception error kind using kind as parameter. More...
 
static MStdString VisualizeParameter (const MVariant &v)
 Make the given variant suitable for showing in error message. More...
 
static char * VisualizeVariantParameter (char *buff, const MVariant &v)
 Make the given variant parameter suitable for showing in error message. More...
 
static char * VisualizeStringParameter (char *buff, const MStdString &v)
 Make the given string parameter suitable for showing in error message. More...
 
static char * VisualizeCharsParameter (char *buff, const char *v)
 Make the given zero terminated string parameter suitable for showing in error message. More...
 
static char * VisualizeCharsParameter (char *buff, const char *v, unsigned len)
 Make the given not zero terminated character parameter suitable for showing in error message. More...
 
static M_NORETURN_FUNC void ThrowSyntaxError (MConstChars offendingString)
 
static M_NORETURN_FUNC void ThrowSyntaxError (MConstChars offendingString, size_t offendingStringLength)
 
static M_NORETURN_FUNC void ThrowUnknownItem (MException::KindType kind, MConstChars name)
 
static M_NORETURN_FUNC void ThrowUnknownItem (MConstChars name)
 
static M_NORETURN_FUNC void ThrowUnknownItem (MException::KindType kind, const MStdString &name)
 
static M_NORETURN_FUNC void ThrowUnknownItem (const MStdString &name)
 
static M_NORETURN_FUNC void Throw (MErrorEnum::Type code, MConstLocalChars str,...)
 
static M_NORETURN_FUNC void Throw (MErrorEnum::Type code, const char *str,...)
 
static M_NORETURN_FUNC void Throw (KindType kind, MErrorEnum::Type code, MConstLocalChars str,...)
 
static M_NORETURN_FUNC void Throw (KindType kind, MErrorEnum::Type code, const char *str,...)
 
- Static Public Member Functions inherited from MObject
static const MClassGetStaticClass ()
 Get the declared class of this particular object. More...
 
static bool IsClassPresent (const MStdString &name)
 Tells if the given class name is available. More...
 

Additional Inherited Members

- Public Types inherited from MException
enum  KindType {
  ErrorNone = 0,
  ErrorInformation = 1,
  ErrorWarning = 2,
  Error = 3,
  ErrorFatal = 4,
  ErrorCommunication = 5,
  ErrorSystem = 6,
  ErrorSocket = 7,
  ErrorConfiguration = 8,
  ErrorSecurity = 9,
  ErrorMeter = 10,
  ErrorSoftware = 15,
  ErrorUser = 20
}
 Enumeration that stands for the kind of the exception. More...
 
enum  { MaximumVisibleParameterLength = 64 }
 
- Static Public Attributes inherited from MException
static const char s_itemIsUnknownErrorString []
 Constant string "Item '%s' is unknown", shared through many libraries.
 
- Static Public Attributes inherited from MObject
static const MClass s_class
 Class of MObject.
 
- Protected Member Functions inherited from MObject
 MObject ()
 Object constructor, protected as the class is abstract.
 
void DoSetPersistentPropertiesToDefault (const MClass *staticClass)
 Set the persistent properties to their default values for one object provided the class for that object. More...
 
- Protected Attributes inherited from MException
MErrorEnum::Type m_code
 Message code for this exception.
 
KindType m_kind
 The kind type for this exception.
 
MStdString m_message
 Message string that represents this exception.
 
MFileNameAndLineNumber m_fileNameAndLineNumber
 File name and line number where the compile error took place. More...
 
MFileNameAndLineNumber::VectorType m_stack
 Stack of file names and line numbers.
 

Detailed Description

Exception, number is out of range.

The text of the message of the exception depends on the exception parameters/properties. English texts for parameters 'val', 'name', 'lo' and 'hi' are:

  • "Value 'val' is out of range" - when the range is invalid (high bound is lower than low) and the item name is not given.
  • "Value 'val' for 'name' is out of range" - when the range is invalid (high bound is lower than low) and there is an item name.
  • "Value 'val' is out of range 'lo' .. 'hi'" - range is valid, no item name.
  • "Value 'val' for 'name' is out of range 'lo' .. 'hi'" - range is valid and item name is given.

Constructor & Destructor Documentation

MENumberOutOfRange::MENumberOutOfRange ( double  lo,
double  hi,
double  val,
MConstChars  itemName = NULL 
)

Constructor that takes all properties as parameters.

The text thrown by this exception depends on the parameters given, as described here.

Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message.
valOffending out of range value. There is a debug time assert that checks if the given value is indeed out of range determined by inclusive range lo .. hi.
itemNameOptional name of the item, typically the array name. If absent, the name will not be reported.
MENumberOutOfRange::MENumberOutOfRange ( const MENumberOutOfRange ex)

Copy constructor.

Parameters
exException from which to create this object.

Member Function Documentation

static void MENumberOutOfRange::Check ( double  lo,
double  hi,
double  val 
)
inlinestatic

Checks whether the double precision value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
static void MENumberOutOfRange::Check ( double  lo,
double  hi,
double  val,
MConstChars  itemName 
)
inlinestatic

Checks whether the named double precision value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
itemNameName of the item, typically the array name. If absent, the name will not be reported.
static void MENumberOutOfRange::CheckInteger ( int  lo,
int  hi,
int  val 
)
inlinestatic

Checks whether the integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
static void MENumberOutOfRange::CheckInteger ( int  lo,
int  hi,
int  val,
MConstChars  itemName 
)
inlinestatic

Checks whether the named integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
itemNameName of the item, typically the array name. If absent, the name will not be reported.
static void MENumberOutOfRange::CheckIntegerRange ( int  lo,
int  hi,
int  val 
)
static

Checks whether the integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
static void MENumberOutOfRange::CheckNamedIntegerRange ( int  lo,
int  hi,
int  val,
MConstChars  itemName 
)
static

Checks whether the named integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
itemNameName of the item, typically the array name. If absent, the name will not be reported.
static void MENumberOutOfRange::CheckNamedRange ( double  lo,
double  hi,
double  val,
MConstChars  itemName 
)
static

Checks whether the named double precision value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
itemNameName of the item, typically the array name. If absent, the name will not be reported.
static void MENumberOutOfRange::CheckNamedUInt64Range ( Muint64  lo,
Muint64  hi,
Muint64  val,
MConstChars  itemName = NULL 
)
static

Checks whether the named unsigned 64-bit integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
itemNameName of the item, typically the array name. If absent, the name will not be reported.
static void MENumberOutOfRange::CheckNamedUnsignedLongRange ( unsigned long  lo,
unsigned long  hi,
unsigned long  val,
MConstChars  itemName = NULL 
)
inlinestatic

Checks whether the named unsigned long integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
itemNameName of the item, typically the array name. If absent, the name will not be reported.
static void MENumberOutOfRange::CheckNamedUnsignedRange ( unsigned  lo,
unsigned  hi,
unsigned  val,
MConstChars  itemName 
)
static

Checks whether the named unsigned integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
itemNameName of the item, typically the array name. If absent, the name will not be reported.
static void MENumberOutOfRange::CheckRange ( double  lo,
double  hi,
double  val 
)
static

Checks whether the double precision value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
static void MENumberOutOfRange::CheckUnsignedRange ( unsigned  lo,
unsigned  hi,
unsigned  val 
)
static

Checks whether the unsigned integer value is in the given range, and throws an error if it is not.

Precondition
The value shall be in the given range, or an exception is thrown.
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message. Obviously, in this case the check will always fail and an exception will always be thrown.
valThe value to test.
const MStdString& MENumberOutOfRange::GetName ( ) const
inline

Name of the item that exceeds exception-guided range.

double MENumberOutOfRange::GetRangeMax ( ) const
inline

Maximum value of exception-guided range.

When this value is lower than the minimum range value the range is not included into the error message.

double MENumberOutOfRange::GetRangeMin ( ) const
inline

Minimum value of exception-guided range.

When this value is bigger than the maximum range value the range is not included into the error message.

double MENumberOutOfRange::GetValue ( ) const
inline

Value that is outside of the exception-guided range.

virtual MException* MENumberOutOfRange::NewClone ( ) const
virtual

Clone the exception, so the new exception has the same final type.

Returns
New exception, which is the same as this.
See also
Rethrow() Rethrows the cloned exception with respect to the final exception type.

Reimplemented from MException.

MENumberOutOfRange& MENumberOutOfRange::operator= ( const MENumberOutOfRange ex)
inline

Assignment operator.

Be careful while using the assignment operator when dealing with children of this class, as the properties of a child might not be copied correctly.

Parameters
exException from which to copy this exception.
Returns
Reference to this object.
virtual M_NORETURN_FUNC void MENumberOutOfRange::Rethrow ( )
virtual

Rethrows this exception.

This polymorphic call is necessary if a generic exception is caught by its base, and had to be saved for future throwing. Simple "throw *ex" will not work in this case, as it will call the copy constructor of the declared exception, not the final class copy constructor.

See also
NewClone() Clones the exception so the new exception has the same final type.

Reimplemented from MException.

void MENumberOutOfRange::SetName ( const MStdString name)
inline

Name of the item that exceeds exception-guided range.

void MENumberOutOfRange::SetRangeMax ( double  hi)
inline

Maximum value of exception-guided range.

When this value is lower than the minimum range value the range is not included into the error message.

void MENumberOutOfRange::SetRangeMin ( double  lo)
inline

Minimum value of exception-guided range.

When this value is bigger than the maximum range value the range is not included into the error message.

void MENumberOutOfRange::SetValue ( double  value)
inline

Value that is outside of the exception-guided range.

static M_NORETURN_FUNC void MENumberOutOfRange::Throw ( double  val)
inlinestatic

Throw an out of range exception with a single value.

The English text of the exception message will be: "Value 'val' is out of range".

Parameters
valOffending out of range value.
static M_NORETURN_FUNC void MENumberOutOfRange::Throw ( double  val,
MConstChars  itemName 
)
inlinestatic

Throw an out of range exception with a single value and name.

The English text of the exception message will be: "Value 'val' for 'itemName' is out of range".

Parameters
valOffending out of range value.
itemNameOptional name of the item, typically the array name. If absent, the name will not be reported.
static M_NORETURN_FUNC void MENumberOutOfRange::Throw ( double  lo,
double  hi,
double  val 
)
inlinestatic

Throw an out of range exception with the value and range.

The English version of the text thrown by this method is

  • "Value 'val' is out of range 'lo' .. 'hi'".
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message.
valOffending out of range value. There is a debug time assert that checks if the given value is indeed out of range determined by inclusive range lo .. hi.
static M_NORETURN_FUNC void MENumberOutOfRange::Throw ( double  lo,
double  hi,
double  val,
MConstChars  itemName 
)
inlinestatic

Throw an out of range exception with the value, range, and name.

The English version of the text thrown by this method is

  • "Value 'val' for 'itemName' is out of range 'lo' .. 'hi'".
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message.
valOffending out of range value. There is a debug time assert that checks if the given value is indeed out of range determined by inclusive range lo .. hi.
itemNameOptional name of the item, typically the array name. If absent, the name will not be reported.
static M_NORETURN_FUNC void MENumberOutOfRange::ThrowNamedRange ( double  lo,
double  hi,
double  val,
MConstChars  itemName 
)
static

Throw an out of range exception with the value, range, and name.

The English version of the text thrown by this method is

  • "Value 'val' for 'itemName' is out of range 'lo' .. 'hi'".
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message.
valOffending out of range value. There is a debug time assert that checks if the given value is indeed out of range determined by inclusive range lo .. hi.
itemNameOptional name of the item, typically the array name. If absent, the name will not be reported.
static M_NORETURN_FUNC void MENumberOutOfRange::ThrowNamedValue ( double  val,
MConstChars  itemName 
)
static

Throw an out of range exception with a single value and name.

The English text of the exception message will be: "Value 'val' for 'itemName' is out of range".

Parameters
valOffending out of range value.
itemNameOptional name of the item, typically the array name. If absent, the name will not be reported.
static M_NORETURN_FUNC void MENumberOutOfRange::ThrowRange ( double  lo,
double  hi,
double  val 
)
static

Throw an out of range exception with the value and range.

The English version of the text thrown by this method is

  • "Value 'val' is out of range 'lo' .. 'hi'".
Parameters
loLow bound of the range, inclusive.
hiHigh bound of the range, inclusive. It is not an error to have the value of hi smaller than low, but in this case the range will not be included into the error message.
valOffending out of range value. There is a debug time assert that checks if the given value is indeed out of range determined by inclusive range lo .. hi.
static M_NORETURN_FUNC void MENumberOutOfRange::ThrowValue ( double  val)
static

Throw an out of range exception with a single value.

The English text of the exception message will be: "Value 'val' is out of range".

Parameters
valOffending out of range value.