NAME

OTCERR_PreconditionFailure - Exception class to be thrown for a failed precondition.

SYNOPSIS


#include <OTC/debug/precfail.hh>

class OTCERR_PreconditionFailure : public OTC_Exception
{
  public:
    ~OTCERR_PreconditionFailure();
    OTCERR_PreconditionFailure(
      char const* theFile,
      u_int theLine,
      char const* theCondition,
      char const* theDescription
    );
    OTCERR_PreconditionFailure(
      OTCERR_PreconditionFailure const& theException
    );
    inline char const* condition() const;
    inline char const* description() const;
    void display(ostream& outs) const;
};

CLASS TYPE

Concrete

DESCRIPTION

This class is to be used when wishing to throw an exception for a precondition failure. It is this exception which is thrown by OTCLIB_ENSURE() when the condition fails. Typically, you would not use this class directly, but would use OTCLIB_ENSURE(). If used explicitly this class would be used in the following way: The preferred method of using this class, is to write: OTCLIB_ENSURE() cannot be compiled out of code. If a condition check is only required during development the OTCLIB_ASSERT() macro, which can be compiled out of code by defining NDEBUG should be used.

INITIALISATION

OTCERR_PreconditionFailure(
  char const* theFile,
  u_int theLine,
  char const* theCondition,
  char const* theDescription
);
OTCERR_PreconditionFailure(
  OTCERR_PreconditionFailure const& theException
);

QUERY

inline char const* condition() const;
inline char const* description() const;

DISPLAY

void display(ostream& outs) const;

SEE ALSO

OTC_Exception, OTCLIB_ASSERT, OTCLIB_ENSURE

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED