//Editor-Info: -*- C++ -*-
//
//Subject: Scheduler Framework
//
//File: exception.h
//
//State: $State: Exp $
//
//Version: $Revision: 1.5 $
//
//Date: $Date: 1998/07/15 11:28:17 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
// 
//Authors:
//	Vesa-Matti Puro
//      Juhana Räsänen
//
//Description:
//	This file contains sfException class used in Scheduler
//	Framework code. The exception may include further details
//	about the reason for exception. The type of the exception
//	might be:
//
//	SchedulerEmptyException
//	Exception type thrown by schedulers if all the scheduler
//	queues become empty and execution cannot proceed within the
//	scheduler.
//
//	InvalidHandleException
//	Exception type thrown by schedulers if they encounter an
//	invalid scheduler handle (eg. one with a null task).
//
//	sfInvalidRequestException
//	Exception type thrown by schedulers if they an invalid request
//	was made by a handle (eg. request read while read pending on a
//	different fd).
//
//	sfInvalidCallbackException
//	Exception type thrown by sfTask if the base class callbacks
//	get called, which means that the inherited task has requested
//	an event for which it doesn't have a callback implemented.
//
//Copyright:    
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//      
//Licence:
//     
//
//History:
//
//

#ifndef __SF_EXCEPTION_H__
#define __SF_EXCEPTION_H__

#include <typeinfo>
#include <string>
#include "pf/types.h"

class sfException
{
    public:
        sfException(const sfException &other_);
        virtual ~sfException(void);

        // methods to throw sfException with different reason codes
        static void throwSchedulerEmptyException(void);
        static void throwInvalidHandleException(void);
        static void throwInvalidRequestException(void);
        static void throwInvalidCallbackException(void);

        virtual void printInfo(void) const;
  
    protected:
        sfException(void);
};

#endif // __SF_EXCEPTION_H__

