- A Logic Circuit Simulation Library in C++





lcs::OutOfRangeException< T > Class Template Reference

#include <outofrange_exception.h>

Inheritance diagram for lcs::OutOfRangeException< T >:

lcs::Exception List of all members.

Detailed Description

template<typename T>
class lcs::OutOfRangeException< T >

An exception class whose objects are thrown when data beyond the allowed range is accessed from indexed data access classes. An example of a call which can lead to this exception being thrown is the function lcs::InputBus::operator[].

Parameters:
T should be a type which supports relational operators like <, >, etc.


Public Member Functions

 OutOfRangeException ()
 OutOfRangeException (T allowedLowerLimit, T allowedUpperLimit, T requestedIndex)
virtual ~OutOfRangeException ()
virtual std::string getMessage (void)
void setData (T allowedLowerLimit, T allowedUpperLimit, T requestedIndex)
getAllowedLowerLimit ()
getAllowedUpperLimit ()


Constructor & Destructor Documentation

template<typename T>
lcs::OutOfRangeException< T >::OutOfRangeException (  ) 

Default constructor. Exception objects initialised through this constructor should set the exception specific data using the OutOfRangeException::setData function. If the data is not set, then wrong information is reported by the OutOfRangeException::getMessage function.

template<typename T>
lcs::OutOfRangeException< T >::OutOfRangeException ( allowedLowerLimit,
allowedUpperLimit,
requestedIndex 
)

Data initialising constructor. The exception should occur if the requestedIndex is out the allowed range (allowedLowerLimit, allowedUpperLimit).

Parameters:
allowedLowerLimit The allowed lower limit for the data access index.
allowedUpperLimit The allowed upper limit for the data access index.
requestedIndex The requested data index which triggered the exception.

template<typename T>
virtual lcs::OutOfRangeException< T >::~OutOfRangeException (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename T>
T lcs::OutOfRangeException< T >::getAllowedLowerLimit (  )  [inline]

Returns the allowed lower limit.

template<typename T>
T lcs::OutOfRangeException< T >::getAllowedUpperLimit (  )  [inline]

Returns the allowed upper limit.

template<typename T>
std::string lcs::OutOfRangeException< T >::getMessage ( void   )  [virtual]

Returns the exception specific message string generated using the exception data.

Implements lcs::Exception.

template<typename T>
void lcs::OutOfRangeException< T >::setData ( allowedLowerLimit,
allowedUpperLimit,
requestedIndex 
)

Sets the exception specific data. The exception should occur if the requestedIndex is out the allowed range (allowedLowerLimit, allowedUpperLimit).

Parameters:
allowedLowerLimit The allowed lower limit for the data access index.
allowedUpperLimit The allowed upper limit for the data access index.
requestedIndex The requested data index which triggered the exception.


Copyright © 2006, 2007 Siva Chandra