# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac_exception.h File Reference

`#include <string>`
`#include <iostream>`

Include dependency graph for dirac_exception.h:

Go to the source code of this file.

## Namespaces

- namespace dirac

## Classes

- class dirac::DiracException
    DiracException is the class which should be used for all exceptions within Dirac. More...

## Defines

- #define DIRAC_LOG_EXCEPTION(exception)
    Write an exception to the log.
- #define DIRAC_THROW_EXCEPTION(arg1, arg2, arg3)
    Construct an exception from 3 arguments, log it, and throw it.
- #define DIRAC_CATCH_AND_RETHROW()
    Catch a DiracException, log it, and rethrow it.

## Enumerations

- enum dirac::DiracErrorCode {
  dirac::ERR_UNSUPPORTED_STREAM_DATA = 0, dirac::ERR_END_OF_STREAM, dirac::ERR_INVALID_VIDEO_FORMAT, dirac::ERR_INVALID_CHROMA_FORMAT,
  dirac::ERR_INVALID_FRAME_RATE, dirac::ERR_INVALID_SIGNAL_RANGE, dirac::ERR_INVALID_ASPECT_RATIO, dirac::ERR_INVALID_VIDEO_DEPTH,
  dirac::ERR_INVALID_MOTION_VECTOR_PRECISION
  }
    Enumeration of Dirac-defined error codes. More...
- enum dirac::DiracSeverityCode {
  dirac::SEVERITY_NO_ERROR = 0, dirac::SEVERITY_WARNING, dirac::SEVERITY_FRAME_ERROR, dirac::SEVERITY_ACCESSUNIT_ERROR,
  dirac::SEVERITY_SEQUENCE_ERROR, dirac::SEVERITY_TERMINATE
  }
    Error-severity states. More...

## Functions

- std::ostream & dirac::operator<< (std::ostream &dst, const DiracException &exception)

## Define Documentation

#define DIRAC_CATCH_AND_RETHROW | ( |  | ) |

Value:

    catch (const DiracException& e) {                                     \
            DiracException exception(e);           \
            DIRAC_LOG_EXCEPTION(exception)\
            throw exception;                     \
        }

#define DIRAC_LOG_EXCEPTION | ( | exception |  | ) |

Value:

    {                                                                   \
           if(exception.GetSeverityCode()!=SEVERITY_NO_ERROR)       \
                std::cerr << exception.GetErrorMessage();          \
        }

#define DIRAC_THROW_EXCEPTION | ( | arg1,
|  | arg2,
|  | arg3 |  | ) |

Value:

    {                                                                   \
            DiracException exception(arg1,arg2, arg3);      \
            DIRAC_LOG_EXCEPTION(exception)  \
            throw exception;                        \
        }

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.